from_spec: Take a JSON Vega-Lite Spec and render as an htmlwidget

Description Usage Arguments Examples

View source: R/fromspec.r

Description

Vega-Lite is - at the core - a JSON "Grammar of Graphics" specification for how to build a data- & stats-based visualization. While Vega & D3 are the main targets, the use of Vega-Lite does not have to be restricted to just D3. For now, this function takes in a JSON spec (full text or URL) and renders it as an htmlwidget. Data should either be embedded or use a an absolute URL reference.

Usage

1
2
from_spec(spec, width = NULL, height = NULL, renderer = c("svg",
  "canvas"), export = FALSE, source = FALSE, editor = FALSE)

Arguments

spec

URL to a Vega-Lite JSON file or the JSON text of a spec

width, height

widget width/height

renderer

the renderer to use for the view. One of canvas or svg (the default)

export

if TRUE the "Export as..." link will be displayed with the chart.(Default: FALSE.)

source

if TRUE the "View Source" link will be displayed with the chart. (Default: FALSE.)

editor

if TRUE the "Open in editor" link will be displayed with the cahrt. (Default: FALSE.)

Examples

1
from_spec("http://rud.is/dl/embedded.json")

vegalite documentation built on May 2, 2019, 10:46 a.m.