@fluentui/react-charting 5.23.91 → 5.23.93
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.
- package/CHANGELOG.json +61 -1
- package/CHANGELOG.md +25 -2
- package/dist/react-charting.d.ts +5 -1
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +2 -0
- package/lib/components/DeclarativeChart/DeclarativeChart.js +9 -2
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +4 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +239 -94
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/LineChart/LineChart.base.d.ts +2 -0
- package/lib/components/LineChart/LineChart.base.js +58 -17
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/LineChart/LineChart.types.d.ts +1 -1
- package/lib/components/LineChart/LineChart.types.js.map +1 -1
- package/lib/types/IDataPoint.d.ts +4 -0
- package/lib/types/IDataPoint.js.map +1 -1
- package/lib/utilities/image-export-utils.js +18 -1
- package/lib/utilities/image-export-utils.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +9 -2
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +4 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +243 -95
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.d.ts +2 -0
- package/lib-amd/components/LineChart/LineChart.base.js +58 -17
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.types.d.ts +1 -1
- package/lib-amd/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-amd/types/IDataPoint.d.ts +4 -0
- package/lib-amd/types/IDataPoint.js.map +1 -1
- package/lib-amd/utilities/image-export-utils.js +18 -1
- package/lib-amd/utilities/image-export-utils.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +9 -2
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +4 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +243 -95
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.d.ts +2 -0
- package/lib-commonjs/components/LineChart/LineChart.base.js +58 -17
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.d.ts +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-commonjs/types/IDataPoint.d.ts +4 -0
- package/lib-commonjs/types/IDataPoint.js.map +1 -1
- package/lib-commonjs/utilities/image-export-utils.js +18 -1
- package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
- package/package.json +2 -2
- package/src/components/LineChart/LineChart.types.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/colors", "../GaugeChart/index", "../../utilities/utilities", "@fluentui/chart-utilities", "d3-time-format", "d3-shape", "./PlotlyColorAdapter"], function (require, exports, tslib_1, d3_array_1, d3_scale_1, colors_1, index_1, utilities_1, chart_utilities_1, d3_time_format_1, d3_shape_1, PlotlyColorAdapter_1) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.findArrayAttributes = exports.projectPolarToCartesian = exports.transformPlotlyJsonToChartTableProps = exports.transformPlotlyJsonToGaugeProps = exports.transformPlotlyJsonToSankeyProps = exports.transformPlotlyJsonToHeatmapProps = exports.transformPlotlyJsonToHorizontalBarWithAxisProps = exports.transformPlotlyJsonToScatterChartProps = exports.transformPlotlyJsonToVBCProps = exports.transformPlotlyJsonToGVBCProps = exports.transformPlotlyJsonToVSBCProps = exports.transformPlotlyJsonToDonutProps = exports._getGaugeAxisColor = exports.correctYearMonth = exports.isMonthArray = void 0;
|
|
4
|
+
exports.getValidXYRanges = exports.getNumberAtIndexOrDefault = exports.isInvalidValue = exports.findArrayAttributes = exports.projectPolarToCartesian = exports.transformPlotlyJsonToChartTableProps = exports.transformPlotlyJsonToGaugeProps = exports.transformPlotlyJsonToSankeyProps = exports.transformPlotlyJsonToHeatmapProps = exports.transformPlotlyJsonToHorizontalBarWithAxisProps = exports.transformPlotlyJsonToScatterChartProps = exports.transformPlotlyJsonToVBCProps = exports.transformPlotlyJsonToGVBCProps = exports.transformPlotlyJsonToVSBCProps = exports.transformPlotlyJsonToDonutProps = exports._getGaugeAxisColor = exports.correctYearMonth = exports.isMonthArray = void 0;
|
|
5
5
|
var dashOptions = {
|
|
6
6
|
dot: {
|
|
7
7
|
strokeDasharray: '1, 5',
|
|
@@ -47,7 +47,8 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
|
|
|
47
47
|
return parseFullMonth(possiblyMonthValue) !== null || parseShortMonth(possiblyMonthValue) !== null;
|
|
48
48
|
};
|
|
49
49
|
var isMonthArray = function (data) {
|
|
50
|
-
|
|
50
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
51
|
+
return (0, chart_utilities_1.isArrayOfType)(data, function (value) { return isMonth(value) || value === null; });
|
|
51
52
|
};
|
|
52
53
|
exports.isMonthArray = isMonthArray;
|
|
53
54
|
function getTitles(layout) {
|
|
@@ -69,19 +70,29 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
|
|
|
69
70
|
var parsedDate = "".concat(possiblyMonthValue, " 01, ").concat(presentYear);
|
|
70
71
|
return (0, chart_utilities_1.isDate)(parsedDate) ? new Date(parsedDate) : null;
|
|
71
72
|
});
|
|
72
|
-
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
var filteredDateIndexPairs = dates.map(function (date, index) { return [date, index]; }).filter(function (_a) {
|
|
74
|
+
var date = _a[0];
|
|
75
|
+
return date !== null;
|
|
76
|
+
});
|
|
77
|
+
for (var i = filteredDateIndexPairs.length - 1; i > 0; i--) {
|
|
78
|
+
var currentDate = filteredDateIndexPairs[i][0];
|
|
79
|
+
var previousDate = filteredDateIndexPairs[i - 1][0];
|
|
80
|
+
var currentMonth = currentDate.getMonth();
|
|
81
|
+
var previousMonth = previousDate.getMonth();
|
|
82
|
+
var currentYear = currentDate.getFullYear();
|
|
83
|
+
var previousYear = previousDate.getFullYear();
|
|
77
84
|
if (previousMonth >= currentMonth) {
|
|
78
|
-
|
|
85
|
+
filteredDateIndexPairs[i - 1][0].setFullYear(currentYear - 1);
|
|
79
86
|
}
|
|
80
87
|
else if (previousYear > currentYear) {
|
|
81
|
-
|
|
88
|
+
filteredDateIndexPairs[i - 1][0].setFullYear(currentYear);
|
|
82
89
|
}
|
|
90
|
+
dates[filteredDateIndexPairs[i - 1][1]] = filteredDateIndexPairs[i - 1][0];
|
|
83
91
|
}
|
|
84
92
|
xValues = xValues.map(function (month, index) {
|
|
93
|
+
if (dates[index] === null) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
85
96
|
return "".concat(month, " 01, ").concat(dates[index].getFullYear());
|
|
86
97
|
});
|
|
87
98
|
return xValues;
|
|
@@ -142,20 +153,22 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
|
|
|
142
153
|
var colors = (0, PlotlyColorAdapter_1.extractColor)((_c = (_b = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.template) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.colorway, colorwayType, (_d = firstData === null || firstData === void 0 ? void 0 : firstData.marker) === null || _d === void 0 ? void 0 : _d.colors, colorMap, isDarkTheme);
|
|
143
154
|
var mapLegendToDataPoint = {};
|
|
144
155
|
(_e = firstData.labels) === null || _e === void 0 ? void 0 : _e.forEach(function (label, index) {
|
|
145
|
-
var
|
|
156
|
+
var value = (0, exports.getNumberAtIndexOrDefault)(firstData.values, index);
|
|
157
|
+
if ((0, exports.isInvalidValue)(value) || value < 0) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
var legend = "".concat(label);
|
|
146
161
|
// resolve color for each legend from the extracted colors
|
|
147
|
-
var color = (0, PlotlyColorAdapter_1.resolveColor)(colors, index,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
mapLegendToDataPoint[label] = {
|
|
152
|
-
legend: label,
|
|
162
|
+
var color = (0, PlotlyColorAdapter_1.resolveColor)(colors, index, legend, colorMap, isDarkTheme);
|
|
163
|
+
if (!mapLegendToDataPoint[legend]) {
|
|
164
|
+
mapLegendToDataPoint[legend] = {
|
|
165
|
+
legend: legend,
|
|
153
166
|
data: value,
|
|
154
167
|
color: color,
|
|
155
168
|
};
|
|
156
169
|
}
|
|
157
170
|
else {
|
|
158
|
-
mapLegendToDataPoint[
|
|
171
|
+
mapLegendToDataPoint[legend].data += value;
|
|
159
172
|
}
|
|
160
173
|
});
|
|
161
174
|
var width = (_g = (_f = input.layout) === null || _f === void 0 ? void 0 : _f.width) !== null && _g !== void 0 ? _g : 440;
|
|
@@ -192,44 +205,61 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
|
|
|
192
205
|
var secondaryYAxisValues = getSecondaryYAxisValues(input.data, input.layout);
|
|
193
206
|
var _d = getLegendProps(input.data, input.layout), legends = _d.legends, hideLegend = _d.hideLegend;
|
|
194
207
|
input.data.forEach(function (series, index1) {
|
|
195
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
208
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
196
209
|
var isXYearCategory = (0, chart_utilities_1.isYearArray)(series.x); // Consider year as categorical not numeric continuous axis
|
|
197
210
|
// extract bar colors for each series only once
|
|
198
211
|
var extractedBarColors = (0, PlotlyColorAdapter_1.extractColor)((_c = (_b = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.template) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.colorway, colorwayType, (_d = series.marker) === null || _d === void 0 ? void 0 : _d.color, colorMap, isDarkTheme);
|
|
199
212
|
// extract line colors for each series only once
|
|
200
213
|
var extractedLineColors = (0, PlotlyColorAdapter_1.extractColor)((_g = (_f = (_e = input.layout) === null || _e === void 0 ? void 0 : _e.template) === null || _f === void 0 ? void 0 : _f.layout) === null || _g === void 0 ? void 0 : _g.colorway, colorwayType, (_h = series.line) === null || _h === void 0 ? void 0 : _h.color, colorMap, isDarkTheme);
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
var dashType = ((_c = series.line) === null || _c === void 0 ? void 0 : _c.dash) || 'solid';
|
|
222
|
-
var legendShape = dashType === 'dot' || dashType === 'dash' || dashType === 'dashdot' ? 'dottedLine' : 'default';
|
|
223
|
-
mapXToDataPoints[x].lineData.push(tslib_1.__assign(tslib_1.__assign({ legend: legend, legendShape: legendShape, y: yVal, color: lineColor }, (lineOptions ? { lineOptions: lineOptions } : {})), { useSecondaryYScale: usesSecondaryYScale(series) }));
|
|
224
|
-
if (!usesSecondaryYScale(series)) {
|
|
214
|
+
var validXYRanges = (0, exports.getValidXYRanges)(series);
|
|
215
|
+
validXYRanges.forEach(function (_a, rangeIdx) {
|
|
216
|
+
var rangeStart = _a[0], rangeEnd = _a[1];
|
|
217
|
+
var rangeXValues = series.x.slice(rangeStart, rangeEnd);
|
|
218
|
+
var rangeYValues = series.y.slice(rangeStart, rangeEnd);
|
|
219
|
+
rangeXValues.forEach(function (x, index2) {
|
|
220
|
+
var _a, _b;
|
|
221
|
+
if (!mapXToDataPoints[x]) {
|
|
222
|
+
mapXToDataPoints[x] = { xAxisPoint: isXYearCategory ? x.toString() : x, chartData: [], lineData: [] };
|
|
223
|
+
}
|
|
224
|
+
var legend = legends[index1];
|
|
225
|
+
// resolve color for each legend's bars from the extracted colors
|
|
226
|
+
var color = (0, PlotlyColorAdapter_1.resolveColor)(extractedBarColors, index1, legend, colorMap, isDarkTheme);
|
|
227
|
+
var yVal = rangeYValues[index2];
|
|
228
|
+
if (series.type === 'bar') {
|
|
229
|
+
mapXToDataPoints[x].chartData.push({
|
|
230
|
+
legend: legend,
|
|
231
|
+
data: yVal,
|
|
232
|
+
color: color,
|
|
233
|
+
});
|
|
225
234
|
yMaxValue = Math.max(yMaxValue, yVal);
|
|
226
|
-
yMinValue = Math.min(yMinValue, yVal);
|
|
227
235
|
}
|
|
228
|
-
|
|
236
|
+
else if (series.type === 'scatter' || !!fallbackVSBC) {
|
|
237
|
+
var lineColor = (0, PlotlyColorAdapter_1.resolveColor)(extractedLineColors, index1, legend, colorMap, isDarkTheme);
|
|
238
|
+
var lineOptions = getLineOptions(series.line);
|
|
239
|
+
var dashType = ((_a = series.line) === null || _a === void 0 ? void 0 : _a.dash) || 'solid';
|
|
240
|
+
var legendShape = dashType === 'dot' || dashType === 'dash' || dashType === 'dashdot'
|
|
241
|
+
? 'dottedLine'
|
|
242
|
+
: ((_b = series.mode) === null || _b === void 0 ? void 0 : _b.includes('markers'))
|
|
243
|
+
? 'circle'
|
|
244
|
+
: 'default';
|
|
245
|
+
mapXToDataPoints[x].lineData.push({
|
|
246
|
+
legend: legend + (validXYRanges.length > 1 ? ".".concat(rangeIdx + 1) : ''),
|
|
247
|
+
legendShape: legendShape,
|
|
248
|
+
y: yVal,
|
|
249
|
+
color: lineColor,
|
|
250
|
+
lineOptions: tslib_1.__assign(tslib_1.__assign({}, (lineOptions !== null && lineOptions !== void 0 ? lineOptions : {})), { mode: series.mode }),
|
|
251
|
+
useSecondaryYScale: usesSecondaryYScale(series),
|
|
252
|
+
});
|
|
253
|
+
if (!usesSecondaryYScale(series)) {
|
|
254
|
+
yMaxValue = Math.max(yMaxValue, yVal);
|
|
255
|
+
yMinValue = Math.min(yMinValue, yVal);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
});
|
|
229
259
|
});
|
|
230
260
|
});
|
|
231
261
|
var _e = getTitles(input.layout), chartTitle = _e.chartTitle, xAxisTitle = _e.xAxisTitle, yAxisTitle = _e.yAxisTitle;
|
|
232
|
-
return tslib_1.__assign(tslib_1.__assign({ data: Object.values(mapXToDataPoints), width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 350, barWidth: 'auto', yMaxValue: yMaxValue, yMinValue: yMinValue, chartTitle: chartTitle, xAxisTitle: xAxisTitle, yAxisTitle: yAxisTitle, mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, supportNegativeData: true });
|
|
262
|
+
return tslib_1.__assign(tslib_1.__assign({ data: Object.values(mapXToDataPoints), width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 350, barWidth: 'auto', yMaxValue: yMaxValue, yMinValue: yMinValue, chartTitle: chartTitle, xAxisTitle: xAxisTitle, yAxisTitle: yAxisTitle, mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, supportNegativeData: true, barGapMax: 2 });
|
|
233
263
|
};
|
|
234
264
|
exports.transformPlotlyJsonToVSBCProps = transformPlotlyJsonToVSBCProps;
|
|
235
265
|
var transformPlotlyJsonToGVBCProps = function (input, colorMap, colorwayType, isDarkTheme) {
|
|
@@ -242,7 +272,10 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
|
|
|
242
272
|
// extract colors for each series only once
|
|
243
273
|
var extractedColors = (0, PlotlyColorAdapter_1.extractColor)((_c = (_b = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.template) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.colorway, colorwayType, (_d = series.marker) === null || _d === void 0 ? void 0 : _d.color, colorMap, isDarkTheme);
|
|
244
274
|
(_e = series.x) === null || _e === void 0 ? void 0 : _e.forEach(function (x, xIndex) {
|
|
245
|
-
var _a
|
|
275
|
+
var _a;
|
|
276
|
+
if ((0, exports.isInvalidValue)(x) || (0, exports.isInvalidValue)((_a = series.y) === null || _a === void 0 ? void 0 : _a[xIndex])) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
246
279
|
if (!mapXToDataPoints[x]) {
|
|
247
280
|
mapXToDataPoints[x] = { name: x.toString(), series: [] };
|
|
248
281
|
}
|
|
@@ -252,7 +285,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
|
|
|
252
285
|
var color = (0, PlotlyColorAdapter_1.resolveColor)(extractedColors, index1, legend, colorMap, isDarkTheme);
|
|
253
286
|
mapXToDataPoints[x].series.push({
|
|
254
287
|
key: legend,
|
|
255
|
-
data:
|
|
288
|
+
data: series.y[xIndex],
|
|
256
289
|
xAxisCalloutData: x,
|
|
257
290
|
color: color,
|
|
258
291
|
legend: legend,
|
|
@@ -276,17 +309,26 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
|
|
|
276
309
|
}
|
|
277
310
|
// extract colors for each series only once
|
|
278
311
|
var extractedColors = (0, PlotlyColorAdapter_1.extractColor)((_c = (_b = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.template) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.colorway, colorwayType, (_d = series.marker) === null || _d === void 0 ? void 0 : _d.color, colorMap, isDarkTheme);
|
|
279
|
-
var
|
|
312
|
+
var xValues = [];
|
|
313
|
+
var yValues = [];
|
|
314
|
+
series.x.forEach(function (xVal, index) {
|
|
315
|
+
var yVal = (0, exports.getNumberAtIndexOrDefault)(series.y, index);
|
|
316
|
+
if ((0, exports.isInvalidValue)(xVal) || (0, exports.isInvalidValue)(yVal)) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
xValues.push(xVal);
|
|
320
|
+
yValues.push(yVal);
|
|
321
|
+
});
|
|
322
|
+
var isXString = isStringArray(xValues);
|
|
280
323
|
// TODO: In case of a single bin, add an empty bin of the same size to prevent the
|
|
281
324
|
// default bar width from being used and ensure the bar spans the full intended range.
|
|
282
|
-
var xBins = createBins(
|
|
325
|
+
var xBins = createBins(xValues, (_e = series.xbins) === null || _e === void 0 ? void 0 : _e.start, (_f = series.xbins) === null || _f === void 0 ? void 0 : _f.end, (_g = series.xbins) === null || _g === void 0 ? void 0 : _g.size);
|
|
283
326
|
var yBins = xBins.map(function () { return []; });
|
|
284
327
|
var total = 0;
|
|
285
|
-
|
|
286
|
-
var _a, _b;
|
|
328
|
+
xValues.forEach(function (xVal, index) {
|
|
287
329
|
var binIdx = findBinIndex(xBins, xVal, isXString);
|
|
288
330
|
if (binIdx !== -1) {
|
|
289
|
-
yBins[binIdx].push(
|
|
331
|
+
yBins[binIdx].push(yValues[index]);
|
|
290
332
|
}
|
|
291
333
|
});
|
|
292
334
|
var y = yBins.map(function (bin) {
|
|
@@ -326,12 +368,13 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
|
|
|
326
368
|
var secondaryYAxisValues = getSecondaryYAxisValues(input.data, input.layout, isAreaChart ? 0 : undefined, isAreaChart ? 0 : undefined);
|
|
327
369
|
var mode = 'tonexty';
|
|
328
370
|
var _g = getLegendProps(input.data, input.layout), legends = _g.legends, hideLegend = _g.hideLegend;
|
|
329
|
-
var chartData = input.data
|
|
330
|
-
|
|
371
|
+
var chartData = input.data
|
|
372
|
+
.map(function (series, index) {
|
|
373
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
331
374
|
// extract colors for each series only once
|
|
332
375
|
var extractedColors = (0, PlotlyColorAdapter_1.extractColor)((_c = (_b = (_a = input.layout) === null || _a === void 0 ? void 0 : _a.template) === null || _b === void 0 ? void 0 : _b.layout) === null || _c === void 0 ? void 0 : _c.colorway, colorwayType, isScatterMarkers ? (_d = series.marker) === null || _d === void 0 ? void 0 : _d.color : (_e = series.line) === null || _e === void 0 ? void 0 : _e.color, colorMap, isDarkTheme);
|
|
333
376
|
var xValues = series.x;
|
|
334
|
-
var isString =
|
|
377
|
+
var isString = isStringArray(xValues);
|
|
335
378
|
var isXDate = (0, chart_utilities_1.isDateArray)(xValues);
|
|
336
379
|
var isXNumber = (0, chart_utilities_1.isNumberArray)(xValues);
|
|
337
380
|
var legend = legends[index];
|
|
@@ -340,27 +383,50 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
|
|
|
340
383
|
mode = series.fill === 'tozeroy' ? 'tozeroy' : 'tonexty';
|
|
341
384
|
var lineOptions = getLineOptions(series.line);
|
|
342
385
|
var dashType = ((_f = series.line) === null || _f === void 0 ? void 0 : _f.dash) || 'solid';
|
|
343
|
-
var legendShape = dashType === 'dot' || dashType === 'dash' || dashType === 'dashdot'
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
386
|
+
var legendShape = dashType === 'dot' || dashType === 'dash' || dashType === 'dashdot'
|
|
387
|
+
? 'dottedLine'
|
|
388
|
+
: ((_g = series.mode) === null || _g === void 0 ? void 0 : _g.includes('markers'))
|
|
389
|
+
? 'circle'
|
|
390
|
+
: 'default';
|
|
391
|
+
var validXYRanges = (0, exports.getValidXYRanges)(series);
|
|
392
|
+
return validXYRanges.map(function (_a, rangeIdx) {
|
|
393
|
+
var _b;
|
|
394
|
+
var rangeStart = _a[0], rangeEnd = _a[1];
|
|
395
|
+
var rangeXValues = xValues.slice(rangeStart, rangeEnd);
|
|
396
|
+
var rangeYValues = series.y.slice(rangeStart, rangeEnd);
|
|
397
|
+
var markerSizes = (0, chart_utilities_1.isArrayOrTypedArray)((_b = series.marker) === null || _b === void 0 ? void 0 : _b.size)
|
|
398
|
+
? series.marker.size.slice(rangeStart, rangeEnd)
|
|
399
|
+
: [];
|
|
400
|
+
return {
|
|
401
|
+
legend: legend,
|
|
402
|
+
legendShape: legendShape,
|
|
403
|
+
data: rangeXValues.map(function (x, i) {
|
|
404
|
+
var _a, _b;
|
|
405
|
+
return (tslib_1.__assign({ x: isString ? (isXDate ? new Date(x) : isXNumber ? parseFloat(x) : x) : x, y: rangeYValues[i] }, (Array.isArray((_a = series.marker) === null || _a === void 0 ? void 0 : _a.size)
|
|
406
|
+
? { markerSize: markerSizes[i] }
|
|
407
|
+
: typeof ((_b = series.marker) === null || _b === void 0 ? void 0 : _b.size) === 'number'
|
|
408
|
+
? { markerSize: series.marker.size }
|
|
409
|
+
: {})));
|
|
410
|
+
}),
|
|
411
|
+
color: seriesColor,
|
|
412
|
+
lineOptions: tslib_1.__assign(tslib_1.__assign({}, (lineOptions !== null && lineOptions !== void 0 ? lineOptions : {})), { mode: series.mode }),
|
|
413
|
+
useSecondaryYScale: usesSecondaryYScale(series),
|
|
414
|
+
};
|
|
415
|
+
});
|
|
416
|
+
})
|
|
417
|
+
.flat();
|
|
353
418
|
var yMinMaxValues = (0, utilities_1.findNumericMinMaxOfY)(chartData);
|
|
354
419
|
var _h = getTitles(input.layout), chartTitle = _h.chartTitle, xAxisTitle = _h.xAxisTitle, yAxisTitle = _h.yAxisTitle;
|
|
420
|
+
var numDataPoints = chartData.reduce(function (total, lineChartPoints) { return total + lineChartPoints.data.length; }, 0);
|
|
355
421
|
var chartProps = {
|
|
356
422
|
chartTitle: chartTitle,
|
|
357
423
|
lineChartData: chartData,
|
|
358
424
|
};
|
|
359
425
|
if (isAreaChart) {
|
|
360
|
-
return tslib_1.__assign(tslib_1.__assign({ data: chartProps, supportNegativeData: true, xAxisTitle: xAxisTitle, yAxisTitle: yAxisTitle }, secondaryYAxisValues), { mode: mode, width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 350, hideTickOverlap: true, hideLegend: hideLegend, useUTC: false });
|
|
426
|
+
return tslib_1.__assign(tslib_1.__assign({ data: chartProps, supportNegativeData: true, xAxisTitle: xAxisTitle, yAxisTitle: yAxisTitle }, secondaryYAxisValues), { mode: mode, width: (_a = input.layout) === null || _a === void 0 ? void 0 : _a.width, height: (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 350, hideTickOverlap: true, hideLegend: hideLegend, useUTC: false, optimizeLargeData: numDataPoints > 1000 });
|
|
361
427
|
}
|
|
362
428
|
else {
|
|
363
|
-
return tslib_1.__assign(tslib_1.__assign({ data: chartProps, supportNegativeData: true, xAxisTitle: xAxisTitle, yAxisTitle: yAxisTitle }, secondaryYAxisValues), { roundedTicks: true, yMinValue: yMinMaxValues.startValue, yMaxValue: yMinMaxValues.endValue, width: (_d = input.layout) === null || _d === void 0 ? void 0 : _d.width, height: (_f = (_e = input.layout) === null || _e === void 0 ? void 0 : _e.height) !== null && _f !== void 0 ? _f : 350, hideTickOverlap: true, enableReflow: false, hideLegend: hideLegend, useUTC: false });
|
|
429
|
+
return tslib_1.__assign(tslib_1.__assign({ data: chartProps, supportNegativeData: true, xAxisTitle: xAxisTitle, yAxisTitle: yAxisTitle }, secondaryYAxisValues), { roundedTicks: true, yMinValue: yMinMaxValues.startValue, yMaxValue: yMinMaxValues.endValue, width: (_d = input.layout) === null || _d === void 0 ? void 0 : _d.width, height: (_f = (_e = input.layout) === null || _e === void 0 ? void 0 : _e.height) !== null && _f !== void 0 ? _f : 350, hideTickOverlap: true, enableReflow: false, hideLegend: hideLegend, useUTC: false, optimizeLargeData: numDataPoints > 1000 });
|
|
364
430
|
}
|
|
365
431
|
};
|
|
366
432
|
exports.transformPlotlyJsonToScatterChartProps = transformPlotlyJsonToScatterChartProps;
|
|
@@ -375,14 +441,20 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
|
|
|
375
441
|
var legend = legends[index];
|
|
376
442
|
// resolve color for each legend's bars from the extracted colors
|
|
377
443
|
var color = (0, PlotlyColorAdapter_1.resolveColor)(extractedColors, index, legend, colorMap, isDarkTheme);
|
|
378
|
-
return series.y
|
|
444
|
+
return series.y
|
|
445
|
+
.map(function (yValue, i) {
|
|
446
|
+
var _a;
|
|
447
|
+
if ((0, exports.isInvalidValue)((_a = series.x) === null || _a === void 0 ? void 0 : _a[i]) || (0, exports.isInvalidValue)(yValue)) {
|
|
448
|
+
return null;
|
|
449
|
+
}
|
|
379
450
|
return {
|
|
380
451
|
x: series.x[i],
|
|
381
452
|
y: yValue,
|
|
382
453
|
legend: legend,
|
|
383
454
|
color: color,
|
|
384
455
|
};
|
|
385
|
-
})
|
|
456
|
+
})
|
|
457
|
+
.filter(function (point) { return point !== null; });
|
|
386
458
|
})
|
|
387
459
|
.reverse()
|
|
388
460
|
.flat()
|
|
@@ -421,24 +493,36 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
|
|
|
421
493
|
};
|
|
422
494
|
exports.transformPlotlyJsonToHorizontalBarWithAxisProps = transformPlotlyJsonToHorizontalBarWithAxisProps;
|
|
423
495
|
var transformPlotlyJsonToHeatmapProps = function (input) {
|
|
424
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
496
|
+
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, _8;
|
|
425
497
|
var firstData = input.data[0];
|
|
426
498
|
var heatmapDataPoints = [];
|
|
427
499
|
var zMin = Number.POSITIVE_INFINITY;
|
|
428
500
|
var zMax = Number.NEGATIVE_INFINITY;
|
|
429
501
|
if (firstData.type === 'histogram2d') {
|
|
430
|
-
var
|
|
431
|
-
var
|
|
432
|
-
var
|
|
433
|
-
|
|
502
|
+
var xValues_1 = [];
|
|
503
|
+
var yValues_1 = [];
|
|
504
|
+
var zValues_1 = [];
|
|
505
|
+
(_a = firstData.x) === null || _a === void 0 ? void 0 : _a.forEach(function (xVal, index) {
|
|
506
|
+
var _a;
|
|
507
|
+
var zVal = (0, exports.getNumberAtIndexOrDefault)(firstData.z, index);
|
|
508
|
+
if ((0, exports.isInvalidValue)(xVal) || (0, exports.isInvalidValue)((_a = firstData.y) === null || _a === void 0 ? void 0 : _a[index]) || (0, exports.isInvalidValue)(zVal)) {
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
xValues_1.push(xVal);
|
|
512
|
+
yValues_1.push(firstData.y[index]);
|
|
513
|
+
zValues_1.push(zVal);
|
|
514
|
+
});
|
|
515
|
+
var isXString_1 = isStringArray(xValues_1);
|
|
516
|
+
var isYString_1 = isStringArray(yValues_1);
|
|
517
|
+
var xBins_1 = createBins(xValues_1, (_b = firstData.xbins) === null || _b === void 0 ? void 0 : _b.start, (_c = firstData.xbins) === null || _c === void 0 ? void 0 : _c.end, (_d = firstData.xbins) === null || _d === void 0 ? void 0 : _d.size);
|
|
518
|
+
var yBins_1 = createBins(yValues_1, (_e = firstData.ybins) === null || _e === void 0 ? void 0 : _e.start, (_f = firstData.ybins) === null || _f === void 0 ? void 0 : _f.end, (_g = firstData.ybins) === null || _g === void 0 ? void 0 : _g.size);
|
|
434
519
|
var zBins_1 = yBins_1.map(function () { return xBins_1.map(function () { return []; }); });
|
|
435
520
|
var total_1 = 0;
|
|
436
|
-
|
|
437
|
-
var _a, _b, _c;
|
|
521
|
+
xValues_1.forEach(function (xVal, index) {
|
|
438
522
|
var xBinIdx = findBinIndex(xBins_1, xVal, isXString_1);
|
|
439
|
-
var yBinIdx = findBinIndex(yBins_1,
|
|
523
|
+
var yBinIdx = findBinIndex(yBins_1, yValues_1[index], isYString_1);
|
|
440
524
|
if (xBinIdx !== -1 && yBinIdx !== -1) {
|
|
441
|
-
zBins_1[yBinIdx][xBinIdx].push(
|
|
525
|
+
zBins_1[yBinIdx][xBinIdx].push(zValues_1[index]);
|
|
442
526
|
}
|
|
443
527
|
});
|
|
444
528
|
var z_1 = zBins_1.map(function (row) {
|
|
@@ -496,13 +580,31 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
|
|
|
496
580
|
(0, colors_1.getColorFromToken)(colors_1.DataVizPalette.color2),
|
|
497
581
|
(0, colors_1.getColorFromToken)(colors_1.DataVizPalette.color3),
|
|
498
582
|
];
|
|
499
|
-
var
|
|
500
|
-
|
|
583
|
+
var colorscale = (_0 = (_u = (_q = (_m = (_k = firstData === null || firstData === void 0 ? void 0 : firstData.colorscale) !== null && _k !== void 0 ? _k : (_l = input.layout) === null || _l === void 0 ? void 0 : _l.colorscale) !== null && _m !== void 0 ? _m : (_p = (_o = input.layout) === null || _o === void 0 ? void 0 : _o.coloraxis) === null || _p === void 0 ? void 0 : _p.colorscale) !== null && _q !== void 0 ? _q : (_t = (_s = (_r = input.layout) === null || _r === void 0 ? void 0 : _r.template) === null || _s === void 0 ? void 0 : _s.layout) === null || _t === void 0 ? void 0 : _t.colorscale) !== null && _u !== void 0 ? _u : (firstData.type === 'histogram2d' && ((_z = (_y = (_x = (_w = (_v = input.layout) === null || _v === void 0 ? void 0 : _v.template) === null || _w === void 0 ? void 0 : _w.data) === null || _x === void 0 ? void 0 : _x.histogram2d) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.colorscale))) !== null && _0 !== void 0 ? _0 : (_5 = (_4 = (_3 = (_2 = (_1 = input.layout) === null || _1 === void 0 ? void 0 : _1.template) === null || _2 === void 0 ? void 0 : _2.data) === null || _3 === void 0 ? void 0 : _3.heatmap) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.colorscale;
|
|
584
|
+
// determine if the types diverging, sequential or sequentialminus are present in colorscale
|
|
585
|
+
if (colorscale &&
|
|
586
|
+
typeof colorscale === 'object' &&
|
|
587
|
+
('diverging' in colorscale || 'sequential' in colorscale || 'sequentialminus' in colorscale)) {
|
|
588
|
+
var isDivergent = zMin < 0 && zMax > 0; // Data spans both positive and negative values
|
|
589
|
+
var isSequential = zMin >= 0; // Data is entirely positive
|
|
590
|
+
var isSequentialMinus = zMax <= 0; // Data is entirely negative
|
|
591
|
+
if (isDivergent) {
|
|
592
|
+
colorscale = colorscale === null || colorscale === void 0 ? void 0 : colorscale.diverging;
|
|
593
|
+
}
|
|
594
|
+
else if (isSequential) {
|
|
595
|
+
colorscale = colorscale === null || colorscale === void 0 ? void 0 : colorscale.sequential;
|
|
596
|
+
}
|
|
597
|
+
else if (isSequentialMinus) {
|
|
598
|
+
colorscale = colorscale === null || colorscale === void 0 ? void 0 : colorscale.sequentialminus;
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
var domainValuesForColorScale = Array.isArray(colorscale)
|
|
602
|
+
? colorscale.map(function (arr) { return arr[0] * (zMax - zMin) + zMin; })
|
|
501
603
|
: defaultDomain;
|
|
502
|
-
var rangeValuesForColorScale = Array.isArray(
|
|
503
|
-
?
|
|
604
|
+
var rangeValuesForColorScale = Array.isArray(colorscale)
|
|
605
|
+
? colorscale.map(function (arr) { return arr[1]; })
|
|
504
606
|
: defaultRange;
|
|
505
|
-
var
|
|
607
|
+
var _9 = getTitles(input.layout), chartTitle = _9.chartTitle, xAxisTitle = _9.xAxisTitle, yAxisTitle = _9.yAxisTitle;
|
|
506
608
|
return {
|
|
507
609
|
data: [heatmapData],
|
|
508
610
|
domainValuesForColorScale: domainValuesForColorScale,
|
|
@@ -513,8 +615,8 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
|
|
|
513
615
|
xAxisTitle: xAxisTitle,
|
|
514
616
|
yAxisTitle: yAxisTitle,
|
|
515
617
|
sortOrder: 'none',
|
|
516
|
-
width: (
|
|
517
|
-
height: (
|
|
618
|
+
width: (_6 = input.layout) === null || _6 === void 0 ? void 0 : _6.width,
|
|
619
|
+
height: (_8 = (_7 = input.layout) === null || _7 === void 0 ? void 0 : _7.height) !== null && _8 !== void 0 ? _8 : 350,
|
|
518
620
|
hideTickOverlap: true,
|
|
519
621
|
noOfCharsToTruncate: 20,
|
|
520
622
|
showYAxisLablesTooltip: true,
|
|
@@ -525,13 +627,19 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
|
|
|
525
627
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
526
628
|
var _m = input.data[0], link = _m.link, node = _m.node;
|
|
527
629
|
var validLinks = ((_a = link === null || link === void 0 ? void 0 : link.value) !== null && _a !== void 0 ? _a : [])
|
|
528
|
-
.map(function (val, index) {
|
|
529
|
-
|
|
530
|
-
source: link === null || link === void 0 ? void 0 : link.
|
|
531
|
-
|
|
532
|
-
|
|
630
|
+
.map(function (val, index) {
|
|
631
|
+
var _a, _b;
|
|
632
|
+
if ((0, exports.isInvalidValue)(val) || (0, exports.isInvalidValue)((_a = link === null || link === void 0 ? void 0 : link.source) === null || _a === void 0 ? void 0 : _a[index]) || (0, exports.isInvalidValue)((_b = link === null || link === void 0 ? void 0 : link.target) === null || _b === void 0 ? void 0 : _b[index])) {
|
|
633
|
+
return null;
|
|
634
|
+
}
|
|
635
|
+
return {
|
|
636
|
+
value: val,
|
|
637
|
+
source: link === null || link === void 0 ? void 0 : link.source[index],
|
|
638
|
+
target: link === null || link === void 0 ? void 0 : link.target[index],
|
|
639
|
+
};
|
|
640
|
+
})
|
|
533
641
|
// Filter out negative nodes, unequal nodes and self-references (circular links)
|
|
534
|
-
.filter(function (x) { return x.source >= 0 && x.target >= 0 && x.source !== x.target; });
|
|
642
|
+
.filter(function (x) { return x !== null && x.source >= 0 && x.target >= 0 && x.source !== x.target; });
|
|
535
643
|
var extractedNodeColors = (0, PlotlyColorAdapter_1.extractColor)((_d = (_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.template) === null || _c === void 0 ? void 0 : _c.layout) === null || _d === void 0 ? void 0 : _d.colorway, colorwayType, node === null || node === void 0 ? void 0 : node.color, colorMap, isDarkTheme);
|
|
536
644
|
var sankeyChartData = {
|
|
537
645
|
nodes: (_e = node.label) === null || _e === void 0 ? void 0 : _e.map(function (label, index) {
|
|
@@ -676,16 +784,20 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
|
|
|
676
784
|
};
|
|
677
785
|
exports.transformPlotlyJsonToChartTableProps = transformPlotlyJsonToChartTableProps;
|
|
678
786
|
var projectPolarToCartesian = function (input) {
|
|
787
|
+
var _a, _b, _c, _d;
|
|
679
788
|
var projection = tslib_1.__assign({}, input);
|
|
680
789
|
for (var sindex = 0; sindex < input.data.length; sindex++) {
|
|
681
790
|
var series = input.data[sindex];
|
|
682
791
|
series.x = [];
|
|
683
792
|
series.y = [];
|
|
684
|
-
for (var ptindex = 0; ptindex < series.r.length; ptindex++) {
|
|
793
|
+
for (var ptindex = 0; ptindex < ((_b = (_a = series.r) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0); ptindex++) {
|
|
794
|
+
if ((0, exports.isInvalidValue)((_c = series.theta) === null || _c === void 0 ? void 0 : _c[ptindex]) || (0, exports.isInvalidValue)((_d = series.r) === null || _d === void 0 ? void 0 : _d[ptindex])) {
|
|
795
|
+
continue;
|
|
796
|
+
}
|
|
685
797
|
var thetaRad = (series.theta[ptindex] * Math.PI) / 180;
|
|
686
798
|
var radius = series.r[ptindex];
|
|
687
|
-
series.x
|
|
688
|
-
series.y
|
|
799
|
+
series.x.push(radius * Math.cos(thetaRad));
|
|
800
|
+
series.y.push(radius * Math.sin(thetaRad));
|
|
689
801
|
}
|
|
690
802
|
projection.data[sindex] = series;
|
|
691
803
|
}
|
|
@@ -773,7 +885,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
|
|
|
773
885
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
774
886
|
var isStringArray = function (arr) {
|
|
775
887
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
776
|
-
return (0, chart_utilities_1.isArrayOfType)(arr, function (value) { return typeof value === 'string'; });
|
|
888
|
+
return (0, chart_utilities_1.isArrayOfType)(arr, function (value) { return typeof value === 'string' || value === null; });
|
|
777
889
|
};
|
|
778
890
|
// TODO: Use binary search to find the appropriate bin for numeric value.
|
|
779
891
|
var findBinIndex = function (bins, value, isString) {
|
|
@@ -885,5 +997,41 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "../../utilities/
|
|
|
885
997
|
hideLegend: (layout === null || layout === void 0 ? void 0 : layout.showlegend) === false || ((layout === null || layout === void 0 ? void 0 : layout.showlegend) !== true && legends.length < 2) ? true : hideLegends,
|
|
886
998
|
};
|
|
887
999
|
};
|
|
1000
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1001
|
+
var isInvalidValue = function (value) {
|
|
1002
|
+
return typeof value === 'undefined' || value === null || (typeof value === 'number' && !isFinite(value));
|
|
1003
|
+
};
|
|
1004
|
+
exports.isInvalidValue = isInvalidValue;
|
|
1005
|
+
var getNumberAtIndexOrDefault = function (data, index) {
|
|
1006
|
+
if ((0, chart_utilities_1.isArrayOrTypedArray)(data)) {
|
|
1007
|
+
if (typeof data[index] !== 'number' || !isFinite(data[index])) {
|
|
1008
|
+
return;
|
|
1009
|
+
}
|
|
1010
|
+
return data[index];
|
|
1011
|
+
}
|
|
1012
|
+
return 1;
|
|
1013
|
+
};
|
|
1014
|
+
exports.getNumberAtIndexOrDefault = getNumberAtIndexOrDefault;
|
|
1015
|
+
var getValidXYRanges = function (series) {
|
|
1016
|
+
if (!(0, chart_utilities_1.isArrayOrTypedArray)(series.x) || !(0, chart_utilities_1.isArrayOrTypedArray)(series.y)) {
|
|
1017
|
+
return [];
|
|
1018
|
+
}
|
|
1019
|
+
var ranges = [];
|
|
1020
|
+
var start = 0;
|
|
1021
|
+
var end = 0;
|
|
1022
|
+
for (; end < series.x.length; end++) {
|
|
1023
|
+
if ((0, exports.isInvalidValue)(series.x[end]) || (0, exports.isInvalidValue)(series.y[end])) {
|
|
1024
|
+
if (end - start > 0) {
|
|
1025
|
+
ranges.push([start, end]);
|
|
1026
|
+
}
|
|
1027
|
+
start = end + 1;
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
if (end - start > 0) {
|
|
1031
|
+
ranges.push([start, end]);
|
|
1032
|
+
}
|
|
1033
|
+
return ranges;
|
|
1034
|
+
};
|
|
1035
|
+
exports.getValidXYRanges = getValidXYRanges;
|
|
888
1036
|
});
|
|
889
1037
|
//# sourceMappingURL=PlotlySchemaAdapter.js.map
|