canvasXpress.json: HTML Widget Creation using JSON input

View source: R/canvasXpress.R

canvasXpress.jsonR Documentation

HTML Widget Creation using JSON input

Description

Custom HTML widget creation function based on widget YAML and JavaScript for use in any html-compatible context using raw JSON input. Validation of data and configuration is deferred completely to the canvasXpress JavaScript library.

Usage

canvasXpress.json(
  json,
  pretty = FALSE,
  digits = 4,
  width = 600,
  height = 400,
  destroy = FALSE
)

Arguments

json

JSON string or object

pretty

print tagged code (JSON/HTML) nicely - default = FALSE

digits

display digits - default = 4

width

plot width (valid CSS units) - default = 600px

height

plot height (valid CSS units) - default = 400px

destroy

used to indicate removal of a plot - default = FALSE

Details

For the formatting of the JSON input object see

**Note:** this function is intended for use by advanced users who are experimenting with or need to utilize the json-formatted input to canvasXpress and are comfortable debugging chart issues in a browser (JavaScript) context instead of in R.

Value

htmlwidgets object

More Information

https://www.canvasxpress.org

Examples


my_json <- '{ "data": {"y": { "vars": ["Performance"],
                              "smps": ["January"],
                              "data": [[85]] }},
              "config": { "graphType": "Meter",
                          "meterType": "gauge" }}'

canvasXpress.json(my_json)


canvasXpress documentation built on June 23, 2024, 5:06 p.m.