ec.inspect: Chart to JSON

View source: R/util.R

ec.inspectR Documentation

Chart to JSON

Description

Convert chart to JSON string

Usage

ec.inspect(wt, target = "opts", ...)

Arguments

wt

An echarty widget as returned by ec.init

target

type of resulting value:
⁠ ⁠'opts' - the htmlwidget options as JSON (default)
⁠ ⁠'full' - the entire htmlwidget as JSON
⁠ ⁠'data' - info about chart's embedded data (char vector)

...

Additional attributes to pass to toJSON
'file' - optional file name to save to when target='full'

Details

Must be invoked or chained as last command.
target='full' will export all JavaScript custom code, ready to be used on import.

Value

A JSON string, except when target is 'data' - then a character vector.

Examples

# extract JSON
json <- cars |> ec.init() |> ec.inspect()
json

# get from JSON and modify plot
ec.fromJson(json) |> ec.theme('macarons')


echarty documentation built on Oct. 16, 2023, 1:06 a.m.