Repository navigation
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
Open
kumilingus wants to merge 3 commits into
kumilingus wants to merge 3 commits into
Conversation
This branch has not been deployed
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.
Description
Fixes three visual problems of the
jumpoverconnector 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 withinsizeof 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
arcjump 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 bysizelike 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
xcoordinates exactly, so a vertical line computed by a router (e.g.xoff by1e-13) could get its jumps on the opposite side. It now ignores differences below1e-6, forarcandcubicjumps.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
jump over track
Tests
test/jointjs/connectors.js,jumpover connector:size, and so do two close links; a single crossing still gets a semicircle; distant crossings get separate jumps;jump: 'gap'a track gets one gap, and withjump: 'cubic'one curve about as high assize;1e-9(going up and going down) get their jumps on the same side as exactly vertical links;size).normal,rightAngleandmanhattanrouters.yarn dist, karmajoint(2224),yarn test-server,yarn lintandyarn test-tspass.