@fluentui/react-charting 5.24.33 → 5.24.34
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 +37 -1
- package/CHANGELOG.md +12 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +68 -7
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +68 -7
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +68 -7
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/package.json +2 -5
- package/project.json +1 -155
|
@@ -407,12 +407,12 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
407
407
|
};
|
|
408
408
|
exports.transformPlotlyJsonToDonutProps = transformPlotlyJsonToDonutProps;
|
|
409
409
|
var transformPlotlyJsonToVSBCProps = function (input, isMultiPlot, colorMap, colorwayType, isDarkTheme, fallbackVSBC) {
|
|
410
|
-
var _a, _b, _c, _d;
|
|
410
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
411
411
|
var mapXToDataPoints = {};
|
|
412
412
|
var yMaxValue = 0;
|
|
413
413
|
var yMinValue = 0;
|
|
414
414
|
var secondaryYAxisValues = getSecondaryYAxisValues(input.data, input.layout);
|
|
415
|
-
var
|
|
415
|
+
var _j = getLegendProps(input.data, input.layout, isMultiPlot), legends = _j.legends, hideLegend = _j.hideLegend;
|
|
416
416
|
var colorScale = undefined;
|
|
417
417
|
var yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
|
|
418
418
|
input.data.forEach(function (series, index1) {
|
|
@@ -483,8 +483,53 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
483
483
|
});
|
|
484
484
|
});
|
|
485
485
|
});
|
|
486
|
+
var xCategories = (_b = (_a = input.data[0]) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : [];
|
|
487
|
+
((_d = (_c = input.layout) === null || _c === void 0 ? void 0 : _c.shapes) !== null && _d !== void 0 ? _d : [])
|
|
488
|
+
.filter(function (shape) { return shape.type === 'line'; })
|
|
489
|
+
.forEach(function (shape, shapeIdx) {
|
|
490
|
+
var _a, _b, _c;
|
|
491
|
+
var lineColor = (_a = shape.line) === null || _a === void 0 ? void 0 : _a.color;
|
|
492
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
493
|
+
var resolveX = function (val) {
|
|
494
|
+
if (typeof val === 'number' && Array.isArray(xCategories) && xCategories[val] !== undefined) {
|
|
495
|
+
return xCategories[val];
|
|
496
|
+
}
|
|
497
|
+
return val;
|
|
498
|
+
};
|
|
499
|
+
var x0Key = resolveX(shape.x0);
|
|
500
|
+
var x1Key = resolveX(shape.x1);
|
|
501
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
502
|
+
var resolveY = function (val) {
|
|
503
|
+
if (shape.yref === 'paper') {
|
|
504
|
+
if (val === 0) {
|
|
505
|
+
return yMinValue;
|
|
506
|
+
}
|
|
507
|
+
if (val === 1) {
|
|
508
|
+
return yMaxValue;
|
|
509
|
+
}
|
|
510
|
+
return yMinValue + val * (yMaxValue - yMinValue);
|
|
511
|
+
}
|
|
512
|
+
return val;
|
|
513
|
+
};
|
|
514
|
+
var y0Val = resolveY(shape.y0);
|
|
515
|
+
var y1Val = resolveY(shape.y1);
|
|
516
|
+
mapXToDataPoints[x0Key].lineData.push({
|
|
517
|
+
legend: "Reference_".concat(shapeIdx),
|
|
518
|
+
y: y0Val,
|
|
519
|
+
color: (_b = (0, d3_color_1.rgb)(lineColor).formatHex8()) !== null && _b !== void 0 ? _b : lineColor,
|
|
520
|
+
lineOptions: getLineOptions(shape.line),
|
|
521
|
+
useSecondaryYScale: false,
|
|
522
|
+
});
|
|
523
|
+
mapXToDataPoints[x1Key].lineData.push({
|
|
524
|
+
legend: "Reference_".concat(shapeIdx),
|
|
525
|
+
y: y1Val,
|
|
526
|
+
color: (_c = (0, d3_color_1.rgb)(lineColor).formatHex8()) !== null && _c !== void 0 ? _c : lineColor,
|
|
527
|
+
lineOptions: getLineOptions(shape.line),
|
|
528
|
+
useSecondaryYScale: false,
|
|
529
|
+
});
|
|
530
|
+
});
|
|
486
531
|
var vsbcData = Object.values(mapXToDataPoints);
|
|
487
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: vsbcData, width: (
|
|
532
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ data: vsbcData, width: (_e = input.layout) === null || _e === void 0 ? void 0 : _e.width, height: (_g = (_f = input.layout) === null || _f === void 0 ? void 0 : _f.height) !== null && _g !== void 0 ? _g : 350, barWidth: 'auto', yMaxValue: yMaxValue, yMinValue: yMinValue, mode: 'plotly' }, secondaryYAxisValues), { hideTickOverlap: true, hideLegend: hideLegend, roundCorners: true, supportNegativeData: true, barGapMax: 2, showYAxisLables: true, noOfCharsToTruncate: 20, showYAxisLablesTooltip: true, wrapXAxisLables: typeof ((_h = vsbcData[0]) === null || _h === void 0 ? void 0 : _h.xAxisPoint) === 'string' }), getTitles(input.layout)), getAxisCategoryOrderProps(input.data, input.layout)), getYMinMaxValues(input.data[0], input.layout)), getXAxisTickFormat(input.data[0], input.layout)), yAxisTickFormat), getBarProps(input.data, input.layout)), getAxisTickProps(input.data, input.layout));
|
|
488
533
|
};
|
|
489
534
|
exports.transformPlotlyJsonToVSBCProps = transformPlotlyJsonToVSBCProps;
|
|
490
535
|
var transformPlotlyJsonToGVBCProps = function (input, isMultiPlot, colorMap, colorwayType, isDarkTheme) {
|
|
@@ -658,7 +703,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
658
703
|
};
|
|
659
704
|
exports.transformPlotlyJsonToScatterChartProps = transformPlotlyJsonToScatterChartProps;
|
|
660
705
|
var transformPlotlyJsonToScatterTraceProps = function (input, isMultiPlot, chartType, colorMap, colorwayType, isDarkTheme) {
|
|
661
|
-
var _a, _b, _c, _d;
|
|
706
|
+
var _a, _b, _c, _d, _e, _f;
|
|
662
707
|
var isScatterMarkers = [
|
|
663
708
|
'text',
|
|
664
709
|
'markers',
|
|
@@ -673,7 +718,7 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
673
718
|
var isScatterChart = chartType === 'scatter';
|
|
674
719
|
var secondaryYAxisValues = getSecondaryYAxisValues(input.data, input.layout);
|
|
675
720
|
var mode = 'tonexty';
|
|
676
|
-
var
|
|
721
|
+
var _g = getLegendProps(input.data, input.layout, isMultiPlot), legends = _g.legends, hideLegend = _g.hideLegend;
|
|
677
722
|
var yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
|
|
678
723
|
var chartData = input.data
|
|
679
724
|
.map(function (series, index) {
|
|
@@ -741,6 +786,22 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
741
786
|
});
|
|
742
787
|
})
|
|
743
788
|
.flat();
|
|
789
|
+
var lineShape = ((_c = (_b = input.layout) === null || _b === void 0 ? void 0 : _b.shapes) !== null && _c !== void 0 ? _c : [])
|
|
790
|
+
.filter(function (shape) { return shape.type === 'line'; })
|
|
791
|
+
.map(function (shape, shapeIdx) {
|
|
792
|
+
var _a, _b;
|
|
793
|
+
var lineColor = (_a = shape.line) === null || _a === void 0 ? void 0 : _a.color;
|
|
794
|
+
return {
|
|
795
|
+
legend: "Reference_".concat(shapeIdx),
|
|
796
|
+
data: [
|
|
797
|
+
{ x: shape.x0, y: shape.y0 },
|
|
798
|
+
{ x: shape.x1, y: shape.y1 },
|
|
799
|
+
],
|
|
800
|
+
color: (_b = (0, d3_color_1.rgb)(lineColor).formatHex8()) !== null && _b !== void 0 ? _b : lineColor,
|
|
801
|
+
lineOptions: getLineOptions(shape.line),
|
|
802
|
+
useSecondaryYScale: false,
|
|
803
|
+
};
|
|
804
|
+
});
|
|
744
805
|
var yMinMax = getYMinMaxValues(input.data[0], input.layout);
|
|
745
806
|
if (yMinMax.yMinValue === undefined && yMinMax.yMaxValue === undefined) {
|
|
746
807
|
var yMinMaxValues = (0, utilities_1.findNumericMinMaxOfY)(chartData);
|
|
@@ -749,12 +810,12 @@ define(["require", "exports", "tslib", "d3-array", "d3-scale", "d3-format", "../
|
|
|
749
810
|
}
|
|
750
811
|
var numDataPoints = chartData.reduce(function (total, lineChartPoints) { return total + lineChartPoints.data.length; }, 0);
|
|
751
812
|
var chartProps = {
|
|
752
|
-
lineChartData: chartData,
|
|
813
|
+
lineChartData: tslib_1.__spreadArray(tslib_1.__spreadArray([], chartData, true), lineShape, true),
|
|
753
814
|
};
|
|
754
815
|
var scatterChartProps = {
|
|
755
816
|
scatterChartData: chartData,
|
|
756
817
|
};
|
|
757
|
-
var commonProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ supportNegativeData: true }, secondaryYAxisValues), { width: (
|
|
818
|
+
var commonProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ supportNegativeData: true }, secondaryYAxisValues), { 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, hideLegend: hideLegend, useUTC: false, optimizeLargeData: numDataPoints > 1000 }), getTitles(input.layout)), getXAxisTickFormat(input.data[0], input.layout)), yAxisTickFormat), getAxisScaleTypeProps(input.data, input.layout)), getAxisTickProps(input.data, input.layout));
|
|
758
819
|
if (isAreaChart) {
|
|
759
820
|
return tslib_1.__assign({ data: chartProps, mode: mode }, commonProps);
|
|
760
821
|
}
|