Visualizer compaction and optimization - #85
Merged
Merged
Conversation
harsh-sikhwal
approved these changes
Sep 17, 2026
ajbalogh
approved these changes
Sep 23, 2026
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.
PR Summary: Visualizer Compaction and Performance Optimization
Overview
Adds large-fabric support to the infrastructure visualizer: server-side layout precomputation, a compressed-view ladder for large topologies, on-demand "rack/pod" drill-down views, and rendering optimizations for large graphs. Also includes a couple of small fixes and README cleanup.
Key changes
1. Precomputed layout (
visualize.py)Visualizer._compute_layoutassigns hierarchical level + x/y position to every instance node server-side (BFS from hosts + barycenter ordering), so the browser no longer needs to run vis.js's hierarchical layout/physics engine to open large graphs.count(parallel-link count) alongside the existing label/width.2. Compressed view ladder (
visualize.py,navigation.js)COMPRESS_MIN_HOSTS),_generate_compressed_viewsbuilds a ladder ofinfrastructure_compressed_N.jsonviews, each merging nodes with identical connectivity one step further than the last, ending in one node per tier.navigation.js) to switch the infrastructure view to a chosen rung, only enabled/visible when on the top-level infrastructure view.3. Rack/pod drill-down (
navigation.js,data.js,app.js)infrastructure.jsonand laid out client-side (layoutSubgraph, a JS port of the Python layout).RACK_MAX_NODES) to stay responsive, with a toast shown when capped or refused.4. Large-graph rendering mode (
network.js,data.js,app.js)optionsForData()centralizes picking precomputed vs. hierarchical vs. large-graph vis.js options.5. Misc frontend fixes
controller.js: slider handlers (font/node size, spacing) are now debounced (120ms) instead of firing on every pixel of drag; precomputed-view spacing sliders rescale positions directly instead of re-running vis layout.app.js/render(): uses aMaplookup (nodeById) instead ofArray.findfor click/hover node lookup; skips thestabilizationIterationsDonephysics dance entirely when a view has no physics.search.js: node search result colors now use CSS theme variables instead of hardcoded hex, so results respect dark/light theme.visualize.py: removes two now-unnecessary lines from the pipeline (pipeline fixcommit).6. Docs
README.md/docs/src/cli.md: document the compressed view, rack/pod behavior, and--hostsguidance.src/infragraph/visualizer/README.md(407 lines) and a couple of lines from the root README in the final commit — worth confirming this was an intentional retirement of that file rather than an accidental deletion, since there's no equivalent content added elsewhere in the diff.Files touched
visualize.py,navigation.js(+341 new),network.js(+42 new),data.js,app.js,controller.js,filters.js,search.js,style.css,index.html,README.md,docs/src/cli.md.