From f69deb6274cd6b8285162347a40bfdc529622e62 Mon Sep 17 00:00:00 2001 From: Marco Vettorello Date: Tue, 3 Dec 2024 10:27:58 +0100 Subject: [PATCH] [TSVB] fix point visibility regression (#202358) ## Summary fix https://github.com/elastic/kibana/issues/200255 The regression was caused by a [breaking change](https://github.com/elastic/elastic-charts/pull/2525) introduced by elastic-charts around the `area.points.visible` style, that passed from a `boolean` to a union of `'always' | 'never' | 'auto'`; (cherry picked from commit a7397b2ce23c22e06af246eca59c32c63dc63cdb) --- .../decorators/__snapshots__/area_decorator.test.js.snap | 2 +- .../timeseries/utils/__snapshots__/series_styles.test.js.snap | 4 ++-- .../visualizations/views/timeseries/utils/series_styles.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/vis_types/timeseries/public/application/visualizations/views/timeseries/decorators/__snapshots__/area_decorator.test.js.snap b/src/plugins/vis_types/timeseries/public/application/visualizations/views/timeseries/decorators/__snapshots__/area_decorator.test.js.snap index 7ded8e2254aa9..18ce44a9fb7ec 100644 --- a/src/plugins/vis_types/timeseries/public/application/visualizations/views/timeseries/decorators/__snapshots__/area_decorator.test.js.snap +++ b/src/plugins/vis_types/timeseries/public/application/visualizations/views/timeseries/decorators/__snapshots__/area_decorator.test.js.snap @@ -18,7 +18,7 @@ exports[`src/legacy/core_plugins/metrics/public/visualizations/views/timeseries/ "radius": 1, "stroke": "rgb(0, 156, 224)", "strokeWidth": 5, - "visible": false, + "visible": "never", }, } } diff --git a/src/plugins/vis_types/timeseries/public/application/visualizations/views/timeseries/utils/__snapshots__/series_styles.test.js.snap b/src/plugins/vis_types/timeseries/public/application/visualizations/views/timeseries/utils/__snapshots__/series_styles.test.js.snap index 054ca0f0d8193..28bfd0c698307 100644 --- a/src/plugins/vis_types/timeseries/public/application/visualizations/views/timeseries/utils/__snapshots__/series_styles.test.js.snap +++ b/src/plugins/vis_types/timeseries/public/application/visualizations/views/timeseries/utils/__snapshots__/series_styles.test.js.snap @@ -17,7 +17,7 @@ Object { "radius": 1, "stroke": "rgb(224, 0, 221)", "strokeWidth": 1, - "visible": true, + "visible": "always", }, }, "curve": 7, @@ -41,7 +41,7 @@ Object { "radius": 0.5, "stroke": "#000", "strokeWidth": 5, - "visible": false, + "visible": "never", }, }, "curve": 9, diff --git a/src/plugins/vis_types/timeseries/public/application/visualizations/views/timeseries/utils/series_styles.js b/src/plugins/vis_types/timeseries/public/application/visualizations/views/timeseries/utils/series_styles.js index 0da1e8e474b50..6bfbbb7bfb287 100644 --- a/src/plugins/vis_types/timeseries/public/application/visualizations/views/timeseries/utils/series_styles.js +++ b/src/plugins/vis_types/timeseries/public/application/visualizations/views/timeseries/utils/series_styles.js @@ -27,7 +27,7 @@ export const getAreaStyles = ({ points, lines, color }) => ({ radius: points.radius || 0.5, stroke: color || DEFAULT_COLOR, strokeWidth: points.lineWidth || 5, - visible: points.lineWidth > 0 && Boolean(points.show), + visible: points.lineWidth > 0 && Boolean(points.show) ? 'always' : 'never', }, }, curve: lines.steps ? CurveType.CURVE_STEP_AFTER : CurveType.LINEAR,