ec.plugjs | R Documentation |
Install Javascript plugin from URL source
ec.plugjs(wt = NULL, source = NULL, ask = FALSE)
wt |
A widget to add dependency to, see createWidget |
source |
URL or file:// of a Javascript plugin, |
ask |
Boolean, to ask the user to download source if missing. Default is FALSE. |
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.
A widget with JS dependency added if successful, otherwise input wt
# import map plugin and display two (lon,lat) locations
if (interactive()) {
ec.init(preset= FALSE,
geo = list(map= 'china-contour', roam= TRUE),
series = list(list(
type= 'scatter', coordinateSystem= 'geo',
symbolSize= 9, itemStyle= list(color= 'red'),
data= list(list(value= c(113, 40)), list(value= c(118, 39))) ))
) |>
ec.plugjs( paste0('https://raw.githubusercontent.com/apache/echarts/',
'master/test/data/map/js/china-contour.js') )
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.