-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[XY axis] Implement new palette service #86876
Conversation
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
merge conflict between base and head |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
const showNoResult = shouldShowNoResultsMessage(visData, visType); | ||
const isSplitChart = Boolean(visConfig.dimensions.splitRow || visConfig.dimensions.splitRow); |
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 is irrelevant with this PR but it's an OR on the same value.
@elasticmachine merge upstream |
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.
@flash1293 thanx for reviewing and testing this PR 🙂 I will check this! |
@flash1293 it should be ok now. Make sure also that the migration script has run. It should default on the legacy palette |
@elasticmachine merge upstream |
@stratoula I can still reproduce this specific thing, these are the steps:
Maybe it's something about this visualization in particular? |
Thanx for the steps Joe, I didn't test this scenario. Let me check it |
@flash1293 great catch! It fails for all the visualizations that have more than one metric. I will proceed with a fix |
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.
@@ -77,8 +77,9 @@ export class VisTypeXyPlugin | |||
if (!core.uiSettings.get(LEGACY_CHARTS_LIBRARY, false)) { | |||
setUISettings(core.uiSettings); | |||
setThemeService(charts.theme); | |||
setColorsService(charts.legacyColors); | |||
|
|||
charts.palettes.getPalettes().then((palettes) => { |
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 function should not be called directly in a plugin lifecycle because it's meant to enable lazy loading (if it's loaded every time the plugin is loaded, that's pretty much defeated).
It should be called if it's certain a chart will be rendered very soon (e.g. in the renderer or behind some existing lazy loading barrier)
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.
LGTM, works as expected. Thanks for taking care of lazy loading.
We don't necessarily have to change that because I think the experience is nice, but I want to point out one small difference to Lens - if there is no "split series" dimension, it will always use the default palette and don't allow the user to change it.
Thanx Joe 🙂 Yes, I know that is quite different from Lens and I thought about it too but I like it that way. I don't have a strong opinion on it but we can leave it as it is and see how it goes |
@elasticmachine merge upstream |
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.
LGTM, great addition! Tested locally on chrome on multiple sample visualizations.
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.
code LGTM
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
* [XY Axis] New Palette service * Calculate all Series to map the colors correctly * remove commented out code * syncColors on XY plugin * Reset to false when no embeddable * Add unit test for getAllSeries function * Measure the usage of the selected palette * Minor adjustments * Update documentation for isSyncColorsEnabled method * Fix bug on changing palette on charts with no split series * Fix coloring for multiple y axis visualizations * Call getPalettes function from the renderer * Fullwidth palette picker * Fetch palette registry on the component and not on the renderer Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [XY Axis] New Palette service * Calculate all Series to map the colors correctly * remove commented out code * syncColors on XY plugin * Reset to false when no embeddable * Add unit test for getAllSeries function * Measure the usage of the selected palette * Minor adjustments * Update documentation for isSyncColorsEnabled method * Fix bug on changing palette on charts with no split series * Fix coloring for multiple y axis visualizations * Call getPalettes function from the renderer * Fullwidth palette picker * Fetch palette registry on the component and not on the renderer Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
Closes #82495.
This PR integrates the new palette service to the new XY axis plugin. So in order to test it, the
Legacy charts library
switch should be off (this is the default state).We introduce a new dropdown on the Panel Settings tab of the XY plugin.
Here the user can choose which palette she wants to use.
default
palette will be chosen.kibana_palette
will be chosen. (For this reason, I have added the migration script)What this PR implements
Screenshots
Bar and area charts without color syncing (legacy palette)
Bar and area charts with color syncing (legacy palette)
Color syncing between Lens and XY plugin (default palette)
Checklist
Delete any items that are not applicable to this PR.
For maintainers