-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
(1/n) refactor legend components to use items prop #42417
(1/n) refactor legend components to use items prop #42417
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @EmmadUsmani and the rest of your teammates on Graphite |
Codenotify: Notifying subscribers in CODENOTIFY files for diff 9d968d9...19522f5.
|
|
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.
90164f3
to
5defa89
Compare
@JesseSDevaney Good catch! I've fixed the type errors, could you check if those dashcards still error in static viz? |
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.
@EmmadUsmani Did you forget to add a milestone to the issue for this PR? When and where should I add a milestone? |
Precursor to #41988 and #41986
Description
Refactoring the legend component to take a single
items
prop that is an array of objects with akey
,name
, andcolor
, instead of taking two separate arrays oflabels
andcolors
.This will make it easier to implement toggling via the legend, because we can later add additional properties to the item object, like a boolean that describes whether the series is visible or not.
In general it will make the legend easier to work with, for example when we need to add a legend item for the "other" bar in that project it'll be easier to just add one object where the name and color are coupled.
How to verify
Demo
Checklist
Covered by existing tests like
12439-click-on-legend-breaks-ui.cy.spec.js