-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Add auto text positioning for scatter traces #8065
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
Open
chriddyp
wants to merge
25
commits into
main
Choose a base branch
from
claude/youthful-shannon-s2pabd
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,854
−48
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
b51bae7
Add *auto* textposition to scatter traces
claude 2736e30
Give clustered labels a leader line in *auto* textposition
claude 401b1d1
Keep *auto* leader lines off neighboring markers
claude 5cd4ee7
Judge *auto* label ambiguity by the label, not the point
claude 151ad8f
Measure *auto* label ambiguity as a distance of one font size
claude 98c16d6
Place *auto* labels by their measured box
claude 19de71b
Set the corner reach of *auto* labels from the marker symbol
claude 7738193
Cover more cases in the *auto* textposition mock
claude c69d486
Hide *auto* labels of points outside the plot area
claude 0461094
Use a twelve-point clock as the cluster in the *auto* textposition mock
claude c99ddd0
Add placement benchmarks to the *auto* textposition mock
claude f908b75
Try *auto* label positions in the direction away from nearby markers
claude 83a9b49
Add a real-world mock for *auto* textposition
claude 74c3265
Drop dead code from the *auto* textposition placement
claude 535bc91
Add a dense time-series mock for *auto* textposition
claude 8468b5d
Keep *auto* labels off the line of a lines+text trace
claude 99c2ccd
Document what *auto* text placement does not avoid
claude b284f55
Name the draftlog after the pull request
claude c040aa0
Point the draftlog at pull request 8065
claude c07bf59
Keep *auto* out of the map textposition attributes
claude cae1cc4
Handle MathJax labels and animated leader lines in *auto* textposition
claude 3f011eb
Move the label placement engine into Lib.placeLabels
claude 245fb7f
Add textpriority to order the *auto* text placement
claude 9afdb1b
Keep an *auto* label in place across a pan or zoom while it is free
claude 03bacb7
Keep the leader line of an *auto* label across a pan too
claude 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 *auto* to the `textposition` of `scatter`, `scatterpolar`, `scatterternary`, `scattercarpet` and `scattersmith` traces, to place text labels without overlaps and with leader lines for labels moved away from their points, and `textpriority` to set the order in which those labels take their positions [[#8065](https://github.com/plotly/plotly.js/pull/8065)] |
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.
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.
Quick explanation of this part: In my reference scatter plot, I noticed that the text was closer to the squares than the circles, because the circles' corners are folded in. In dense scatter plots with text, I find myself comparing the text to different points to try to understand which text is associated with which point, and this discrepancy of distance was throwing me off.
Circles are the default case, so that's handled. And then squares are the largest symbol from the corner, so that's the default otherwise for the rest of the symbols.
I recognize this is getting kind of hardcore, and would also be OK removing this logic as well.