visgl / flowmap.gl

Flow map drawing layer for deck.gl
https://flowmap.gl
Apache License 2.0
91 stars 14 forks source link

[Feat] Add force directed flow paths #9

Open ehartford opened 2 years ago

ehartford commented 2 years ago

I'm interested in adding force directed flow paths, like this:

image

image

as described in this paper:

Jenny, Bernhard & Stephen, Daniel & Muehlenhaus, Ian & Marston, Brooke & Sharma, Ritesh & Zhang, Eugene & Jenny, Helen. (2017). Force-directed Layout of Origin-destination Flow Maps. International Journal of Geographical Information Science. 31. 10.1080/13658816.2017.1307378.

ilyabo commented 1 year ago

Hi Eric! Sorry for the late reply. Somehow I didn't get any notification. Yes, I am familiar with that paper. I would definitely want to at least add curved arrows as a rendering option. Force directed de-cluttering could be a nice addition too. However, it is usually a computationally-intensive task, so I am not sure how well this might work with the dynamic (adaptive to viewport) rendering approach I've taken. Anyways, if are you interested in contributing some of that to the library, I'd be happy to discuss further or see a PR.

ilyabo commented 1 year ago

It would be fantastic if you could give it a try! I would go with the approach implemented in Flowmapper. In this paper starting on page 17 they discuss their algorithm to construct Bezier curves for a curved half‐arrow: https://www.geo-social.com/docs/Koylu_Tian_Windsor_2021_FlowMapper.pdf Here's their implementation. They did it in SVG. The challenge is to reimplement it in WebGL. This WebGL Bezier curve intro might be of help.

image

ehartford commented 1 year ago

Thank you I will do so