fix vertical dragging in visualizer - #80
Open
Amos-Rai-KEYS wants to merge 2 commits into
Open
Conversation
harsh-sikhwal
previously approved these changes
Aug 21, 2026
ajbalogh
approved these changes
Aug 21, 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.
Fix: Restore vertical dragging after level separation and node spacing slider moves
Summary
When users adjusted the "Level Separation" or "Node Spacing" sliders in the control panel, nodes became locked to their vertical axis and could no longer be dragged. This fix restores full dragging freedom after layout adjustments.
Problem
The infragraph visualizer uses vis-network's hierarchical layout, which pins every node on its level axis to maintain the graph structure:
fixed.y = truefor vertical (DU/UD) fabric viewfixed.x = truefor horizontal (LR) internal viewThe drag handler only moves nodes on axes where
fixedisfalse, so pinned axes are immovable.On initial render, nodes are unpinned after stabilization (cleared
fixedback tofalse). However, when either slider triggered a layout re-run viasetOptions(), the layout engine re-applied the pins but the slider handlers never cleared them again. Result: first slider touch permanently froze the vertical axis.Solution
Introduced
unpinNodes(network)helper that:getPositions()x/y(durable position + setspredefinedPosition = true)fixed: falseon all nodes to restore drag freedomThe helper is called in all three places the layout stabilizes: initial render and both slider handlers.
Changes
src/infragraph/visualizer/frontend/js/network.js
unpinNodes(network)helper function (lines 40–51)renderNetwork()to callunpinNodes()after stabilization (line 61)src/infragraph/visualizer/frontend/js/controller.js
respaceLayout(hierarchical, repulsion)helper to deduplicate slider logic (lines 36–57)respaceLayout({}, { nodeDistance: spacing })(lines 59–62)respaceLayout({ levelSeparation: spacing }, {})(lines 64–67)unpinNodes(net)after stabilization ✓net.off('stabilizationIterationsDone')to prevent stale listener stackingsetOptions()calls and duplicated configsrc/infragraph/visualizer/frontend/js/app.js
render()to useunpinNodes(net)instead of inline unpin logic (line 52)