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)

Arguments

wt

A widget to add dependency to, see createWidget

source

URL of the uninstalled Javascript plugin,
or name of an installed plugin file, suffix .js included. Default is NULL.

Details

When source is URL, the plugin file is installed with a popup prompt to the user.
When source is just a file name (xxx.js), it is assumed installed and only a dependency is added. The latter option is for internal usage by echarty.

Value

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

Examples

# import map plugin and display two (lon,lat) locations
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),
  legend = list(data = list(list(name = 'Geo'))),
  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 0.2.0 Index]