Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hierarchy Graphs #859

Closed
Prophet32j opened this issue May 5, 2017 · 29 comments
Closed

Hierarchy Graphs #859

Prophet32j opened this issue May 5, 2017 · 29 comments
Labels

Comments

@Prophet32j
Copy link

I'm looking at sigma.js for potentially replacing vis.js as our big data graphing library of choice. One of the deal breakers is hierarchy views of the network. I don't see anything besides this old issue #162 that says it's not possible, but potentially getting worked on. That was 3 years ago. Any word on this?

@Yomguithereal
Copy link
Collaborator

The issue is about the gexf file format. Do you have the same issue or do you just want to render your graph as a philogeny?

@Prophet32j
Copy link
Author

Prophet32j commented May 5, 2017 via email

@Yomguithereal
Copy link
Collaborator

What would be the size of you tree in terms of number of nodes? The fact is sigma has been designed to render graphs, not trees. So one would probably need to develop a tree layout algorithm to be used with sigma to display it like a philogeny.

@Prophet32j
Copy link
Author

Prophet32j commented May 6, 2017 via email

@Yomguithereal
Copy link
Collaborator

Ok. Have you by chance considered d3? You don't have a lot of nodes & the fact is sigma can do the job but will require you to write some amount of code to do the layout.

@Prophet32j
Copy link
Author

Prophet32j commented May 6, 2017 via email

@Yomguithereal
Copy link
Collaborator

Well I guess than one option then would be to develop the layout algorithm and use it with sigma. I can help you towards this if you want. Do you have, per chance, an image showing roughly what you intend to render?

@Prophet32j
Copy link
Author

hierarchy-lg
hierarchy-zoom

@Prophet32j
Copy link
Author

this is rendered with Vis right now. The large graph is rather tame, displaying less than 100 nodes. We found that Vis's render time was slow with anything over 100 nodes. It's even worse when displaying a typical network graph.

@Yomguithereal
Copy link
Collaborator

Do your node's data contain layout information or was it computed by Vis? Sigma would not have issues rendering graphs of that scale but does not have the code to perform this kind of layout. You would just need to compute the layout beforehand before using sigma to render.

@Prophet32j
Copy link
Author

Vis handles layout for us, which is a very nice thing to have. Developing our own layout algorith isn't necessarily out of the question. We have requirements to display performant graphs. So if that means creating our own layout algorithm I think we would be ok spending the time to do it.

@Prophet32j
Copy link
Author

some requirements:

  • append a subgraph of a child node
  • delete/hide a node and its subgraph
  • render a network graph
  • render a hierarchical graph (phylogeny)
  • textual display of node name and edge name (runs on / owns / contains)

@Yomguithereal
Copy link
Collaborator

All your requirements can be met with sigma. The only one that might be problematic for performance is edge labeling but considering the scale of your graphs this should not be too much of an issue.

@Prophet32j
Copy link
Author

Prophet32j commented May 7, 2017 via email

@Yomguithereal
Copy link
Collaborator

That's possible indeed.

with better performance

Since I don't know what are your current performance I can't really tell. What I know is that edge hovering is an algorithmical nightmare and tends to slow everything down (specially if you represent them as bézier curves).

@AVermeij
Copy link

Have you by any chance checked out dagre (https://github.com/cpettitt/dagre)? I've used this in the past for laying out hierarchies with sigma and it works very well.

@Prophet32j
Copy link
Author

That's very interesting. I see it's no longer being maintained. How complex were your graphs @AVermeij ? Did you have large graphs with over 150 nodes? Was there any pain in implementing dagre with sigma?

@AVermeij
Copy link

AVermeij commented May 19, 2017

I remember it working pretty well with graphs of a few hundred nodes, the main performance bottleneck being the layout calculations - in terms of rendering sigma can easily handle that number of nodes using the canvas or webgl renderers.

Actually, I just remembered the guys over at Linkurious developed a drop-in plugin to use dagre with sigma. Saves some work on an implementation perhaps, and has an MIT license (apart from lots of other elements of their lib, which is GPL): https://github.com/Linkurious/linkurious.js/tree/develop/plugins/sigma.layouts.dagre

Edit: it's also possible to delegate the layout calculations to a webworker so that they don't block the browser - may help when graphs get larger and calcs take longer.

@Prophet32j
Copy link
Author

awesome. Thanks for your edit. Delegating to a web worker is critical when we have graphs with hundreds of nodes and edges

@sftranna
Copy link

Did you try to implement dagre with sigma?
I am looking for a tree structure but I am still unable to find a good way to start of dagre with sigma.js.
Any help/tutorial will be highly appreciated.
Thanks

@Prophet32j
Copy link
Author

Prophet32j commented Jul 22, 2017 via email

@PythonLinks
Copy link

Here is my beta version of Hierarchy for 710 nodes.
https://pythonlinks.info/graph

Comments appreciated.

@Yomguithereal
Copy link
Collaborator

What's the layout algorithm used? Did you develop it yourself for this example? I would very much like to implement it for graphology so it can be used with sigma's next version.

@PythonLinks
Copy link

Yes, I developed it myself. Does that mean we should call it the "Lozinski Algorithm."

Maybe it would be easier to implement it with graphology than with Sigma. I had to add parent and children variables to each Sigma.js node object.

I guess in due course a new version of sigma.js based on graphology will be released, and then it should be relatively easy for me to port it over.

Is that fast enough? Do you have an urgent need for a hierarchy view?

I took a look at what you are doing. I think that your project is very interesting. Can I call you to discuss this further?

Warm Regards
Christopher Lozinski
PythonLinks.info/contact

@PythonLinks
Copy link

Thank you for your interest.
Here is the production version of a hierarchy graph.
Desktop.PythonLinks.info

@stale
Copy link

stale bot commented Oct 8, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Oct 8, 2021
@stale stale bot closed this as completed Oct 23, 2021
@hakunamatata97k
Copy link

hakunamatata97k commented Nov 14, 2022

Hey @Yomguithereal Any update on this issue? I have a kinda same use case, but with +10,000 nodes. So D3 is sadly not an option. :(

hierarchy-lg hierarchy-zoom

@Prophet32j what did you end up doing?
@PythonLinks could you please link the layout model that you implemented?

@PythonLinks
Copy link

Oh it is ancient and no longer online. Basically it was a circular tree of nodes, with some simple algorithms to determine the angle of each branch. Not that much work to replicate.

@rbowers02
Copy link

@hakunamatata97k Find anything that would work to draw this type of topology?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants