
Last chance! 50% off unlimited learning
Sale ends in
Allows customization of the toolbar
opts_toolbar(
position = c("topright", "top", "bottom", "topleft", "bottomleft", "bottomright"),
saveaspng = TRUE,
pngname = "diagram",
tooltips = NULL,
hidden = NULL,
delay_mouseover = 200,
delay_mouseout = 500
)
Position of the toolbar relative to the plot. One of 'top', 'bottom', 'topleft', 'topright', 'bottomleft', 'bottomright'
Show (TRUE) or hide (FALSE) the 'download png' button.
The default basename (without .png extension) to use for the png file.
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' )
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
The duration in milliseconds of the transition associated with toolbar display.
The duration in milliseconds of the transition associated with toolbar end of display.
Other girafe animation options:
girafe_defaults()
,
girafe_options()
,
init_girafe_defaults()
,
opts_hover()
,
opts_selection()
,
opts_sizing()
,
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_toolbar(position = "top") )
if( interactive() ) print(x)
Run the code above in your browser using DataLab