Skip to content

Add static auto-layout graph visualization#8

Draft
lgulich wants to merge 5 commits into
nvidia-isaac:mainfrom
lgulich:codex/graph-visualization-autolayout
Draft

Add static auto-layout graph visualization#8
lgulich wants to merge 5 commits into
nvidia-isaac:mainfrom
lgulich:codex/graph-visualization-autolayout

Conversation

@lgulich

@lgulich lgulich commented Jun 26, 2026

Copy link
Copy Markdown

Summary

  • Replace the old manual Matplotlib/NetworkX graph drawing path with a static layered auto-layout renderer.
  • Emit both <graph_name>.svg and <graph_name>.png from leapp.compile_graph(visualize=True).
  • Render graph inputs/outputs, node names, backend labels, port names, tensor shapes/dtypes, and semantic kind when available.
  • Split the reusable graph model, layout, geometry, SVG, and PNG rendering code into a sibling leapp-visualization pip package.
  • Keep visualization enabled by default: leapp now depends on leapp-visualization==0.5.2, resolved locally by uv from packages/leapp-visualization during development.
  • Move visualization-only dependencies (fast-sugiyama, Pillow) into leapp-visualization.
  • Update docs, examples, and tests for the new SVG+PNG visualization behavior.

Package layout

  • packages/leapp-visualization/src/leapp_visualization/: generic visual graph dataclasses, layout, geometry, SVG renderer, PNG renderer, and render_graph(...).
  • leapp/leapp_graph/visualization_adapter.py: LEAPP-specific adapter from LEAPP nodes/connections/tensor descriptors into leapp_visualization.VisualGraph.
  • leapp/leapp_graph/graph_gui.py: compatibility wrapper used by compile_graph(visualize=True).

Example artifacts

Generated on this branch by leapp.compile_graph(visualize=True):

LEAPP auto-layout graph visualization example

GR00T Graph Example

Larger saved LEAPP export rendered with the same static auto-layout path:

GR00T Unitree G1 LEAPP auto-layout graph visualization

Verification

  • uv run pytest tests/unit_tests/test_graph_visualization_*.py tests/functional_tests/test_annotate.py::TestAnnotateTensor::test_annotate_traced_tensors_diamond_with_feedback tests/test_examples/test_getting_started.py::TestGettingStarted::test_getting_started_execution tests/test_examples/test_feedback_example.py::TestFeedbackExample::test_feedback_example_execution -q -> 38 passed, 4 warnings
  • uv build packages/leapp-visualization && uv build -> built both distributions successfully

@lgulich lgulich force-pushed the codex/graph-visualization-autolayout branch 4 times, most recently from 926ccfa to e6917ed Compare June 26, 2026 11:44
@lgulich lgulich force-pushed the codex/graph-visualization-autolayout branch from e6917ed to 276aead Compare June 26, 2026 11:56
Comment thread pyproject.toml
# getting the end_lineno for ast nodes is provided in 3.8+
# __init__subclass__ is provided in 3.6+
requires-python = ">=3.8"
requires-python = ">=3.11"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is there a way to make it so the python version isn't forced to be 3.11?
I think minimum we can get away with is 3.10. this is because gr00t requires 3.10

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

this is tough. I added 3.11 because fast-sugiyama (the layout library) needs it. If we cannot use 3.10 then we have to write the layout library from scratch

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do you know if gr00t requiring 3.10 is actually true? I think the public github still says requires 3.10 but at the same time it seems like you were able to run a test. If 3.10 is true we can make graphing optional depending on the python version the user is running? like before import add a try except. we can probably make this condition reflect in the pyproject too.

Comment thread thirdparty.txt
Comment thread uv.lock Outdated
Comment thread tests/visualization_tests/test_graph_visualization_builder.py
Comment thread leapp/leapp_graph/graph_gui.py Outdated
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.

2 participants