Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

Heat Map Functionality #38

Open
fletcmd opened this issue Jun 26, 2018 · 2 comments
Open

Heat Map Functionality #38

fletcmd opened this issue Jun 26, 2018 · 2 comments

Comments

@fletcmd
Copy link

fletcmd commented Jun 26, 2018

I am a big fan of dc.js, but realized that it doesn't support heatmaps for leaflet, which my company would love to use. Is there any plans to add that? I know leaflet supports it natively, so hopefully getting it to connect to crossfilter is doable.

@gordonwoodhull
Copy link

gordonwoodhull commented Jun 26, 2018

I'd be very interested in this feature, and would love to help if you care to contribute.

It looks like Leaflet.heat is the standard plug-in for this.

One design consideration is that Leaflet.heat does aggregation, and crossfilter does too. Where to put this responsibility? I guess in most cases Leaflet.heat should do the aggregation for this dimension, because it knows the current zoom level and the right block size. So you'd expose a crossfilter dimension & group which is not aggregated, i.e. keyed on some unique id or the row number.

(Some parts of the library assume that the crossfilter group is aggregated at the latlong level by default, but I don't recommend this since then you'd have the confusion of two levels of aggregation.)

The heatmap should be pretty easy to implement, since the drawing is already done by Leaflet.heat. As you can see, this is a tiny library and not hard to extend. You'd just derive from dc_leaflet.leafletBase and override _postRender and _doRedraw.

Anyway, I'm here to help if you want to take this up!

@fletcmd
Copy link
Author

fletcmd commented Jun 26, 2018

AWESOME. So I'm hoping that the aggregations are similar to the MarkerCluster addon that does similar aggregations, just not as a heatmap. My first steps are going to be to look through that and see how they broke out the ags.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants