Add AutoLayout to NodeView using topological sort#116
Add AutoLayout to NodeView using topological sort#116theolivenbaum wants to merge 1 commit intomasterfrom
Conversation
This commit adds an `AutoLayout` method to the `NodeView` component to automatically position the nodes using a dependency-free approach. The algorithm calculates the depth of each node using Kahn's algorithm for topological sorting, and groups nodes into columns (layers) based on their incoming/outgoing connections to avoid overlap and create a structured flow. A custom `MagicWand` button is added to the toolbar to trigger this layout feature. The toolbar button is injected into a floating element adjacent to the BaklavaJS view to avoid conflicts with Vue's virtual DOM re-renders. The NodeViewSample has been updated to scatter the nodes initially, allowing for clear visual verification of the `AutoLayout` function. A Playwright test has been added to verify that the button is rendered and the layout changes when clicked. Co-authored-by: theolivenbaum <8791811+theolivenbaum@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR adds an
AutoLayoutmethod to theNodeViewcomponent, enabling automatic node positioning using a dependency-free topological sorting approach.Features:
MagicWandbutton to theNodeViewtoolbar. It is injected into a floating container so it's not removed when BaklavaJS's Vue engine re-renders the DOM.NodeViewSamplehas been updated to initially scatter the nodes so the auto-layout behavior is visually demonstrable.PR created automatically by Jules for task 9644769049275588425 started by @theolivenbaum