Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Graph support #1829
Based on the discussion @jlstevens and I had during SciPy sprints this PR adds a Graph Element to HoloViews. The outline below represents the discussion surrounding the API we had:
Graph: Element that may or may not visualize itself.
Graph - Composite Element
data: start and end columns (where start and end are the node indices)
Defines concrete position of each node using three columns/kdims, x/y position plus node index/label. Any value dimensions will be exposed as hover labels.
data: x,y positions + node index + anything else
data: [ dfs/array, ... ]
Graph(edges) - Abstract graph (cannot be displayed).
jbednar left a comment
Fabulous! I think this has turned out to be very clean and will be really nice for people to use. I had a variety of comments about the example notebook, mostly about things to make clear to the users how to do, but also possibly about the underlying support (not sure which).
Also, there's no example of mapping edge "weight" onto anything visible; is that supported?
And it would be useful to have a datashaded categorical example, with some large graph of edges broken into categories that show up as different colors; that always makes for pretty pictures that drive people to try to explore what the categories and network structures mean.
Yes, I agree, not implemented yet. Any suggestion on plot options to control this? Ideally we'd have addressed that issue
I'll implement that.
One thing that I think is missing from this PR are element notebooks documenting
There is a fair bit of documentation work that needs doing. For this reason, I wouldn't mind merging this PR to get the code in place with a separate PR improving the docs. That PR could improve the user guide in the ways Jim has suggested and add the various other notebooks.
The tests are now green and I'm very happy with the API overall. There are three things I want us to follow up on:
I don't think these issues should hold up this PR any longer as any PR adding a major new feature is going to need tweaks. I am happy to merge now so we can get testing and improving our new graph support!