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

opts_toolbar

Toolbar settings


Description

Allows customization of the toolbar

Usage

opts_toolbar(position = "topright", saveaspng = TRUE, pngname = "diagram")

Arguments

position

one of 'top', 'bottom', 'topleft', 'topright', 'bottomleft', 'bottomright'

saveaspng

set to TRUE to propose the 'save as png' button.

pngname

the default basename (without .png extension) to use for the png file.

Note

saveaspng relies on JavaScript promises, so any browsers that don't natively support the standard Promise object will need to have a polyfill (e.g. Internet Explorer with version less than 11 will need it).

See Also

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

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_toolbar(position = "top") )
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.