From 8ef9a1d3986ec90f89f8f9d859a11a943636cf97 Mon Sep 17 00:00:00 2001 From: Steven Hao Date: Wed, 19 Jan 2022 10:17:27 -0800 Subject: [PATCH] Fix: make plotly charts have unbounded hoverlabel name length (#5661) --- .../chart/plotly/fixtures/prepareLayout/box-single-axis.json | 3 +++ .../plotly/fixtures/prepareLayout/box-with-second-axis.json | 3 +++ .../plotly/fixtures/prepareLayout/default-single-axis.json | 3 +++ .../fixtures/prepareLayout/default-with-second-axis.json | 3 +++ .../plotly/fixtures/prepareLayout/default-with-stacking.json | 3 +++ .../plotly/fixtures/prepareLayout/default-without-legend.json | 3 +++ .../plotly/fixtures/prepareLayout/pie-multiple-series.json | 3 +++ .../plotly/fixtures/prepareLayout/pie-without-annotations.json | 3 +++ .../chart/plotly/fixtures/prepareLayout/pie.json | 3 +++ viz-lib/src/visualizations/chart/plotly/prepareLayout.ts | 3 +++ 10 files changed, 30 insertions(+) diff --git a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/box-single-axis.json b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/box-single-axis.json index 7332ce9886..447faadcf7 100644 --- a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/box-single-axis.json +++ b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/box-single-axis.json @@ -35,6 +35,9 @@ "type": "linear", "autorange": true, "range": null + }, + "hoverlabel": { + "namelength": -1 } } } diff --git a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/box-with-second-axis.json b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/box-with-second-axis.json index c54a771f22..bea2fb311f 100644 --- a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/box-with-second-axis.json +++ b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/box-with-second-axis.json @@ -47,6 +47,9 @@ "range": null, "overlaying": "y", "side": "right" + }, + "hoverlabel": { + "namelength": -1 } } } diff --git a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/default-single-axis.json b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/default-single-axis.json index 3cd303b58f..285a8b0e6c 100644 --- a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/default-single-axis.json +++ b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/default-single-axis.json @@ -33,6 +33,9 @@ "type": "linear", "autorange": true, "range": null + }, + "hoverlabel": { + "namelength": -1 } } } diff --git a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/default-with-second-axis.json b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/default-with-second-axis.json index 3e9379cfdc..fbb59fec37 100644 --- a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/default-with-second-axis.json +++ b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/default-with-second-axis.json @@ -45,6 +45,9 @@ "range": null, "overlaying": "y", "side": "right" + }, + "hoverlabel": { + "namelength": -1 } } } diff --git a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/default-with-stacking.json b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/default-with-stacking.json index beef4f243f..a974ebdb5a 100644 --- a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/default-with-stacking.json +++ b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/default-with-stacking.json @@ -32,6 +32,9 @@ "type": "linear", "autorange": true, "range": null + }, + "hoverlabel": { + "namelength": -1 } } } diff --git a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/default-without-legend.json b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/default-without-legend.json index 529e216820..553cf090c8 100644 --- a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/default-without-legend.json +++ b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/default-without-legend.json @@ -31,6 +31,9 @@ "type": "linear", "autorange": true, "range": null + }, + "hoverlabel": { + "namelength": -1 } } } diff --git a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/pie-multiple-series.json b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/pie-multiple-series.json index 7b8b452510..7f3735c433 100644 --- a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/pie-multiple-series.json +++ b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/pie-multiple-series.json @@ -19,6 +19,9 @@ "legend": { "traceorder": "normal" }, + "hoverlabel": { + "namelength": -1 + }, "annotations": [ { "x": 0.24, diff --git a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/pie-without-annotations.json b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/pie-without-annotations.json index 35d5e2550f..3b2ca9f09a 100644 --- a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/pie-without-annotations.json +++ b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/pie-without-annotations.json @@ -19,6 +19,9 @@ "legend": { "traceorder": "normal" }, + "hoverlabel": { + "namelength": -1 + }, "annotations": [] } } diff --git a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/pie.json b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/pie.json index cc42d35d49..a4865bbc13 100644 --- a/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/pie.json +++ b/viz-lib/src/visualizations/chart/plotly/fixtures/prepareLayout/pie.json @@ -19,6 +19,9 @@ "legend": { "traceorder": "normal" }, + "hoverlabel": { + "namelength": -1 + }, "annotations": [ { "x": 0.49, diff --git a/viz-lib/src/visualizations/chart/plotly/prepareLayout.ts b/viz-lib/src/visualizations/chart/plotly/prepareLayout.ts index 9be2d7436d..f79912a2fd 100644 --- a/viz-lib/src/visualizations/chart/plotly/prepareLayout.ts +++ b/viz-lib/src/visualizations/chart/plotly/prepareLayout.ts @@ -117,6 +117,9 @@ export default function prepareLayout(element: any, options: any, data: any) { legend: { traceorder: options.legend.traceorder, }, + hoverlabel: { + namelength: -1, + }, }; switch (options.globalSeriesType) {