View source: R/girafe_options.R
girafe_options | R Documentation |
Defines the animation options related to
a girafe()
object.
girafe_options(x, ...)
x |
girafe object. |
... |
set of options defined by calls to |
girafe()
, girafe_css()
, girafe_css_bicolor()
Other girafe animation options:
girafe_defaults()
,
init_girafe_defaults()
,
opts_hover()
,
opts_selection()
,
opts_sizing()
,
opts_toolbar()
,
opts_tooltip()
,
opts_zoom()
,
set_girafe_defaults()
library(ggplot2)
library(htmlwidgets)
dataset <- mtcars
dataset$carname = row.names(mtcars)
gg_point = 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_point)
x <- girafe_options(x = x,
opts_tooltip(opacity = .7),
opts_zoom(min = .5, max = 4),
sizingPolicy(defaultWidth = "100%", defaultHeight = "300px"),
opts_hover(css = "fill:red;stroke:orange;r:5pt;") )
if(interactive()){
print(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.