Make 'graph.linkorder' and 'graph.rank' easier to use#3330
Open
Make 'graph.linkorder' and 'graph.rank' easier to use#3330
Conversation
A number of small changes were made to the graph creation code to make the node positioning features easier to use: * 'graph.rank' and 'graph.linkorder' can be used on nodes, links, or interfaces * Setting node 'graph.linkorder' to a high value will consistently place the node below the connected subnet. * The 'Influencing Graph Layout' documentation section was expanded with several examples. Bug fixes: * Cleanup the 'get attribute' code and use a shared function in all sorting procedures * Do not copy 'graph.rank' from link to interface, allowing 'graph.rank' to be used for node sorting when the link 'graph.linkorder' is set to 50 (node default value).
There was a problem hiding this comment.
Pull request overview
Updates the graph output pipeline to make graph.rank / graph.linkorder easier to apply across nodes, links, and interfaces, improving determinism of layout ordering and expanding the documentation with practical examples.
Changes:
- Added node-level schema support for
graph.linkorderand updated integration topology to exercise node/group-levelgraph.linkorder. - Refactored graph attribute lookup into a shared helper used by multiple edge/link sorting paths.
- Expanded “Influencing the Graph Layout” docs with concrete
graph.linkorderexamples.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/platform-integration/graph/01-topo.yml | Updates test topology to set graph.linkorder via a group and to use interfaces: syntax for a multi-access link. |
| netsim/outputs/graph.yml | Extends node attribute schema to include linkorder. |
| netsim/outputs/_graph.py | Introduces shared get_attr helper and updates edge/link sorting and propagation rules. |
| docs/outputs/graph.md | Adds clearer explanations and examples for graph.rank / graph.linkorder behavior. |
Owner
Author
|
@a-v-popov -- this should solve the "hosts below subnet" graphing challenge you had a while ago. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A number of small changes were made to the graph creation code to make the node positioning features easier to use:
Bug fixes: