vw_as_json: Coerce vegaspec to JSON

View source: R/vegaspec.R

vw_as_jsonR Documentation

Coerce vegaspec to JSON

Description

For Vega and Vega-Lite, the translation between lists and JSON is a little bit particular. This function, vw_as_json(), can be used to translate to JSON; as_vegaspec() can be used to translate from JSON.

Usage

vw_as_json(spec, pretty = TRUE)

Arguments

spec

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

pretty

logical indicates to use pretty (vs. minified) formatting

Value

jsonlite::json object

See Also

as_vegaspec()

Examples

  vw_as_json(spec_mtcars)


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