-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
clipped axis labels #5404
Comments
It does not appear to be a |
I'm not sure I understand what you're seeing in that mock... nothing is clipped for me there |
In the mock, I can pan the X axis and never get a clipped ticklabel, but in my codepen, panning the X axis always results in clipping, on both sides actually, not just the side with the inside ticklabel on the Y axis |
Here is a codepen. |
OK, with this pen I can see some clipping, yes. Oh I see, in the pen I posted above it's not the edge of the plotting area that's clipping, it's the edge of the figure altogether, because the margins are so small. |
What kind of heuristic could we build that would avoid rendering this label? In this case there is no data in 2007, so there's not really much sense in rendering this label. Resolving #5502 wouldn't get rid of this, because the 2007 gridline doesn't intersect the Y ticklabels. Maybe we need to just not render ticklabels if they'll be clipped by the margin. @alexcjohnson thoughts? |
This is basically the requirement, yes. |
The it should be labeled as a feature, right? |
I still consider the current behaviour a bug: it's ugly and should not be the default. |
Related: #3292 (nudge the first and last tick labels inward to fit within the axis span - though in this case removing these labels is better) I'm a little worried about a blanket "remove tick labels that get clipped by the graph div boundaries" - that might catch too many things, like long category labels with automargin disabled. We would only remove those that get clipped in the axis direction, so for an x axis category labels going off the bottom would remain visible, just those that go off the right (or left) edge, most likely when the What about a new attribute So perhaps an enum with five values: |
That sounds great to me as a way forward, thanks for synthesizing :) |
I think Alex's framework above leaves room for that i.e. with |
OK. |
Per conversation just now, I think we agree that this is "domain" and "div" and not "range". |
It looks we should not coerce |
Hehe, yes :) |
Perhaps it would be cleaner if we default it to |
Let's leave that out for now... this is for cases where the inside label is so long that it spans the whole subplot? Seems unlikely to happen very often |
Not only that; but also it would make our supplyDefaults logic and writing the logic for tick label adjustment function simpler. |
I thought we agreed earlier that we wouldn't have anything related to range? |
Positive.That the domain 😀 |
Ok but for now let's just implement "remove past div" not anything domain related. |
We already did implement 'remove past domain' functionality for inside tick labels and I am going to reuse that function for div. |
Can I see a demo of this remove past domain in action for inside tick labels? |
In this pen: https://codepen.io/nicolaskruchten/pen/BaLGYeW?editors=0010 the right-most xaxis ticklabel should not be rendered if it's being clipped like this. Note:
ticklabelmode
is being set toperiod
in thelayout.template
and the clipped label has no data associated with it.The text was updated successfully, but these errors were encountered: