-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use canvas instead of svg as a default or an option #161
Comments
I'm willing to put some work into this, but it would be more appealing if there was an obvious need. Can anyone provide a plausible, reproducible example where the performance of the |
I think this makes a lot of sense. What is the case against using a manufactured data set for testing? |
|
(As opposed to chasing some convoluted edge case) |
I know that many people have asked if they can use networkD3 with a significant number of nodes. How much of a performance improvement do you think canvas will give? Will it allow a 1000 node network to be interacted with? (I probably wouldn't recommend this with the current implementation). |
Alright, I can work with that. 1000 nodes and a few thousand links? It would still be good to be able to load it from a web accessible JSON file, rather than randomly generating it at every run with varying results. I guess I can randomly generate some data and then save it as a JSON somewhere. |
Before I start in on this again, let me just say that if I sound hesitant about this, which is ironic because it was my proposal, it's only because I worry that adding a parameter to switch between canvas and svg will likely require two significantly different chunks of code in the JavaScript, and therefore increase the effort needed to maintain these scripts. Having said that, here are a few relevant things that I've learned after a bit of research and experimentation...
I haven't given up on this yet, just haven't had the time to work on it because I was focussing on other features. |
Thanks for all of these details. I kind of like the idea for 4, though I wonder how useful it will be. You could already just run the script from R not in RStudio to avoid the viewer issue. Any other opinions out there on this? |
Hello, In response to idea 2, I have a shiny app using networkD3 with good performance on a laptop/desktop yet terrible performance on my iphone6s and other smart phones. With just a few dozen nodes, the app is unusable on mobile. Try for yourself here: https://areeves87.shinyapps.io/flavor-bible/ Could improved smartphone performance be a potential motivating use case for the canvas plots? I've heard mobile performance can suffer during DOM manipulations of large data: https://www.quora.com/Does-D3-js-work-efficiently-on-massive-amounts-of-data-200-million-rows-with-at-least-a-dozen-columns Pardon any incorrect use of terminology. I am a novice. Hope my point was clear enough. |
Generally speaking, the canvas approach would have better performance on all platforms, but with other consequences. |
enable, by default or as an option, plotting using canvas versus svg
I have a working prototype of
forceNetwork()
working that uses d3 v4 and plots using canvas instead of svg, so it's at least feasible. Apparently, it would afford significant performance gains when plotting with many nodes. Not certain if or what issues this might cause. Thoughts and ideas are appreciated. Maybe I'll get a branch on my fork working and link to it here so people can experiment with it?(preemptive issue, anticipating/depending on the completed conversion to d3 v4 #143)
The text was updated successfully, but these errors were encountered: