-
Notifications
You must be signed in to change notification settings - Fork 830
Charts: Add global context utility for getting styles for any chart component #45207
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
base: trunk
Are you sure you want to change the base?
Charts: Add global context utility for getting styles for any chart component #45207
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 5 files.
|
7b071d9
to
6b1fe74
Compare
fb8e3de
to
6fbf3ca
Compare
6fbf3ca
to
9180049
Compare
764565e
to
94d121d
Compare
@@ -151,6 +151,15 @@ const wooTheme: ChartTheme = { | |||
legendContainerStyles: { | |||
gap: '8px', | |||
}, | |||
legendShapeStyles: [ |
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.
Copied from Woo Analytics. We should be able to remove it there after this is shipped
renderGlyph, | ||
}; | ||
if ( withGlyph ) { | ||
const glyphToUse = renderGlyph || glyph; |
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.
This support for legend glyphs isn't working yet
|
||
return itemWithGlyph; | ||
if ( withGlyph ) { | ||
const glyphToUse = renderGlyph || glyph; |
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.
This support for legend glyphs isn't working yet
94d121d
to
a4da715
Compare
6e3a973
to
e37b8e9
Compare
e37b8e9
to
a623766
Compare
Fixes CHARTS-111: Charts: Add hook to get the styles for any chart component
Proposed changes:
getElementStyles
method to the global charts context, which can provide all the possible styles for an element; color, lineStyles, glyph, legend shape...resolveColor
utility), and getters for glyphs, shapes, line styles...Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions: