Skip to content
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

is it possible to cluster points and paths #6

Open
Zahma opened this issue Sep 1, 2017 · 5 comments
Open

is it possible to cluster points and paths #6

Zahma opened this issue Sep 1, 2017 · 5 comments

Comments

@Zahma
Copy link

Zahma commented Sep 1, 2017

I'm wondering if we can clusters the points and paths using markerclusterGroup. As far as I understood from this libraey its suing canvas elements, and not markers to render the flows. Is there any way you can think of to add the markerclustergroup to this one it would be wonderful. Grouping points and flows while zooming out.

@jwasilgeo
Copy link
Owner

@Zahma neat idea. Specifically you mean Leaflet.markercluster, right?

As a first step in looking into this--in your own use of that plugin--did you try to see if it would support drawing to the canvas automatically, via the L.canvas LeafletJS conventions? Such as:

var canvasRenderer = L.canvas();
var markers = L.markerClusterGroup({
  renderer: canvasRenderer
});

Although I'm unsure if it even supports that and if you have to do it at the L.markerClusterGroup level or at its individual marker layers that get added to it. First I'd want to know if that is supported with that lib to help decide how to technically implement this. I would want to lean on an already established clustering plugin to help with the to/from points.

With Leaflet.Canvas-Flowmap-Layer when it comes to "clustering" the flow lines I could see that being pretty straightforward once we have the clustered markers figured out.

cc @sarahbellum

@Zahma
Copy link
Author

Zahma commented Sep 3, 2017

@jwasilgeo I'm pretty sure markerclusterGroup doesn't support canvas it only gets Markers as parameter.
One Idea I thought about is to have both libraries each working on its side. Canvas Flow Map Layer takes a Feature collection, whereas markerclustergroup takes Markers. So what I'm thinking about basically is to draw the Markers without displaying them, apply the clustering, and then do some calculations to finally construct a featurecollection object that will be then served to CanvasFlowMap for display. But
this is not the best way to do it in terms of efficiency. If you have any idea or contribution I'll be grateful.

@sarahbellum
Copy link
Collaborator

@Zahma Hi, I'm chiming in on behalf of the visualization implications of clustering. One consideration is the complexity that clustering might add to creation of the Bezier curve line, especially if you allow zooming, where the clustering would change. The Bezier curve lines will potentially become far fewer when zoomed out, and more abundant as the user zooms in and point declustering occurs. This could be super cool!

@jwasilgeo
Copy link
Owner

@Zahma I think I follow what you're saying above. "...then do some calculations to finally construct a featurecollection object that will be then served to CanvasFlowMap for display..." could totally work.

@sarahbellum thanks for bringing up the visualization feedback and concerns. Is this the behaviour you envisioned, @Zahma?

@Zahma
Copy link
Author

Zahma commented Sep 5, 2017

@sarahbellum @jwasilgeo .Thank you both for your interest. In fact i'm working on it right now, I'll let you know of the implications.

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

No branches or pull requests

3 participants