mapgl icon indicating copy to clipboard operation
mapgl copied to clipboard

flows visualisation with arcs or flowmaps

Open e-kotov opened this issue 1 year ago • 8 comments

Hello @walkerke , I wonder if it is possible to add support for flow visualisation with both or either of:

  • arcs https://svelte-maplibre.vercel.app/examples/deckgl-arcs , implemented in https://symbolixau.github.io/mapdeck/reference/add_arc.html

  • flowmaps https://github.com/FlowmapBlue/FlowmapBlue ; https://github.com/FlowmapBlue/flowmapblue.R

e-kotov avatar Sep 01 '24 08:09 e-kotov

See also https://github.com/JohMast/flowmapper

bt-maps avatar Sep 05 '24 21:09 bt-maps

See also https://github.com/JohMast/flowmapper

yes, see also, but these are static. I do not suggest implementing the algorithm used in {flowmapper}.

I was thinking since the underlying tech of {mapgl}, {deckgl}, {mapdeck}, {flowmapblue} are essentially the same (correct me if i'm wrong, but it's all based on deck.gl one way or another), adding arcs or even better, flowmaps, to {mapgl} (which to me seems like the most ergonomic solution with many nice features) may be relatively easy.

e-kotov avatar Sep 05 '24 22:09 e-kotov

Agreed that deck.gl/flowmap.gl is preferred. Deck.gl layer sources would be a great feature. Py-maplibregl has this functionality for shiny for python. https://eodagmbh.github.io/py-maplibregl/

flowmapper algorithm is from flowmapblue, so some additional work would be needed to visualize with mapgl using sf objects

On Thu, Sep 5, 2024, 6:23 PM Egor Kotov @.***> wrote:

See also https://github.com/JohMast/flowmapper

yes, see also, but these are static. I do not suggest implementing the algorithm used in {flowmapper}.

I was thinking since the underlying tech of {mapgl}, {deckgl}, {mapdeck}, {flowmapblue} are essentially the same (correct me if i'm wrong, but it's all based on deck.gl one way or another), adding arcs or even better, flowmaps, to {mapgl} (which to me seems like the most ergonomic solution with many nice features) may be relatively easy.

— Reply to this email directly, view it on GitHub https://github.com/walkerke/mapgl/issues/37#issuecomment-2332730306, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABALIN3ZHIC6FHUBXKXRQZ3ZVDKU7AVCNFSM6AAAAABNOUABAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZSG4ZTAMZQGY . You are receiving this because you commented.Message ID: @.***>

bt-maps avatar Sep 05 '24 22:09 bt-maps

This would be interesting to consider. Those types of maps are available in deck.gl, which is not part of Mapbox GL JS or MapLibre GL JS by default. So we'd need to build out a deck.gl interface to accomplish that (which is what py-maplibregl has done). I'm not sure what the development lift for that would be.

In the meantime, the rdeck package (https://github.com/qfes/rdeck) is also a really nice interface to deck.gl (though unfortunately not on CRAN). You might consider taking a look at it for flow mapping.

walkerke avatar Sep 24 '24 13:09 walkerke

Arc visualization support may be coming soon to Mapbox, which means we'll be able to support it here. See: https://github.com/mapbox/mapbox-gl-js/issues/3993#issuecomment-2533717645

walkerke avatar Jan 09 '25 15:01 walkerke

Non-interactive flows are now mappable with {mapgl}, thanks to the latest update in {flowmapper} by @JohMast!

Image

Code and discussion over here: https://github.com/JohMast/flowmapper/issues/7#issuecomment-2809270589

e-kotov avatar Apr 16 '25 11:04 e-kotov

This is excellent @e-kotov!

walkerke avatar Apr 16 '25 19:04 walkerke