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

tips for a clipped mark should be clipped #2213

Open
Fil opened this issue Oct 30, 2024 · 2 comments
Open

tips for a clipped mark should be clipped #2213

Fil opened this issue Oct 30, 2024 · 2 comments
Labels
bug Something isn’t working

Comments

@Fil
Copy link
Contributor

Fil commented Oct 30, 2024

Currently if you clip a mark, the tip doesn't get clipped and you might end up with surprising results when using facets.

For example the tip shown below, belongs to the facet highlighted in red.

Image

(The cause in this case is that the y scale's domain is set to [0, 0.09] and the excess area between 9% and 100% is clipped out.)

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

Would you expect the tip to be hidden in this case? Or do you want to use clamp instead of clip?

@Fil
Copy link
Contributor Author

Fil commented Oct 30, 2024

My solution in this case is to avoid drawing the segments that go into the clipped zone. Clamping works too!

But both depend on the user doing the right thing; in the process of creating the chart, it was very surprising to see these default tips that were (visually) not connected to anything.

I wonder if fixing this might do more harm than good in some situations, it might be ok to close as won't fix. However, that's what we do with the geo mark: a feature that is completely off-screen gets no tip, and a feature that is clipped gets its (default) tip location in the centroid[1] of the (visible) shape. (Note that a further difficulty is that the shape might be visible even if its reference position is outside the clip region…) 🤔

[1] related: #2098.

@Fil Fil mentioned this issue Nov 21, 2024
4 tasks
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