Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

girafe_options

Set girafe options


Description

Defines the animation options related to a girafe() object.

Usage

girafe_options(x, ...)

Arguments

x

girafe object.

...

set of options defined by calls to opts_* functions or to sizingPolicy from htmlwidgets (this won't have any effect within a shiny context).

See Also

Other girafe animation options: opts_hover(), opts_selection(), opts_sizing(), opts_toolbar(), opts_tooltip(), opts_zoom()

Examples

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)
}

ggiraph

Make 'ggplot2' Graphics Interactive

v0.7.10
GPL-3
Authors
David Gohel [aut, cre], Panagiotis Skintzos [aut], Mike Bostock [cph] (d3.js), Speros Kokenes [cph] (d3-lasso), Eric Shull [cph] (saveSvgAsPng js library), Eric Book [ctb] (hline and vline geoms)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.