File: plotly-persist.R

package info (click to toggle)
r-cran-dt 0.17%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 848 kB
  • sloc: javascript: 3,687; makefile: 13; sh: 9
file content (15 lines) | stat: -rw-r--r-- 349 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)
)