@fluentui/react-charting 5.23.42 → 5.23.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.json +61 -1
  2. package/CHANGELOG.md +25 -2
  3. package/bundle-size/DeclarativeChart.fixture.js +7 -0
  4. package/dist/react-charting.js +1 -1
  5. package/dist/react-charting.min.js +1 -1
  6. package/lib/components/DeclarativeChart/DeclarativeChart.js +66 -49
  7. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  8. package/lib/components/DeclarativeChart/PlotlySchema.d.ts +1516 -0
  9. package/lib/components/DeclarativeChart/PlotlySchema.js +4 -0
  10. package/lib/components/DeclarativeChart/PlotlySchema.js.map +1 -0
  11. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +16 -13
  12. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +221 -114
  13. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  14. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +5 -4
  15. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  16. package/lib/components/VerticalBarChart/VerticalBarChart.base.js +10 -1
  17. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  18. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +1 -1
  19. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  20. package/lib/utilities/utilities.js +2 -9
  21. package/lib/utilities/utilities.js.map +1 -1
  22. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +64 -47
  23. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  24. package/lib-amd/components/DeclarativeChart/PlotlySchema.d.ts +1516 -0
  25. package/lib-amd/components/DeclarativeChart/PlotlySchema.js +7 -0
  26. package/lib-amd/components/DeclarativeChart/PlotlySchema.js.map +1 -0
  27. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +16 -13
  28. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +223 -115
  29. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  30. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +5 -4
  31. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  32. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +10 -1
  33. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  34. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +1 -1
  35. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  36. package/lib-amd/utilities/utilities.js +2 -9
  37. package/lib-amd/utilities/utilities.js.map +1 -1
  38. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +65 -48
  39. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  40. package/lib-commonjs/components/DeclarativeChart/PlotlySchema.d.ts +1516 -0
  41. package/lib-commonjs/components/DeclarativeChart/PlotlySchema.js +5 -0
  42. package/lib-commonjs/components/DeclarativeChart/PlotlySchema.js.map +1 -0
  43. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +16 -13
  44. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +223 -115
  45. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  46. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +5 -4
  47. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  48. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +10 -1
  49. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  50. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +1 -1
  51. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  52. package/lib-commonjs/utilities/utilities.js +2 -9
  53. package/lib-commonjs/utilities/utilities.js.map +1 -1
  54. package/package.json +3 -3
@@ -1,43 +1,91 @@
1
- import { __assign } from "tslib";
1
+ import { __assign, __spreadArray } from "tslib";
2
2
  import { bin as d3Bin, extent as d3Extent, sum as d3Sum, min as d3Min, max as d3Max, merge as d3Merge } from 'd3-array';
3
3
  import { scaleLinear as d3ScaleLinear } from 'd3-scale';
4
4
  import { format as d3Format, precisionFixed as d3PrecisionFixed } from 'd3-format';
5
5
  import { DataVizPalette, getColorFromToken, getNextColor } from '../../utilities/colors';
6
6
  import { GaugeChartVariant } from '../GaugeChart/index';
7
7
  import { timeParse } from 'd3-time-format';
8
- var isDate = function (value) { return !isNaN(Date.parse(value)); };
8
+ var SUPPORTED_PLOT_TYPES = ['pie', 'bar', 'scatter', 'heatmap', 'sankey', 'indicator', 'histogram'];
9
+ var isDate = function (value) {
10
+ var parsedDate = new Date(Date.parse(value));
11
+ if (isNaN(parsedDate.getTime())) {
12
+ return false;
13
+ }
14
+ var parsedYear = parsedDate.getFullYear();
15
+ var yearInString = /\b\d{4}\b/.test(value);
16
+ if (!yearInString && (parsedYear === 2000 || parsedYear === 2001)) {
17
+ return false;
18
+ }
19
+ return true;
20
+ };
9
21
  var isNumber = function (value) { return !isNaN(parseFloat(value)) && isFinite(value); };
