feat(joint-router-avoid): new avoid router package - #3443
Open
Geliogabalus wants to merge 32 commits into
Open
Conversation
… content after paper unfreeze Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds libavoid-based orthogonal routing to JointJS via a new workspace package and demo, with supporting changes in @joint/core to share the rightAngle path algorithm and improve routing/anchor handling.
Changes:
- Introduces
@joint/router-avoidwith main-thread + Web Worker providers, plus Karma/QUnit end-to-end tests. - Refactors
rightAnglerouter to reuse a new exportedalg.rightAnglePath()implementation and adjustsLinkViewanchor usage. - Adds an
examples/avoid-routerdemo app and wires new workspace deps into the monorepo.
Reviewed changes
Copilot reviewed 43 out of 47 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds workspace entries and deps for the new package + demo. |
| packages/joint-router-avoid/tsconfig.json | Base TS config for the new package. |
| packages/joint-router-avoid/tsconfig.esm.json | ESM build TS config. |
| packages/joint-router-avoid/tsconfig.cjs.json | CJS build TS config (currently unused by scripts). |
| packages/joint-router-avoid/test/libavoid-loader.mjs | Test-only loader to expose libavoidJs global for UMD. |
| packages/joint-router-avoid/test/index.js | QUnit end-to-end tests for RouterService behavior. |
| packages/joint-router-avoid/test/index.html | Browser test harness for the package. |
| packages/joint-router-avoid/src/RouterService.mts | Core routing service syncing a dia.Graph to libavoid providers. |
| packages/joint-router-avoid/src/providers/WorkerProvider.mts | Provider implementation backed by a Web Worker. |
| packages/joint-router-avoid/src/providers/Worker.mts | Worker-side libavoid integration + debounced batching. |
| packages/joint-router-avoid/src/providers/Provider.mts | Provider abstraction types and interface. |
| packages/joint-router-avoid/src/providers/MainThreadProvider.mts | Main-thread libavoid provider implementation. |
| packages/joint-router-avoid/src/init.mts | Public init/load helpers to bootstrap libavoid and RouterService. |
| packages/joint-router-avoid/src/index.mts | Package entrypoint exports. |
| packages/joint-router-avoid/SECURITY.md | Package-level security policy doc. |
| packages/joint-router-avoid/rollup.config.mjs | Rollup UMD build config for the package. |
| packages/joint-router-avoid/README.md | Package documentation (currently inconsistent with shipped API). |
| packages/joint-router-avoid/package.json | New workspace package manifest. |
| packages/joint-router-avoid/LICENSE | MPL-2.0 license file for the package. |
| packages/joint-router-avoid/karma.conf.js | Karma config for running browser tests + WASM proxying. |
| packages/joint-router-avoid/eslint.config.mjs | ESLint flat config for the package. |
| packages/joint-router-avoid/.gitignore | Ignores build/test artifacts in the new package. |
| packages/joint-core/types/index.d.ts | Exposes alg types from @joint/core. |
| packages/joint-core/types/alg.d.ts | Adds TS types for alg.rightAnglePath(). |
| packages/joint-core/src/routers/rightAngle.mjs | Refactors to delegate core pathing to alg.rightAnglePath(). |
| packages/joint-core/src/dia/LinkView.mjs | Ensures connection points use the latest stored anchors. |
| packages/joint-core/src/core.mjs | Exports alg from the core entrypoint. |
| packages/joint-core/src/alg/rightAnglePath.mjs | New shared right-angle path algorithm implementation. |
| packages/joint-core/src/alg/index.mjs | Exports rightAnglePath from alg. |
| package.json | Updates pack-all to include the new package (name currently mismatched). |
| examples/avoid-router/webpack.config.js | Webpack config for the demo + copies libavoid.wasm. |
| examples/avoid-router/styles.scss | Shared styling for the demo UI. |
| examples/avoid-router/src/simple-graph/shapes.js | Demo shapes for the simple graph tab. |
| examples/avoid-router/src/simple-graph/resize-tool.js | Demo resize tool for nodes. |
| examples/avoid-router/src/simple-graph/example.js | Simple graph demo wiring initAvoid(). |
| examples/avoid-router/src/simple-graph-extra/shapes.js | Demo shapes for “simple extra” tab. |
| examples/avoid-router/src/simple-graph-extra/resize-tool.js | Resize tool for “simple extra”. |
| examples/avoid-router/src/simple-graph-extra/example.js | “Simple extra” demo with custom unroutable handling. |
| examples/avoid-router/src/large-graph/shapes.js | Demo shapes for the large graph tab. |
| examples/avoid-router/src/large-graph/example.js | Large graph demo using Worker provider + pending styling. |
| examples/avoid-router/src/index.js | Demo tab switcher/initializer. |
| examples/avoid-router/src/common.js | Shared paper setup + interaction/zoom helpers. |
| examples/avoid-router/README.md | Demo usage instructions. |
| examples/avoid-router/package.json | Demo workspace package manifest. |
| examples/avoid-router/index.html | Demo page with tab UI + bundle script. |
| examples/avoid-router/.gitignore | Ignores demo build artifacts. |
Suppressed comments (1)
packages/joint-router-avoid/src/providers/Worker.mts:252
flushMessageQueueis currently aconstdebounced with the module-level defaultdebounceTime. To supportdebounceTimecoming frominitoptions, it needs to be re-creatable/reassignable.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
# Conflicts: # packages/joint-core/src/routers/rightAngle.mjs
Geliogabalus
marked this pull request as ready for review
August 13, 2026 13:22
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
@joint/routers-avoidpackage integrating the libavoid routing library (main-thread and Web Worker providers) as a JointJS router.avoid-routerexample app demonstrating the router on a large sample graph.rightAnglerouter andLinkViewneeded to support the new router.Test plan
yarn testpasses forjoint-routers-avoidpackageavoid-routerexample builds and runs (yarn ensure-examples-can-build)🤖 Generated with Claude Code