Skip to contents

Universal wrapper that converts any ggforge ggplot object into an interactive plotly visualization via plotly::ggplotly(), with ggforge-specific tooltip and layout optimizations.

Usage

ggforge_interactive(
  plot,
  tooltip = "all",
  width = NULL,
  height = NULL,
  dynamicTicks = FALSE,
  layerData = 1,
  ...
)

Arguments

plot

A ggplot object (typically from any ggforge function).

tooltip

Character vector of aesthetics to include in tooltip, or "all" for all mapped aesthetics.

width, height

Plot dimensions in pixels.

dynamicTicks

Whether plotly should use dynamic axis ticks.

layerData

Which layer's data to use for tooltip (default 1).

...

Additional arguments passed to plotly::ggplotly().

Value

A plotly object

Examples

# \donttest{
p <- ScatterPlot(iris, x = "Sepal.Length", y = "Sepal.Width",
  color_by = "Species")
ggforge_interactive(p)
p2 <- BarPlot(iris, x = "Species") ggforge_interactive(p2, tooltip = "all")
# }