10
- export var isDateArray = function (array) { return isArrayOrTypedArray(array) && array.every(isDate); };
11
- export var isNumberArray = function (array) { return isArrayOrTypedArray(array) && array.every(isNumber); };
12
- export var isMonthArray = function (array) {
13
- if (array && array.length > 0) {
14
- var parseFullMonth_1 = timeParse('%B');
15
- var parseShortMonth_1 = timeParse('%b');
16
- return array.every(function (possiblyMonthValue) {
17
- return parseFullMonth_1(possiblyMonthValue) !== null || parseShortMonth_1(possiblyMonthValue) !== null;
18
- });
22
+ var isMonth = function (possiblyMonthValue) {
23
+ var parseFullMonth = timeParse('%B');
24
+ var parseShortMonth = timeParse('%b');
25
+ return parseFullMonth(possiblyMonthValue) !== null || parseShortMonth(possiblyMonthValue) !== null;
26
+ };
27
+ var isArrayOfType = function (plotCoordinates, typeCheck) {
28
+ var args = [];
29
+ for (var _i = 2; _i < arguments.length; _i++) {
30
+ args[_i - 2] = arguments[_i];
31
+ }
32
+ if (!isArrayOrTypedArray(plotCoordinates)) {
33
+ return false;
34
+ }
35
+ if (plotCoordinates.length === 0) {
36
+ return false;
37
+ }
38
+ if (Array.isArray(plotCoordinates[0])) {
39
+ // Handle 2D array
40
+ return plotCoordinates.every(function (innerArray) { return innerArray.every(function (datum) { return typeCheck.apply(void 0, __spreadArray([datum], args, false)); }); });
41
+ }
42
+ else {
43
+ // Handle 1D array
44
+ return plotCoordinates.every(function (datum) { return typeCheck.apply(void 0, __spreadArray([datum], args, false)); });
45
+ }
46
+ };
47
+ export var isDateArray = function (data) {
48
+ return isArrayOfType(data, isDate);
49
+ };
50
+ export var isNumberArray = function (data) {
51
+ return isArrayOfType(data, isNumber);
52
+ };
53
+ export var isMonthArray = function (data) {
54
+ return isArrayOfType(data, isMonth);
55
+ };
56
+ export var isLineData = function (data) {
57
+ return (!SUPPORTED_PLOT_TYPES.includes("".concat(data.type)) &&
58
+ Array.isArray(data.x) &&
59
+ isArrayOfType(data.y, function (value) { return typeof value === 'number'; }) &&
60
+ data.x.length > 0 &&
61
+ data.x.length === data.y.length);
62
+ };
63
+ var invalidate2Dseries = function (series, chartType) {
64
+ var _a, _b;
65
+ if (((_a = series.x) === null || _a === void 0 ? void 0 : _a.length) > 0 && Array.isArray(series.x[0])) {
66
+ throw new Error("transform to ".concat(chartType, ":: 2D x array not supported"));
67
+ }
68
+ if (((_b = series.y) === null || _b === void 0 ? void 0 : _b.length) > 0 && Array.isArray(series.y[0])) {
69
+ throw new Error("transform to ".concat(chartType, ":: 2D y array not supported"));
19
70
  }
20
- return false;
71
+ };
72
+ var getLegend = function (series, index) {
73
+ return series.name || "Series ".concat(index + 1);
21
74
  };
22
75
  function getTitles(layout) {
23
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
76
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
24
77
  var titles = {
25
- chartTitle: typeof layout.title === 'string' ? layout.title : typeof ((_a = layout.title) === null || _a === void 0 ? void 0 : _a.text) === 'string' ? layout.title.text : '',
26
- xAxisTitle: typeof ((_b = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _b === void 0 ? void 0 : _b.title) === 'string'
27
- ? (_c = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _c === void 0 ? void 0 : _c.title
28
- : typeof ((_e = (_d = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _d === void 0 ? void 0 : _d.title) === null || _e === void 0 ? void 0 : _e.text) === 'string'
29
- ? (_g = (_f = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _f === void 0 ? void 0 : _f.title) === null || _g === void 0 ? void 0 : _g.text
30
- : '',
31
- yAxisTitle: typeof ((_h = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _h === void 0 ? void 0 : _h.title) === 'string'
32
- ? (_j = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _j === void 0 ? void 0 : _j.title
33
- : typeof ((_l = (_k = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _k === void 0 ? void 0 : _k.title) === null || _l === void 0 ? void 0 : _l.text) === 'string'
34
- ? (_o = (_m = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _m === void 0 ? void 0 : _m.title) === null || _o === void 0 ? void 0 : _o.text
35
- : '',
78
+ chartTitle: typeof (layout === null || layout === void 0 ? void 0 : layout.title) === 'string' ? layout.title : (_b = (_a = layout === null || layout === void 0 ? void 0 : layout.title) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : '',
79
+ xAxisTitle: typeof ((_c = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _c === void 0 ? void 0 : _c.title) === 'string' ? (_d = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _d === void 0 ? void 0 : _d.title : (_g = (_f = (_e = layout === null || layout === void 0 ? void 0 : layout.xaxis) === null || _e === void 0 ? void 0 : _e.title) === null || _f === void 0 ? void 0 : _f.text) !== null && _g !== void 0 ? _g : '',
80
+ yAxisTitle: typeof ((_h = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _h === void 0 ? void 0 : _h.title) === 'string' ? (_j = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _j === void 0 ? void 0 : _j.title : (_m = (_l = (_k = layout === null || layout === void 0 ? void 0 : layout.yaxis) === null || _k === void 0 ? void 0 : _k.title) === null || _l === void 0 ? void 0 : _l.text) !== null && _m !== void 0 ? _m : '',
36
81
  };
37
82
  return titles;
38
83
  }
39
84
  export var updateXValues = function (xValues) {
40
85
  var presentYear = new Date().getFullYear();
86
+ if (xValues.length > 0 && Array.isArray(xValues[0])) {
87
+ throw new Error('updateXValues:: 2D array not supported');
88
+ }
41
89
  var dates = xValues.map(function (possiblyMonthValue) {
42
90
  var parsedDate = "".concat(possiblyMonthValue, " 01, ").concat(presentYear);
43
91
  return isDate(parsedDate) ? new Date(parsedDate) : null;
@@ -67,21 +115,54 @@ export var getColor = function (legendLabel, colorMap, isDarkTheme) {
67
115
  }
68
116
  return colorMap.current.get(legendLabel);
69
117
  };
70
- export var transformPlotlyJsonToDonutProps = function (jsonObj, colorMap, isDarkTheme) {
71
- var _a, _b;
72
- var data = jsonObj.data, layout = jsonObj.layout;
73
- var firstData = data[0];
118
+ var getSecondaryYAxisValues = function (series, layout) {
119
+ var _a;
120
+ var secondaryYAxisValues = {};
121
+ if (layout && layout.yaxis2 && series.yaxis === 'y2') {
122
+ secondaryYAxisValues.secondaryYAxistitle =
123
+ typeof layout.yaxis2.title === 'string'
124
+ ? layout.yaxis2.title
125
+ : typeof ((_a = layout.yaxis2.title) === null || _a === void 0 ? void 0 : _a.text) === 'string'
126
+ ? layout.yaxis2.title.text
127
+ : '';
128
+ if (layout.yaxis2.range) {
129
+ secondaryYAxisValues.secondaryYScaleOptions = {
130
+ yMinValue: layout.yaxis2.range[0],
131
+ yMaxValue: layout.yaxis2.range[1],
132
+ };
133
+ }
134
+ else {
135
+ var yValues = series.y;
136
+ if (yValues) {
137
+ secondaryYAxisValues.secondaryYScaleOptions = {
138
+ yMinValue: Math.min.apply(Math, yValues),
139
+ yMaxValue: Math.max.apply(Math, yValues),
140
+ };
141
+ }
142
+ }
143
+ }
144
+ secondaryYAxisValues.secondaryYAxistitle =
145
+ secondaryYAxisValues.secondaryYAxistitle !== '' ? secondaryYAxisValues.secondaryYAxistitle : undefined;
146
+ secondaryYAxisValues.secondaryYScaleOptions =
147
+ secondaryYAxisValues.secondaryYScaleOptions && Object.keys(secondaryYAxisValues.secondaryYScaleOptions).length !== 0
148
+ ? secondaryYAxisValues.secondaryYScaleOptions
149
+ : undefined;
150
+ return secondaryYAxisValues;
151
+ };
152
+ export var transformPlotlyJsonToDonutProps = function (input, colorMap, isDarkTheme) {
153
+ var _a, _b, _c, _d, _e, _f, _g;
154
+ var firstData = input.data[0];
74
155
  var donutData = (_a = firstData.labels) === null || _a === void 0 ? void 0 : _a.map(function (label, index) {
75
156
  var _a;
76
157
  var color = getColor(label, colorMap, isDarkTheme);
77
158
  return {
78
159
  legend: label,
79
- data: (_a = firstData.values) === null || _a === void 0 ? void 0 : _a[index],
160
+ data: (_a = firstData.values) === null || _a === void 0 ? void 0 : _a[index], //ToDo how to handle string data?
80
161
  color: color,
81
162
  };
82
163
  });
83
- var width = typeof (layout === null || layout === void 0 ? void 0 : layout.width) === 'number' ? layout === null || layout === void 0 ? void 0 : layout.width : 440;
84
- var height = typeof (layout === null || layout === void 0 ? void 0 : layout.height) === 'number' ? layout === null || layout === void 0 ? void 0 : layout.height : 220;
164
+ var width = (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.width) !== null && _c !== void 0 ? _c : 440;
165
+ var height = (_e = (_d = input.layout) === null || _d === void 0 ? void 0 : _d.height) !== null && _e !== void 0 ? _e : 220;
85
166
  var hideLabels = firstData.textinfo
86
167
  ? !['value', 'percent', 'label+percent'].includes(firstData.textinfo)
87
168
  : false;
@@ -92,16 +173,16 @@ export var transformPlotlyJsonToDonutProps = function (jsonObj, colorMap, isDark
92
173
  : 0;
93
174
  var styles = {
94
175
  root: {
95
- '[class^="arcLabel"]': __assign({}, (typeof ((_b = firstData.textfont) === null || _b === void 0 ? void 0 : _b.size) === 'number' ? { fontSize: firstData.textfont.size } : {})),
176
+ '[class^="arcLabel"]': __assign({}, (typeof ((_f = firstData.textfont) === null || _f === void 0 ? void 0 : _f.size) === 'number' ? { fontSize: firstData.textfont.size } : {})),
96
177
  },
97
178
  };
98
- var chartTitle = getTitles(layout).chartTitle;
179
+ var chartTitle = getTitles(input.layout).chartTitle;
99
180
  return {
100
181
  data: {
101
182
  chartTitle: chartTitle,
102
183
  chartData: donutData,
103
184
  },
104
- hideLegend: (layout === null || layout === void 0 ? void 0 : layout.showlegend) === false ? true : false,
185
+ hideLegend: ((_g = input.layout) === null || _g === void 0 ? void 0 : _g.showlegend) === false ? true : false,
105
186
  width: width,
106
187
  height: height,
107
188
  innerRadius: innerRadius,
@@ -110,38 +191,44 @@ export var transformPlotlyJsonToDonutProps = function (jsonObj, colorMap, isDark
110
191
  styles: styles,
111
192
  };
112
193
  };
113
- export var transformPlotlyJsonToVSBCProps = function (jsonObj, colorMap, isDarkTheme) {
114
- var data = jsonObj.data, layout = jsonObj.layout;
194
+ export var transformPlotlyJsonToVSBCProps = function (input, colorMap, isDarkTheme, fallbackVSBC) {
115
195
  var mapXToDataPoints = {};
116
196
  var yMaxValue = 0;
117
- data.forEach(function (series, index1) {
197
+ var secondaryYAxisValues = {};
198
+ input.data.forEach(function (series, index1) {
118
199
  var _a;
200
+ invalidate2Dseries(series, 'VSBC');
201
+ if (!isNumberArray(series.y)) {
202
+ throw new Error('transform to VSBC:: y values should be numeric');
203
+ }
119
204
  (_a = series.x) === null || _a === void 0 ? void 0 : _a.forEach(function (x, index2) {
120
- var _a, _b, _c;
205
+ var _a, _b;
121
206
  if (!mapXToDataPoints[x]) {
122
207
  mapXToDataPoints[x] = { xAxisPoint: x, chartData: [], lineData: [] };
123
208
  }
124
- var legend = series.name || "Series ".concat(index1 + 1);
125
- if (series.type === 'bar' || series.type === 'scatter') {
209
+ var legend = getLegend(series, index1);
210
+ var yVal = (_b = (_a = series.y) === null || _a === void 0 ? void 0 : _a[index2]) !== null && _b !== void 0 ? _b : 0;
211
+ if (series.type === 'bar') {
126
212
  var color = getColor(legend, colorMap, isDarkTheme);
127
213
  mapXToDataPoints[x].chartData.push({
128
214
  legend: legend,
129
- data: (_a = series.y) === null || _a === void 0 ? void 0 : _a[index2],
215
+ data: yVal,
130
216
  color: color,
131
217
  });
132
218
  }
133
- else if (series.type === 'line') {
219
+ else if (series.type === 'scatter' || isLineData(series) || !!fallbackVSBC) {
134
220
  var color = getColor(legend, colorMap, isDarkTheme);
135
221
  mapXToDataPoints[x].lineData.push({
136
222
  legend: legend,
137
- y: (_b = series.y) === null || _b === void 0 ? void 0 : _b[index2],
223
+ y: yVal,
138
224
  color: color,
139
225
  });
140
226
  }
141
- yMaxValue = Math.max(yMaxValue, (_c = series.y) === null || _c === void 0 ? void 0 : _c[index2]);
227
+ yMaxValue = Math.max(yMaxValue, yVal);
142
228
  });
229
+ secondaryYAxisValues = getSecondaryYAxisValues(series, input.layout);
143
230
  });
144
- var _a = getTitles(layout), chartTitle = _a.chartTitle, xAxisTitle = _a.xAxisTitle, yAxisTitle = _a.yAxisTitle;
231
+ var _a = getTitles(input.layout), chartTitle = _a.chartTitle, xAxisTitle = _a.xAxisTitle, yAxisTitle = _a.yAxisTitle;
145
232
  return {
146
233
  data: Object.values(mapXToDataPoints),
147
234
  // width: layout?.width,
@@ -152,32 +239,39 @@ export var transformPlotlyJsonToVSBCProps = function (jsonObj, colorMap, isDarkT
152
239
  xAxisTitle: xAxisTitle,
153
240
  yAxisTitle: yAxisTitle,
154
241
  mode: 'plotly',
242
+ secondaryYAxistitle: secondaryYAxisValues.secondaryYAxistitle,
243
+ secondaryYScaleOptions: secondaryYAxisValues.secondaryYScaleOptions,
155
244
  };
156
245
  };
157
- export var transformPlotlyJsonToGVBCProps = function (jsonObj, colorMap, isDarkTheme) {
158
- var data = jsonObj.data, layout = jsonObj.layout;
246
+ export var transformPlotlyJsonToGVBCProps = function (input, colorMap, isDarkTheme) {
159
247
  var mapXToDataPoints = {};
160
- data.forEach(function (series, index1) {
248
+ var secondaryYAxisValues = {};
249
+ input.data.forEach(function (series, index1) {
161
250
  var _a;
251
+ invalidate2Dseries(series, 'GVBC');
252
+ if (!isNumberArray(series.y)) {
253
+ throw new Error('transform to GVBC:: y values should be numeric');
254
+ }
162
255
  (_a = series.x) === null || _a === void 0 ? void 0 : _a.forEach(function (x, index2) {
163
- var _a;
256
+ var _a, _b;
164
257
  if (!mapXToDataPoints[x]) {
165
258
  mapXToDataPoints[x] = { name: x.toString(), series: [] };
166
259
  }
167
260
  if (series.type === 'bar') {
168
- var legend = series.name || "Series ".concat(index1 + 1);
261
+ var legend = getLegend(series, index1);
169
262
  var color = getColor(legend, colorMap, isDarkTheme);
170
263
  mapXToDataPoints[x].series.push({
171
264
  key: legend,
172
- data: (_a = series.y) === null || _a === void 0 ? void 0 : _a[index2],
265
+ data: (_b = (_a = series.y) === null || _a === void 0 ? void 0 : _a[index2]) !== null && _b !== void 0 ? _b : 0,
173
266
  xAxisCalloutData: x,
174
267
  color: color,
175
268
  legend: legend,
176
269
  });
177
270
  }
178
271
  });
272
+ secondaryYAxisValues = getSecondaryYAxisValues(series, input.layout);
179
273
  });
180
- var _a = getTitles(layout), chartTitle = _a.chartTitle, xAxisTitle = _a.xAxisTitle, yAxisTitle = _a.yAxisTitle;
274
+ var _a = getTitles(input.layout), chartTitle = _a.chartTitle, xAxisTitle = _a.xAxisTitle, yAxisTitle = _a.yAxisTitle;
181
275
  return {
182
276
  data: Object.values(mapXToDataPoints),
183
277
  // width: layout?.width,
@@ -187,13 +281,15 @@ export var transformPlotlyJsonToGVBCProps = function (jsonObj, colorMap, isDarkT
187
281
  xAxisTitle: xAxisTitle,
188
282
  yAxisTitle: yAxisTitle,
189
283
  mode: 'plotly',
284
+ secondaryYAxistitle: secondaryYAxisValues.secondaryYAxistitle,
285
+ secondaryYScaleOptions: secondaryYAxisValues.secondaryYScaleOptions,
190
286
  };
191
287
  };
192
- export var transformPlotlyJsonToVBCProps = function (jsonObj, colorMap, isDarkTheme) {
193
- var data = jsonObj.data, layout = jsonObj.layout;
288
+ export var transformPlotlyJsonToVBCProps = function (input, colorMap, isDarkTheme) {
194
289
  var vbcData = [];
195
- data.forEach(function (series, index) {
290
+ input.data.forEach(function (series, index) {
196
291
  var _a, _b, _c;
292
+ invalidate2Dseries(series, 'VBC');
197
293
  if (!series.x) {
198
294
  return;
199
295
  }
@@ -221,7 +317,7 @@ export var transformPlotlyJsonToVBCProps = function (jsonObj, colorMap, isDarkTh
221
317
  // If the start or end of xbins is specified, then the number of datapoints may become less than x.length
222
318
  var totalDataPoints = d3Merge(buckets).length;
223
319
  buckets.forEach(function (bucket) {
224
- var legend = series.name || "Series ".concat(index + 1);
320
+ var legend = getLegend(series, index);
225
321
  var color = getColor(legend, colorMap, isDarkTheme);
226
322
  var y = bucket.length;
227
323
  if (series.histnorm === 'percent') {
@@ -257,12 +353,11 @@ export var transformPlotlyJsonToVBCProps = function (jsonObj, colorMap, isDarkTh
257
353
  });
258
354
  });
259
355
  });
260
- var _a = getTitles(layout), chartTitle = _a.chartTitle, xAxisTitle = _a.xAxisTitle, yAxisTitle = _a.yAxisTitle;
356
+ var _a = getTitles(input.layout), chartTitle = _a.chartTitle, xAxisTitle = _a.xAxisTitle, yAxisTitle = _a.yAxisTitle;
261
357
  return {
262
358
  data: vbcData,
263
359
  // width: layout?.width,
264
360
  // height: layout?.height,
265
- barWidth: 24,
266
361
  supportNegativeData: true,
267
362
  chartTitle: chartTitle,
268
363
  xAxisTitle: xAxisTitle,
@@ -270,16 +365,18 @@ export var transformPlotlyJsonToVBCProps = function (jsonObj, colorMap, isDarkTh
270
365
  mode: 'plotly',
271
366
  };
272
367
  };
273
- export var transformPlotlyJsonToScatterChartProps = function (jsonObj, isAreaChart, colorMap, isDarkTheme) {
274
- var data = jsonObj.data, layout = jsonObj.layout;
368
+ export var transformPlotlyJsonToScatterChartProps = function (input, isAreaChart, colorMap, isDarkTheme) {
369
+ var secondaryYAxisValues = {};
275
370
  var mode = 'tonexty';
276
- var chartData = data.map(function (series, index) {
371
+ var chartData = input.data.map(function (series, index) {
372
+ invalidate2Dseries(series, 'Scatter');
277
373
  var xValues = series.x;
278
374
  var isString = typeof xValues[0] === 'string';
279
375
  var isXDate = isDateArray(xValues);
280
376
  var isXNumber = isNumberArray(xValues);
281
- var legend = series.name || "Series ".concat(index + 1);
377
+ var legend = getLegend(series, index);
282
378
  var lineColor = getColor(legend, colorMap, isDarkTheme);
379
+ secondaryYAxisValues = getSecondaryYAxisValues(series, input.layout);
283
380
  mode = series.fill === 'tozeroy' ? 'tozeroy' : 'tonexty';
284
381
  return {
285
382
  legend: legend,
@@ -290,7 +387,7 @@ export var transformPlotlyJsonToScatterChartProps = function (jsonObj, isAreaCha
290
387
  color: lineColor,
291
388
  };
292
389
  });
293
- var _a = getTitles(layout), chartTitle = _a.chartTitle, xAxisTitle = _a.xAxisTitle, yAxisTitle = _a.yAxisTitle;
390
+ var _a = getTitles(input.layout), chartTitle = _a.chartTitle, xAxisTitle = _a.xAxisTitle, yAxisTitle = _a.yAxisTitle;
294
391
  var chartProps = {
295
392
  chartTitle: chartTitle,
296
393
  lineChartData: chartData,
@@ -301,6 +398,8 @@ export var transformPlotlyJsonToScatterChartProps = function (jsonObj, isAreaCha
301
398
  supportNegativeData: true,
302
399
  xAxisTitle: xAxisTitle,
303
400
  yAxisTitle: yAxisTitle,
401
+ secondaryYAxistitle: secondaryYAxisValues.secondaryYAxistitle,
402
+ secondaryYScaleOptions: secondaryYAxisValues.secondaryYScaleOptions,
304
403
  mode: mode,
305
404
  };
306
405
  }
@@ -310,14 +409,16 @@ export var transformPlotlyJsonToScatterChartProps = function (jsonObj, isAreaCha
310
409
  supportNegativeData: true,
311
410
  xAxisTitle: xAxisTitle,
312
411
  yAxisTitle: yAxisTitle,
412
+ secondaryYAxistitle: secondaryYAxisValues.secondaryYAxistitle,
413
+ secondaryYScaleOptions: secondaryYAxisValues.secondaryYScaleOptions,
313
414
  };
314
415
  }
315
416
  };
316
- export var transformPlotlyJsonToHorizontalBarWithAxisProps = function (jsonObj, colorMap, isDarkTheme) {
317
- var _a, _b, _c, _d, _e, _f, _g, _h;
318
- var data = jsonObj.data, layout = jsonObj.layout;
319
- var chartData = data
417
+ export var transformPlotlyJsonToHorizontalBarWithAxisProps = function (input, colorMap, isDarkTheme) {
418
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
419
+ var chartData = input.data
320
420
  .map(function (series, index) {
421
+ invalidate2Dseries(series, 'HBC');
321
422
  return series.y.map(function (yValue, i) {
322
423
  var color = getColor(yValue, colorMap, isDarkTheme);
323
424
  return {
@@ -331,46 +432,47 @@ export var transformPlotlyJsonToHorizontalBarWithAxisProps = function (jsonObj,
331
432
  .flat()
332
433
  //reversing the order to invert the Y bars order as required by plotly.
333
434
  .reverse();
334
- var chartHeight = typeof layout.height === 'number' ? layout.height : 450;
335
- var margin = typeof ((_a = layout.margin) === null || _a === void 0 ? void 0 : _a.l) === 'number' ? (_b = layout.margin) === null || _b === void 0 ? void 0 : _b.l : 0;
336
- var padding = typeof ((_c = layout.margin) === null || _c === void 0 ? void 0 : _c.pad) === 'number' ? (_d = layout.margin) === null || _d === void 0 ? void 0 : _d.pad : 0;
435
+ var chartHeight = (_b = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.height) !== null && _b !== void 0 ? _b : 450;
436
+ var margin = (_e = (_d = (_c = input.layout) === null || _c === void 0 ? void 0 : _c.margin) === null || _d === void 0 ? void 0 : _d.l) !== null && _e !== void 0 ? _e : 0;
437
+ var padding = (_h = (_g = (_f = input.layout) === null || _f === void 0 ? void 0 : _f.margin) === null || _g === void 0 ? void 0 : _g.pad) !== null && _h !== void 0 ? _h : 0;
337
438
  var availableHeight = chartHeight - margin - padding;
338
- var numberOfBars = data[0].y.length;
439
+ var numberOfBars = input.data[0].y.length;
339
440
  var scalingFactor = 0.01;
340
441
  var gapFactor = 1 / (1 + scalingFactor * numberOfBars);
341
442
  var barHeight = availableHeight / (numberOfBars * (1 + gapFactor));
342
- var _j = getTitles(layout), chartTitle = _j.chartTitle, xAxisTitle = _j.xAxisTitle, yAxisTitle = _j.yAxisTitle;
443
+ var _t = getTitles(input.layout), chartTitle = _t.chartTitle, xAxisTitle = _t.xAxisTitle, yAxisTitle = _t.yAxisTitle;
343
444
  return {
344
445
  data: chartData,
345
446
  chartTitle: chartTitle,
346
447
  xAxisTitle: xAxisTitle,
347
448
  yAxisTitle: yAxisTitle,
348
- secondaryYAxistitle: typeof ((_e = layout === null || layout === void 0 ? void 0 : layout.yaxis2) === null || _e === void 0 ? void 0 : _e.title) === 'string' ? (_f = layout === null || layout === void 0 ? void 0 : layout.yaxis2) === null || _f === void 0 ? void 0 : _f.title : ((_h = (_g = layout === null || layout === void 0 ? void 0 : layout.yaxis2) === null || _g === void 0 ? void 0 : _g.title) === null || _h === void 0 ? void 0 : _h.text) || '',
449
+ secondaryYAxistitle: typeof ((_k = (_j = input.layout) === null || _j === void 0 ? void 0 : _j.yaxis2) === null || _k === void 0 ? void 0 : _k.title) === 'string'
450
+ ? (_m = (_l = input.layout) === null || _l === void 0 ? void 0 : _l.yaxis2) === null || _m === void 0 ? void 0 : _m.title
451
+ : ((_q = (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.yaxis2) === null || _p === void 0 ? void 0 : _p.title) === null || _q === void 0 ? void 0 : _q.text) || '',
349
452
  barHeight: barHeight,
350
453
  showYAxisLables: true,
351
454
  styles: {
352
455
  root: {
353
456
  height: chartHeight,
354
- width: typeof layout.width === 'number' ? layout.width : 600,
457
+ width: (_s = (_r = input.layout) === null || _r === void 0 ? void 0 : _r.width) !== null && _s !== void 0 ? _s : 600,
355
458
  },
356
459
  },
357
460
  };
358
461
  };
359
- export var transformPlotlyJsonToHeatmapProps = function (jsonObj) {
462
+ export var transformPlotlyJsonToHeatmapProps = function (input) {
360
463
  var _a;
361
- var data = jsonObj.data, layout = jsonObj.layout;
362
- var firstData = data[0];
464
+ var firstData = input.data[0];
363
465
  var heatmapDataPoints = [];
364
466
  var zMin = Number.POSITIVE_INFINITY;
365
467
  var zMax = Number.NEGATIVE_INFINITY;
366
468
  (_a = firstData.x) === null || _a === void 0 ? void 0 : _a.forEach(function (xVal, xIdx) {
367
469
  var _a;
368
470
  (_a = firstData.y) === null || _a === void 0 ? void 0 : _a.forEach(function (yVal, yIdx) {
369
- var _a, _b, _c, _d;
471
+ var _a, _b, _c, _d, _e, _f;
370
472
  var zVal = (_b = (_a = firstData.z) === null || _a === void 0 ? void 0 : _a[yIdx]) === null || _b === void 0 ? void 0 : _b[xIdx];
371
473
  heatmapDataPoints.push({
372
- x: ((_c = layout.xaxis) === null || _c === void 0 ? void 0 : _c.type) === 'date' ? new Date(xVal) : xVal,
373
- y: ((_d = layout.yaxis) === null || _d === void 0 ? void 0 : _d.type) === 'date' ? new Date(yVal) : yVal,
474
+ x: ((_d = (_c = input.layout) === null || _c === void 0 ? void 0 : _c.xaxis) === null || _d === void 0 ? void 0 : _d.type) === 'date' ? xVal : xVal !== null && xVal !== void 0 ? xVal : 0,
475
+ y: ((_f = (_e = input.layout) === null || _e === void 0 ? void 0 : _e.yaxis) === null || _f === void 0 ? void 0 : _f.type) === 'date' ? yVal : yVal,
374
476
  value: zVal,
375
477
  rectText: zVal,
376
478
  });
@@ -379,16 +481,24 @@ export var transformPlotlyJsonToHeatmapProps = function (jsonObj) {
379
481
  });
380
482
  });
381
483
  var heatmapData = {
382
- legend: typeof firstData.name === 'string' ? firstData.name : '',
484
+ legend: firstData.name,
383
485
  data: heatmapDataPoints,
384
486
  value: 0,
385
487
  };
386
- // Convert normalized values to actual values
387
- var domainValuesForColorScale = firstData.colorscale
488
+ // Initialize domain and range to default values
489
+ var defaultDomain = [zMin, zMax];
490
+ var defaultRange = [
491
+ getColorFromToken(DataVizPalette.color1),
492
+ getColorFromToken(DataVizPalette.color2),
493
+ getColorFromToken(DataVizPalette.color3),
494
+ ];
495
+ var domainValuesForColorScale = Array.isArray(firstData.colorscale)
388
496
  ? firstData.colorscale.map(function (arr) { return arr[0] * (zMax - zMin) + zMin; })
389
- : [];
390
- var rangeValuesForColorScale = firstData.colorscale ? firstData.colorscale.map(function (arr) { return arr[1]; }) : [];
391
- var _b = getTitles(layout), chartTitle = _b.chartTitle, xAxisTitle = _b.xAxisTitle, yAxisTitle = _b.yAxisTitle;
497
+ : defaultDomain;
498
+ var rangeValuesForColorScale = Array.isArray(firstData.colorscale)
499
+ ? firstData.colorscale.map(function (arr) { return arr[1]; })
500
+ : defaultRange;
501
+ var _b = getTitles(input.layout), chartTitle = _b.chartTitle, xAxisTitle = _b.xAxisTitle, yAxisTitle = _b.yAxisTitle;
392
502
  return {
393
503
  data: [heatmapData],
394
504
  domainValuesForColorScale: domainValuesForColorScale,
@@ -401,22 +511,20 @@ export var transformPlotlyJsonToHeatmapProps = function (jsonObj) {
401
511
  sortOrder: 'none',
402
512
  };
403
513
  };
404
- export var transformPlotlyJsonToSankeyProps = function (jsonObj, colorMap, isDarkTheme) {
405
- var _a, _b;
406
- var data = jsonObj.data, layout = jsonObj.layout;
407
- var _c = data[0], link = _c.link, node = _c.node;
408
- var validLinks = link.value
514
+ export var transformPlotlyJsonToSankeyProps = function (input, colorMap, isDarkTheme) {
515
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
516
+ var _k = input.data[0], link = _k.link, node = _k.node;
517
+ var validLinks = ((_a = link === null || link === void 0 ? void 0 : link.value) !== null && _a !== void 0 ? _a : [])
409
518
  .map(function (val, index) { return ({
410
519
  value: val,
411
- source: link.source[index],
412
- target: link.target[index],
520
+ source: link === null || link === void 0 ? void 0 : link.source[index],
521
+ target: link === null || link === void 0 ? void 0 : link.target[index],
413
522
  }); })
414
523
  // eslint-disable-next-line @typescript-eslint/no-shadow
415
- //@ts-expect-error Dynamic link object. Ignore for now.
416
524
  // Filter out negative nodes, unequal nodes and self-references (circular links)
417
525
  .filter(function (x) { return x.source >= 0 && x.target >= 0 && x.source !== x.target; });
418
526
  var sankeyChartData = {
419
- nodes: node.label.map(function (label, index) {
527
+ nodes: (_b = node.label) === null || _b === void 0 ? void 0 : _b.map(function (label, index) {
420
528
  var color = getColor(label, colorMap, isDarkTheme);
421
529
  return {
422
530
  nodeId: index,
@@ -428,13 +536,13 @@ export var transformPlotlyJsonToSankeyProps = function (jsonObj, colorMap, isDar
428
536
  return __assign({}, validLink);
429
537
  }),
430
538
  };
431
- var width = typeof (layout === null || layout === void 0 ? void 0 : layout.width) === 'number' ? layout === null || layout === void 0 ? void 0 : layout.width : 440;
432
- var height = typeof (layout === null || layout === void 0 ? void 0 : layout.height) === 'number' ? layout === null || layout === void 0 ? void 0 : layout.height : 220;
539
+ var width = (_d = (_c = input.layout) === null || _c === void 0 ? void 0 : _c.width) !== null && _d !== void 0 ? _d : 440;
540
+ var height = (_f = (_e = input.layout) === null || _e === void 0 ? void 0 : _e.height) !== null && _f !== void 0 ? _f : 220;
433
541
  var styles = {
434
- root: __assign({}, (typeof ((_a = layout.font) === null || _a === void 0 ? void 0 : _a.size) === 'number' ? { fontSize: (_b = layout.font) === null || _b === void 0 ? void 0 : _b.size } : {})),
542
+ root: __assign({}, (((_h = (_g = input.layout) === null || _g === void 0 ? void 0 : _g.font) === null || _h === void 0 ? void 0 : _h.size) ? { fontSize: (_j = input.layout.font) === null || _j === void 0 ? void 0 : _j.size } : {})),
435
543
  };
436
544
  var shouldResize = width + height;
437
- var chartTitle = getTitles(layout).chartTitle;
545
+ var chartTitle = getTitles(input.layout).chartTitle;
438
546
  return {
439
547
  data: {
440
548
  chartTitle: chartTitle,
@@ -447,10 +555,9 @@ export var transformPlotlyJsonToSankeyProps = function (jsonObj, colorMap, isDar
447
555
  enableReflow: true,
448
556
  };
449
557
  };
450
- export var transformPlotlyJsonToGaugeProps = function (jsonObj, colorMap, isDarkTheme) {
451
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
452
- var data = jsonObj.data, layout = jsonObj.layout;
453
- var firstData = data[0];
558
+ export var transformPlotlyJsonToGaugeProps = function (input, colorMap, isDarkTheme) {
559
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
560
+ var firstData = input.data[0];
454
561
  var segments = ((_b = (_a = firstData.gauge) === null || _a === void 0 ? void 0 : _a.steps) === null || _b === void 0 ? void 0 : _b.length)
455
562
  ? firstData.gauge.steps.map(function (step, index) {
456
563
  var _a, _b;
@@ -465,18 +572,18 @@ export var transformPlotlyJsonToGaugeProps = function (jsonObj, colorMap, isDark
465
572
  : [
466
573
  {
467
574
  legend: 'Current',
468
- size: (_c = firstData.value) !== null && _c !== void 0 ? _c : 0 - ((_f = (_e = (_d = firstData.gauge) === null || _d === void 0 ? void 0 : _d.range) === null || _e === void 0 ? void 0 : _e[0]) !== null && _f !== void 0 ? _f : 0),
575
+ size: (_c = firstData.value) !== null && _c !== void 0 ? _c : 0 - ((_g = (_f = (_e = (_d = firstData.gauge) === null || _d === void 0 ? void 0 : _d.axis) === null || _e === void 0 ? void 0 : _e.range) === null || _f === void 0 ? void 0 : _f[0]) !== null && _g !== void 0 ? _g : 0),
469
576
  color: getColor('Current', colorMap, isDarkTheme),
470
577
  },
471
578
  {
472
579
  legend: 'Target',
473
- size: ((_j = (_h = (_g = firstData.gauge) === null || _g === void 0 ? void 0 : _g.range) === null || _h === void 0 ? void 0 : _h[1]) !== null && _j !== void 0 ? _j : 100) - ((_k = firstData.value) !== null && _k !== void 0 ? _k : 0),
580
+ size: ((_l = (_k = (_j = (_h = firstData.gauge) === null || _h === void 0 ? void 0 : _h.axis) === null || _j === void 0 ? void 0 : _j.range) === null || _k === void 0 ? void 0 : _k[1]) !== null && _l !== void 0 ? _l : 100) - ((_m = firstData.value) !== null && _m !== void 0 ? _m : 0),
474
581
  color: DataVizPalette.disabled,
475
582
  },
476
583
  ];
477
584
  var sublabel;
478
585
  var sublabelColor;
479
- if (typeof ((_l = firstData.delta) === null || _l === void 0 ? void 0 : _l.reference) === 'number') {
586
+ if ((_o = firstData.delta) === null || _o === void 0 ? void 0 : _o.reference) {
480
587
  var diff = firstData.value - firstData.delta.reference;
481
588
  if (diff >= 0) {
482
589
  sublabel = "\u25B2 ".concat(diff);
@@ -494,20 +601,20 @@ export var transformPlotlyJsonToGaugeProps = function (jsonObj, colorMap, isDark
494
601
  fill: sublabelColor,
495
602
  },
496
603
  };
497
- var chartTitle = getTitles(layout).chartTitle;
604
+ var chartTitle = getTitles(input.layout).chartTitle;
498
605
  return {
499
606
  segments: segments,
500
- chartValue: typeof firstData.value === 'number' ? firstData.value : 0,
607
+ chartValue: (_p = firstData.value) !== null && _p !== void 0 ? _p : 0,
501
608
  chartTitle: chartTitle,
502
609
  sublabel: sublabel,
503
610
  // range values can be null
504
- minValue: typeof ((_p = (_o = (_m = firstData.gauge) === null || _m === void 0 ? void 0 : _m.axis) === null || _o === void 0 ? void 0 : _o.range) === null || _p === void 0 ? void 0 : _p[0]) === 'number' ? (_s = (_r = (_q = firstData.gauge) === null || _q === void 0 ? void 0 : _q.axis) === null || _r === void 0 ? void 0 : _r.range) === null || _s === void 0 ? void 0 : _s[0] : undefined,
505
- maxValue: typeof ((_v = (_u = (_t = firstData.gauge) === null || _t === void 0 ? void 0 : _t.axis) === null || _u === void 0 ? void 0 : _u.range) === null || _v === void 0 ? void 0 : _v[1]) === 'number' ? (_y = (_x = (_w = firstData.gauge) === null || _w === void 0 ? void 0 : _w.axis) === null || _x === void 0 ? void 0 : _x.range) === null || _y === void 0 ? void 0 : _y[1] : undefined,
506
- chartValueFormat: function () { return firstData.value; },
507
- width: typeof (layout === null || layout === void 0 ? void 0 : layout.width) === 'number' ? layout === null || layout === void 0 ? void 0 : layout.width : 440,
508
- height: typeof (layout === null || layout === void 0 ? void 0 : layout.height) === 'number' ? layout === null || layout === void 0 ? void 0 : layout.height : 220,
611
+ minValue: typeof ((_s = (_r = (_q = firstData.gauge) === null || _q === void 0 ? void 0 : _q.axis) === null || _r === void 0 ? void 0 : _r.range) === null || _s === void 0 ? void 0 : _s[0]) === 'number' ? (_v = (_u = (_t = firstData.gauge) === null || _t === void 0 ? void 0 : _t.axis) === null || _u === void 0 ? void 0 : _u.range) === null || _v === void 0 ? void 0 : _v[0] : undefined,
612
+ maxValue: typeof ((_y = (_x = (_w = firstData.gauge) === null || _w === void 0 ? void 0 : _w.axis) === null || _x === void 0 ? void 0 : _x.range) === null || _y === void 0 ? void 0 : _y[1]) === 'number' ? (_1 = (_0 = (_z = firstData.gauge) === null || _z === void 0 ? void 0 : _z.axis) === null || _0 === void 0 ? void 0 : _0.range) === null || _1 === void 0 ? void 0 : _1[1] : undefined,
613
+ chartValueFormat: function () { var _a, _b; return (_b = (_a = firstData.value) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : ''; },
614
+ width: (_3 = (_2 = input.layout) === null || _2 === void 0 ? void 0 : _2.width) !== null && _3 !== void 0 ? _3 : 440,
615
+ height: (_5 = (_4 = input.layout) === null || _4 === void 0 ? void 0 : _4.height) !== null && _5 !== void 0 ? _5 : 220,
509
616
  styles: styles,
510
- variant: ((_0 = (_z = firstData.gauge) === null || _z === void 0 ? void 0 : _z.steps) === null || _0 === void 0 ? void 0 : _0.length) ? GaugeChartVariant.MultipleSegments : GaugeChartVariant.SingleSegment,
617
+ variant: ((_7 = (_6 = firstData.gauge) === null || _6 === void 0 ? void 0 : _6.steps) === null || _7 === void 0 ? void 0 : _7.length) ? GaugeChartVariant.MultipleSegments : GaugeChartVariant.SingleSegment,
511
618
  };
512
619
  };
513
620
  var MAX_DEPTH = 8;