-
Notifications
You must be signed in to change notification settings - Fork 18
Refactor: Improve tick and label sharing logic #373
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
Conversation
This commit introduces a major refactoring of the tick and label sharing mechanism in UltraPlot. The previous implementation had complex and distributed logic for determining tick and label visibility, which was difficult to maintain and extend. This refactoring centralizes the logic within the `Figure` class, making it more robust and easier to understand. Key changes: - A new `_share_ticklabels` method in `Figure` now handles all tick label sharing. - The `_get_border_axes` method has been improved to be more accurate. - The `_Crawler` utility in `ultraplot/utils.py` has been rewritten to better handle complex layouts with panels and mixed axes types. - Redundant and complex logic has been removed from `CartesianAxes`, `GeoAxes`, and other modules.
for more information, see https://pre-commit.ci
| return row1, row2, col1, col2 | ||
|
|
||
| def _get_grid_span(self, hidden=False) -> (int, int, int, int): | ||
| def _get_grid_span(self, hidden=True) -> (int, int, int, int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this default change?
beckermr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question. Also there are other PRs that depend on this one and so it may be best to merge this first. Finally, the image comparison tests are failing.
|
I looked at some of the test failures and they definitely need to be fixed in some cases. |
|
This PR is not needed anymore after #372 |
This commit introduces a major refactoring of the tick and label sharing mechanism in UltraPlot.
The previous implementation had complex and distributed logic for determining tick and label visibility, which was difficult to maintain and extend. This refactoring centralizes the logic within the
Figureclass, making it more robust and easier to understand.Key changes:
_share_ticklabelsmethod inFigurenow handles all tick label sharing._get_border_axesmethod has been improved to be more accurate._Crawlerutility inultraplot/utils.pyhas been rewritten to better handle complex layouts with panels and mixed axes types.CartesianAxes,GeoAxes, and other modules.