Skip to content
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

[Visual Refresh] Borealis visualization palettes #201015

Merged
merged 54 commits into from
Dec 11, 2024

Conversation

nickofthyme
Copy link
Contributor

@nickofthyme nickofthyme commented Nov 20, 2024

Summary

Adds support for toggling between the old Amsterdam themed visualizations palettes, to the new Borealis themed palettes.

When toggling between the Amsterdam and Borealis theme, the palettes are now theme-based. So any visualization that uses the default kibana palette will now use the Borealis palettes. The same applies to gradients excluding custom gradient palettes, see note below.

Key changes:

  • Palettes are now defined in @kbn/palette package. This uses a custom Map-like class for getting palettes based on id. This allows for aliasing new palettes to old palette ids at runtime. So accessing palettes.get('old_amseterdam') would return the new default palette when the borealis theme is selected. These palettes are generated differently based on the selected theme.
  • The Gauge palettes no longer reduce opacity. I don't recall what this was for but it seems off for only Gauges to have a different color palette that is very washed out. If we want this we can add some user control to reduce the palette opacity.
  • Legacy palettes (charts/services/palettes) hard codes color stops in the SO even for non-custom palettes. This poses an issue for swapping the default palettes to use Borealis, this goes for categorical and gradient palettes. Luckily, any change to the palette will convert the palette to custom. We use this behavior to update the default palettes to use the new colors by ignoring the hardcoded colors and generating new colors for the current named palette except for custom palettes. In short non-custom palette color stops are overridden based on the selected palette.

Closes #192848

Running locally

Enabled the theme naming toggle in advanced settings.

// kibana.dev.yml or kibana.yml
uiSettings.experimental.themeSwitcherEnabled: true

Start kibana with experimental theme files loaded.

KBN_OPTIMIZER_THEMES=experimental yarn start

Checklist

@nickofthyme nickofthyme added ci:project-deploy-elasticsearch Create an Elasticsearch Serverless project ci:project-deploy-observability Create an Observability project ci:project-deploy-security Create a Security Serverless Project labels Nov 20, 2024
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@kibanamachine
Copy link
Contributor

PR Project deployment started at: https://buildkite.com/elastic/kibana-deploy-project-from-pr/builds/145

@nickofthyme nickofthyme mentioned this pull request Nov 20, 2024
9 tasks
@nickofthyme nickofthyme added ci:project-deploy-elasticsearch Create an Elasticsearch Serverless project ci:project-deploy-observability Create an Observability project ci:project-deploy-security Create a Security Serverless Project and removed ci:project-deploy-elasticsearch Create an Elasticsearch Serverless project ci:project-deploy-observability Create an Observability project ci:project-deploy-security Create a Security Serverless Project labels Nov 20, 2024
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@kibanamachine
Copy link
Contributor

Project deployed, see credentials at: https://buildkite.com/elastic/kibana-deploy-project-from-pr/builds/145

@nickofthyme nickofthyme removed ci:project-deploy-elasticsearch Create an Elasticsearch Serverless project ci:project-deploy-observability Create an Observability project ci:project-deploy-security Create a Security Serverless Project labels Nov 21, 2024
@nickofthyme nickofthyme requested a review from a team as a code owner December 5, 2024 17:30
Copy link
Contributor

@adcoelho adcoelho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

response-ops changes OK

packages/kbn-palettes/constants.ts Outdated Show resolved Hide resolved
packages/kbn-palettes/palettes/index.ts Outdated Show resolved Hide resolved
packages/kbn-palettes/palettes/categorical/neutral.ts Outdated Show resolved Hide resolved
packages/kbn-palettes/types.ts Outdated Show resolved Hide resolved
isDarkMode
),
];
? Array.from({ length: palette.colorCount }, (d, i) => palette.getColor(i))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous palette management provides a way to require a color by "looping" the palette color set or by not looping that.
Here instead it looks like we always loop by default.
I believe this is fine (we always want to loop) but I'm wondering if we are missing a requirements there where we don't want to loop

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I wasn't sure where this looping came into play. Is there a way in the UI to set the specialAssignments such that the colors do not loop? If not I would agree to remove it until it is needed.

