From bbd96e135611cbdc5d706502d92b4844543c1358 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Thu, 25 Nov 2021 14:51:48 +0200 Subject: [PATCH] Fix brush problem --- .../common/types/expression_functions.ts | 1 - .../public/components/heatmap_component.tsx | 15 ++++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts b/src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts index 2d511aff803c3..a983da669c56d 100644 --- a/src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts +++ b/src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts @@ -14,7 +14,6 @@ import { import { ExpressionValueVisDimension } from '../../../../visualizations/common'; import { CustomPaletteState, PaletteOutput } from '../../../../charts/common'; -// import { VisParams, visType } from './expression_renderers'; import { EXPRESSION_HEATMAP_NAME, EXPRESSION_HEATMAP_LEGEND_NAME, diff --git a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx index 6767423b518f2..a53cb6359c800 100644 --- a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx +++ b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx @@ -352,14 +352,15 @@ const HeatmapComponent: FC = ({ }); }); } - - (x as string[]).forEach((v) => { - points.push({ - row: table.rows.findIndex((r) => r[xAxisColumn.id] === v), - column: xAxisColumnIndex, - value: v, + if (xAxisColumn) { + (x as string[]).forEach((v) => { + points.push({ + row: table.rows.findIndex((r) => r[xAxisColumn.id] === v), + column: xAxisColumnIndex, + value: v, + }); }); - }); + } const context: FilterEvent['data'] = { data: points.map((point) => ({