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
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.
The text was updated successfully, but these errors were encountered:
Could this be done as an initializer that swaps the source and target based on the y position?
Could this be done as an option on the arrow mark that computes the sweep flag based on the y position of the source and target? (And similarly for the x position?)
Again, I don’t think we want to use a render transform here. The render transform is the “big hammer” that we probably only want to use for animation and interaction.
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:
PR #1740 introduces a new option sweep that allows to control this at render time.
The text was updated successfully, but these errors were encountered: