You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* arrow sweep option; note that I also removed the arrow head if headLength is zero.
* miserables.json
* miserables arc diagram
* the arrow head and insets computations depend on the flipped bend angle
* darker initializer
* functional sweep (#1741)
* ±[xy]
---------
Co-authored-by: Mike Bostock <[email protected]>
Copy file name to clipboardExpand all lines: docs/marks/arrow.md
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -111,9 +111,12 @@ The arrow mark supports the [standard mark options](../features/marks.md#mark-op
111
111
***insetEnd** - inset at the end of the arrow (useful if the arrow points to a dot)
112
112
***insetStart** - inset at the start of the arrow
113
113
***inset** - shorthand for the two insets
114
+
***sweep** - the sweep order
114
115
115
116
The **bend** option sets the angle between the straight line connecting the two points and the outgoing direction of the arrow from the start point. It must be within ±90°. A positive angle will produce a clockwise curve; a negative angle will produce a counterclockwise curve; zero will produce a straight line. The **headAngle** determines how pointy the arrowhead is; it is typically between 0° and 180°. The **headLength** determines the scale of the arrowhead relative to the stroke width. Assuming the default of stroke width 1.5px, the **headLength** is the length of the arrowhead’s side in pixels.
116
117
118
+
The **sweep** option can be used to make arrows bend in the same direction, independently of the relative positions of the starting and ending points. It defaults to 1 indicating a positive (clockwise) bend angle; -1 indicates a negative (anticlockwise) bend angle. 0 effectively clears the bend angle. If set to *-x*, the bend angle is flipped when the ending point is to the left of the starting point — ensuring all arrows bulge up (down if bend is negative); if set to *-y*, the bend angle is flipped when the ending point is above the starting point — ensuring all arrows bulge right (left if bend is negative); the sign is negated for *+x* and *+y*.
0 commit comments