mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[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:
parent
3f1c97e38e
commit
228f83fde3
4 changed files with 15 additions and 12 deletions
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
"common/**/*",
|
||||
"public/**/*",
|
||||
"server/**/*",
|
||||
"../../../../../../typings/emotion.d.ts"
|
||||
],
|
||||
"kbn_references": [
|
||||
{ "path": "../tsconfig.json" },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue