Skip to content
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

markerEnd and variable aesthetics #2093

Closed
Fil opened this issue Jun 17, 2024 · 1 comment · Fixed by #2094
Closed

markerEnd and variable aesthetics #2093

Fil opened this issue Jun 17, 2024 · 1 comment · Fixed by #2094
Labels
bug Something isn’t working

Comments

@Fil
Copy link
Contributor

Fil commented Jun 17, 2024

When using markerEnd on a line with variable aesthetics, the marker is shown on each and every segment:

Capture d’écran 2024-06-17 à 11 13 02

This seems wrong, and it would be better to apply markerStart only on the first segment, and markerEnd only the last segment. marker should also probably be applied more sparingly to avoid duplications between the end of a segment and start of the following segment.

There is a work-around, but it doesn't feel great:

Capture d’écran 2024-06-17 à 11 14 13

see https://observablehq.com/@observablehq/plot-whirlpool-arrows

@Fil Fil added the bug Something isn’t working label Jun 17, 2024
@mbostock
Copy link
Member

Seems like applyGroupedMarkers should be able to do the “right thing” with respect to groups.

Fil added a commit that referenced this issue Jun 17, 2024
…el semantics of markers:

- markerStart matches the start of the line
- markerMid matches the points which are not at the start or the end
- markerEnd matches the end of the line

Since these lines are implemented as multiple paths, we have change the low-level implementation of markers:
- markerStart only applies to the first segment of a line
- markerMid applies to all the segments, complemented by the start of all but the first segments
- markerEnd only applies to the last segment of a line

closes #2093
mbostock added a commit that referenced this issue Jul 28, 2024
* for lines with variable aesthetics we want to maintain the higher-level semantics of markers:
- markerStart matches the start of the line
- markerMid matches the points which are not at the start or the end
- markerEnd matches the end of the line

Since these lines are implemented as multiple paths, we have change the low-level implementation of markers:
- markerStart only applies to the first segment of a line
- markerMid applies to all the segments, complemented by the start of all but the first segments
- markerEnd only applies to the last segment of a line

closes #2093

* better marker strategy (#2095)

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants