Learn R Programming

vegawidget (version 0.4.1)

vw_examine: Examine vegaspec

Description

This is a thin wrapper to listviewer::jsonedit(), use to interactively examine a Vega or Vega-Lite specification.

Usage

vw_examine(
  spec,
  mode = "view",
  modes = c("view", "code", "form", "text", "tree"),
  ...,
  width = NULL,
  height = NULL,
  elementId = NULL
)

Arguments

spec

An object to be coerced to vegaspec, a Vega/Vega-Lite specification

mode

string for the initial view from modes. 'view' is the default.

modes

string c('view','code', 'form', 'text', 'tree') will be the default, since these are all the modes currently supported by jsoneditor.

...

list of other options for jsoneditor. This is a temporary way of trying other options in jsoneditor. In the future, this will be eliminated in favor of specific, more self-documenting and helpful arguments.

width

integer in pixels defining the width of the div container.

height

integer in pixels defining the height of the div container.

elementId

character to specify valid CSS id of the htmlwidget for special situations in which you want a non-random identifier.

Value

S3 object of class jsonedit and htmlwidget

Examples

Run this code
# NOT RUN {
  vw_examine(spec_mtcars)

  spec_mtcars_autosize <-
    spec_mtcars %>%
    vw_autosize(width = 300, height = 300)

  vw_examine(spec_mtcars_autosize)
# }

Run the code above in your browser using DataLab