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
The angle API is a bit tricky to use in programmatic drawing, where the angle value is not known statically. One must play with inner and mark to get the right result depending on the angle value. For example I often need figures for different trigonometric angles:
The first drawing (60deg) is what I expected, but the others all require different fixes:
For 240deg I need inner: false
For -60deg I must replace end: ">" with start: ">"
For -240deg I need both of the above
(Here I could implement the four cases with conditional logic, but in general the angle can be specified by all sorts of coordinates with no explicit angle value.)
What would you think of the following changes to the API:
make angle(O, A, B) always draw from OA to OB (this makes the effect of mark start and end more predictable)
allow inner: auto, in which case the angle is drawn counterclockwise for positive values, and clockwise for negative values (I think this should be the default, but having this opt-in would be fine)
The text was updated successfully, but these errors were encountered:
I've created a PR #729. Could you please validate that it fulfils your expectations. I did not implement the auto behaviour, as it is not clear to me, when the angle would be negative. Do you mean if it is > 180deg?
The
angle
API is a bit tricky to use in programmatic drawing, where the angle value is not known statically. One must play withinner
andmark
to get the right result depending on the angle value. For example I often need figures for different trigonometric angles:The first drawing (60deg) is what I expected, but the others all require different fixes:
inner: false
end: ">"
withstart: ">"
(Here I could implement the four cases with conditional logic, but in general the angle can be specified by all sorts of coordinates with no explicit angle value.)
What would you think of the following changes to the API:
make
angle(O, A, B)
always draw from OA to OB (this makes the effect of markstart
andend
more predictable)allow
inner: auto
, in which case the angle is drawn counterclockwise for positive values, and clockwise for negative values (I think this should be the default, but having this opt-in would be fine)The text was updated successfully, but these errors were encountered: