@fluentui/react-charting 5.23.76 → 5.23.78
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 +55 -1
- package/CHANGELOG.md +24 -2
- package/dist/react-charting.d.ts +12 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +4 -2
- package/lib/components/AreaChart/AreaChart.base.d.ts +2 -0
- package/lib/components/AreaChart/AreaChart.base.js +20 -6
- package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.base.js +18 -14
- package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.d.ts +2 -2
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +52 -92
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +0 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +23 -14
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.base.js +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +3 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +89 -26
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib/components/LineChart/LineChart.base.d.ts +4 -3
- package/lib/components/LineChart/LineChart.base.js +50 -37
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/LabelLink.js +1 -1
- package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js +4 -4
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +3 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +55 -18
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib/types/IDataPoint.d.ts +10 -0
- package/lib/types/IDataPoint.js.map +1 -1
- package/lib/utilities/utilities.d.ts +8 -5
- package/lib/utilities/utilities.js +35 -43
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-amd/components/AreaChart/AreaChart.base.d.ts +2 -0
- package/lib-amd/components/AreaChart/AreaChart.base.js +20 -6
- package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.base.js +18 -14
- package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +2 -2
- package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +52 -92
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +0 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +21 -12
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +1 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +3 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +88 -25
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.d.ts +4 -3
- package/lib-amd/components/LineChart/LineChart.base.js +50 -37
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/LineChart/eventAnnotation/LabelLink.js +1 -1
- package/lib-amd/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +4 -4
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +3 -0
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +55 -18
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-amd/types/IDataPoint.d.ts +10 -0
- package/lib-amd/types/IDataPoint.js.map +1 -1
- package/lib-amd/utilities/utilities.d.ts +8 -5
- package/lib-amd/utilities/utilities.js +37 -45
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.base.d.ts +2 -0
- package/lib-commonjs/components/AreaChart/AreaChart.base.js +20 -6
- package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +18 -14
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +2 -2
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +52 -92
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +0 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +21 -12
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +3 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +88 -25
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.d.ts +4 -3
- package/lib-commonjs/components/LineChart/LineChart.base.js +50 -37
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +4 -4
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +3 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +55 -18
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-commonjs/types/IDataPoint.d.ts +10 -0
- package/lib-commonjs/types/IDataPoint.js.map +1 -1
- package/lib-commonjs/utilities/utilities.d.ts +8 -5
- package/lib-commonjs/utilities/utilities.js +37 -45
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +4 -4
- package/src/components/CommonComponents/CartesianChart.types.ts +2 -1
|
@@ -258,12 +258,15 @@ export declare function domainRangeOfNumericForAreaChart(points: ILineChartPoint
|
|
|
258
258
|
*/
|
|
259
259
|
export declare function groupChartDataByYValue(chartData: IHorizontalBarChartWithAxisDataPoint[]): IHorizontalBarChartWithAxisDataPoint[][];
|
|
260
260
|
/**
|
|
261
|
-
* Calculates maximum domain
|
|
261
|
+
* Calculates maximum domain values for Numeric x axis for both positive and negative values
|
|
262
262
|
* works for Horizontal Bar Chart With axis
|
|
263
263
|
* @param {IHorizontalBarChartWithAxisDataPoint[][]} stackedChartData
|
|
264
264
|
* @returns {number}
|
|
265
265
|
*/
|
|
266
|
-
export declare function
|
|
266
|
+
export declare function computeLongestBars(stackedChartData: IHorizontalBarChartWithAxisDataPoint[][], X_ORIGIN: number): {
|
|
267
|
+
longestPositiveBar: number;
|
|
268
|
+
longestNegativeBar: number;
|
|
269
|
+
};
|
|
267
270
|
/**
|
|
268
271
|
* Calculates Domain and range values for Numeric X axis.
|
|
269
272
|
* This method calculates Horizontal Chart with Axis
|
|
@@ -274,7 +277,7 @@ export declare function computeDomainMax(stackedChartData: IHorizontalBarChartWi
|
|
|
274
277
|
* @param {boolean} isRTL
|
|
275
278
|
* @returns {IDomainNRange}
|
|
276
279
|
*/
|
|
277
|
-
export declare function domainRangeOfNumericForHorizontalBarChartWithAxis(points: IHorizontalBarChartWithAxisDataPoint[], margins: IMargins, containerWidth: number, isRTL: boolean, shiftX: number): IDomainNRange;
|
|
280
|
+
export declare function domainRangeOfNumericForHorizontalBarChartWithAxis(points: IHorizontalBarChartWithAxisDataPoint[], margins: IMargins, containerWidth: number, isRTL: boolean, shiftX: number, X_ORIGIN: number): IDomainNRange;
|
|
278
281
|
/**
|
|
279
282
|
* Calculates Range values of x Axis string axis
|
|
280
283
|
* For String axis, we need to give domain values (Not start and end array values)
|
|
@@ -327,7 +330,7 @@ export declare function domainRageOfVerticalNumeric(points: IDataPoint[], margin
|
|
|
327
330
|
* @param {ILineChartPoints[]} points
|
|
328
331
|
* @returns {{ startValue: number; endValue: number }}
|
|
329
332
|
*/
|
|
330
|
-
export declare function findNumericMinMaxOfY(points: ILineChartPoints[]): {
|
|
333
|
+
export declare function findNumericMinMaxOfY(points: ILineChartPoints[], yAxisType?: YAxisType, useSecondaryYScale?: boolean): {
|
|
331
334
|
startValue: number;
|
|
332
335
|
endValue: number;
|
|
333
336
|
};
|
|
@@ -347,7 +350,7 @@ export declare function findVSBCNumericMinMaxOfY(dataset: IDataPoint[]): {
|
|
|
347
350
|
* @param {IVerticalBarChartDataPoint[]} points
|
|
348
351
|
* @returns {{ startValue: number; endValue: number }}
|
|
349
352
|
*/
|
|
350
|
-
export declare function findVerticalNumericMinMaxOfY(points: IVerticalBarChartDataPoint[]): {
|
|
353
|
+
export declare function findVerticalNumericMinMaxOfY(points: IVerticalBarChartDataPoint[], yAxisType?: YAxisType, useSecondaryYScale?: boolean): {
|
|
351
354
|
startValue: number;
|
|
352
355
|
endValue: number;
|
|
353
356
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.createMeasurementSpan = exports.copyStyle = exports.resolveCSSVariables = exports.areArraysEqual = exports.getSecureProps = exports.formatDate = exports.isScalePaddingDefined = exports.getScalePadding = exports.getBarWidth = exports.formatValueWithSIPrefix = exports.wrapTextInsideDonut = exports.rotateXAxisLabels = exports.convertToLocaleString = exports.getAccessibleDataObject = exports.pointTypes = exports.CustomPoints = exports.Points = exports.getTypeOfAxis = exports.findHBCWANumericMinMaxOfY = exports.findVerticalNumericMinMaxOfY = exports.findVSBCNumericMinMaxOfY = exports.findNumericMinMaxOfY = exports.domainRageOfVerticalNumeric = exports.domainRangeOfDateForAreaLineVerticalBarChart = exports.domainRangeOfVSBCNumeric = exports.domainRangeOfXStringAxis = exports.domainRangeOfNumericForHorizontalBarChartWithAxis = exports.
|
|
4
|
+
exports.createMeasurementSpan = exports.copyStyle = exports.resolveCSSVariables = exports.areArraysEqual = exports.getSecureProps = exports.formatDate = exports.isScalePaddingDefined = exports.getScalePadding = exports.getBarWidth = exports.formatValueWithSIPrefix = exports.wrapTextInsideDonut = exports.rotateXAxisLabels = exports.convertToLocaleString = exports.getAccessibleDataObject = exports.pointTypes = exports.CustomPoints = exports.Points = exports.getTypeOfAxis = exports.findHBCWANumericMinMaxOfY = exports.findVerticalNumericMinMaxOfY = exports.findVSBCNumericMinMaxOfY = exports.findNumericMinMaxOfY = exports.domainRageOfVerticalNumeric = exports.domainRangeOfDateForAreaLineVerticalBarChart = exports.domainRangeOfVSBCNumeric = exports.domainRangeOfXStringAxis = exports.domainRangeOfNumericForHorizontalBarChartWithAxis = exports.computeLongestBars = exports.groupChartDataByYValue = exports.domainRangeOfNumericForAreaChart = exports.getXAxisType = exports.tooltipOfXAxislabels = exports.calculateLongestLabelWidth = exports.wrapContent = exports.createYAxisLabels = exports.createWrapOfXLabels = exports.silceOrAppendToArray = exports.getUnique = exports.calloutData = exports.createStringYAxis = exports.createStringYAxisForHorizontalBarChartWithAxis = exports.createNumericYAxis = exports.createYAxisForHorizontalBarChartWithAxis = exports.prepareDatapoints = exports.createStringXAxis = exports.createDateXAxis = exports.createNumericXAxis = exports.YAxisType = exports.XAxisTypes = exports.ChartTypes = void 0;
|
|
5
5
|
exports.getCurveFactory = void 0;
|
|
6
6
|
var tslib_1 = require("tslib");
|
|
7
7
|
var d3_axis_1 = require("d3-axis");
|
|
@@ -761,20 +761,23 @@ function groupChartDataByYValue(chartData) {
|
|
|
761
761
|
}
|
|
762
762
|
exports.groupChartDataByYValue = groupChartDataByYValue;
|
|
763
763
|
/**
|
|
764
|
-
* Calculates maximum domain
|
|
764
|
+
* Calculates maximum domain values for Numeric x axis for both positive and negative values
|
|
765
765
|
* works for Horizontal Bar Chart With axis
|
|
766
766
|
* @param {IHorizontalBarChartWithAxisDataPoint[][]} stackedChartData
|
|
767
767
|
* @returns {number}
|
|
768
768
|
*/
|
|
769
|
-
function
|
|
770
|
-
var
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
769
|
+
function computeLongestBars(stackedChartData, X_ORIGIN) {
|
|
770
|
+
var longestPositiveBar = 0;
|
|
771
|
+
var longestNegativeBar = 0;
|
|
772
|
+
stackedChartData.forEach(function (group) {
|
|
773
|
+
var positiveBarTotal = group.reduce(function (acc, point) { return acc + (point.x > 0 ? point.x : 0); }, X_ORIGIN);
|
|
774
|
+
var negativeBarTotal = group.reduce(function (acc, point) { return acc + (point.x < 0 ? point.x : 0); }, X_ORIGIN);
|
|
775
|
+
longestPositiveBar = Math.max(longestPositiveBar, positiveBarTotal);
|
|
776
|
+
longestNegativeBar = Math.min(longestNegativeBar, negativeBarTotal);
|
|
774
777
|
});
|
|
775
|
-
return
|
|
778
|
+
return { longestPositiveBar: longestPositiveBar, longestNegativeBar: longestNegativeBar };
|
|
776
779
|
}
|
|
777
|
-
exports.
|
|
780
|
+
exports.computeLongestBars = computeLongestBars;
|
|
778
781
|
/**
|
|
779
782
|
* Calculates Domain and range values for Numeric X axis.
|
|
780
783
|
* This method calculates Horizontal Chart with Axis
|
|
@@ -785,13 +788,15 @@ exports.computeDomainMax = computeDomainMax;
|
|
|
785
788
|
* @param {boolean} isRTL
|
|
786
789
|
* @returns {IDomainNRange}
|
|
787
790
|
*/
|
|
788
|
-
function domainRangeOfNumericForHorizontalBarChartWithAxis(points, margins, containerWidth, isRTL, shiftX) {
|
|
789
|
-
var
|
|
791
|
+
function domainRangeOfNumericForHorizontalBarChartWithAxis(points, margins, containerWidth, isRTL, shiftX, X_ORIGIN) {
|
|
792
|
+
var longestBars = computeLongestBars(groupChartDataByYValue(points), X_ORIGIN);
|
|
793
|
+
var xMax = longestBars.longestPositiveBar;
|
|
794
|
+
var xMin = longestBars.longestNegativeBar;
|
|
790
795
|
var rMin = isRTL ? margins.left : margins.left + shiftX;
|
|
791
796
|
var rMax = isRTL ? containerWidth - margins.right - shiftX : containerWidth - margins.right;
|
|
792
797
|
return isRTL
|
|
793
|
-
? { dStartValue: xMax, dEndValue:
|
|
794
|
-
: { dStartValue:
|
|
798
|
+
? { dStartValue: xMax, dEndValue: Math.min(xMin, X_ORIGIN), rStartValue: rMin, rEndValue: rMax }
|
|
799
|
+
: { dStartValue: Math.min(xMin, X_ORIGIN), dEndValue: xMax, rStartValue: rMin, rEndValue: rMax };
|
|
795
800
|
}
|
|
796
801
|
exports.domainRangeOfNumericForHorizontalBarChartWithAxis = domainRangeOfNumericForHorizontalBarChartWithAxis;
|
|
797
802
|
/**
|
|
@@ -907,16 +912,18 @@ exports.domainRageOfVerticalNumeric = domainRageOfVerticalNumeric;
|
|
|
907
912
|
* @param {ILineChartPoints[]} points
|
|
908
913
|
* @returns {{ startValue: number; endValue: number }}
|
|
909
914
|
*/
|
|
910
|
-
function findNumericMinMaxOfY(points) {
|
|
911
|
-
var
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
915
|
+
function findNumericMinMaxOfY(points, yAxisType, useSecondaryYScale) {
|
|
916
|
+
var values = [];
|
|
917
|
+
points.forEach(function (point) {
|
|
918
|
+
if (!useSecondaryYScale === !point.useSecondaryYScale) {
|
|
919
|
+
point.data.forEach(function (data) {
|
|
920
|
+
values.push(data.y);
|
|
921
|
+
});
|
|
922
|
+
}
|
|
916
923
|
});
|
|
917
924
|
return {
|
|
918
|
-
startValue:
|
|
919
|
-
endValue:
|
|
925
|
+
startValue: (0, d3_array_1.min)(values),
|
|
926
|
+
endValue: (0, d3_array_1.max)(values),
|
|
920
927
|
};
|
|
921
928
|
}
|
|
922
929
|
exports.findNumericMinMaxOfY = findNumericMinMaxOfY;
|
|
@@ -938,34 +945,19 @@ exports.findVSBCNumericMinMaxOfY = findVSBCNumericMinMaxOfY;
|
|
|
938
945
|
* @param {IVerticalBarChartDataPoint[]} points
|
|
939
946
|
* @returns {{ startValue: number; endValue: number }}
|
|
940
947
|
*/
|
|
941
|
-
function findVerticalNumericMinMaxOfY(points) {
|
|
942
|
-
var
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
}
|
|
947
|
-
else {
|
|
948
|
-
return point.lineData.y;
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
else {
|
|
952
|
-
return point.y;
|
|
948
|
+
function findVerticalNumericMinMaxOfY(points, yAxisType, useSecondaryYScale) {
|
|
949
|
+
var values = [];
|
|
950
|
+
points.forEach(function (point) {
|
|
951
|
+
if (!useSecondaryYScale) {
|
|
952
|
+
values.push(point.y);
|
|
953
953
|
}
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
if (point.y < point.lineData.y) {
|
|
958
|
-
return point.y;
|
|
959
|
-
}
|
|
960
|
-
else {
|
|
961
|
-
return point.lineData.y;
|
|
954
|
+
if (typeof point.lineData !== 'undefined') {
|
|
955
|
+
if (!useSecondaryYScale === !point.lineData.useSecondaryYScale) {
|
|
956
|
+
values.push(point.lineData.y);
|
|
962
957
|
}
|
|
963
958
|
}
|
|
964
|
-
else {
|
|
965
|
-
return point.y;
|
|
966
|
-
}
|
|
967
959
|
});
|
|
968
|
-
return { startValue:
|
|
960
|
+
return { startValue: (0, d3_array_1.min)(values), endValue: (0, d3_array_1.max)(values) };
|
|
969
961
|
}
|
|
970
962
|
exports.findVerticalNumericMinMaxOfY = findVerticalNumericMinMaxOfY;
|
|
971
963
|
/**
|