Skip to content

Add static auto-layout graph visualization - #8

Merged
frlai merged 8 commits into
nvidia-isaac:mainfrom
lgulich:codex/graph-visualization-autolayout
Jul 27, 2026
Merged

Add static auto-layout graph visualization#8
frlai merged 8 commits into
nvidia-isaac:mainfrom
lgulich:codex/graph-visualization-autolayout

Conversation

@lgulich

@lgulich lgulich commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

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 Outdated
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
@frlai

frlai commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

@lgulich instead of installing from pip, can we configure it to install from source for now? this library will grow with leapp for a bit and I think for now it's ok to essentially think of them as part of the same monorepo. This way we can pass the tests too.

@frlai

frlai commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

I also just learned (from my agent) that the raster generation is a different process than the vector image generation. I think it makes sense to remove the svg in that case. this lessens the burden to maintain 2 rendering pipelines and make sure they are equivalent.

@lgulich

lgulich commented Jul 17, 2026 via email

Copy link
Copy Markdown
Contributor Author

lgulich and others added 2 commits July 27, 2026 22:46
Raster and vector output were two independent rendering pipelines that had
to be kept visually equivalent by hand. Per PR review feedback, drop the SVG
renderer and keep PNG as the single graph visualization artifact.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
leapp-visualization is developed in lockstep with LEAPP and is not published
to any index (publish.yml only attaches dists to a GitHub release), so
`pip install -e .` on Python 3.11+ failed to resolve `leapp-visualization==0.5.2`
and CI could not install the package at all.

Treat the two as one repo for now: CI installs the local package from source
before installing LEAPP, which satisfies the pin without a PyPI lookup.
Document the same two-step setup for contributors.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@frlai
frlai marked this pull request as ready for review July 27, 2026 22:30
@frlai
frlai merged commit 53169de into nvidia-isaac:main Jul 27, 2026
4 checks passed
frlai added a commit that referenced this pull request Jul 28, 2026
* Add static auto-layout graph visualization (#8)

* Add static graph visualization auto-layout

* Document leapp-visualization package split

* Plan leapp-visualization package split

* Split graph visualization into leapp-visualization package

* Address graph visualization review feedback

* Gate visualization on Python 3.11

* Remove SVG rendering from graph visualization

Raster and vector output were two independent rendering pipelines that had
to be kept visually equivalent by hand. Per PR review feedback, drop the SVG
renderer and keep PNG as the single graph visualization artifact.

* Install leapp-visualization from source instead of an index

* added lincense, fixed formatting. updated some docs

---------

Co-authored-by: lgulich <22480644+lgulich@users.noreply.github.com>
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