@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
|
};
|
|
@@ -2,7 +2,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
2
2
|
"use strict";
|
|
3
3
|
var _a;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.getCurveFactory = 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.
|
|
5
|
+
exports.getCurveFactory = 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;
|
|
6
6
|
var ChartTypes;
|
|
7
7
|
(function (ChartTypes) {
|
|
8
8
|
ChartTypes[ChartTypes["AreaChart"] = 0] = "AreaChart";
|
|
@@ -750,20 +750,23 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
750
750
|
}
|
|
751
751
|
exports.groupChartDataByYValue = groupChartDataByYValue;
|
|
752
752
|
/**
|
|
753
|
-
* Calculates maximum domain
|
|
753
|
+
* Calculates maximum domain values for Numeric x axis for both positive and negative values
|
|
754
754
|
* works for Horizontal Bar Chart With axis
|
|
755
755
|
* @param {IHorizontalBarChartWithAxisDataPoint[][]} stackedChartData
|
|
756
756
|
* @returns {number}
|
|
757
757
|
*/
|
|
758
|
-
function
|
|
759
|
-
var
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
758
|
+
function computeLongestBars(stackedChartData, X_ORIGIN) {
|
|
759
|
+
var longestPositiveBar = 0;
|
|
760
|
+
var longestNegativeBar = 0;
|
|
761
|
+
stackedChartData.forEach(function (group) {
|
|
762
|
+
var positiveBarTotal = group.reduce(function (acc, point) { return acc + (point.x > 0 ? point.x : 0); }, X_ORIGIN);
|
|
763
|
+
var negativeBarTotal = group.reduce(function (acc, point) { return acc + (point.x < 0 ? point.x : 0); }, X_ORIGIN);
|
|
764
|
+
longestPositiveBar = Math.max(longestPositiveBar, positiveBarTotal);
|
|
765
|
+
longestNegativeBar = Math.min(longestNegativeBar, negativeBarTotal);
|
|
763
766
|
});
|
|
764
|
-
return
|
|
767
|
+
return { longestPositiveBar: longestPositiveBar, longestNegativeBar: longestNegativeBar };
|
|
765
768
|
}
|
|
766
|
-
exports.
|
|
769
|
+
exports.computeLongestBars = computeLongestBars;
|
|
767
770
|
/**
|
|
768
771
|
* Calculates Domain and range values for Numeric X axis.
|
|
769
772
|
* This method calculates Horizontal Chart with Axis
|
|
@@ -774,13 +777,15 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
774
777
|
* @param {boolean} isRTL
|
|
775
778
|
* @returns {IDomainNRange}
|
|
776
779
|
*/
|
|
777
|
-
function domainRangeOfNumericForHorizontalBarChartWithAxis(points, margins, containerWidth, isRTL, shiftX) {
|
|
778
|
-
var
|
|
780
|
+
function domainRangeOfNumericForHorizontalBarChartWithAxis(points, margins, containerWidth, isRTL, shiftX, X_ORIGIN) {
|
|
781
|
+
var longestBars = computeLongestBars(groupChartDataByYValue(points), X_ORIGIN);
|
|
782
|
+
var xMax = longestBars.longestPositiveBar;
|
|
783
|
+
var xMin = longestBars.longestNegativeBar;
|
|
779
784
|
var rMin = isRTL ? margins.left : margins.left + shiftX;
|
|
780
785
|
var rMax = isRTL ? containerWidth - margins.right - shiftX : containerWidth - margins.right;
|
|
781
786
|
return isRTL
|
|
782
|
-
? { dStartValue: xMax, dEndValue:
|
|
783
|
-
: { dStartValue:
|
|
787
|
+
? { dStartValue: xMax, dEndValue: Math.min(xMin, X_ORIGIN), rStartValue: rMin, rEndValue: rMax }
|
|
788
|
+
: { dStartValue: Math.min(xMin, X_ORIGIN), dEndValue: xMax, rStartValue: rMin, rEndValue: rMax };
|
|
784
789
|
}
|
|
785
790
|
exports.domainRangeOfNumericForHorizontalBarChartWithAxis = domainRangeOfNumericForHorizontalBarChartWithAxis;
|
|
786
791
|
/**
|
|
@@ -896,16 +901,18 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
896
901
|
* @param {ILineChartPoints[]} points
|
|
897
902
|
* @returns {{ startValue: number; endValue: number }}
|
|
898
903
|
*/
|
|
899
|
-
function findNumericMinMaxOfY(points) {
|
|
900
|
-
var
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
904
|
+
function findNumericMinMaxOfY(points, yAxisType, useSecondaryYScale) {
|
|
905
|
+
var values = [];
|
|
906
|
+
points.forEach(function (point) {
|
|
907
|
+
if (!useSecondaryYScale === !point.useSecondaryYScale) {
|
|
908
|
+
point.data.forEach(function (data) {
|
|
909
|
+
values.push(data.y);
|
|
910
|
+
});
|
|
911
|
+
}
|
|
905
912
|
});
|
|
906
913
|
return {
|
|
907
|
-
startValue:
|
|
908
|
-
endValue:
|
|
914
|
+
startValue: (0, d3_array_1.min)(values),
|
|
915
|
+
endValue: (0, d3_array_1.max)(values),
|
|
909
916
|
};
|
|
910
917
|
}
|
|
911
918
|
exports.findNumericMinMaxOfY = findNumericMinMaxOfY;
|
|
@@ -927,34 +934,19 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
927
934
|
* @param {IVerticalBarChartDataPoint[]} points
|
|
928
935
|
* @returns {{ startValue: number; endValue: number }}
|
|
929
936
|
*/
|
|
930
|
-
function findVerticalNumericMinMaxOfY(points) {
|
|
931
|
-
var
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
}
|
|
936
|
-
else {
|
|
937
|
-
return point.lineData.y;
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
else {
|
|
941
|
-
return point.y;
|
|
937
|
+
function findVerticalNumericMinMaxOfY(points, yAxisType, useSecondaryYScale) {
|
|
938
|
+
var values = [];
|
|
939
|
+
points.forEach(function (point) {
|
|
940
|
+
if (!useSecondaryYScale) {
|
|
941
|
+
values.push(point.y);
|
|
942
942
|
}
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
if (point.y < point.lineData.y) {
|
|
947
|
-
return point.y;
|
|
948
|
-
}
|
|
949
|
-
else {
|
|
950
|
-
return point.lineData.y;
|
|
943
|
+
if (typeof point.lineData !== 'undefined') {
|
|
944
|
+
if (!useSecondaryYScale === !point.lineData.useSecondaryYScale) {
|
|
945
|
+
values.push(point.lineData.y);
|
|
951
946
|
}
|
|
952
947
|
}
|
|
953
|
-
else {
|
|
954
|
-
return point.y;
|
|
955
|
-
}
|
|
956
948
|
});
|
|
957
|
-
return { startValue:
|
|
949
|
+
return { startValue: (0, d3_array_1.min)(values), endValue: (0, d3_array_1.max)(values) };
|
|
958
950
|
}
|
|
959
951
|
exports.findVerticalNumericMinMaxOfY = findVerticalNumericMinMaxOfY;
|
|
960
952
|
/**
|