Repository navigation
Conversation
The head of an arc is a sharp triangle, 9 units long and 10.5 wide, with its back cut in by half a unit. The arc stops 4 units short of the node it points at and runs its last 8.5 units straight, so the head sits on its line. The whole line of an arc stops inside its head, where the head is twice as wide as the line, and that end is round. The distance follows from the shape of the head, so the line cannot show beside or past a head of another size. The round end is a stroke of no length, so the other end of the line keeps its flat end.
Arcs met a node where the line between two centres crossed its outline, so the arcs of a busy node shared points and lay on each other. The core now routes them: each end takes a side of its node, the ends of a side stand at even distances in the order of where they go, and each end turns towards its other node and fans out from the middle of its side. - Core: `placeArcEnds` and `getArcLine` in the layout layer, with the six routing values in one settings object that is read on every call. A routing reuses the one before, so a drag places only the nodes it reaches. - Canvas: the arc layer routes through the core and reads the values from the `arcRouting` user setting. Settings › Labs has a slider for each value and a way back to the defaults. - Docs: an Arc routing guide beside the code with two interactive figures, and a shared loader for figures that load when they come into view. An arc being drawn still aims at the centres of its nodes, and moves to its point among the other arcs when it is dropped.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
This branch was successfully 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.
Warning
Stored settings change
petrinaut:user-settingsinlocalStoragetakes anarcRoutingobject of six numbers.Existing settings load unchanged and take the default routing values.
A build without this PR loads settings that have
arcRoutingand ignores it.Summary
Before this PR, an arc met a node where the line between the two node centres crossed its outline. Arcs of a busy node shared points on the outline and lay on each other. Arrowheads had round corners and touched the node they pointed at.
Core routes the arcs of a node together. Each end takes a side of its node and a point on that side, at even distances in the order of where the arcs go, and turns towards the node at its other end. Arrowheads are sharp, lie in line with their arc and stop 4 units short of the node. Six routing values change under Settings > Labs > Arc routing while a net is on screen.
10712.mp4
Stored settings
petrinaut:user-settingsinlocalStoragetakes anarcRoutingobject that holds the six routing values. It is written whole, with the other settings.Example and loading: settings load in both directions with no migration
arcRoutingLinks
Changes
Core:
placeArcEndsandgetArcLineroute every arc of a net in the layout layerArcRoutingSettingsobject, read on every callCanvas: arc layer routes through the core, and heads are sharp
placeArcEndsSettings: Labs gets an Arc routing group with a slider for each value
arcRoutinguser setting holds the six valuesGuide figures: two interactive figures and a shared loader on the docs site
lazyFigureloads a figure when it scrolls into viewKnown issues
Test coverage
Unit tests: routing rules in core, canvas arcs and heads, stored values and sliders
arc-routing.test.ts:choose-side.test.ts,never-falling.test.ts,arc-line.test.ts,settings.test.ts,outline.test.ts:arc-shapes.test.ts,arc-geometry.test.ts,arc-head.test.ts,outline-connection-line.test.tsx:user-settings-provider.test.tsx,user-settings.test.tsx,setting-slider.test.tsx,arc-routing-rows.test.ts:side-ranges.test.ts:Browser checks: Storybook canvas and Labs sliders, figures on the built docs site
How to test
Canvas: arcs spread along node sides, sharp heads
Labs sliders: canvas follows a slider, values are stored
Guide figures: side dial and playground on the docs preview