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

strokeDashArray affects markers #2131

Open
prostolyubo opened this issue Aug 12, 2024 · 2 comments
Open

strokeDashArray affects markers #2131

prostolyubo opened this issue Aug 12, 2024 · 2 comments
Labels
bug Something isn’t working

Comments

@prostolyubo
Copy link

Current State

Certain settings on strokeDasharray property may break the markers. Here for instance instead of an arrow on the line we have a tick:
image

Repro

Plot.plot({
  marks: [
    Plot.lineY([[0,5],[5,2],[10,0]], { 
      x: (d) => d[0], 
      y : (d) => d[1],
      strokeDasharray: "1,10",
      strokeWidth:3,
      markerMid: "arrow"
    })
  ]
})

Expected State

strokeDasharray should not affect markers, or there should be a separate property to control it:
image

@prostolyubo prostolyubo added the bug Something isn’t working label Aug 12, 2024
@prostolyubo prostolyubo changed the title dashArray affects markers strokeDashArray affects markers Aug 12, 2024
@mbostock
Copy link
Member

Yes, this looks like a bug. The marker element is inheriting the stroke-dasharray because it’s within the g of the line mark. We could either move it up so it doesn’t inherit, or set the stroke-dasharray attribute on the marker explicitly to none. It seems reasonable that the marker shouldn’t inherit dashed strokes.

@prostolyubo
Copy link
Author

Thanks for confirmation and pointing me into the right direction. Seems like an easy fix for me to figure it out. I'll make a PR if I fix it.

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

No branches or pull requests

2 participants