grave
grave copied to clipboard
nx_altair--networkx graphs in Altair
Hi y'all,
I'm sort of injecting myself in the conversation in #25 here between @ericmjl, @tacaswell and @jarrodmillman. I was reading through that thread and thought y'all might find nx_altair
interesting.
(link to repo: https://github.com/Zsailer/nx_altair)
This package mimics the networkx.draw
APIs but renders the figures as Altair Charts. To do that, nx_altair internally ports the Graph to pandas.DataFrame
s (separate dataframes for the nodes and the edges) and constructs a set of visualization declarations on those DataFrames. (I should admit, nx_altair
was an afternoon hack that I created as a concept piece.)
I agree with @tacaswell's comments on "declarative" styling in #25. When it works, it works well. However, it can require a high level of understanding of the data.
I will say, though--porting graphs to dataframes+altair does open some interesting benefits for exploring network data. In nx_altair
, any attribute attached to the nodes/edges is automatically added as a column in the DataFrames and can be easily mapped onto the Altair visualization. It's an interesting avenue for exploring networks interactively.
Anyhow, I'll be watching this project closely to help guide the "network grammar" used in nx_altair
moving forward! Thanks!