Skip to content

Commit 85a00f4

Browse files
committed
fixing map
1 parent cd3dc0c commit 85a00f4

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed

R/echarty.R

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ ec.init <- function( df=NULL, preset=TRUE, group1='scatter', load=NULL,
252252
if (preset) {
253253
wt$x$opts$xAxis <- NULL
254254
wt$x$opts$yAxis <- NULL
255-
#wt$x$opts$series <- list(list(type='map', map='world', roam=TRUE))
255+
wt$x$opts$series <- list(list(type='map', geoIndex=0))
256256
wt$x$opts$geo = list(map='world', roam=TRUE) # may duplicate series
257257
# if (!is.null(df)) # cancelled: dont know if first 2 cols are lng,lat
258258
# wt$x$opts$geo$center= c(mean(unlist(df[,1])), mean(unlist(df[,2])))
@@ -343,25 +343,24 @@ ec.init <- function( df=NULL, preset=TRUE, group1='scatter', load=NULL,
343343
#' Install Javascript plugin from URL source
344344
#'
345345
#' @param wt A widget to add dependency to, see \code{\link[htmlwidgets]{createWidget}}
346-
#' @param source URL or file:// of an uninstalled Javascript plugin, \cr
347-
#' or name of an installed plugin file with suffix '.js'. Default is NULL.
348-
#' @param ask Whether to ask the user to download source if missing. Default is FALSE
346+
#' @param source URL or file:// of a Javascript plugin, \cr
347+
#' file name suffix is '.js'. Default is NULL.
348+
#' @param ask Whether to ask the user to download source if missing. Default is FALSE.
349349
#' @return A widget with JS dependency added if successful, otherwise input wt
350350
#'
351-
#' @details When \emph{source} is URL, the plugin file is installed with a popup prompt to the user.\cr
352-
#' When \emph{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.
351+
#' @details When \emph{source} is URL, the plugin file is installed with an optional popup prompt.\cr
352+
#' When \emph{source} is a file name (file://xxx.js), it is assumed installed and only a dependency is added.
353353
#'
354354
#' @examples
355355
#' # import map plugin and display two (lon,lat) locations
356356
#' p <- ec.init() %>% ec.plugjs(
357357
#' 'https://raw.githubusercontent.com/apache/echarts/master/test/data/map/js/china-contour.js')
358358
#' p$x$opts <- list(
359-
#' geo = list(map='china-contour', roam=TRUE),
360-
#' legend = list(data = list(list(name = 'Geo'))),
361-
#' series = list(list( name = 'Geo',
362-
#' type = 'scatter', coordinateSystem = 'geo',
363-
#' symbolSize = 9, itemStyle = list(color='red'),
364-
#' data = list(list(value=c(113, 40)), list(value=c(118, 39))) ))
359+
#' geo = list(map= 'china-contour', roam= TRUE),
360+
#' series = list(list( name= 'Geo',
361+
#' type= 'scatter', coordinateSystem= 'geo',
362+
#' symbolSize= 9, itemStyle= list(color= 'red'),
363+
#' data= list(list(value= c(113, 40)), list(value= c(118, 39))) ))
365364
#' )
366365
#' p
367366
#'

man/ec.plugjs.Rd

Lines changed: 10 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)