Skip to content

Commit

Permalink
[8.6] [Renderers] always include baseTheme with charts theme (#145401) (
Browse files Browse the repository at this point in the history
#145478)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Renderers] always include baseTheme with charts theme
(#145401)](#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":"[email protected]"},"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 <[email protected]>
  • Loading branch information
kibanamachine and drewdaemon authored Nov 17, 2022
1 parent be37c7d commit 1ec43e0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -377,6 +377,7 @@ export const MetricVis = ({
},
chartTheme,
]}
baseTheme={baseTheme}
onRenderChange={onRenderChange}
onElementClick={(events) => {
if (!filterable) {
Expand Down

0 comments on commit 1ec43e0

Please sign in to comment.