-
Notifications
You must be signed in to change notification settings - Fork 74
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
Support HeatMap #1
Comments
closed in 488de06 |
After trying a lot to use this library, I'm now convinced that it's not satisfying enough for a real use:
In comparison, Leaflet.heat is way more reliable, considering it's developed by Leaflet authors and more actively maintained. As for the perfomances, I did some benchmark using the
Benchmark filesBenchmark results
This shows that for such datasets, there is no significant differences in load time. I also checked memory use (js heap), and the result is also approximately the same. For all those reasons, I'd like |
@RCura Thanks for the detailed comparison. I'll integrate leaflet.heat soon. |
@RCura Some more comments I will integrate Leaflet.heat but just wanted to make sure your benchmarking is done against the latest code base. |
@bhaskarvk : I ran those tests like 2-3 days ago, and used the github version of leaflet.extras, so, this commit was taken into account :) As for the gradientTextures, I'm glad you found :) Thanks for your work 😀 |
Cool thanks for the confirmation. You've certainly made a solid case for Leaflet.heat :) |
Great to read that Leaflet.heat will be integrated. Do you have an expectation as to when this will be available? |
I'd like to add my vote for integrating leaflet.heat. |
I'll start working on this today, so hopefully before the start of next week. |
@bhaskarvk, we were nearly finished integrating |
I know, hence my initial hesitation in integrating leaflet.heat. However I feel comfortable working off a fork for leaflet.extras. I have had to fork and fix quite a few of the plugins that have been integrated in this repo. Many times original authors abandon their projects but fixing small issues is no big deal. |
Big difference here is the author of leaflet.heat is also the author of leaflet :) I will say I like leaflet.heat the best though especially this ability rstudio/leaflet#174 (comment). |
Oh man you guys are killing me. That Leaflet.heat hasn't been touched by the owner in a while too and has a lot of pending PRs. So my first task is to fork it and merge the pending PRs (coz they contain some important fixes). This is going to take me a while (approx 1 or 2 weeks). |
@timelyportfolio / @jcheng5 , Does this Leaflet/Leaflet.heat#78 look like a better alternative to Leaflet/Leaflet.heat#32, they kind of look like addressing the same problem, but 43 looks more exhaustive. |
I'd be surprised if 78 strictly dominates 32--it makes the same mistake that master does, of adding together the altitudes instead of alpha blending them. |
Yes I saw that, but w/o |
never mind I think I know what to do. |
78 removes the option for max intensity by auto assigning max intensity based on the data, is that right? Is that desirable behavior? I'd think you'd want the ability to be explicit. |
By the way, IIRC by far the best results were by alpha blending and not performing clustering at all, and was still plenty fast for 10K data points (I don't think I tested larger). |
For the |
I don't understand |
FWIW , here's my merged changes so far I've added your alpha blended code but commented it out for now, will test with and w/o it. From where I see I don't think alpha blending is required as the max is changed during the calculation. But we'll see. |
I'm saying what if the max is not the max intensity of the data, but some other higher value. Like picture you have two data sets that are being plotted side by side (or two layers in the same map) that reflect the same type of data, and one of them has no points that reach the max? (My PR used the intensity too btw, in case that wasn't clear. It just does a better job of combining multiple data points in the same cell IIRC.) |
OK cool, I have my task cut out, I'll play with just your PR, just 78 and may be a combo of them. |
Sorry to preface everything with IIRC but it's been a long time and I'm on my phone. So clustering refers to (IIRC) Leaflet.heat works pretty hard to reduce the number of points it sends to the underlying heatmap. This should just be a performance optimization as far as I could tell but the end result is the heatmap looks radically different depending on the factor (I think it's |
@RCura I have a small question, the timings that you mentioned in #1 (comment). Thanks |
The benchmarks I gave are the js benchmarks, using chrome dev tools profiling :) |
All done.
So something like leaflet() %>% addHeatMap(..., layerId="ABC")
# OR
leaflet() %>% addWebGLHeatMap(..., layerId="ABC")
And later on
leafletproxy() %>%
htmlwidgets::onRender(JS("
function(el, x, data) {
var map = this;
var layer = map.layerManager.getLayer("heatmap", "ABC");
// OR
var layer = map.layerManager.getLayer("webGLHeatmap", "ABC");
// Work on layer using whatever JS operations it permits.
}
"))
|
Did all those benchmarks : the result is no good for WebGLHeatmap ;) Here's the gist with all infos. Code
(Run 100 times with But page load shows some very different performances, webgl becoming massively slow as points number is increased : wbench Code
File size are quite the same, so, this can't be a file loading difference. So, seems there's a clear winner ;) BTW, thanks a lot for adding leaflet.heat, I can now use a stable and durable package instead of my ugly/dangerously unstable fork of rstudio/leaflet. |
Wow I would never have guessed webGL plugin would be this bad. Thanks for all your hard work on this btw. |
Improve handling of gradients in addHeatmap
Options
I'm leaning towards #3 as it has performance benefits over the other two.
The text was updated successfully, but these errors were encountered: