feat(router): add minPathMargin option to rightAngle router to suppress margin-overlap detours#3266
Merged
kumilingus merged 23 commits intoclientIO:masterfrom May 4, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new minMargin option to the rightAngle router to reduce unnecessary “detour around margin” routes when elements are adjacent and their margin zones only minimally overlap, and introduces a new JS playground example to demonstrate the behavior.
Changes:
- Add
minMarginoption torightAngleRouterand thread it through allrouteBetweenPointscalls. - Add “ignore overlapping margin” logic in
routeBetweenPointsfor opposite-side routing cases. - Add a new
examples/right-angle-playground-jsworkspace demo (and lockfile entry).
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds the new @joint/demo-right-angle-playground-js workspace entry. |
| packages/joint-core/src/routers/rightAngle.mjs | Implements minMargin option and new margin-overlap suppression logic. |
| examples/right-angle-playground-js/src/styles.css | Styling for the new playground demo. |
| examples/right-angle-playground-js/src/main.js | Demo setup showcasing rightAngle routing with minMargin. |
| examples/right-angle-playground-js/package.json | Declares the new example workspace package and its scripts/deps. |
| examples/right-angle-playground-js/index.html | HTML entrypoint for the new Vite demo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kumilingus
previously approved these changes
Apr 14, 2026
# Conflicts: # packages/joint-core/types/joint.d.ts
# Conflicts: # packages/joint-core/src/routers/rightAngle.mjs # packages/joint-core/test/jointjs/routers.js
kumilingus
approved these changes
May 4, 2026
3 tasks
kumilingus
added a commit
that referenced
this pull request
May 4, 2026
Co-authored-by: Arthur Khakhlou <arthur.khokhlov@gmail.com>
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.
Summary
minPathMarginoption torightAngleRoutersourceMarginandtargetMarginoptions torightAngleRouterright-angle-playground-jsexample demonstrating the option with movable vertices, anchors, and a resize handleTest plan
minPathMargin(defaultnull) preserves existing routing behaviour in all side combinationssourceMarginandtargetMarginoptionsright-angle-playground-jsexample loads and the router respects theminPathMargin: 10setting when elements are dragged close together🤖 Generated with Claude Code