[8.6] [Renderers] always include baseTheme with charts theme (#145401) (#145478)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Renderers] always include baseTheme with charts theme
(#145401)](https://github.com/elastic/kibana/pull/145401)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Andrew
Tate","email":"andrew.tate@elastic.co"},"sourceCommit":{"committedDate":"2022-11-16T23:19:26Z","message":"[Renderers]
always include baseTheme with charts theme
(#145401)","sha":"d82075f8d6178ecd197be324b75b5eb2d457b746","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Visualizations","Feature:Lens","backport:prev-minor","v8.7.0"],"number":145401,"url":"https://github.com/elastic/kibana/pull/145401","mergeCommit":{"message":"[Renderers]
always include baseTheme with charts theme
(#145401)","sha":"d82075f8d6178ecd197be324b75b5eb2d457b746"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145401","number":145401,"mergeCommit":{"message":"[Renderers]
always include baseTheme with charts theme
(#145401)","sha":"d82075f8d6178ecd197be324b75b5eb2d457b746"}}]}]
BACKPORT-->

Co-authored-by: Andrew Tate <andrew.tate@elastic.co>
This commit is contained in:
Kibana Machine 2022-11-16 20:15:08 -05:00 committed by GitHub
parent be37c7d130
commit 1ec43e0795
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 3 deletions

View file

@ -6,6 +6,7 @@ exports[`GaugeComponent renders the chart 1`] = `
>
<Settings
ariaUseDefaultSummary={true}
baseTheme={Object {}}
debugState={false}
noResults={
<EmptyPlaceholder

View file

@ -354,6 +354,7 @@ export const GaugeComponent: FC<GaugeRenderProps> = memo(
noResults={<EmptyPlaceholder icon={icon} renderComplete={onRenderChange} />}
debugState={window._echDebugStateFlag ?? false}
theme={[{ background: { color: 'transparent' } }, chartTheme]}
baseTheme={chartsThemeService.useChartsBaseTheme()}
ariaLabel={args.ariaLabel}
ariaUseDefaultSummary={!args.ariaLabel}
onRenderChange={onRenderChange}

View file

@ -589,6 +589,7 @@ export const HeatmapComponent: FC<HeatmapRenderProps> = memo(
debugState={window._echDebugStateFlag ?? false}
tooltip={tooltip}
theme={[themeOverrides, chartTheme]}
baseTheme={chartsThemeService.useChartsBaseTheme()}
xDomain={{
min:
dateHistogramMeta && dateHistogramMeta.timeRange

View file

@ -336,9 +336,9 @@ export const MetricVis = ({
const scrollContainerRef = useRef<HTMLDivElement>(null);
const scrollDimensions = useResizeObserver(scrollContainerRef.current);
const {
metric: { minHeight },
} = getThemeService().useChartsBaseTheme();
const baseTheme = getThemeService().useChartsBaseTheme();
const minHeight = chartTheme.metric?.minHeight ?? baseTheme.metric.minHeight;
useEffect(() => {
const minimumRequiredVerticalSpace = minHeight * grid.length;
@ -377,6 +377,7 @@ export const MetricVis = ({
},
chartTheme,
]}
baseTheme={baseTheme}
onRenderChange={onRenderChange}
onElementClick={(events) => {
if (!filterable) {