-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add autotickangles property #6790
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
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
264617b
drawLabels: don't attempt to re-fix label if it is already rotated by…
my-tien 9170f25
axis autotickangles property
my-tien eb3c456
autotickangles: consider number of lines when calculating min angle
my-tien 60aa918
Change 10.json to test autotickangles
my-tien b70ff86
autotickangles draftlog file
my-tien be99b12
Achieve compatibility with ES5
my-tien 8ec9a45
Add `noAutotickangles` option for `handleTickLabelDefaults` calls out…
my-tien 3fa1c78
drawLabels: don't assume autotickangles exists on axis.
my-tien 6d2501b
Fix typo noAutickangles → noAutotickangles in ternay layout_defaults
my-tien 3f08ba8
Remove unnecessary coerceNumber property from autotickangles
my-tien 7ff8d92
Replace suspicious infinite loop test with check to never decrease th…
my-tien 9473029
Fix backwards-compatibility
my-tien 4b23f99
New 10.png baseline image for testing autotickangles
my-tien 361f61b
Choose angle with smallest absolute cosine instead of largest absolut…
my-tien 6d3e7bd
use info_array instead of data_array for autotickangles
my-tien 896c247
Convert prevAngle to radians as well for calculations.
my-tien aa6d492
Use the radians representation of prevAngle only for comparison (to f…
my-tien 8ebf1a2
For the backwards-compatible auto angle calculation also only use rad…
my-tien 0fdf52e
Revert description change for tickangle because other charts reusing …
my-tien a9b9cc8
Update description in test/plot-schema.json as well.
my-tien b8a8860
update plot-schema.json by running npm run schema after having starte…
my-tien c0e2758
Update draftlogs/6790_add.md
my-tien cdae996
Revert 264617bffe0252b11638e7446c6f3d562df70774 and 7ff8d92650d35f0be…
my-tien 80dedea
Revert "Fix backwards-compatibility"
my-tien a5b1f3a
Add 0 to default autotickangles array
my-tien 5f3f32c
Don't assume autotickangles exists on axis.
my-tien f544c2a
update baseline images and plot schema
my-tien 7d8e607
- only coerce autotickangles for x axes with auto tickangle
alexcjohnson e20de82
fix colorbar noAutotickangles
alexcjohnson 4d4e056
better colorbar fix: noAutotickangles only for vertical
alexcjohnson 84bd54b
allow autotickangles for polar radial axes
alexcjohnson f646c15
schema update
my-tien 1d47d05
new baseline image for polar_polygon-grids with rotated axis labels
my-tien 2f6cd6f
fix jasmine tests
alexcjohnson c51791e
Update test/jasmine/tests/plots_test.js
archmoj b293a11
Update draftlogs/6790_add.md
archmoj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Add `autotickangles` to cartesian and radial axes [[#6790](https://github.com/plotly/plotly.js/pull/6790)], with thanks to @my-tien for the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm not sure if it is safe to remove this block?
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.
I removed this because of the first comment at the top of this PR. Have you checked that?
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.
Yes I see the PR description. But still I thought that it might be something @alexcjohnson could have a second look.
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.
TBH, this isn't even related to the feature I made. The discussion only started because I changed the check
prevAngle === 90
to also consider negative 90.If you are unsure about it, I can also just revert those changes and leave it as it was before, so that you can properly figure out how the prevention of infinite redraws should really work.
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.
@alexcjohnson What do you suggest here?
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.
I went back to look at where this block was originally introduced, it was in #4216 back in v1.49.5 (2019). Adapting the first codepen shown there to the latest release and to this PR, neither shows an infinite loop AFAICT, so that's great. But the current PR has some history-dependent behavior that the latest release does not.
Here's on the latest release: https://codepen.io/alexcjohnson/pen/YzBovrN - the angle starts 30 degrees, then changes to 90 degrees when we shrink the width, then goes back to 30 degrees when we go back to the original width (this is font-dependent, so it's possible on other machines the specific widths will need to be adjusted)
And here's on this branch: https://codepen.io/alexcjohnson/pen/abXgKad - note the angle stays at 90 degrees at the end. It doesn't go back down until you get wide enough to go back to 0 degrees.
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.
I have removed my changes for now, so the old behavior is restored.