@fluentui/react-charts 0.0.0-nightly-20250826-2140.1 → 0.0.0-nightly-20250827-0407.1
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 +48 -15
- package/dist/index.d.ts +15 -1
- package/lib/components/AreaChart/AreaChart.js +4 -1
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.js +2 -2
- package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +3 -15
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.js +87 -6
- package/lib/components/ChartTable/ChartTable.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.js +24 -24
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +17 -14
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +6 -33
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +42 -16
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +20 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +493 -259
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.js +6 -1
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.js +21 -4
- package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +8 -4
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +23 -4
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +4 -17
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +4 -21
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +175 -114
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +26 -6
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +137 -82
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/LineChart/LineChart.types.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.js +23 -10
- package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js +4 -21
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +12 -25
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +2 -12
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +95 -59
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +27 -7
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +8 -14
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +27 -4
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +8 -6
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +5 -19
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +61 -44
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +7 -6
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +4 -19
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
- package/lib/utilities/Common.styles.js +47 -0
- package/lib/utilities/Common.styles.js.map +1 -0
- package/lib/utilities/Common.styles.raw.js +47 -0
- package/lib/utilities/Common.styles.raw.js.map +1 -0
- package/lib/utilities/SVGTooltipText.js.map +1 -1
- package/lib/utilities/index.js +1 -0
- package/lib/utilities/index.js.map +1 -1
- package/lib/utilities/scatterpolar-utils.js +63 -0
- package/lib/utilities/scatterpolar-utils.js.map +1 -0
- package/lib/utilities/utilities.js +32 -37
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.js +4 -1
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +2 -14
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.js +87 -6
- package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +24 -24
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +15 -13
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +4 -32
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +41 -15
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +23 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +500 -257
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +6 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +32 -4
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +8 -4
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +22 -3
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +2 -19
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +3 -20
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +174 -113
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +25 -5
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +136 -81
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +30 -9
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +2 -20
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +23 -33
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +1 -12
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +94 -58
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +37 -5
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +7 -13
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +26 -3
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +5 -3
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +3 -17
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +60 -43
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +5 -3
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +3 -18
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/utilities/Common.styles.js +71 -0
- package/lib-commonjs/utilities/Common.styles.js.map +1 -0
- package/lib-commonjs/utilities/Common.styles.raw.js +71 -0
- package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -0
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/index.js +1 -0
- package/lib-commonjs/utilities/index.js.map +1 -1
- package/lib-commonjs/utilities/scatterpolar-utils.js +78 -0
- package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -0
- package/lib-commonjs/utilities/utilities.js +28 -40
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +12 -12
|
@@ -23,7 +23,11 @@ const _chartutilities = require("@fluentui/chart-utilities");
|
|
|
23
23
|
const barGapMultiplier = 0.2;
|
|
24
24
|
const barGapMin = 1;
|
|
25
25
|
const MIN_DOMAIN_MARGIN = 8;
|
|
26
|
-
const VerticalStackedBarChart = (props
|
|
26
|
+
const VerticalStackedBarChart = /*#__PURE__*/ _react.forwardRef((props = {
|
|
27
|
+
xAxisCategoryOrder: 'default',
|
|
28
|
+
yAxisCategoryOrder: 'default',
|
|
29
|
+
data: []
|
|
30
|
+
}, forwardedRef)=>{
|
|
27
31
|
var _props_legendProps;
|
|
28
32
|
const _isRtl = (0, _index1.useRtl)();
|
|
29
33
|
const _createLegendsForLine = (data)=>_getLineLegends(data);
|
|
@@ -252,9 +256,7 @@ const VerticalStackedBarChart = (props)=>{
|
|
|
252
256
|
_initYAxisParams();
|
|
253
257
|
}
|
|
254
258
|
function _createDataSetLayer() {
|
|
255
|
-
const tempArr = [];
|
|
256
259
|
const dataset = _points.map((singlePointData)=>{
|
|
257
|
-
tempArr.push(singlePointData.xAxisPoint);
|
|
258
260
|
if (_yAxisType === _index1.YAxisType.StringAxis) {
|
|
259
261
|
return {
|
|
260
262
|
x: singlePointData.xAxisPoint,
|
|
@@ -270,7 +272,7 @@ const VerticalStackedBarChart = (props)=>{
|
|
|
270
272
|
y: total
|
|
271
273
|
};
|
|
272
274
|
});
|
|
273
|
-
_xAxisLabels =
|
|
275
|
+
_xAxisLabels = _getOrderedXAxisLabels();
|
|
274
276
|
return dataset;
|
|
275
277
|
}
|
|
276
278
|
function _onLegendHover(legendTitle) {
|
|
@@ -305,16 +307,16 @@ const VerticalStackedBarChart = (props)=>{
|
|
|
305
307
|
}
|
|
306
308
|
}
|
|
307
309
|
/**
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
310
|
+
* This function checks if the given legend is highlighted or not.
|
|
311
|
+
* A legend can be highlighted in 2 ways:
|
|
312
|
+
* 1. selection: if the user clicks on it
|
|
313
|
+
* 2. hovering: if there is no selected legend and the user hovers over it
|
|
314
|
+
*/ function _isLegendHighlighted(legendTitle) {
|
|
313
315
|
return _getHighlightedLegend().includes(legendTitle);
|
|
314
316
|
}
|
|
315
317
|
/**
|
|
316
|
-
|
|
317
|
-
|
|
318
|
+
* This function checks if none of the legends is selected or hovered.
|
|
319
|
+
*/ function _noLegendHighlighted() {
|
|
318
320
|
return _getHighlightedLegend().length === 0;
|
|
319
321
|
}
|
|
320
322
|
function _getAriaLabel(singleChartData, point, isLinePoint) {
|
|
@@ -955,40 +957,13 @@ const VerticalStackedBarChart = (props)=>{
|
|
|
955
957
|
}
|
|
956
958
|
});
|
|
957
959
|
}
|
|
958
|
-
|
|
959
|
-
const legendToYValues = {};
|
|
960
|
-
_points.forEach((xPoint)=>{
|
|
961
|
-
xPoint.chartData.forEach((bar)=>{
|
|
962
|
-
if (!legendToYValues[bar.legend]) {
|
|
963
|
-
legendToYValues[bar.legend] = [
|
|
964
|
-
`${bar.data}`
|
|
965
|
-
];
|
|
966
|
-
} else {
|
|
967
|
-
legendToYValues[bar.legend].push(`${bar.data}`);
|
|
968
|
-
}
|
|
969
|
-
});
|
|
970
|
-
});
|
|
971
|
-
const yAxisLabels = new Set();
|
|
972
|
-
Object.values(legendToYValues).forEach((yValues)=>{
|
|
973
|
-
yValues.forEach((yVal)=>{
|
|
974
|
-
yAxisLabels.add(yVal);
|
|
975
|
-
});
|
|
976
|
-
});
|
|
977
|
-
Object.values(_lineObject).forEach((linePoints)=>{
|
|
978
|
-
linePoints.forEach((linePoint)=>{
|
|
979
|
-
if (!linePoint.useSecondaryYScale) {
|
|
980
|
-
yAxisLabels.add(`${linePoint.y}`);
|
|
981
|
-
}
|
|
982
|
-
});
|
|
983
|
-
});
|
|
984
|
-
_yAxisLabels = Array.from(yAxisLabels);
|
|
985
|
-
}
|
|
960
|
+
_yAxisLabels = _getOrderedYAxisLabels();
|
|
986
961
|
}
|
|
987
962
|
function _getYDomainMargins(containerHeight) {
|
|
988
963
|
/**
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
964
|
+
* Specifies the extra top margin to apply above the highest y-axis tick label.
|
|
965
|
+
* Useful when stacked bars extend beyond the combined height of all y-axis labels (or categories).
|
|
966
|
+
*/ let yAxisTickMarginTop = 0;
|
|
992
967
|
/** Total height available to render the bars */ const totalHeight = containerHeight - _margins.bottom - _margins.top;
|
|
993
968
|
if (_yAxisType === _index1.YAxisType.StringAxis) {
|
|
994
969
|
/** Maximum height of the stacked bars, expressed in multiples of the height of a y-axis label (or category) */ let maxBarHeightInLabels = 0;
|
|
@@ -1007,6 +982,48 @@ const VerticalStackedBarChart = (props)=>{
|
|
|
1007
982
|
top: _margins.top + yAxisTickMarginTop
|
|
1008
983
|
};
|
|
1009
984
|
}
|
|
985
|
+
function _getOrderedXAxisLabels() {
|
|
986
|
+
if (_xAxisType !== _index1.XAxisTypes.StringAxis) {
|
|
987
|
+
return [];
|
|
988
|
+
}
|
|
989
|
+
return (0, _index1.sortAxisCategories)(_mapCategoryToValues(), props.xAxisCategoryOrder);
|
|
990
|
+
}
|
|
991
|
+
function _getOrderedYAxisLabels() {
|
|
992
|
+
if (_yAxisType !== _index1.YAxisType.StringAxis) {
|
|
993
|
+
return [];
|
|
994
|
+
}
|
|
995
|
+
return (0, _index1.sortAxisCategories)(_mapCategoryToValues(true), props.yAxisCategoryOrder);
|
|
996
|
+
}
|
|
997
|
+
function _mapCategoryToValues(isYAxis = false) {
|
|
998
|
+
const categoryToValues = {};
|
|
999
|
+
_points.forEach((point)=>{
|
|
1000
|
+
var _point_lineData;
|
|
1001
|
+
point.chartData.forEach((bar)=>{
|
|
1002
|
+
const category = isYAxis ? bar.data : point.xAxisPoint;
|
|
1003
|
+
const value = isYAxis ? point.xAxisPoint : bar.data;
|
|
1004
|
+
if (!categoryToValues[category]) {
|
|
1005
|
+
categoryToValues[category] = [];
|
|
1006
|
+
}
|
|
1007
|
+
if (typeof value === 'number') {
|
|
1008
|
+
categoryToValues[category].push(value);
|
|
1009
|
+
}
|
|
1010
|
+
});
|
|
1011
|
+
(_point_lineData = point.lineData) === null || _point_lineData === void 0 ? void 0 : _point_lineData.forEach((linePoint)=>{
|
|
1012
|
+
if (isYAxis && linePoint.useSecondaryYScale) {
|
|
1013
|
+
return;
|
|
1014
|
+
}
|
|
1015
|
+
const category = isYAxis ? linePoint.y : point.xAxisPoint;
|
|
1016
|
+
const value = isYAxis ? point.xAxisPoint : linePoint.y;
|
|
1017
|
+
if (!categoryToValues[category]) {
|
|
1018
|
+
categoryToValues[category] = [];
|
|
1019
|
+
}
|
|
1020
|
+
if (typeof value === 'number') {
|
|
1021
|
+
categoryToValues[category].push(value);
|
|
1022
|
+
}
|
|
1023
|
+
});
|
|
1024
|
+
});
|
|
1025
|
+
return categoryToValues;
|
|
1026
|
+
}
|
|
1010
1027
|
if (!_isChartEmpty()) {
|
|
1011
1028
|
_adjustProps();
|
|
1012
1029
|
const _isHavingLines = props.data.some((item)=>item.lineData && item.lineData.length > 0);
|
|
@@ -1081,5 +1098,5 @@ const VerticalStackedBarChart = (props)=>{
|
|
|
1081
1098
|
},
|
|
1082
1099
|
"aria-label": 'Graph has no data to display'
|
|
1083
1100
|
});
|
|
1084
|
-
};
|
|
1101
|
+
});
|
|
1085
1102
|
VerticalStackedBarChart.displayName = 'VerticalStackedBarChart';
|