Comments (5)
Just to add: it's hard/impossible to open it up on a smartphone. I suspect the size of the network is a cause. No comments on the memory eating... To clarify, are you talking about memory eating on the client side? I imagine so based on the logs from the Firefox web client.
from upthat.
Yeah, deck.gl doesn't deliver well on mobile devices, but hey, not delivering well is still miles better than leaflet & co, which don't deliver at all
from upthat.
@SymbolixAU I tried with latest dev of all packages (mapdeck, spatialwidget, colouorvalues, jsonify), but the whole thing failed. Downgraded to CRAN mapdeck (0.2.1) then worked again, but it still eats memory. Note that its not a leak, it is clearly just that something - deck.gl? - is holding all the vector data from each click in memory, so memory usage aggregates with each successive click of toggle.
from upthat.
I've run this a few times and I can't say I'm seeing the issue you're describing. How many times do you toggle between cities before you notice it slow down?
One thing I have found is in the Kathmandu data, row 24869 has a LINESTRING with two coordinates, both of which appear to be the same. Deck.gl errors when it finds this.
options( digits = 8 )
> unclass( net[ 24869, ]$geometry[[1]] )
[,1] [,2]
[1,] 85.342642 27.751105
[2,] 85.342642 27.751105
And, you don't need to call clear_path()
if you're overwriting the same layer (layer_id
) with new data; deck.gl will handle that for you.
I'm also using the latest dev versions of all my packages, and using Chrome
devtools::session_info("mapdeck")
─ Session info ─────────
setting value
version R version 3.6.0 (2019-04-26)
os macOS Mojave 10.14.5
system x86_64, darwin15.6.0
ui RStudio
language (EN)
collate en_AU.UTF-8
ctype en_AU.UTF-8
tz Australia/Melbourne
date 2019-07-29
─ Packages ────────────
! package * version date lib source
BH 1.69.0-1 2019-01-07 [1] CRAN (R 3.6.0)
colourvalues 0.3.0 2019-07-04 [1] Github (SymbolixAU/colourvalues@074fc54)
crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.0)
curl 4.0 2019-07-22 [1] CRAN (R 3.6.0)
digest 0.6.20 2019-07-04 [1] CRAN (R 3.6.0)
geojsonsf 1.3.2 2019-04-28 [1] Github (SymbolixAU/geojsonsf@94eb225)
googlePolylines 0.7.2 2018-11-23 [1] CRAN (R 3.6.0)
htmltools 0.3.6 2017-04-28 [1] CRAN (R 3.6.0)
htmlwidgets 1.3 2018-09-30 [1] CRAN (R 3.6.0)
httpuv 1.5.1 2019-04-05 [1] CRAN (R 3.6.0)
jsonify 0.2.10002 2019-07-24 [1] Github (SymbolixAU/jsonify@1313e23)
jsonlite 1.6 2018-12-07 [1] CRAN (R 3.6.0)
later 0.8.0 2019-02-11 [1] CRAN (R 3.6.0)
magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.0)
mapdeck * 0.2.1006 2019-07-28 [1] local
mime 0.7 2019-06-11 [1] CRAN (R 3.6.0)
promises 1.0.1 2018-04-13 [1] CRAN (R 3.6.0)
R6 2.4.0 2019-02-14 [1] CRAN (R 3.6.0)
rapidjsonr 1.1 2018-09-22 [1] CRAN (R 3.6.0)
V Rcpp 1.0.1 2019-07-25 [1] CRAN (R 3.6.0)
rlang 0.4.0.9000 2019-07-09 [1] Github (r-lib/rlang@a3d7e47)
shiny * 1.3.2 2019-04-22 [1] CRAN (R 3.6.0)
sourcetools 0.1.7 2018-04-25 [1] CRAN (R 3.6.0)
spatialwidget 0.2.1006 2019-07-24 [1] Github (SymbolixAU/spatialwidget@dbe2449)
xtable 1.8-4 2019-04-21 [1] CRAN (R 3.6.0)
yaml 2.2.0 2018-07-25 [1] CRAN (R 3.6.0)
from upthat.
Thanks @SymbolixAU. Here's some latest attempts from my side, toggling around half a dozen times in between each memory profile. Chrome:
And firefox:
All actually looks okay now, so happy to close. I'll remove the clear_path
, which I just inserted in an attempt to possibly improve things - thanks.
Note also that I don't get any error with that linestring, possibly because:
duplicated(as.matrix(net$geometry[[24869]]))
#> FALSE FALSE
The values aren't identical. Thanks for looking into this - much appreciated!
from upthat.
Related Issues (20)
- Data in demo data is of different units than in city releases HOT 8
- Upthat no longer defaults to installed data HOT 1
- Numbers in flow map legend have unnecessarily high number of significant figures HOT 1
- Highest value in flow layer for Accra seems to be on isolated road HOT 14
- Map zooms out to max global extent on first load HOT 5
- Replace 'Recalculate scenario' button with 'Zoom to city extent' HOT 3
- Add (dummy) crash data
- Hide UI elements that don't do anything HOT 3
- Issues with new health tab HOT 8
- layers to modify/add HOT 3
- Expand boundary for Kathmandu network HOT 4
- Ensure pb_download drops data into inst HOT 1
- Add Bristol
- Selecting Accra on the online tool results in Bristol on the map HOT 2
- Spatial interaction approach HOT 14
- Switching cities on non-default layers shows only default layer HOT 2
- Error on loading the app with Error in if: argument is of length zero HOT 8
- Health uptake model HOT 7
- distribution of walking trip times/distances HOT 1
- Missing figure on website
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 upthat.