-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Implement legendrank attribute in traces #5591
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 2 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
3cee835
implement legendrank
archmoj a60a382
keep track of initial order - to handle chrome unstable sort in old v…
archmoj 5813717
remove some empty lines
archmoj 5136cc0
add legend calc jasmine test with legendrank
archmoj 598d60c
add image test - pie ranking looks strange
archmoj 4ffb06c
describe why dflt 1000 is used - mentioning ranking works within each…
archmoj 6e61bd8
refactor - less variable and use push
archmoj 737478e
refactor - add sort step
archmoj 274db06
refactor - bring down the sort function
archmoj 915c67a
refactor - simplify logic
archmoj 69c0b29
update image test
archmoj e1e9a74
simplify and fixup legend sort
archmoj f232f42
no more need for _initID now that sort and collapse are fixed
archmoj c00d56e
more refactor
archmoj 69bf7eb
remove extra loop - update comments
archmoj d87ee12
update legendrank description
archmoj d35ff08
add fallback to have stable sort in Chrome < 70
archmoj a1f87b9
would be > are
archmoj 32a890c
rank groups based on minimum legendranks within each group
archmoj a1abb19
add legendrank2 mock
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
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
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 assuming
_initID
is important for pie traces? Anything else? OK, so the code below implies (and I just tested to confirm) thatlegend.traceorder
flips the order of pie entries in the legend, not just the order individual traces get added to the legend.Based on that, I'd say the correct behavior of traceorder once we add
legendrank
is to simply flip the whole thing. That's not what I thought we concluded on the call yesterday but it's what you've implemented and with the pie complication I think it's the simplest thing to explain :)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 fine with this.
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 noticed some older version of Chrome (including our image test) sort the items differently.
So
_initID
was added in a60a382 to address that issue.As you mentioned
pie-like
traces appear to behave differently.In 598d60c
I was expecting that by using a higher value of
legendrank
on the firstpie
trace the slice legends come next.However it is the opposite and it is rather confusing.