inst/examples/DT-crosstalk/plotly-persist.R

library(plotly)
library(crosstalk)
library(DT)

m <- SharedData$new(mtcars)
bscols(
  plot_ly(m, x = ~wt, y = ~mpg) %>%
    add_markers(text  = row.names(mtcars)) %>%
    config(displayModeBar = FALSE) %>%
    layout(
      title = "Hold shift while clicking \n markers for persistent selection",
      margin = list(t = 60)
    ),
  datatable(m)
)

Try the DT package in your browser

Any scripts or data that you put into this service are public.

DT documentation built on Oct. 5, 2023, 5:09 p.m.