-
Notifications
You must be signed in to change notification settings - Fork 197
rule & tick markers; arrow-reverse marker #1600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/marker.js
Outdated
| .attr("markerWidth", 6.67) | ||
| .attr("markerHeight", 6.67) | ||
| .attr("orient", "auto") | ||
| .attr("orient", "auto-start-reverse") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is especially noticeable with tick and rule (as shown in the tests); I think this is a better default for the arrow marker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree it's a better default for rules and ticks, that (typically) indicate an extent; but for a line that (typically) indicates a sequence, it feels a bit wrong if the first arrow is pointing outwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels less wrong than having the arrows point the same way for a rule and a line. I don’t see any practical demand for having an arrow at the start of the line; you’d typically use markerMid instead, and possible markerEnd.
The alternative is we have to introduce two types of marker, one for line (arrow if we retain backwards compatibility) which will almost never be used for that purpose, and another for rule and tick (arrow-reverse, say) which won’t be as discoverable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve reverted the changes to the arrow marker and added an arrow-reverse marker in the latest commit.
Fil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you wanted to have the best defaults, we could imagine two new options arrow-auto and arrow-reverse, with arrow defaulting to arrow-reverse for rules and ticks, and to arrow-auto for lines?
Just a suggestion, I'm OK with both approaches.
|
Interesting; I hadn’t consider mark-specific defaults for markers but that would be possible. I think this is fine for now. Perhaps it’s better to be more explicit when you want bidirectional arrows. And I don’t know if there will be much demand for markers on rules and ticks in any case. |
38c35f1 to
a4b4435
Compare
* rule & tick markers; arrow auto-start-reverse * docs edits * arrow-reverse marker
Fixes #1412.