ggiraph (version 0.8.9)

opts_toolbar: Toolbar settings

Description

Allows customization of the toolbar

Usage

opts_toolbar(
  position = c("topright", "top", "bottom", "topleft", "bottomleft", "bottomright"),
  saveaspng = TRUE,
  pngname = "diagram",
  tooltips = NULL,
  hidden = NULL,
  delay_mouseover = 200,
  delay_mouseout = 500
)

Arguments

position

Position of the toolbar relative to the plot. One of 'top', 'bottom', 'topleft', 'topright', 'bottomleft', 'bottomright'

saveaspng

Show (TRUE) or hide (FALSE) the 'download png' button.

pngname

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

tooltips

A named list with tooltip labels for the buttons, for adapting to other language. Passing NULL will use the default tooltips:

list( lasso_select = 'lasso selection', lasso_deselect = 'lasso deselection', zoom_on = 'activate pan/zoom', zoom_off = 'deactivate pan/zoom', zoom_rect = 'zoom with rectangle', zoom_reset = 'reset pan/zoom', saveaspng = 'download png' )

hidden

A character vector with the names of the buttons or button groups to be hidden from the toolbar.

Valid button groups: selection, zoom, misc

Valid button names: lasso_select, lasso_deselect, zoom_onoff, zoom_rect, zoom_reset, saveaspng

delay_mouseover

The duration in milliseconds of the transition associated with toolbar display.

delay_mouseout

The duration in milliseconds of the transition associated with toolbar end of display.

See Also

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

Examples

Run this code
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)

Run the code above in your browser using DataLab