Skip to content

Commit d07a9d6

Browse files
[8.18] [Lens] Replace scss for heatmap expression (#209246) (#210070)
# Backport This will backport the following commits from `main` to `8.18`: - [[Lens] Replace scss for heatmap expression (#209246)](#209246) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Maria Iriarte","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-06T16:38:08Z","message":"[Lens] Replace scss for heatmap expression (#209246)\n\n## Summary\r\n\r\nPart of https://github.com/elastic/kibana/issues/208908\r\n\r\nReplaces scss to css-in-js. \r\n\r\n### Checklist\r\n\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Marta Bondyra <[email protected]>","sha":"228f83fde3b872121b8149196b65d9aa4d842156","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","Feature:Lens","v9.0.0","backport:version","v8.18.0","v9.1.0"],"title":"[Lens] Replace scss for heatmap expression","number":209246,"url":"https://github.com/elastic/kibana/pull/209246","mergeCommit":{"message":"[Lens] Replace scss for heatmap expression (#209246)\n\n## Summary\r\n\r\nPart of https://github.com/elastic/kibana/issues/208908\r\n\r\nReplaces scss to css-in-js. \r\n\r\n### Checklist\r\n\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Marta Bondyra <[email protected]>","sha":"228f83fde3b872121b8149196b65d9aa4d842156"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/209246","number":209246,"mergeCommit":{"message":"[Lens] Replace scss for heatmap expression (#209246)\n\n## Summary\r\n\r\nPart of https://github.com/elastic/kibana/issues/208908\r\n\r\nReplaces scss to css-in-js. \r\n\r\n### Checklist\r\n\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Marta Bondyra <[email protected]>","sha":"228f83fde3b872121b8149196b65d9aa4d842156"}}]}] BACKPORT--> Co-authored-by: Maria Iriarte <[email protected]>
1 parent cdeb504 commit d07a9d6

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

src/platform/plugins/shared/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ import {
5757
import { defaultPaletteParams } from '../constants';
5858
import { ChartSplit } from './chart_split';
5959
import { getSplitDimensionAccessor, createSplitPoint } from '../utils/get_split_dimension_utils';
60-
import './index.scss';
6160

6261
declare global {
6362
interface Window {

src/platform/plugins/shared/chart_expressions/expression_heatmap/public/components/index.scss

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/platform/plugins/shared/chart_expressions/expression_heatmap/public/expression_renderers/heatmap_renderer.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import {
2121
extractContainerType,
2222
extractVisualizationType,
2323
} from '@kbn/chart-expressions-common';
24+
import { css } from '@emotion/react';
25+
import { UseEuiTheme } from '@elastic/eui';
2426
import { MultiFilterEvent } from '../../common/types';
2527
import { ExpressionHeatmapPluginStart } from '../plugin';
2628
import {
@@ -40,6 +42,17 @@ interface ExpressioHeatmapRendererDependencies {
4042
getStartDeps: StartServicesGetter<ExpressionHeatmapPluginStart>;
4143
}
4244

45+
const heatmapContainerCss = ({ euiTheme }: UseEuiTheme) =>
46+
css({
47+
width: '100%',
48+
height: '100%',
49+
padding: euiTheme.size.s,
50+
// the FocusTrap is adding extra divs which are making the visualization redraw twice
51+
// with a visible glitch. This make the chart library resilient to this extra reflow
52+
overflow: 'auto hidden',
53+
userSelect: 'text',
54+
});
55+
4356
export const heatmapRenderer: (
4457
deps: ExpressioHeatmapRendererDependencies
4558
) => ExpressionRenderDefinition<HeatmapExpressionProps> = ({ getStartDeps }) => ({
@@ -101,7 +114,7 @@ export const heatmapRenderer: (
101114

102115
render(
103116
<KibanaRenderContextProvider {...core}>
104-
<div className="heatmap-container" data-test-subj="heatmapChart">
117+
<div className="eui-scrollBar" css={heatmapContainerCss} data-test-subj="heatmapChart">
105118
<HeatmapComponent
106119
{...config}
107120
onClickValue={onClickValue}

src/platform/plugins/shared/chart_expressions/expression_heatmap/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"common/**/*",
99
"public/**/*",
1010
"server/**/*",
11+
"../../../../../../typings/emotion.d.ts"
1112
],
1213
"kbn_references": [
1314
{ "path": "../tsconfig.json" },

0 commit comments

Comments
 (0)