Closed
Description
To make an arc diagram such as https://observablehq.com/@d3/arc-diagram, I want to use the arrow mark with a bend angle of 90°, to draw the half-circles connecting a source to a target in the graph.
However currently this always draws the arc in a “clockwise”[1] manner from the first point (x1, y1) to the second point (x2, y2), which means that in most cases the arrow will go either to the left or to the right, depending on whether y1 > y2.
[1] clockwise, becomes counter-clockwise when bend is < 0.
Visually, what I get is the image on the left; what I want is the image on the right:
To reach this goal, I can:
- check how the source and target are ordered in the y domain, and reverse them as needed. This implies that the channels now depend on the scale (not good);
- draw both source-target and target-source arrows, and clip them to the frame—provided the main axis is the left edge of the frame (also not very good);
- write a render transform that reverses the sweep-flag on the generated path (it works, but… 😵💫).
PR #1740 introduces a new option sweep that allows to control this at render time.