View source: R/girafe_options.R
opts_sizing | R Documentation |
Allows customization of the svg style sizing
opts_sizing(rescale = TRUE, width = 1)
rescale |
If FALSE, graphic will not be resized and the dimensions are exactly those of the svg. If TRUE the graphic will be resize to fit its container |
width |
widget width ratio (0 < width <= 1). |
Other girafe animation options:
girafe_defaults()
,
girafe_options()
,
init_girafe_defaults()
,
opts_hover()
,
opts_selection()
,
opts_toolbar()
,
opts_tooltip()
,
opts_zoom()
,
set_girafe_defaults()
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_sizing(rescale = FALSE) )
if( interactive() ) print(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.