Skip to content

fix(jumpover): one jump over a track of links, consistent jump direction, skip links that cannot cross - #3591

Open
kumilingus wants to merge 3 commits into
clientIO:masterfrom
kumilingus:fix/jumpover-jumps
Open

kumilingus wants to merge 3 commits into
clientIO:masterfrom
kumilingus:fix/jumpover-jumps

Conversation

@kumilingus

@kumilingus kumilingus commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes three visual problems of the jumpover connector and makes it skip links that cannot cross.

One jump over a track of links. createJumps() merged a crossing only with the next one. A link crossing a track of parallel links close to each other got a row of jumps, each over two links. Now a jump keeps extending while the next crossing is within size of its end, so the whole track gets one jump. A crossing too close to the start or the end of the line still gets no jump, and the crossings next to it still get theirs. The merge no longer moves the intersection points it reads.

Long jumps no higher than a single jump. An arc jump was a semicircle over its whole length, so a jump over several links bulged by half of its length. A jump longer than a single one (2 * size) is now drawn as a quarter circle up, a straight line and a quarter circle down, bulging by size like a single jump. A single jump is drawn as before.

Jumps on vertical lines point the same way. A jump points up, or right on a vertical line. The check compared the x coordinates exactly, so a vertical line computed by a router (e.g. x off by 1e-13) could get its jumps on the opposite side. It now ignores differences below 1e-6, for arc and cubic jumps.

Skipping links that cannot cross. For each other link, the connector built its lines and tested them against every segment of the link. Two links can only cross where the bounding boxes of their route polylines (source, route and target points) meet, so the links outside of that box are now left out before the line math. The result is the same: a box that only touches the other one is still tested (it is inflated by 1), and links without rendered geometry are tested as before.

Images

jump height

jumpover-height

jump over track

jumpover-track

Tests

  • test/jointjs/connectors.js, jumpover connector:
    • a track of four close links gets one jump, which bulges by size, and so do two close links; a single crossing still gets a semicircle; distant crossings get separate jumps;
    • a track with a crossing too close to the start or the end of the line still gets a jump over the other crossings;
    • with jump: 'gap' a track gets one gap, and with jump: 'cubic' one curve about as high as size;
    • vertical links off by 1e-9 (going up and going down) get their jumps on the same side as exactly vertical links;
    • links outside of the bounding box are not tested for crossings, and a link touching the box at its edge is.
  • The tests fail without the change: on the previous connector (two jumps instead of one, the opposite side, all links tested), without the inflated box (the touching link is not tested), and without the new long jump shape (the jump bulges by more than size).
  • With and without the bounding box check, every jumpover path is the same on random graphs of 300 elements and about 440 links with the normal, rightAngle and manhattan routers.
  • yarn dist, karma joint (2224), yarn test-server, yarn lint and yarn test-ts pass.

This branch has not been deployed

No deployments
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.

1 participant