@fluentui/react-charts 9.1.6 → 9.1.8
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.md +27 -2
- package/dist/index.d.ts +64 -5
- package/lib/components/AreaChart/AreaChart.js +21 -1
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.js +8 -9
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.js +2 -1
- package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +3 -3
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +11 -5
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.js +10 -3
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js +7 -2
- package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +2 -6
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +18 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +29 -2
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +7 -2
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js +15 -5
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +4 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +22 -2
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.js +18 -22
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +28 -3
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +28 -15
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +29 -12
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib/utilities/FocusableTooltipText.js +1 -2
- package/lib/utilities/FocusableTooltipText.js.map +1 -1
- package/lib/utilities/utilities.js +6 -144
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.js +20 -0
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +7 -7
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.js +2 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +3 -3
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +14 -5
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +10 -3
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +10 -2
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +0 -14
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +17 -0
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +28 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +8 -2
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +15 -5
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +3 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +21 -1
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.js +18 -22
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +26 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +3 -3
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +27 -14
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +28 -11
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib-commonjs/utilities/FocusableTooltipText.js +1 -2
- package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +11 -132
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +5 -5
|
@@ -470,20 +470,7 @@ function handleFloatingPointPrecisionError(num) {
|
|
|
470
470
|
}
|
|
471
471
|
return dataPointsArray;
|
|
472
472
|
}
|
|
473
|
-
|
|
474
|
-
* Creating Numeric Y axis of the chart
|
|
475
|
-
* @export
|
|
476
|
-
* @param {IYAxisParams} yAxisParams
|
|
477
|
-
* @param {boolean} isRtl
|
|
478
|
-
*/ export function createYAxis(yAxisParams, isRtl, axisData, chartType, barWidth, isIntegralDataset, useSecondaryYScale = false, roundedTicks = false) {
|
|
479
|
-
switch(chartType){
|
|
480
|
-
case 6:
|
|
481
|
-
return createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl, axisData, barWidth);
|
|
482
|
-
default:
|
|
483
|
-
return createNumericYAxisForOtherCharts(yAxisParams, isRtl, axisData, isIntegralDataset, chartType, useSecondaryYScale, roundedTicks);
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
export function createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl, axisData, barWidth) {
|
|
473
|
+
export function createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl) {
|
|
487
474
|
const { yMinMaxValues = {
|
|
488
475
|
startValue: 0,
|
|
489
476
|
endValue: 0
|
|
@@ -505,7 +492,7 @@ export function createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl, axi
|
|
|
505
492
|
yAxisElement ? d3Select(yAxisElement).call(yAxis).selectAll('text').attr('aria-hidden', 'true') : '';
|
|
506
493
|
return yAxisScale;
|
|
507
494
|
}
|
|
508
|
-
export function
|
|
495
|
+
export function createNumericYAxis(yAxisParams, isRtl, axisData, isIntegralDataset, chartType, useSecondaryYScale = false, roundedTicks = false) {
|
|
509
496
|
const { yMinMaxValues = {
|
|
510
497
|
startValue: 0,
|
|
511
498
|
endValue: 0
|
|
@@ -536,20 +523,12 @@ export function createNumericYAxisForOtherCharts(yAxisParams, isRtl, axisData, i
|
|
|
536
523
|
axisData.yAxisDomainValues = domainValues;
|
|
537
524
|
return yAxisScale;
|
|
538
525
|
}
|
|
539
|
-
export const createStringYAxis = (yAxisParams, dataPoints, isRtl, chartType, barWidth, culture)=>{
|
|
540
|
-
switch(chartType){
|
|
541
|
-
case 6:
|
|
542
|
-
return createStringYAxisForHorizontalBarChartWithAxis(yAxisParams, dataPoints, isRtl, barWidth, culture);
|
|
543
|
-
default:
|
|
544
|
-
return createStringYAxisForOtherCharts(yAxisParams, dataPoints, isRtl);
|
|
545
|
-
}
|
|
546
|
-
};
|
|
547
526
|
/**
|
|
548
527
|
* Creating String Y axis of the chart for Horizontal Bar Chart With Axis
|
|
549
528
|
* @param yAxisParams
|
|
550
529
|
* @param dataPoints
|
|
551
530
|
* @param isRtl
|
|
552
|
-
*/ export const createStringYAxisForHorizontalBarChartWithAxis = (yAxisParams, dataPoints, isRtl, barWidth
|
|
531
|
+
*/ export const createStringYAxisForHorizontalBarChartWithAxis = (yAxisParams, dataPoints, isRtl, barWidth)=>{
|
|
553
532
|
const { containerHeight, tickPadding = 12, margins, yAxisTickFormat, yAxisElement, yAxisPadding } = yAxisParams;
|
|
554
533
|
let yAxisPaddingValue = yAxisPadding !== null && yAxisPadding !== void 0 ? yAxisPadding : 0.5;
|
|
555
534
|
yAxisPaddingValue = yAxisPaddingValue === 1 ? 0.99 : yAxisPaddingValue;
|
|
@@ -570,7 +549,7 @@ export const createStringYAxis = (yAxisParams, dataPoints, isRtl, chartType, bar
|
|
|
570
549
|
* @param yAxisParams
|
|
571
550
|
* @param dataPoints
|
|
572
551
|
* @param isRtl
|
|
573
|
-
*/ export const
|
|
552
|
+
*/ export const createStringYAxis = (yAxisParams, dataPoints, isRtl)=>{
|
|
574
553
|
const { containerHeight, tickPadding = 12, margins, yAxisTickFormat, yAxisElement, yAxisPadding = 0 } = yAxisParams;
|
|
575
554
|
const yAxisScale = d3ScaleBand().domain(dataPoints).range([
|
|
576
555
|
containerHeight - margins.bottom,
|
|
@@ -744,7 +723,7 @@ export function getUnique(arr, comp) {
|
|
|
744
723
|
* This method used for wrapping of y axis labels (tick values).
|
|
745
724
|
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
746
725
|
export function createYAxisLabels(node, // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
747
|
-
yAxis, noOfCharsToTruncate, truncateLabel,
|
|
726
|
+
yAxis, noOfCharsToTruncate, truncateLabel, isRtl) {
|
|
748
727
|
if (node === null) {
|
|
749
728
|
return;
|
|
750
729
|
}
|
|
@@ -1153,7 +1132,7 @@ export function tooltipOfAxislabels(axistooltipProps) {
|
|
|
1153
1132
|
* @param {boolean} isRTL
|
|
1154
1133
|
* @param {number} barWidth
|
|
1155
1134
|
* @returns {IDomainNRange}
|
|
1156
|
-
*/ export function
|
|
1135
|
+
*/ export function domainRangeOfVerticalNumeric(points, margins, containerWidth, isRTL, barWidth) {
|
|
1157
1136
|
const xMax = d3Max(points, (point)=>point.x);
|
|
1158
1137
|
const xMin = d3Min(points, (point)=>point.x);
|
|
1159
1138
|
const rMin = margins.left;
|
|
@@ -1170,88 +1149,6 @@ export function tooltipOfAxislabels(axistooltipProps) {
|
|
|
1170
1149
|
rEndValue: rMax
|
|
1171
1150
|
};
|
|
1172
1151
|
}
|
|
1173
|
-
/**
|
|
1174
|
-
* For creating X axis, need to calculate x axis domain and range values from given points.
|
|
1175
|
-
* This may vary based on chart type and type of x axis
|
|
1176
|
-
* So, this method will define which method need to call based on chart type and axis type.
|
|
1177
|
-
* @export
|
|
1178
|
-
* @param {*} points
|
|
1179
|
-
* @param {IMargins} margins
|
|
1180
|
-
* @param {number} width
|
|
1181
|
-
* @param {ChartTypes} chartType
|
|
1182
|
-
* @param {boolean} isRTL
|
|
1183
|
-
* @param {XAxisTypes} xAxisType
|
|
1184
|
-
* @param {number} [barWidth]
|
|
1185
|
-
* @returns {IDomainNRange}
|
|
1186
|
-
*/ export function getDomainNRangeValues(// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1187
|
-
points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues, shiftX, X_ORIGIN) {
|
|
1188
|
-
let domainNRangeValue;
|
|
1189
|
-
if (xAxisType === 0) {
|
|
1190
|
-
switch(chartType){
|
|
1191
|
-
case 0:
|
|
1192
|
-
case 1:
|
|
1193
|
-
domainNRangeValue = domainRangeOfNumericForAreaChart(points, margins, width, isRTL);
|
|
1194
|
-
break;
|
|
1195
|
-
case 3:
|
|
1196
|
-
domainNRangeValue = domainRangeOfVSBCNumeric(points, margins, width, isRTL, barWidth);
|
|
1197
|
-
break;
|
|
1198
|
-
case 2:
|
|
1199
|
-
domainNRangeValue = domainRageOfVerticalNumeric(points, margins, width, isRTL, barWidth);
|
|
1200
|
-
break;
|
|
1201
|
-
case 6:
|
|
1202
|
-
domainNRangeValue = domainRangeOfNumericForHorizontalBarChartWithAxis(points, margins, width, isRTL, shiftX, X_ORIGIN);
|
|
1203
|
-
break;
|
|
1204
|
-
case 7:
|
|
1205
|
-
domainNRangeValue = domainRangeOfNumericForScatterChart(points, margins, width, isRTL);
|
|
1206
|
-
break;
|
|
1207
|
-
default:
|
|
1208
|
-
domainNRangeValue = {
|
|
1209
|
-
dStartValue: 0,
|
|
1210
|
-
dEndValue: 0,
|
|
1211
|
-
rStartValue: 0,
|
|
1212
|
-
rEndValue: 0
|
|
1213
|
-
};
|
|
1214
|
-
}
|
|
1215
|
-
} else if (xAxisType === 1) {
|
|
1216
|
-
switch(chartType){
|
|
1217
|
-
case 0:
|
|
1218
|
-
case 1:
|
|
1219
|
-
case 2:
|
|
1220
|
-
case 3:
|
|
1221
|
-
domainNRangeValue = domainRangeOfDateForAreaLineVerticalBarChart(points, margins, width, isRTL, tickValues, chartType, barWidth);
|
|
1222
|
-
break;
|
|
1223
|
-
case 7:
|
|
1224
|
-
domainNRangeValue = domainRangeOfDateForScatterChart(points, margins, width, isRTL, tickValues);
|
|
1225
|
-
break;
|
|
1226
|
-
default:
|
|
1227
|
-
domainNRangeValue = {
|
|
1228
|
-
dStartValue: 0,
|
|
1229
|
-
dEndValue: 0,
|
|
1230
|
-
rStartValue: 0,
|
|
1231
|
-
rEndValue: 0
|
|
1232
|
-
};
|
|
1233
|
-
}
|
|
1234
|
-
} else {
|
|
1235
|
-
// String Axis type
|
|
1236
|
-
switch(chartType){
|
|
1237
|
-
case 3:
|
|
1238
|
-
case 4:
|
|
1239
|
-
case 2:
|
|
1240
|
-
case 5:
|
|
1241
|
-
case 7:
|
|
1242
|
-
domainNRangeValue = domainRangeOfXStringAxis(margins, width, isRTL);
|
|
1243
|
-
break;
|
|
1244
|
-
default:
|
|
1245
|
-
domainNRangeValue = {
|
|
1246
|
-
dStartValue: 0,
|
|
1247
|
-
dEndValue: 0,
|
|
1248
|
-
rStartValue: 0,
|
|
1249
|
-
rEndValue: 0
|
|
1250
|
-
};
|
|
1251
|
-
}
|
|
1252
|
-
}
|
|
1253
|
-
return domainNRangeValue;
|
|
1254
|
-
}
|
|
1255
1152
|
/**
|
|
1256
1153
|
* Calculating start and ending values of the Area chart and LineChart
|
|
1257
1154
|
* @export
|
|
@@ -1325,41 +1222,6 @@ points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues, shift
|
|
|
1325
1222
|
endValue: 0
|
|
1326
1223
|
};
|
|
1327
1224
|
}
|
|
1328
|
-
/**
|
|
1329
|
-
* For creating Y axis, need to calculate y axis domain values from given points. This may vary based on chart type.
|
|
1330
|
-
* So, this method will define which method need to call based on chart type to find out min and max values(For Domain).
|
|
1331
|
-
* For grouped vertical bar chart, Calculating yMax value in the base file and sending as MaxOfYVal to cartesian.
|
|
1332
|
-
* @export
|
|
1333
|
-
* @param {*} points
|
|
1334
|
-
* @param {ChartTypes} chartType
|
|
1335
|
-
* @returns {{ startValue: number; endValue: number }}
|
|
1336
|
-
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1337
|
-
export function getMinMaxOfYAxis(// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1338
|
-
points, chartType, yAxisType = 0, useSecondaryYScale) {
|
|
1339
|
-
let minMaxValues;
|
|
1340
|
-
switch(chartType){
|
|
1341
|
-
case 0:
|
|
1342
|
-
case 1:
|
|
1343
|
-
case 7:
|
|
1344
|
-
minMaxValues = findNumericMinMaxOfY(points, yAxisType, useSecondaryYScale);
|
|
1345
|
-
break;
|
|
1346
|
-
case 3:
|
|
1347
|
-
minMaxValues = findVSBCNumericMinMaxOfY(points);
|
|
1348
|
-
break;
|
|
1349
|
-
case 2:
|
|
1350
|
-
minMaxValues = findVerticalNumericMinMaxOfY(points, yAxisType, useSecondaryYScale);
|
|
1351
|
-
break;
|
|
1352
|
-
case 6:
|
|
1353
|
-
minMaxValues = findHBCWANumericMinMaxOfY(points, yAxisType);
|
|
1354
|
-
break;
|
|
1355
|
-
default:
|
|
1356
|
-
minMaxValues = {
|
|
1357
|
-
startValue: 0,
|
|
1358
|
-
endValue: 0
|
|
1359
|
-
};
|
|
1360
|
-
}
|
|
1361
|
-
return minMaxValues;
|
|
1362
|
-
}
|
|
1363
1225
|
/**
|
|
1364
1226
|
* @param p string or number or Date
|
|
1365
1227
|
*
|