Skip to content

Make 'graph.linkorder' and 'graph.rank' easier to use#3330

Open
ipspace wants to merge 2 commits intodevfrom
graph-rank
Open

Make 'graph.linkorder' and 'graph.rank' easier to use#3330
ipspace wants to merge 2 commits intodevfrom
graph-rank

Conversation

@ipspace
Copy link
Copy Markdown
Owner

@ipspace ipspace commented Apr 15, 2026

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).

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).
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.linkorder and updated integration topology to exercise node/group-level graph.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.linkorder examples.

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.

Comment thread netsim/outputs/_graph.py Outdated
@ipspace ipspace requested a review from a-v-popov April 15, 2026 15:59
@ipspace
Copy link
Copy Markdown
Owner Author

ipspace commented Apr 15, 2026

@a-v-popov -- this should solve the "hosts below subnet" graphing challenge you had a while ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] graph.rank and graph.linkorder should not be copied from links to interfaces

2 participants