From 66f4bace6fc22579ade21147639306288fd0917b Mon Sep 17 00:00:00 2001 From: nickofthyme Date: Fri, 16 Jul 2021 09:37:31 -0500 Subject: [PATCH] update breaking changes --- .../public/utils/render_all_series.tsx | 5 +-- .../__snapshots__/expression.test.tsx.snap | 32 ++++++++++++++----- .../public/xy_visualization/expression.tsx | 3 +- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/plugins/vis_type_xy/public/utils/render_all_series.tsx b/src/plugins/vis_type_xy/public/utils/render_all_series.tsx index e915e6d4966c50..ebf36944959819 100644 --- a/src/plugins/vis_type_xy/public/utils/render_all_series.tsx +++ b/src/plugins/vis_type_xy/public/utils/render_all_series.tsx @@ -18,6 +18,7 @@ import { Accessor, AccessorFn, ColorVariant, + LabelOverflowConstraint, } from '@elastic/charts'; import { DatatableRow } from '../../../expressions/public'; @@ -130,7 +131,7 @@ export const renderAllSeries = ( minBarHeight={2} displayValueSettings={{ showValueLabel, - hideClippedValue: true, + overflowConstraints: [LabelOverflowConstraint.ChartEdges], }} /> ); @@ -161,7 +162,7 @@ export const renderAllSeries = ( stackAccessors={isStacked ? ['__any_value__'] : undefined} displayValueSettings={{ showValueLabel, - hideClippedValue: true, + overflowConstraints: [LabelOverflowConstraint.ChartEdges], }} timeZone={timeZone} stackMode={stackMode} diff --git a/x-pack/plugins/lens/public/xy_visualization/__snapshots__/expression.test.tsx.snap b/x-pack/plugins/lens/public/xy_visualization/__snapshots__/expression.test.tsx.snap index 1f647680408d71..26fe4dc72921dc 100644 --- a/x-pack/plugins/lens/public/xy_visualization/__snapshots__/expression.test.tsx.snap +++ b/x-pack/plugins/lens/public/xy_visualization/__snapshots__/expression.test.tsx.snap @@ -335,9 +335,11 @@ exports[`xy_expression XYChart component it renders bar 1`] = ` } displayValueSettings={ Object { - "hideClippedValue": true, "isAlternatingValueLabel": false, "isValueContainedInElement": true, + "overflowConstraints": Array [ + "chartEdges", + ], "showValueLabel": false, "valueFormatter": [Function], } @@ -399,9 +401,11 @@ exports[`xy_expression XYChart component it renders bar 1`] = ` } displayValueSettings={ Object { - "hideClippedValue": true, "isAlternatingValueLabel": false, "isValueContainedInElement": true, + "overflowConstraints": Array [ + "chartEdges", + ], "showValueLabel": false, "valueFormatter": [Function], } @@ -558,9 +562,11 @@ exports[`xy_expression XYChart component it renders horizontal bar 1`] = ` } displayValueSettings={ Object { - "hideClippedValue": true, "isAlternatingValueLabel": false, "isValueContainedInElement": true, + "overflowConstraints": Array [ + "chartEdges", + ], "showValueLabel": false, "valueFormatter": [Function], } @@ -622,9 +628,11 @@ exports[`xy_expression XYChart component it renders horizontal bar 1`] = ` } displayValueSettings={ Object { - "hideClippedValue": true, "isAlternatingValueLabel": false, "isValueContainedInElement": true, + "overflowConstraints": Array [ + "chartEdges", + ], "showValueLabel": false, "valueFormatter": [Function], } @@ -1219,9 +1227,11 @@ exports[`xy_expression XYChart component it renders stacked bar 1`] = ` } displayValueSettings={ Object { - "hideClippedValue": true, "isAlternatingValueLabel": false, "isValueContainedInElement": true, + "overflowConstraints": Array [ + "chartEdges", + ], "showValueLabel": false, "valueFormatter": [Function], } @@ -1287,9 +1297,11 @@ exports[`xy_expression XYChart component it renders stacked bar 1`] = ` } displayValueSettings={ Object { - "hideClippedValue": true, "isAlternatingValueLabel": false, "isValueContainedInElement": true, + "overflowConstraints": Array [ + "chartEdges", + ], "showValueLabel": false, "valueFormatter": [Function], } @@ -1450,9 +1462,11 @@ exports[`xy_expression XYChart component it renders stacked horizontal bar 1`] = } displayValueSettings={ Object { - "hideClippedValue": true, "isAlternatingValueLabel": false, "isValueContainedInElement": true, + "overflowConstraints": Array [ + "chartEdges", + ], "showValueLabel": false, "valueFormatter": [Function], } @@ -1518,9 +1532,11 @@ exports[`xy_expression XYChart component it renders stacked horizontal bar 1`] = } displayValueSettings={ Object { - "hideClippedValue": true, "isAlternatingValueLabel": false, "isValueContainedInElement": true, + "overflowConstraints": Array [ + "chartEdges", + ], "showValueLabel": false, "valueFormatter": [Function], } diff --git a/x-pack/plugins/lens/public/xy_visualization/expression.tsx b/x-pack/plugins/lens/public/xy_visualization/expression.tsx index 3fe98282a18b0c..404608f9da43ae 100644 --- a/x-pack/plugins/lens/public/xy_visualization/expression.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/expression.tsx @@ -25,6 +25,7 @@ import { ElementClickListener, BrushEndListener, CurveType, + LabelOverflowConstraint, } from '@elastic/charts'; import { I18nProvider } from '@kbn/i18n/react'; import { @@ -909,7 +910,7 @@ export function XYChart({ showValueLabel: shouldShowValueLabels && valueLabels !== 'hide', isAlternatingValueLabel: false, isValueContainedInElement: true, - hideClippedValue: true, + overflowConstraints: [LabelOverflowConstraint.ChartEdges], }, }; return ;