ericdrowell/ElGrapho

Bezier edges, or similar

Closed this issue ยท 5 comments

ElGrapho is great. ๐Ÿ‘
I'd love to be able to use it to do hierarchical edge bundling, at the kind of scale where D3 and its SVGs rather struggle. See:
https://www.data-to-viz.com/graph/edge_bundling.html
https://www.r-graph-gallery.com/hierarchical-edge-bundling/

Image of hierarchical edge bundled chart

This is where you do a Chord layout, but route the edges via a hierarchical tree instead of point-to-point lines.

If it supported that out of the box, that'd obviously be really cool! Failing that, the ability to specify curved coordinates for the edges would be a half-way house. Would probably be useful for various other kinds of plots, anyway.

Thanks for the great library!

Totally agree. I named the layout a "Chord" because I intended to add edge bundling and curves, just like this diagram. I also intend to add configurable node sizes as well. I'll hopefully get around to doing this within a week or so - I'll let you know when the work begins. Thanks!

Also thanks for the kind words.

Wanted to give another update on this - I've made a ton of good changes for 2.3.0, but arcs will not be in that release. As of now, I will shoot for adding arcs and edge bundling in 2.4.0

Another update - I will be adding a new shader to handle the quadratic curve calculations in the GPU. Will be passing three vector attributes for each curve (start point, control point, end point). Will implement this weekend. Targeting v2.4.0

Following up on this - I spiked/considered a few implementations:

  1. geometric (creating tons of triangles to construct quad lines)
  2. quads in shaders with position points 0..1
  3. quad textures

And all of these are doable, but they will add a pretty hefty perf impact. Also, it seems as if chords are the only layout that may benefit from quad lines. And because my main priority for El Grapho is performance, this feature is feeling a little less important at the moment - if it's okay, I'd like to wait for more requests for curved lines and corresponding use cases before overhauling the architecture to support it.

The great thing about straight lines is that webgl is designed specifically for triangles (straight edges) with color interpolation between vertices built in. To achieve curved lines, color interpolation would have to be executed for each segment of each curve either on the CPU (slow load time) or in the shaders on the GPU (slow render time for tons of edges)

At any rate, I will close this for now, but will strongly consider adding this feature in the future.