vw_examine: Examine vegaspec

View source: R/examine.R

vw_examineR Documentation

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

  vw_examine(spec_mtcars)

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

  vw_examine(spec_mtcars_autosize)

vegawidget documentation built on May 29, 2024, 12:17 p.m.