Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
helgasoft committed Oct 1, 2023
1 parent ac02688 commit 0ca73d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions inst/js/renderers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
})
}
Expand Down
1 change: 0 additions & 1 deletion tests/testthat/test-other.R
Original file line number Diff line number Diff line change
Expand Up @@ -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'))

})
1 change: 1 addition & 0 deletions tests/testthat/test-renderers.R
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 0ca73d7

Please sign in to comment.