@fluentui/react-charting 5.21.14 → 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 +24 -1
- package/CHANGELOG.md +11 -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/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/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/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
|
@@ -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.isScalePaddingDefined = exports.getScalePadding = exports.getBarWidth = exports.formatValueWithSIPrefix = exports.wrapTextInsideDonut = exports.rotateXAxisLabels = exports.convertToLocaleString = exports.getAccessibleDataObject = exports.pointTypes = exports.CustomPoints = exports.Points = exports.getTypeOfAxis = exports.
|
|
5
|
+
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;
|
|
6
6
|
var ChartTypes;
|
|
7
7
|
(function (ChartTypes) {
|
|
8
8
|
ChartTypes[ChartTypes["AreaChart"] = 0] = "AreaChart";
|
|
@@ -176,23 +176,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
176
176
|
return dataPointsArray;
|
|
177
177
|
}
|
|
178
178
|
exports.prepareDatapoints = prepareDatapoints;
|
|
179
|
-
|
|
180
|
-
* Creating Numeric Y axis of the chart
|
|
181
|
-
* @export
|
|
182
|
-
* @param {IYAxisParams} yAxisParams
|
|
183
|
-
* @param {boolean} isRtl
|
|
184
|
-
*/
|
|
185
|
-
function createYAxis(yAxisParams, isRtl, axisData, chartType, barWidth, isIntegralDataset, useSecondaryYScale) {
|
|
186
|
-
if (useSecondaryYScale === void 0) { useSecondaryYScale = false; }
|
|
187
|
-
switch (chartType) {
|
|
188
|
-
case ChartTypes.HorizontalBarChartWithAxis:
|
|
189
|
-
return createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl, axisData, barWidth);
|
|
190
|
-
default:
|
|
191
|
-
return createYAxisForOtherCharts(yAxisParams, isRtl, axisData, isIntegralDataset, useSecondaryYScale);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
exports.createYAxis = createYAxis;
|
|
195
|
-
function createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl, axisData, barWidth) {
|
|
179
|
+
function createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl) {
|
|
196
180
|
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;
|
|
197
181
|
// maxOfYVal coming from only area chart and Grouped vertical bar chart(Calculation done at base file)
|
|
198
182
|
var tempVal = maxOfYVal || yMinMaxValues.endValue;
|
|
@@ -208,7 +192,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
208
192
|
return yAxisScale;
|
|
209
193
|
}
|
|
210
194
|
exports.createYAxisForHorizontalBarChartWithAxis = createYAxisForHorizontalBarChartWithAxis;
|
|
211
|
-
function
|
|
195
|
+
function createNumericYAxis(yAxisParams, isRtl, axisData, isIntegralDataset, useSecondaryYScale) {
|
|
212
196
|
if (useSecondaryYScale === void 0) { useSecondaryYScale = false; }
|
|
213
197
|
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;
|
|
214
198
|
// maxOfYVal coming from only area chart and Grouped vertical bar chart(Calculation done at base file)
|
|
@@ -229,23 +213,14 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
229
213
|
axisData.yAxisDomainValues = domainValues;
|
|
230
214
|
return yAxisScale;
|
|
231
215
|
}
|
|
232
|
-
exports.
|
|
233
|
-
var createStringYAxis = function (yAxisParams, dataPoints, isRtl, chartType, barWidth, culture) {
|
|
234
|
-
switch (chartType) {
|
|
235
|
-
case ChartTypes.HorizontalBarChartWithAxis:
|
|
236
|
-
return (0, exports.createStringYAxisForHorizontalBarChartWithAxis)(yAxisParams, dataPoints, isRtl, barWidth, culture);
|
|
237
|
-
default:
|
|
238
|
-
return (0, exports.createStringYAxisForOtherCharts)(yAxisParams, dataPoints, isRtl);
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
exports.createStringYAxis = createStringYAxis;
|
|
216
|
+
exports.createNumericYAxis = createNumericYAxis;
|
|
242
217
|
/**
|
|
243
218
|
* Creating String Y axis of the chart for Horizontal Bar Chart With Axis
|
|
244
219
|
* @param yAxisParams
|
|
245
220
|
* @param dataPoints
|
|
246
221
|
* @param isRtl
|
|
247
222
|
*/
|
|
248
|
-
var createStringYAxisForHorizontalBarChartWithAxis = function (yAxisParams, dataPoints, isRtl, barWidth
|
|
223
|
+
var createStringYAxisForHorizontalBarChartWithAxis = function (yAxisParams, dataPoints, isRtl, barWidth) {
|
|
249
224
|
var containerHeight = yAxisParams.containerHeight, _a = yAxisParams.tickPadding, tickPadding = _a === void 0 ? 12 : _a, margins = yAxisParams.margins, yAxisTickFormat = yAxisParams.yAxisTickFormat, yAxisElement = yAxisParams.yAxisElement;
|
|
250
225
|
var yAxisScale = (0, d3_scale_1.scaleBand)()
|
|
251
226
|
.domain(dataPoints)
|
|
@@ -265,7 +240,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
265
240
|
* @param dataPoints
|
|
266
241
|
* @param isRtl
|
|
267
242
|
*/
|
|
268
|
-
var
|
|
243
|
+
var createStringYAxis = function (yAxisParams, dataPoints, isRtl) {
|
|
269
244
|
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;
|
|
270
245
|
var yAxisScale = (0, d3_scale_1.scaleBand)()
|
|
271
246
|
.domain(dataPoints)
|
|
@@ -279,7 +254,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
279
254
|
yAxisElement ? (0, d3_selection_1.select)(yAxisElement).call(yAxis).selectAll('text') : '';
|
|
280
255
|
return yAxisScale;
|
|
281
256
|
};
|
|
282
|
-
exports.
|
|
257
|
+
exports.createStringYAxis = createStringYAxis;
|
|
283
258
|
/**
|
|
284
259
|
* For area chart and line chart, while displaying stackCallout, Need to form a callout data object.
|
|
285
260
|
* This methos creates an object for those 2 charts.
|
|
@@ -472,7 +447,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
472
447
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
473
448
|
function createYAxisLabels(node,
|
|
474
449
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
475
|
-
yAxis, noOfCharsToTruncate, truncateLabel,
|
|
450
|
+
yAxis, noOfCharsToTruncate, truncateLabel, isRtl) {
|
|
476
451
|
if (node === null) {
|
|
477
452
|
return;
|
|
478
453
|
}
|
|
@@ -774,71 +749,6 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
774
749
|
: { dStartValue: xMin, dEndValue: xMax, rStartValue: rMin, rEndValue: rMax };
|
|
775
750
|
}
|
|
776
751
|
exports.domainRageOfVerticalNumeric = domainRageOfVerticalNumeric;
|
|
777
|
-
/**
|
|
778
|
-
* For creating X axis, need to calculate x axis domain and range values from given points.
|
|
779
|
-
* This may vary based on chart type and type of x axis
|
|
780
|
-
* So, this method will define which method need to call based on chart type and axis type.
|
|
781
|
-
* @export
|
|
782
|
-
* @param {*} points
|
|
783
|
-
* @param {IMargins} margins
|
|
784
|
-
* @param {number} width
|
|
785
|
-
* @param {ChartTypes} chartType
|
|
786
|
-
* @param {boolean} isRTL
|
|
787
|
-
* @param {XAxisTypes} xAxisType
|
|
788
|
-
* @param {number} [barWidth]
|
|
789
|
-
* @returns {IDomainNRange}
|
|
790
|
-
*/
|
|
791
|
-
function getDomainNRangeValues(
|
|
792
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
793
|
-
points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues, shiftX) {
|
|
794
|
-
var domainNRangeValue;
|
|
795
|
-
if (xAxisType === XAxisTypes.NumericAxis) {
|
|
796
|
-
switch (chartType) {
|
|
797
|
-
case ChartTypes.AreaChart:
|
|
798
|
-
case ChartTypes.LineChart:
|
|
799
|
-
domainNRangeValue = domainRangeOfNumericForAreaChart(points, margins, width, isRTL);
|
|
800
|
-
break;
|
|
801
|
-
case ChartTypes.VerticalStackedBarChart:
|
|
802
|
-
domainNRangeValue = domainRangeOfVSBCNumeric(points, margins, width, isRTL, barWidth);
|
|
803
|
-
break;
|
|
804
|
-
case ChartTypes.VerticalBarChart:
|
|
805
|
-
domainNRangeValue = domainRageOfVerticalNumeric(points, margins, width, isRTL, barWidth);
|
|
806
|
-
break;
|
|
807
|
-
case ChartTypes.HorizontalBarChartWithAxis:
|
|
808
|
-
domainNRangeValue = domainRangeOfNumericForHorizontalBarChartWithAxis(points, margins, width, isRTL, shiftX);
|
|
809
|
-
break;
|
|
810
|
-
default:
|
|
811
|
-
domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
else if (xAxisType === XAxisTypes.DateAxis) {
|
|
815
|
-
switch (chartType) {
|
|
816
|
-
case ChartTypes.AreaChart:
|
|
817
|
-
case ChartTypes.LineChart:
|
|
818
|
-
case ChartTypes.VerticalBarChart:
|
|
819
|
-
case ChartTypes.VerticalStackedBarChart:
|
|
820
|
-
domainNRangeValue = domainRangeOfDateForAreaLineVerticalBarChart(points, margins, width, isRTL, tickValues, chartType, barWidth);
|
|
821
|
-
break;
|
|
822
|
-
default:
|
|
823
|
-
domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
else {
|
|
827
|
-
// String Axis type
|
|
828
|
-
switch (chartType) {
|
|
829
|
-
case ChartTypes.VerticalStackedBarChart:
|
|
830
|
-
case ChartTypes.GroupedVerticalBarChart:
|
|
831
|
-
case ChartTypes.VerticalBarChart:
|
|
832
|
-
case ChartTypes.HeatMapChart:
|
|
833
|
-
domainNRangeValue = domainRangeOfXStringAxis(margins, width, isRTL);
|
|
834
|
-
break;
|
|
835
|
-
default:
|
|
836
|
-
domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
return domainNRangeValue;
|
|
840
|
-
}
|
|
841
|
-
exports.getDomainNRangeValues = getDomainNRangeValues;
|
|
842
752
|
/**
|
|
843
753
|
* Calculating start and ending values of the Area chart and LineChart
|
|
844
754
|
* @export
|
|
@@ -921,41 +831,6 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
|
|
|
921
831
|
return { startValue: 0, endValue: 0 };
|
|
922
832
|
}
|
|
923
833
|
exports.findHBCWANumericMinMaxOfY = findHBCWANumericMinMaxOfY;
|
|
924
|
-
/**
|
|
925
|
-
* For creating Y axis, need to calculate y axis domain values from given points. This may vary based on chart type.
|
|
926
|
-
* So, this method will define which method need to call based on chart type to find out min and max values(For Domain).
|
|
927
|
-
* For grouped vertical bar chart, Calculating yMax value in the base file and sending as MaxOfYVal to cartesian.
|
|
928
|
-
* @export
|
|
929
|
-
* @param {*} points
|
|
930
|
-
* @param {ChartTypes} chartType
|
|
931
|
-
* @returns {{ startValue: number; endValue: number }}
|
|
932
|
-
*/
|
|
933
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
934
|
-
function getMinMaxOfYAxis(
|
|
935
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
936
|
-
points, chartType, yAxisType) {
|
|
937
|
-
if (yAxisType === void 0) { yAxisType = YAxisType.NumericAxis; }
|
|
938
|
-
var minMaxValues;
|
|
939
|
-
switch (chartType) {
|
|
940
|
-
case ChartTypes.AreaChart:
|
|
941
|
-
case ChartTypes.LineChart:
|
|
942
|
-
minMaxValues = findNumericMinMaxOfY(points);
|
|
943
|
-
break;
|
|
944
|
-
case ChartTypes.VerticalStackedBarChart:
|
|
945
|
-
minMaxValues = findVSBCNumericMinMaxOfY(points);
|
|
946
|
-
break;
|
|
947
|
-
case ChartTypes.VerticalBarChart:
|
|
948
|
-
minMaxValues = findVerticalNumericMinMaxOfY(points);
|
|
949
|
-
break;
|
|
950
|
-
case ChartTypes.HorizontalBarChartWithAxis:
|
|
951
|
-
minMaxValues = findHBCWANumericMinMaxOfY(points, yAxisType);
|
|
952
|
-
break;
|
|
953
|
-
default:
|
|
954
|
-
minMaxValues = { startValue: 0, endValue: 0 };
|
|
955
|
-
}
|
|
956
|
-
return minMaxValues;
|
|
957
|
-
}
|
|
958
|
-
exports.getMinMaxOfYAxis = getMinMaxOfYAxis;
|
|
959
834
|
/**
|
|
960
835
|
* @param p string or number or Date
|
|
961
836
|
*
|