-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add ability to sort nodes and edges #100
Conversation
This issue has been automatically marked as stale, because it has not had activity within the past 30 days. It will be closed if no further activity occurs within the next 30 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions. |
Does Dagre have guarantees, i.e. explicit API documentation, that the ordering of the elements affects the end result? |
@maxkfranz dagre itself doesn't have explicit documentation, but dagre uses From the
cytoscape dagre uses the default value for |
Great. What could we do to clarify how this proposed sorting feature would affect the resultant layout, especially for people who are reading the documentation for the first time? The circle layout and grid layout have conventional orderings, clockwise and the Western reading direction respectively (also the typical x/y graphics axes in CS). The natural ordering of a tree is the topology, so the reader can't necessarily make a connection for what sorting would do. |
We could clarify in the docs that by default cycoscape dagre creates a directed graph, and directed graphs use the node order as a tie breaker when defining the topology of a graph. This feature is most useful when adding and removing the same nodes and edges multiple times in a graph. Would that make sense? |
Sounds good
… On Sep 21, 2022, at 22:47, Tyler ***@***.***> wrote:
We could clarify in the docs that by default cycoscape dagre creates a directed graph, and directed graphs use the node order as a tie breaker when defining the topology of a graph. This feature is most useful when adding and removing the same nodes and edges multiple times in a graph.
Would that make sense?
—
Reply to this email directly, view it on GitHub <#100 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAHRO42NKU7RSI3XU3MRI73V7PCCZANCNFSM6AAAAAAQC2SFJI>.
You are receiving this because you were mentioned.
|
@maxkfranz I updated the readme based on what we talked about 👍 |
Great, @treardon17. I'll set aside some time tomorrow for a merge & release |
Sorry, this slipped past me somehow. Released to npm with your updates for 2.5.0 |
Thanks @maxkfranz! |
Some of the default layouts in cytoscape have a
sort
option (or some variation of it) that lets you sort the nodes/edges so the resulting graph is predictable if you're adding/removing nodes.examples layouts with sort:
https://js.cytoscape.org/#layouts/grid
https://js.cytoscape.org/#layouts/circle
https://js.cytoscape.org/#layouts/breadthfirst
Without this, the graph will have a different outcome if several nodes/edges are added, then some middle nodes/edges are removed, and then those same removed nodes/edges are added back.