src/plugins/charts/public/plugin.ts Show resolved Hide resolved
src/plugins/charts/public/services/theme/theme.test.tsx Outdated Show resolved Hide resolved
Comment on lines +1754 to +1760
palettes={
KbnPalettes {
"get": [Function],
"getAll": [Function],
"query": [Function],
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you look right above that there is also another thing called paletteService how can we replace that and how can we avoid having such similar expressions?

Copy link
Contributor Author

@nickofthyme nickofthyme Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is my attempt to clarify the usage of the legacy charts/palette service as the paletteService and the new @kbn/palettes as palettes.

Previously the legacy palette is called palettes, paletteService, paletteRegistry, etc.

I think this is something we tackle when we deprecate the legacy charts palette service. For now they live side-by-side.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok thanks, can you write a simple issue to solve this tech debt? thanks

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #34 / Spaces app (with solution view) space solution tour solution tour does not show the solution tour after deleting spaces and leave only the default

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
charts 127 165 +38
eventAnnotationListing 592 629 +37
expressionHeatmap 183 220 +37
expressionMetricVis 116 153 +37
expressionPartitionVis 200 237 +37
expressionTagcloud 171 208 +37
expressionXY 261 298 +37
lens 1518 1555 +37
observability 1070 1107 +37
visDefaultEditor 207 244 +37
visTypeTimeseries 463 500 +37
visTypeVega 289 331 +42
total +450

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/coloring 188 149 -39
@kbn/palettes - 27 +27
@kbn/react-kibana-context-common 8 9 +1
@kbn/visualization-ui-components 138 139 +1
charts 252 255 +3
total -7

Any counts in public APIs

Total count of every any typed public API. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats any for more detailed information.

id before after diff
@kbn/palettes - 3 +3

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
aiops 615.1KB 615.5KB +364.0B
alerting 100.3KB 100.3KB +91.0B
apm 3.3MB 3.3MB +91.0B
canvas 1.1MB 1.1MB +91.0B
charts 9.5KB 17.3KB +7.8KB
cloudDataMigration 6.3KB 6.4KB +91.0B
cloudSecurityPosture 502.8KB 502.9KB +91.0B
controls 494.3KB 494.4KB +91.0B
crossClusterReplication 146.8KB 146.9KB +91.0B
dataQuality 28.7KB 28.8KB +91.0B
dataUsage 241.7KB 241.8KB +91.0B
dataViewManagement 140.4KB 140.5KB +91.0B
dataVisualizer 615.9KB 616.3KB +455.0B
devTools 8.2KB 8.3KB +91.0B
discover 784.9KB 785.0KB +91.0B
entityManagerApp 12.0KB 12.0KB +91.0B
eventAnnotationListing 231.9KB 232.0KB +82.0B
exploratoryView 183.4KB 183.5KB +91.0B
expressionMetricVis 5.2KB 5.3KB +42.0B
expressionPartitionVis 35.6KB 43.6KB +8.0KB
expressionTagcloud 19.0KB 26.8KB +7.9KB
expressionXY 127.8KB 135.7KB +8.0KB
filesManagement 125.7KB 125.8KB +91.0B
graph 418.3KB 418.4KB +91.0B
grokdebugger 11.4KB 11.5KB +91.0B
home 152.4KB 152.5KB +91.0B
imageEmbeddable 70.0KB 70.2KB +182.0B
indexLifecycleManagement 166.3KB 166.4KB +91.0B
infra 1.8MB 1.8MB +182.0B
inputControlVis 52.5KB 52.6KB +91.0B
inventory 234.3KB 234.4KB +91.0B
kibanaOverview 55.2KB 55.2KB +91.0B
lens 1.5MB 1.5MB +7.8KB
licenseManagement 47.0KB 47.1KB +91.0B
links 48.6KB 48.6KB +91.0B
logstash 33.9KB 34.0KB +91.0B
management 48.8KB 48.8KB +91.0B
metricsDataAccess 99.9KB 100.0KB +91.0B
ml 4.7MB 4.7MB +819.0B
monitoring 538.3KB 538.3KB +91.0B
observabilityLogsExplorer 147.9KB 148.0KB +91.0B
observabilityOnboarding 273.3KB 273.4KB +91.0B
painlessLab 19.0KB 19.1KB +91.0B
profiling 406.6KB 406.7KB +91.0B
remoteClusters 79.7KB 79.8KB +91.0B
rollup 116.0KB 116.1KB +91.0B
savedObjectsManagement 87.1KB 87.2KB +91.0B
searchHomepage 55.3KB 55.4KB +91.0B
searchIndices 169.5KB 169.5KB +91.0B
searchInferenceEndpoints 99.0KB 99.1KB +91.0B
searchPlayground 164.5KB 164.6KB +91.0B
searchprofiler 49.3KB 49.4KB +91.0B
securitySolution 14.7MB 14.7MB +637.0B
serverlessSearch 369.6KB 369.9KB +273.0B
slo 855.9KB 850.7KB -5.2KB
snapshotRestore 263.5KB 263.6KB +91.0B
streamsApp 95.5KB 95.6KB +91.0B
synthetics 1.1MB 1.1MB +182.0B
timelines 33.2KB 33.3KB +91.0B
transform 475.2KB 475.3KB +91.0B
triggersActionsUi 1.7MB 1.7MB +1001.0B
uptime 467.7KB 467.8KB +91.0B
ux 168.0KB 168.1KB +91.0B
visTypeVega 1.9MB 1.9MB +60.0B
watcher 166.8KB 166.9KB +91.0B
total +42.6KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/coloring 9 8 -1
@kbn/palettes - 1 +1
total -0

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
advancedSettings 7.9KB 8.0KB +91.0B
banners 10.9KB 11.0KB +91.0B
cases 159.9KB 159.9KB +91.0B
charts 43.1KB 43.6KB +517.0B
cloudLinks 30.7KB 30.8KB +91.0B
console 38.6KB 38.7KB +91.0B
core 450.7KB 450.7KB +91.0B
dashboard 52.2KB 52.3KB +91.0B
dashboardEnhanced 18.4KB 18.5KB +91.0B
data 421.0KB 421.1KB +91.0B
dataViewEditor 14.0KB 14.1KB +91.0B
dataViewFieldEditor 27.3KB 27.4KB +91.0B
embeddable 71.0KB 71.1KB +91.0B
expressionGauge 16.8KB 16.9KB +91.0B
expressionHeatmap 17.7KB 17.8KB +91.0B
expressionLegacyMetricVis 13.0KB 13.1KB +91.0B
expressionMetricVis 17.4KB 17.4KB +50.0B
expressionPartitionVis 29.6KB 29.7KB +91.0B
expressionTagcloud 13.7KB 13.8KB +91.0B
expressionXY 42.5KB 42.6KB +91.0B
fleet 173.7KB 173.8KB +91.0B
globalSearchBar 30.3KB 30.4KB +91.0B
guidedOnboarding 30.1KB 30.2KB +91.0B
indexManagement 47.2KB 47.3KB +91.0B
ingestPipelines 18.0KB 18.1KB +91.0B
inspector 25.4KB 25.5KB +91.0B
interactiveSetup 60.2KB 60.3KB +91.0B
kbnUiSharedDeps-srcJs 3.5MB 3.5MB +91.0B
kibanaReact 39.7KB 39.8KB +91.0B
licensing 12.2KB 12.3KB +91.0B
maps 54.9KB 55.0KB +91.0B
mockIdpPlugin 10.3KB 10.4KB +91.0B
newsfeed 13.2KB 13.3KB +91.0B
observability 104.8KB 104.8KB +91.0B
osquery 47.4KB 47.5KB +91.0B
presentationPanel 43.7KB 43.8KB +91.0B
reporting 50.8KB 50.9KB +91.0B
runtimeFields 14.4KB 14.4KB +91.0B
savedObjects 18.1KB 18.2KB +91.0B
savedObjectsTagging 23.1KB 23.2KB +91.0B
security 68.3KB 68.4KB +91.0B
serverless 14.9KB 15.0KB +91.0B
share 58.2KB 58.3KB +91.0B
slo 29.8KB 29.8KB +7.0B
spaces 34.8KB 34.9KB +91.0B
telemetry 25.3KB 25.4KB +91.0B
uiActions 24.5KB 24.6KB +91.0B
unifiedSearch 39.1KB 39.2KB +91.0B
upgradeAssistant 25.1KB 25.2KB +91.0B
visDefaultEditor 24.5KB 24.6KB +91.0B
visTypeMarkdown 10.2KB 10.3KB +91.0B
visTypeTable 19.7KB 19.8KB +91.0B
visTypeTimelion 14.0KB 14.1KB +91.0B
visTypeTimeseries 20.9KB 21.0KB +91.0B
visTypeVega 36.6KB 45.6KB +9.0KB
visTypeVislib 15.8KB 15.9KB +91.0B
visualizations 71.4KB 71.5KB +91.0B
total +14.3KB
Unknown metric groups

API count

id before after diff
@kbn/coloring 227 190 -37
@kbn/palettes - 44 +44
@kbn/react-kibana-context-common 15 16 +1
@kbn/visualization-ui-components 144 145 +1
charts 267 271 +4
total +13

async chunk count

id before after diff
visTypeVega 8 9 +1

History

@markov00 markov00 self-requested a review December 11, 2024 18:02
@nickofthyme nickofthyme changed the title [Palettes] Borealis visualization palettes [Visual Refresh] Borealis visualization palettes Dec 11, 2024
@nickofthyme nickofthyme merged commit 9312248 into elastic:main Dec 11, 2024
9 checks passed
@nickofthyme nickofthyme deleted the borealis-vis-palettes branch December 11, 2024 20:58
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
Adds support for toggling between the old Amsterdam themed visualizations palettes and the new Borealis themed palettes.
nickofthyme added a commit to nickofthyme/kibana that referenced this pull request Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting EUI Visual Refresh Feature:Lens release_note:skip Skip the PR/issue when compiling release notes v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Integrate Borealis color palette