schema: Acquire (and optionally display) plotly's plot schema

Description Usage Arguments Examples

View source: R/dev.R

Description

The schema contains valid attributes names, their value type, default values (if any), and min/max values (if applicable).

Usage

1
schema(jsonedit = interactive(), ...)

Arguments

jsonedit

use listviewer::jsonedit to view the JSON?

...

other options passed onto listviewer::jsonedit

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
s <- schema()

# retrieve acceptable `layout.mapbox.style` values
if (!is.na(Sys.getenv('MAPBOX_TOKEN', NA))) {
  styles <- s$layout$layoutAttributes$mapbox$style$values
  subplot(
    plot_mapbox() %>% layout(mapbox = list(style = styles[3])),
    plot_mapbox() %>% layout(mapbox = list(style = styles[5]))
  )
}

plotly documentation built on Feb. 13, 2020, 1:07 a.m.