Comments (3)
rleaflet::leaflet()
contains the map data added with rleaflet::addPolygons()
. It creates a html widget using htmlwidgets::createWidget()
.
There, widget_data()
is used to convert the data to JSON, using jsonlite::toJSON()
.
from forecaster2.
Wups, actually htmlwidgets uses a wrapper for jsonlite::toJSON()
. Turns out the arguments that get passed to this can be controlled by setting some options (https://github.com/ramnathv/htmlwidgets/pull/103
; don't want to auto link spam). E.g.:
options(htmlwidgets.TOJSON_ARGS = list(pretty = TRUE, digits = 6))
from forecaster2.
- use 4 digits
- changed
st_simplify()
to use 7000 as tolerance (5000 before) - removed whitespace from html popup labels
This gets it down to ~3.2MB in browser and 2MB for the file system size. Good enough for twitter card validation.
Another thing is that the html labels are repeated for each addPolygon()
layer. Maybe just use one invisible, clickable layer on top for the popups?
from forecaster2.
Related Issues (11)
- Add copyright footer for website
- Find better map data for website map HOT 1
- Try changing map projection from Mercator HOT 2
- Add past forecasts and assessments
- Add G&W state age to data sources
- Add REIGN to data sources
- Re-run the forecast models with RNG seed
- How much do the forecasts vary over RNG seeds?
- Try out a skinny forest HP strategy for the RF models
- Check OG and TC metadata HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forecaster2.