vega / altair

Declarative statistical visualization library for Python
https://altair-viz.github.io/
BSD 3-Clause "New" or "Revised" License
9.06k stars 773 forks source link

Edge Bundling #3399

Open rraadd88 opened 2 months ago

rraadd88 commented 2 months ago

What is your suggestion?

Hi, I wonder if network visualizations are of interest for altair. I would like if a feature to make edge-bundling of Vega i.e. https://vega.github.io/vega/examples/edge-bundling/ is incorporated. Unlike other network visualizations, edge bundling is relatively simple and space-defined visualization, which is currently much easier to make in R than in python.

The key advantage of using Vega and therefore altair would be interactivity, which is lacking in the R implementation, AFAIK.

Have you considered any alternative solutions?

I recently developed a python package, called parag (code, website with interactive plots) which is essentially a wrapper around the Vega's edge-bundling functionality. It (1) prepossesses the input (pandas) dataframe, (2) fills out the json schema and (3) displays the plot. In addition, on top of the base plot, I implemented node annotations, which show the interactor types for each node.

If there any plan to incorporate the edge-bundling in altair, at least some of the functions from my package could be used.

joelostblom commented 2 months ago

Thanks for the suggestion @rraadd88 ! Those edge bundling examples are neat, and I agree it is an interesting and helpful visualization when the data lends it self well to it.

The approach that we are currently taking is that major functionality like this benefit from being added directly to VegaLite and then it will become available in Altair. If edge bundling is too specialized for being generally available in VegaLite, I think it makes sense that it is a separate package that is complementary to altair. Feel free to add a PR to include it on this page where we list such packages; you can see there is a network edge related package there too (although not updated in a while).