opts_zoom: Zoom settings

View source: R/girafe_options.R

opts_zoomR Documentation

Zoom settings

Description

Allows customization of the zoom.

Usage

opts_zoom(min = 1, max = 1, duration = 300)

Arguments

min

minimum zoom factor

max

maximum zoom factor

duration

duration of the zoom transitions, in milliseconds

See Also

Other girafe animation options: girafe_defaults(), girafe_options(), init_girafe_defaults(), opts_hover(), opts_selection(), opts_sizing(), opts_toolbar(), opts_tooltip(), set_girafe_defaults()

Examples

library(ggplot2)

dataset <- mtcars
dataset$carname = row.names(mtcars)

gg <- ggplot(
  data = dataset,
  mapping = aes(x = wt, y = qsec, color = disp,
                tooltip = carname, data_id = carname) ) +
  geom_point_interactive() + theme_minimal()

x <- girafe(ggobj = gg)
x <- girafe_options(x,
  opts_zoom(min = .7, max = 2) )
if( interactive() ) print(x)

ggiraph documentation built on May 29, 2024, 4:46 a.m.