ec.inspect {echarty}R 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.
See also ec.fromJson.

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')


[Package echarty version 1.6.4 Index]