Skip to contents

Plotly module that handles plotly objects.

Details

Plotly exposes bindings to interact with the plot programaticaly. Currently, only the plotly_selected binding is supported in this module.

Super classes

ShinyModule -> Plot -> PlotPlotly

Active bindings

plot

(plotly) object.

source

(character) Source label for the plotly plot.

bindings

(reactivevalues) bindings from the plotly object.

Methods

Public methods

Inherited methods


PlotPlotly$clone()

The objects of this class are cloneable with this method.

Usage

PlotPlotly$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

library(DarwinShinyModules)

plotlyFun <- function(data) {
  plotly::ggplotly(
    ggplot(data = data, mapping = aes(x = Sepal.Length, y = Sepal.Width, color = Species)) +
      geom_point() +
      theme_bw()
  )
}

plotlyModule <- PlotPlotly$new(fun = plotlyFun, args = list(data = iris))

if (interactive()) {
  preview(plotlyModule)
}