ec.plugjs {echarty}R Documentation

Install Javascript plugin from URL source

Description

Install Javascript plugin from URL source

Usage

ec.plugjs(wt = NULL, source = NULL, ask = FALSE)

Arguments

wt

A widget to add dependency to, see createWidget

source

URL or file:// of a Javascript plugin,
file name suffix is '.js'. Default is NULL.

ask

Boolean, to ask the user to download source if missing. Default is FALSE.

Details

When source is URL, the plugin file is installed with an optional popup prompt.
When source is a file name (file://xxx.js), it is assumed installed and only a dependency is added.
Called internally by ec.init. It is recommended to use ec.init(load=...) instead of ec.plugjs.

Value

A widget with JS dependency added if successful, otherwise input wt

Examples

# import map plugin and display two (lon,lat) locations
if (interactive()) {
p <- ec.init() |> ec.plugjs(
  'https://raw.githubusercontent.com/apache/echarts/master/test/data/map/js/china-contour.js')
p$x$opts <- list(
  geo = list(map= 'china-contour', roam= TRUE),
  series = list(list( name= 'Geo',
    type= 'scatter', coordinateSystem= 'geo',
    symbolSize= 9, itemStyle= list(color= 'red'),
    data= list(list(value= c(113, 40)), list(value= c(118, 39))) ))
)
p
}

[Package echarty version 1.4.5 Index]