@fluentui/react-charting 5.21.13 → 5.21.15
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 +39 -1
- package/CHANGELOG.md +20 -2
- package/dist/react-charting.d.ts +75 -0
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +12 -0
- package/lib/components/AreaChart/AreaChart.base.d.ts +1 -0
- package/lib/components/AreaChart/AreaChart.base.js +15 -2
- package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.base.js +8 -8
- package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.d.ts +23 -2
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +2 -0
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +15 -2
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.base.d.ts +2 -0
- package/lib/components/HeatMapChart/HeatMapChart.base.js +15 -2
- package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +1 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +12 -2
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib/components/LineChart/LineChart.base.d.ts +1 -0
- package/lib/components/LineChart/LineChart.base.js +16 -3
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.base.js +56 -12
- package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.d.ts +1 -0
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js +15 -2
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +1 -0
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +15 -2
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib/utilities/utilities.d.ts +5 -41
- package/lib/utilities/utilities.js +5 -126
- package/lib/utilities/utilities.js.map +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/lib-amd/components/AreaChart/AreaChart.base.d.ts +1 -0
- package/lib-amd/components/AreaChart/AreaChart.base.js +14 -1
- package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.base.js +7 -7
- package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +23 -2
- package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +2 -0
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +14 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.d.ts +2 -0
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +14 -1
- package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +1 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +11 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.d.ts +1 -0
- package/lib-amd/components/LineChart/LineChart.base.js +15 -2
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/SankeyChart/SankeyChart.base.js +56 -12
- package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.d.ts +1 -0
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +14 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +1 -0
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +14 -1
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-amd/utilities/utilities.d.ts +5 -41
- package/lib-amd/utilities/utilities.js +8 -133
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-amd/version.js +1 -1
- package/lib-amd/version.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.base.d.ts +1 -0
- package/lib-commonjs/components/AreaChart/AreaChart.base.js +14 -1
- package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +7 -7
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +23 -2
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +2 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +14 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.d.ts +2 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +14 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +11 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.d.ts +1 -0
- package/lib-commonjs/components/LineChart/LineChart.base.js +15 -2
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +56 -12
- package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.d.ts +1 -0
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +14 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.d.ts +1 -0
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +14 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-commonjs/utilities/utilities.d.ts +5 -41
- package/lib-commonjs/utilities/utilities.js +8 -133
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/lib-commonjs/version.js +1 -1
- package/lib-commonjs/version.js.map +1 -1
- package/package.json +2 -2
- package/src/components/CommonComponents/CartesianChart.types.ts +64 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
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.
|
|
4
|
+
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.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
|
var tslib_1 = require("tslib");
|
|
6
6
|
var d3_axis_1 = require("d3-axis");
|
|
7
7
|
var d3_array_1 = require("d3-array");
|
|
@@ -184,23 +184,7 @@ function prepareDatapoints(maxVal, minVal, splitInto, isIntegralDataset) {
|
|
|
184
184
|
return dataPointsArray;
|
|
185
185
|
}
|
|
186
186
|
exports.prepareDatapoints = prepareDatapoints;
|
|
187
|
-
|
|
188
|
-
* Creating Numeric Y axis of the chart
|
|
189
|
-
* @export
|
|
190
|
-
* @param {IYAxisParams} yAxisParams
|
|
191
|
-
* @param {boolean} isRtl
|
|
192
|
-
*/
|
|
193
|
-
function createYAxis(yAxisParams, isRtl, axisData, chartType, barWidth, isIntegralDataset, useSecondaryYScale) {
|
|
194
|
-
if (useSecondaryYScale === void 0) { useSecondaryYScale = false; }
|
|
195
|
-
switch (chartType) {
|
|
196
|
-
case ChartTypes.HorizontalBarChartWithAxis:
|
|
197
|
-
return createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl, axisData, barWidth);
|
|
198
|
-
default:
|
|
199
|
-
return createYAxisForOtherCharts(yAxisParams, isRtl, axisData, isIntegralDataset, useSecondaryYScale);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
exports.createYAxis = createYAxis;
|
|
203
|
-
function createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl, axisData, barWidth) {
|
|
187
|
+
function createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl) {
|
|
204
188
|
var _a = yAxisParams.yMinMaxValues, yMinMaxValues = _a === void 0 ? { startValue: 0, endValue: 0 } : _a, _b = yAxisParams.yAxisElement, yAxisElement = _b === void 0 ? null : _b, _c = yAxisParams.yMaxValue, yMaxValue = _c === void 0 ? 0 : _c, _d = yAxisParams.yMinValue, yMinValue = _d === void 0 ? 0 : _d, containerHeight = yAxisParams.containerHeight, margins = yAxisParams.margins, _e = yAxisParams.tickPadding, tickPadding = _e === void 0 ? 12 : _e, _f = yAxisParams.maxOfYVal, maxOfYVal = _f === void 0 ? 0 : _f, yAxisTickFormat = yAxisParams.yAxisTickFormat, _g = yAxisParams.yAxisTickCount, yAxisTickCount = _g === void 0 ? 4 : _g;
|
|
205
189
|
// maxOfYVal coming from only area chart and Grouped vertical bar chart(Calculation done at base file)
|
|
206
190
|
var tempVal = maxOfYVal || yMinMaxValues.endValue;
|
|
@@ -216,7 +200,7 @@ function createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl, axisData,
|
|
|
216
200
|
return yAxisScale;
|
|
217
201
|
}
|
|
218
202
|
exports.createYAxisForHorizontalBarChartWithAxis = createYAxisForHorizontalBarChartWithAxis;
|
|
219
|
-
function
|
|
203
|
+
function createNumericYAxis(yAxisParams, isRtl, axisData, isIntegralDataset, useSecondaryYScale) {
|
|
220
204
|
if (useSecondaryYScale === void 0) { useSecondaryYScale = false; }
|
|
221
205
|
var _a = yAxisParams.yMinMaxValues, yMinMaxValues = _a === void 0 ? { startValue: 0, endValue: 0 } : _a, _b = yAxisParams.yAxisElement, yAxisElement = _b === void 0 ? null : _b, _c = yAxisParams.yMaxValue, yMaxValue = _c === void 0 ? 0 : _c, _d = yAxisParams.yMinValue, yMinValue = _d === void 0 ? 0 : _d, containerHeight = yAxisParams.containerHeight, containerWidth = yAxisParams.containerWidth, margins = yAxisParams.margins, _e = yAxisParams.tickPadding, tickPadding = _e === void 0 ? 12 : _e, _f = yAxisParams.maxOfYVal, maxOfYVal = _f === void 0 ? 0 : _f, yAxisTickFormat = yAxisParams.yAxisTickFormat, _g = yAxisParams.yAxisTickCount, yAxisTickCount = _g === void 0 ? 4 : _g, eventAnnotationProps = yAxisParams.eventAnnotationProps, eventLabelHeight = yAxisParams.eventLabelHeight;
|
|
222
206
|
// maxOfYVal coming from only area chart and Grouped vertical bar chart(Calculation done at base file)
|
|
@@ -237,23 +221,14 @@ function createYAxisForOtherCharts(yAxisParams, isRtl, axisData, isIntegralDatas
|
|
|
237
221
|
axisData.yAxisDomainValues = domainValues;
|
|
238
222
|
return yAxisScale;
|
|
239
223
|
}
|
|
240
|
-
exports.
|
|
241
|
-
var createStringYAxis = function (yAxisParams, dataPoints, isRtl, chartType, barWidth, culture) {
|
|
242
|
-
switch (chartType) {
|
|
243
|
-
case ChartTypes.HorizontalBarChartWithAxis:
|
|
244
|
-
return (0, exports.createStringYAxisForHorizontalBarChartWithAxis)(yAxisParams, dataPoints, isRtl, barWidth, culture);
|
|
245
|
-
default:
|
|
246
|
-
return (0, exports.createStringYAxisForOtherCharts)(yAxisParams, dataPoints, isRtl);
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
exports.createStringYAxis = createStringYAxis;
|
|
224
|
+
exports.createNumericYAxis = createNumericYAxis;
|
|
250
225
|
/**
|
|
251
226
|
* Creating String Y axis of the chart for Horizontal Bar Chart With Axis
|
|
252
227
|
* @param yAxisParams
|
|
253
228
|
* @param dataPoints
|
|
254
229
|
* @param isRtl
|
|
255
230
|
*/
|
|
256
|
-
var createStringYAxisForHorizontalBarChartWithAxis = function (yAxisParams, dataPoints, isRtl, barWidth
|
|
231
|
+
var createStringYAxisForHorizontalBarChartWithAxis = function (yAxisParams, dataPoints, isRtl, barWidth) {
|
|
257
232
|
var containerHeight = yAxisParams.containerHeight, _a = yAxisParams.tickPadding, tickPadding = _a === void 0 ? 12 : _a, margins = yAxisParams.margins, yAxisTickFormat = yAxisParams.yAxisTickFormat, yAxisElement = yAxisParams.yAxisElement;
|
|
258
233
|
var yAxisScale = (0, d3_scale_1.scaleBand)()
|
|
259
234
|
.domain(dataPoints)
|
|
@@ -273,7 +248,7 @@ exports.createStringYAxisForHorizontalBarChartWithAxis = createStringYAxisForHor
|
|
|
273
248
|
* @param dataPoints
|
|
274
249
|
* @param isRtl
|
|
275
250
|
*/
|
|
276
|
-
var
|
|
251
|
+
var createStringYAxis = function (yAxisParams, dataPoints, isRtl) {
|
|
277
252
|
var containerHeight = yAxisParams.containerHeight, _a = yAxisParams.tickPadding, tickPadding = _a === void 0 ? 12 : _a, margins = yAxisParams.margins, yAxisTickFormat = yAxisParams.yAxisTickFormat, yAxisElement = yAxisParams.yAxisElement, _b = yAxisParams.yAxisPadding, yAxisPadding = _b === void 0 ? 0 : _b;
|
|
278
253
|
var yAxisScale = (0, d3_scale_1.scaleBand)()
|
|
279
254
|
.domain(dataPoints)
|
|
@@ -287,7 +262,7 @@ var createStringYAxisForOtherCharts = function (yAxisParams, dataPoints, isRtl)
|
|
|
287
262
|
yAxisElement ? (0, d3_selection_1.select)(yAxisElement).call(yAxis).selectAll('text') : '';
|
|
288
263
|
return yAxisScale;
|
|
289
264
|
};
|
|
290
|
-
exports.
|
|
265
|
+
exports.createStringYAxis = createStringYAxis;
|
|
291
266
|
/**
|
|
292
267
|
* For area chart and line chart, while displaying stackCallout, Need to form a callout data object.
|
|
293
268
|
* This methos creates an object for those 2 charts.
|
|
@@ -480,7 +455,7 @@ exports.createWrapOfXLabels = createWrapOfXLabels;
|
|
|
480
455
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
481
456
|
function createYAxisLabels(node,
|
|
482
457
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
483
|
-
yAxis, noOfCharsToTruncate, truncateLabel,
|
|
458
|
+
yAxis, noOfCharsToTruncate, truncateLabel, isRtl) {
|
|
484
459
|
if (node === null) {
|
|
485
460
|
return;
|
|
486
461
|
}
|
|
@@ -782,71 +757,6 @@ function domainRageOfVerticalNumeric(points, margins, containerWidth, isRTL, bar
|
|
|
782
757
|
: { dStartValue: xMin, dEndValue: xMax, rStartValue: rMin, rEndValue: rMax };
|
|
783
758
|
}
|
|
784
759
|
exports.domainRageOfVerticalNumeric = domainRageOfVerticalNumeric;
|
|
785
|
-
/**
|
|
786
|
-
* For creating X axis, need to calculate x axis domain and range values from given points.
|
|
787
|
-
* This may vary based on chart type and type of x axis
|
|
788
|
-
* So, this method will define which method need to call based on chart type and axis type.
|
|
789
|
-
* @export
|
|
790
|
-
* @param {*} points
|
|
791
|
-
* @param {IMargins} margins
|
|
792
|
-
* @param {number} width
|
|
793
|
-
* @param {ChartTypes} chartType
|
|
794
|
-
* @param {boolean} isRTL
|
|
795
|
-
* @param {XAxisTypes} xAxisType
|
|
796
|
-
* @param {number} [barWidth]
|
|
797
|
-
* @returns {IDomainNRange}
|
|
798
|
-
*/
|
|
799
|
-
function getDomainNRangeValues(
|
|
800
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
801
|
-
points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues, shiftX) {
|
|
802
|
-
var domainNRangeValue;
|
|
803
|
-
if (xAxisType === XAxisTypes.NumericAxis) {
|
|
804
|
-
switch (chartType) {
|
|
805
|
-
case ChartTypes.AreaChart:
|
|
806
|
-
case ChartTypes.LineChart:
|
|
807
|
-
domainNRangeValue = domainRangeOfNumericForAreaChart(points, margins, width, isRTL);
|
|
808
|
-
break;
|
|
809
|
-
case ChartTypes.VerticalStackedBarChart:
|
|
810
|
-
domainNRangeValue = domainRangeOfVSBCNumeric(points, margins, width, isRTL, barWidth);
|
|
811
|
-
break;
|
|
812
|
-
case ChartTypes.VerticalBarChart:
|
|
813
|
-
domainNRangeValue = domainRageOfVerticalNumeric(points, margins, width, isRTL, barWidth);
|
|
814
|
-
break;
|
|
815
|
-
case ChartTypes.HorizontalBarChartWithAxis:
|
|
816
|
-
domainNRangeValue = domainRangeOfNumericForHorizontalBarChartWithAxis(points, margins, width, isRTL, shiftX);
|
|
817
|
-
break;
|
|
818
|
-
default:
|
|
819
|
-
domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
else if (xAxisType === XAxisTypes.DateAxis) {
|
|
823
|
-
switch (chartType) {
|
|
824
|
-
case ChartTypes.AreaChart:
|
|
825
|
-
case ChartTypes.LineChart:
|
|
826
|
-
case ChartTypes.VerticalBarChart:
|
|
827
|
-
case ChartTypes.VerticalStackedBarChart:
|
|
828
|
-
domainNRangeValue = domainRangeOfDateForAreaLineVerticalBarChart(points, margins, width, isRTL, tickValues, chartType, barWidth);
|
|
829
|
-
break;
|
|
830
|
-
default:
|
|
831
|
-
domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
else {
|
|
835
|
-
// String Axis type
|
|
836
|
-
switch (chartType) {
|
|
837
|
-
case ChartTypes.VerticalStackedBarChart:
|
|
838
|
-
case ChartTypes.GroupedVerticalBarChart:
|
|
839
|
-
case ChartTypes.VerticalBarChart:
|
|
840
|
-
case ChartTypes.HeatMapChart:
|
|
841
|
-
domainNRangeValue = domainRangeOfXStringAxis(margins, width, isRTL);
|
|
842
|
-
break;
|
|
843
|
-
default:
|
|
844
|
-
domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
return domainNRangeValue;
|
|
848
|
-
}
|
|
849
|
-
exports.getDomainNRangeValues = getDomainNRangeValues;
|
|
850
760
|
/**
|
|
851
761
|
* Calculating start and ending values of the Area chart and LineChart
|
|
852
762
|
* @export
|
|
@@ -929,41 +839,6 @@ function findHBCWANumericMinMaxOfY(points, yAxisType) {
|
|
|
929
839
|
return { startValue: 0, endValue: 0 };
|
|
930
840
|
}
|
|
931
841
|
exports.findHBCWANumericMinMaxOfY = findHBCWANumericMinMaxOfY;
|
|
932
|
-
/**
|
|
933
|
-
* For creating Y axis, need to calculate y axis domain values from given points. This may vary based on chart type.
|
|
934
|
-
* So, this method will define which method need to call based on chart type to find out min and max values(For Domain).
|
|
935
|
-
* For grouped vertical bar chart, Calculating yMax value in the base file and sending as MaxOfYVal to cartesian.
|
|
936
|
-
* @export
|
|
937
|
-
* @param {*} points
|
|
938
|
-
* @param {ChartTypes} chartType
|
|
939
|
-
* @returns {{ startValue: number; endValue: number }}
|
|
940
|
-
*/
|
|
941
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
942
|
-
function getMinMaxOfYAxis(
|
|
943
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
944
|
-
points, chartType, yAxisType) {
|
|
945
|
-
if (yAxisType === void 0) { yAxisType = YAxisType.NumericAxis; }
|
|
946
|
-
var minMaxValues;
|
|
947
|
-
switch (chartType) {
|
|
948
|
-
case ChartTypes.AreaChart:
|
|
949
|
-
case ChartTypes.LineChart:
|
|
950
|
-
minMaxValues = findNumericMinMaxOfY(points);
|
|
951
|
-
break;
|
|
952
|
-
case ChartTypes.VerticalStackedBarChart:
|
|
953
|
-
minMaxValues = findVSBCNumericMinMaxOfY(points);
|
|
954
|
-
break;
|
|
955
|
-
case ChartTypes.VerticalBarChart:
|
|
956
|
-
minMaxValues = findVerticalNumericMinMaxOfY(points);
|
|
957
|
-
break;
|
|
958
|
-
case ChartTypes.HorizontalBarChartWithAxis:
|
|
959
|
-
minMaxValues = findHBCWANumericMinMaxOfY(points, yAxisType);
|
|
960
|
-
break;
|
|
961
|
-
default:
|
|
962
|
-
minMaxValues = { startValue: 0, endValue: 0 };
|
|
963
|
-
}
|
|
964
|
-
return minMaxValues;
|
|
965
|
-
}
|
|
966
|
-
exports.getMinMaxOfYAxis = getMinMaxOfYAxis;
|
|
967
842
|
/**
|
|
968
843
|
* @param p string or number or Date
|
|
969
844
|
*
|