From 0ca73d7bd7dcc013f7fecbddfb733b6a3be6dd4e Mon Sep 17 00:00:00 2001 From: helgasoft Date: Sat, 30 Sep 2023 19:59:04 -0700 Subject: [PATCH] clean up --- inst/js/renderers.js | 10 +++++----- tests/testthat/test-other.R | 1 - tests/testthat/test-renderers.R | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/inst/js/renderers.js b/inst/js/renderers.js index 308f6c9..0d9291e 100644 --- a/inst/js/renderers.js +++ b/inst/js/renderers.js @@ -197,21 +197,21 @@ function riPolygon(params, api) { usage: myGeojson <- gsub('\n', '', '{...}') ec.init(load= c('leaflet','custom'), - js= paste('ecfun.geojson=',myGeojson), + js= paste('ecf.geojson=',myGeojson), series= list(list( type= 'custom', coordinateSystem= 'leaflet', # or 'gmap',etc. renderItem= htmlwidgets::JS("riGeoJson") ... */ function riGeoJson(params, api) { - gj = ecfun.geojson.features[params.dataIndex]; + gj = ecf.geojson.features[params.dataIndex]; type = gj.geometry.type.toLowerCase(); ccc = gj.geometry.coordinates; colr = gj.properties.color; if (colr==undefined) colr = api.visual('color'); fill = gj.properties.ppfill; if (fill==undefined) { - fill = ecfun.geofill; + fill = ecf.geofill; if (fill==0) fill = colr; } lwi = gj.properties.lwidth; @@ -291,8 +291,8 @@ function riGeoJson(params, api) { } break; } - ecfun.geoz2++; //z2++; - out.z2 = ecfun.geoz2; + ecf.geoz2++; //z2++; + out.z2 = ecf.geoz2; return out; }) } diff --git a/tests/testthat/test-other.R b/tests/testthat/test-other.R index 200a2b5..6c218ef 100644 --- a/tests/testthat/test-other.R +++ b/tests/testthat/test-other.R @@ -263,6 +263,5 @@ test_that('stops are working in echarty.R', { expect_silent(ec.init(load='gmodular')) expect_silent(ec.init(load='wordcloud')) expect_silent(ec.init(load='lottie')) - expect_silent(ec.init(load='custom')) }) diff --git a/tests/testthat/test-renderers.R b/tests/testthat/test-renderers.R index 726ccf4..1d7e3c9 100644 --- a/tests/testthat/test-renderers.R +++ b/tests/testthat/test-renderers.R @@ -248,6 +248,7 @@ test_that("leaflet with geoJson", { expect_s3_class(p$x$opts$series[[1]]$renderItem, 'JS_EVAL') expect_match(p$x$opts$series[[1]]$renderItem,"ecf.geofill=null", fixed=T) expect_equal(length(p$x$opts$series[[1]]$data), 5) + expect_equal(p$x$opts$series[[1]]$data[[5]][[1]], 5) # tmp <- jsonlite::fromJSON('https://echarts.apache.org/examples/data/asset/geo/USA.json') # p <- ec.init(load= c('leaflet', 'custom'),