@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
|
};
|
|
@@ -738,18 +738,21 @@ export function groupChartDataByYValue(chartData) {
|
|
|
738
738
|
return Object.values(map);
|
|
739
739
|
}
|
|
740
740
|
/**
|
|
741
|
-
* Calculates maximum domain
|
|
741
|
+
* Calculates maximum domain values for Numeric x axis for both positive and negative values
|
|
742
742
|
* works for Horizontal Bar Chart With axis
|
|
743
743
|
* @param {IHorizontalBarChartWithAxisDataPoint[][]} stackedChartData
|
|
744
744
|
* @returns {number}
|
|
745
745
|
*/
|
|
746
|
-
export function
|
|
747
|
-
var
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
746
|
+
export function computeLongestBars(stackedChartData, X_ORIGIN) {
|
|
747
|
+
var longestPositiveBar = 0;
|
|
748
|
+
var longestNegativeBar = 0;
|
|
749
|
+
stackedChartData.forEach(function (group) {
|
|
750
|
+
var positiveBarTotal = group.reduce(function (acc, point) { return acc + (point.x > 0 ? point.x : 0); }, X_ORIGIN);
|
|
751
|
+
var negativeBarTotal = group.reduce(function (acc, point) { return acc + (point.x < 0 ? point.x : 0); }, X_ORIGIN);
|
|
752
|
+
longestPositiveBar = Math.max(longestPositiveBar, positiveBarTotal);
|
|
753
|
+
longestNegativeBar = Math.min(longestNegativeBar, negativeBarTotal);
|
|
751
754
|
});
|
|
752
|
-
return
|
|
755
|
+
return { longestPositiveBar: longestPositiveBar, longestNegativeBar: longestNegativeBar };
|
|
753
756
|
}
|
|
754
757
|
/**
|
|
755
758
|
* Calculates Domain and range values for Numeric X axis.
|
|
@@ -761,13 +764,15 @@ export function computeDomainMax(stackedChartData) {
|
|
|
761
764
|
* @param {boolean} isRTL
|
|
762
765
|
* @returns {IDomainNRange}
|
|
763
766
|
*/
|
|
764
|
-
export function domainRangeOfNumericForHorizontalBarChartWithAxis(points, margins, containerWidth, isRTL, shiftX) {
|
|
765
|
-
var
|
|
767
|
+
export function domainRangeOfNumericForHorizontalBarChartWithAxis(points, margins, containerWidth, isRTL, shiftX, X_ORIGIN) {
|
|
768
|
+
var longestBars = computeLongestBars(groupChartDataByYValue(points), X_ORIGIN);
|
|
769
|
+
var xMax = longestBars.longestPositiveBar;
|
|
770
|
+
var xMin = longestBars.longestNegativeBar;
|
|
766
771
|
var rMin = isRTL ? margins.left : margins.left + shiftX;
|
|
767
772
|
var rMax = isRTL ? containerWidth - margins.right - shiftX : containerWidth - margins.right;
|
|
768
773
|
return isRTL
|
|
769
|
-
? { dStartValue: xMax, dEndValue:
|
|
770
|
-
: { dStartValue:
|
|
774
|
+
? { dStartValue: xMax, dEndValue: Math.min(xMin, X_ORIGIN), rStartValue: rMin, rEndValue: rMax }
|
|
775
|
+
: { dStartValue: Math.min(xMin, X_ORIGIN), dEndValue: xMax, rStartValue: rMin, rEndValue: rMax };
|
|
771
776
|
}
|
|
772
777
|
/**
|
|
773
778
|
* Calculates Range values of x Axis string axis
|
|
@@ -878,16 +883,18 @@ export function domainRageOfVerticalNumeric(points, margins, containerWidth, isR
|
|
|
878
883
|
* @param {ILineChartPoints[]} points
|
|
879
884
|
* @returns {{ startValue: number; endValue: number }}
|
|
880
885
|
*/
|
|
881
|
-
export function findNumericMinMaxOfY(points) {
|
|
882
|
-
var
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
886
|
+
export function findNumericMinMaxOfY(points, yAxisType, useSecondaryYScale) {
|
|
887
|
+
var values = [];
|
|
888
|
+
points.forEach(function (point) {
|
|
889
|
+
if (!useSecondaryYScale === !point.useSecondaryYScale) {
|
|
890
|
+
point.data.forEach(function (data) {
|
|
891
|
+
values.push(data.y);
|
|
892
|
+
});
|
|
893
|
+
}
|
|
887
894
|
});
|
|
888
895
|
return {
|
|
889
|
-
startValue:
|
|
890
|
-
endValue:
|
|
896
|
+
startValue: d3Min(values),
|
|
897
|
+
endValue: d3Max(values),
|
|
891
898
|
};
|
|
892
899
|
}
|
|
893
900
|
/**
|
|
@@ -907,34 +914,19 @@ export function findVSBCNumericMinMaxOfY(dataset) {
|
|
|
907
914
|
* @param {IVerticalBarChartDataPoint[]} points
|
|
908
915
|
* @returns {{ startValue: number; endValue: number }}
|
|
909
916
|
*/
|
|
910
|
-
export function findVerticalNumericMinMaxOfY(points) {
|
|
911
|
-
var
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
}
|
|
916
|
-
else {
|
|
917
|
-
return point.lineData.y;
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
else {
|
|
921
|
-
return point.y;
|
|
917
|
+
export function findVerticalNumericMinMaxOfY(points, yAxisType, useSecondaryYScale) {
|
|
918
|
+
var values = [];
|
|
919
|
+
points.forEach(function (point) {
|
|
920
|
+
if (!useSecondaryYScale) {
|
|
921
|
+
values.push(point.y);
|
|
922
922
|
}
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
if (point.y < point.lineData.y) {
|
|
927
|
-
return point.y;
|
|
928
|
-
}
|
|
929
|
-
else {
|
|
930
|
-
return point.lineData.y;
|
|
923
|
+
if (typeof point.lineData !== 'undefined') {
|
|
924
|
+
if (!useSecondaryYScale === !point.lineData.useSecondaryYScale) {
|
|
925
|
+
values.push(point.lineData.y);
|
|
931
926
|
}
|
|
932
927
|
}
|
|
933
|
-
else {
|
|
934
|
-
return point.y;
|
|
935
|
-
}
|
|
936
928
|
});
|
|
937
|
-
return { startValue:
|
|
929
|
+
return { startValue: d3Min(values), endValue: d3Max(values) };
|
|
938
930
|
}
|
|
939
931
|
/**
|
|
940
932
|
* Fins the min and max values of the vertical bar chart y axis data point.
|