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

Gridlines which would intersect inside tick labels should not be drawn #5502

Closed
nicolaskruchten opened this issue Feb 13, 2021 · 11 comments
Closed
Labels
bug something broken

Comments

@nicolaskruchten
Copy link
Contributor

As discussed in the meeting, let's just call this a bug, and suppress any gridlines/ticks/ticklabels whose position is within the bounding box of any inside tick labels. Resolving this should resolve some cases of #5404

@nicolaskruchten
Copy link
Contributor Author

Some additional context for this issue:

  • the core idea is that nothing should occlude or interfere with the inside tick labels, so that means gridlines and zerolines. Note that axis base lines don't interfere with the labels or ticks, so they can stay
  • the secondary idea is that nothing distracting should be drawn within the same extent even if it doesn't intersect, so no tick labels or ticks should appear on the X axis if they would appear below the inside tick labels on the Y axis. This is pretty straightforward in non-period-positioned cases: hide the gridlines and their ticks and labels
  • One tricky edge case would be with Y labels on the inside right with X labels in period-positioning mode: it would be quite possible to get a gridline that does not intersect the inside labels but its ticklabel would be drawn underneath them. In this case we should keep the gridline but drop the label.

@nicolaskruchten
Copy link
Contributor Author

Addendum: for that final case, we should drop the label only if its centerline will intersect the y tick labels. That's more in keeping with the style guide in question.

@archmoj
Copy link
Contributor

archmoj commented Mar 17, 2021

I noticed showing data without zerolines could be misleading in most cases.

@nicolaskruchten
Copy link
Contributor Author

can you provide an example plz?

@archmoj
Copy link
Contributor

archmoj commented Mar 17, 2021

can you provide an example plz?

For example:

hideZeroLines

@nicolaskruchten
Copy link
Contributor Author

fair enough. That seems unlikely-enough to be the developer's intent that I'm OK with this behaviour.

@nicolaskruchten
Copy link
Contributor Author

I used the artifact from this branch in this pen https://codepen.io/nicolaskruchten/pen/BaLGYeW?editors=0010 (couldn't save because the URL is too long) and it seemed like the right-most ticklabel didn't disappear early enough as I panned. It seemed like it disappeared when its centerline hit the edge of the plot rather than the left edge of the inside ticklabel bounding boxes.

@archmoj
Copy link
Contributor

archmoj commented Apr 7, 2021

This is fixed by #5550.

@archmoj
Copy link
Contributor

archmoj commented Apr 7, 2021

This is fixed by #5550.

Here is a codepen using master.

@nicolaskruchten
Copy link
Contributor Author

Thanks! Do you have a pen that demonstrates this one?

  • One tricky edge case would be with Y labels on the inside right with X labels in period-positioning mode: it would be quite possible to get a gridline that does not intersect the inside labels but its ticklabel would be drawn underneath them. In this case we should keep the gridline but drop the label.

@archmoj
Copy link
Contributor

archmoj commented Apr 7, 2021

Thanks! Do you have a pen that demonstrates this one?

  • One tricky edge case would be with Y labels on the inside right with X labels in period-positioning mode: it would be quite possible to get a gridline that does not intersect the inside labels but its ticklabel would be drawn underneath them. In this case we should keep the gridline but drop the label.

Good call.
Here is the codepen for the case of period.
So it looks we need another PR to handle that period edge case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

2 participants