tick option for rule, as in error bars#1891
Conversation
|
I also considered doing this as a new marker (tick), but it’s a little harder to control the size of the ticks when using a marker since it scales with the stroke width. The arrow-reverse marker is already pretty close to this, though! |
|
As I mentioned in #1892 I think I prefer the marker version, for this particular use case. However, the up-side of changing the node type to a PATH is that it allows it to be more malleable. If we did this across the board, not just for rules, we could have rules on maps (#1164), "curvy rects" (for example to create donut charts as rects displayed with a polar projection). Paths are very versatile and could be used to do something unexpected (like, be used to control a textPath, or add a perturbation/disturbance for style effects, or add a flubber transition to another type of shape). Another use case would be "top rounded corners" (#1201). {maybe this comment should be an independent issue} |
There’s no requirement that a mark always render as the same type of SVG element; it could render as a line sometimes, and a path other times when more expressiveness is required. For example, the dot mark renders as a circle element for the circle symbol and as a path element for other symbols. I don’t think the implementing SVG element should be the primary consideration here — that’s mostly invisible to the user. Instead, we should decide based on the difference in the two interfaces:
I think if we’re happy with the limited configurability of ticks, then (2) seems preferable to me due to the added generality. But we could always add (1) in the future, too. |
Fixes #1874.
Since the rule is now rendered as a path element instead of a line, there is a lot of churn in the test snapshots despite the result being visually identical.