[Lens] Replace scss for heatmap expression (#209246)

## Summary

Part of https://github.com/elastic/kibana/issues/208908

Replaces scss to css-in-js. 

### Checklist

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
This commit is contained in:
Maria Iriarte 2025-02-06 17:38:08 +01:00 committed by GitHub
parent 3f1c97e38e
commit 228f83fde3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 15 additions and 12 deletions

View file

@ -57,7 +57,6 @@ import {
import { defaultPaletteParams } from '../constants';
import { ChartSplit } from './chart_split';
import { getSplitDimensionAccessor, createSplitPoint } from '../utils/get_split_dimension_utils';
import './index.scss';
declare global {
interface Window {

View file

@ -1,10 +0,0 @@
.heatmap-container {
height: 100%;
width: 100%;
// the FocusTrap is adding extra divs which are making the visualization redraw twice
// with a visible glitch. This make the chart library resilient to this extra reflow
overflow: auto hidden;
user-select: text;
padding: $euiSizeS;
@include euiScrollBar;
}

View file

@ -21,6 +21,8 @@ import {
extractContainerType,
extractVisualizationType,
} from '@kbn/chart-expressions-common';
import { css } from '@emotion/react';
import { UseEuiTheme } from '@elastic/eui';
import { MultiFilterEvent } from '../../common/types';
import { ExpressionHeatmapPluginStart } from '../plugin';
import {
@ -40,6 +42,17 @@ interface ExpressioHeatmapRendererDependencies {
getStartDeps: StartServicesGetter<ExpressionHeatmapPluginStart>;
}
const heatmapContainerCss = ({ euiTheme }: UseEuiTheme) =>
css({
width: '100%',
height: '100%',
padding: euiTheme.size.s,
// the FocusTrap is adding extra divs which are making the visualization redraw twice
// with a visible glitch. This make the chart library resilient to this extra reflow
overflow: 'auto hidden',
userSelect: 'text',
});
export const heatmapRenderer: (
deps: ExpressioHeatmapRendererDependencies
) => ExpressionRenderDefinition<HeatmapExpressionProps> = ({ getStartDeps }) => ({
@ -101,7 +114,7 @@ export const heatmapRenderer: (
render(
<KibanaRenderContextProvider {...core}>
<div className="heatmap-container" data-test-subj="heatmapChart">
<div className="eui-scrollBar" css={heatmapContainerCss} data-test-subj="heatmapChart">
<HeatmapComponent
{...config}
onClickValue={onClickValue}

View file

@ -8,6 +8,7 @@
"common/**/*",
"public/**/*",
"server/**/*",
"../../../../../../typings/emotion.d.ts"
],
"kbn_references": [
{ "path": "../tsconfig.json" },