Skip to content

feat(joint-router-avoid): new avoid router package - #3443

Open
Geliogabalus wants to merge 32 commits into
clientIO:masterfrom
Geliogabalus:routers-libavoid
Open

feat(joint-router-avoid): new avoid router package#3443
Geliogabalus wants to merge 32 commits into
clientIO:masterfrom
Geliogabalus:routers-libavoid

Conversation

@Geliogabalus

Copy link
Copy Markdown
Contributor

Summary

  • Adds a new @joint/routers-avoid package integrating the libavoid routing library (main-thread and Web Worker providers) as a JointJS router.
  • Adds an avoid-router example app demonstrating the router on a large sample graph.
  • Minor fixes in rightAngle router and LinkView needed to support the new router.

Test plan

  • yarn test passes for joint-routers-avoid package
  • avoid-router example builds and runs (yarn ensure-examples-can-build)
  • Manually verify routing behaves correctly with both main-thread and worker providers

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-avoid with main-thread + Web Worker providers, plus Karma/QUnit end-to-end tests.
  • Refactors rightAngle router to reuse a new exported alg.rightAnglePath() implementation and adjusts LinkView anchor usage.
  • Adds an examples/avoid-router demo 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

  • flushMessageQueue is currently a const debounced with the module-level default debounceTime. To support debounceTime coming from init options, 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.

Comment thread packages/joint-router-avoid/src/RouterService.mts
Comment thread packages/joint-router-avoid/src/RouterService.mts
Comment thread packages/joint-router-avoid/src/providers/Worker.mts
Comment thread package.json Outdated
Comment thread packages/joint-router-avoid/README.md Outdated
@Geliogabalus Geliogabalus changed the title Add libavoid router support feat(joint-router-avoid): new avoid router package Aug 13, 2026
@Geliogabalus
Geliogabalus marked this pull request as ready for review August 13, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants