@spteck/fluentui-react-charts 1.0.10 → 1.0.12
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/README.md +25 -0
- package/dist/charts/ComboChart/ComboChart.d.ts +6 -1
- package/dist/fluentui-react-charts.cjs.development.js +163 -66
- package/dist/fluentui-react-charts.cjs.development.js.map +1 -1
- package/dist/fluentui-react-charts.cjs.production.min.js +1 -1
- package/dist/fluentui-react-charts.cjs.production.min.js.map +1 -1
- package/dist/fluentui-react-charts.esm.js +163 -67
- package/dist/fluentui-react-charts.esm.js.map +1 -1
- package/dist/hooks/useChartUtils.d.ts +24 -0
- package/package.json +1 -1
|
@@ -782,6 +782,22 @@ var lightenColor = function lightenColor(hex, amount) {
|
|
|
782
782
|
var getFluentPalette = function getFluentPalette(_theme) {
|
|
783
783
|
return ['#4e79a7', '#f28e2c', '#e15759', '#76b7b2', '#59a14f', '#edc949', '#af7aa1', '#ff9da7', '#9c755f', '#bab0ab', '#8cd17d', '#b6992d', '#d37295', '#fabfd2', '#79706e'];
|
|
784
784
|
};
|
|
785
|
+
/**
|
|
786
|
+
* Returns animation configuration for instant interactions.
|
|
787
|
+
* Disables hover/tooltip animations for immediate response.
|
|
788
|
+
*/
|
|
789
|
+
var getInstantInteractionAnimations = function getInstantInteractionAnimations() {
|
|
790
|
+
return {
|
|
791
|
+
animation: false,
|
|
792
|
+
transitions: {
|
|
793
|
+
active: {
|
|
794
|
+
animation: {
|
|
795
|
+
duration: 0
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
};
|
|
800
|
+
};
|
|
785
801
|
/**
|
|
786
802
|
* Smart Fluent tooltip generator with chart-type awareness.
|
|
787
803
|
* Optimized for fast performance with reduced animation delays.
|
|
@@ -931,7 +947,8 @@ function useChartUtils(theme) {
|
|
|
931
947
|
getFluentPalette: getFluentPalette,
|
|
932
948
|
createFluentTooltip: createFluentTooltip,
|
|
933
949
|
createAxisLabelFormatter: createAxisLabelFormatter,
|
|
934
|
-
debounce: debounce
|
|
950
|
+
debounce: debounce,
|
|
951
|
+
getInstantInteractionAnimations: getInstantInteractionAnimations
|
|
935
952
|
};
|
|
936
953
|
}, [theme]);
|
|
937
954
|
}
|
|
@@ -1034,7 +1051,8 @@ function AreaChart(_ref) {
|
|
|
1034
1051
|
var _useChartUtils = useChartUtils(theme),
|
|
1035
1052
|
lightenColor = _useChartUtils.lightenColor,
|
|
1036
1053
|
getFluentPalette = _useChartUtils.getFluentPalette,
|
|
1037
|
-
createFluentTooltip = _useChartUtils.createFluentTooltip
|
|
1054
|
+
createFluentTooltip = _useChartUtils.createFluentTooltip,
|
|
1055
|
+
getInstantInteractionAnimations = _useChartUtils.getInstantInteractionAnimations;
|
|
1038
1056
|
var seriesColors = useMemo(function () {
|
|
1039
1057
|
return data.reduce(function (acc, series, idx) {
|
|
1040
1058
|
var base = getFluentPalette(theme)[idx % getFluentPalette(theme).length];
|
|
@@ -1097,9 +1115,10 @@ function AreaChart(_ref) {
|
|
|
1097
1115
|
labelColor = _useMemo.labelColor,
|
|
1098
1116
|
gridColor = _useMemo.gridColor;
|
|
1099
1117
|
var options = useMemo(function () {
|
|
1100
|
-
return {
|
|
1118
|
+
return _extends({
|
|
1101
1119
|
responsive: true,
|
|
1102
|
-
maintainAspectRatio: false
|
|
1120
|
+
maintainAspectRatio: false
|
|
1121
|
+
}, getInstantInteractionAnimations(), {
|
|
1103
1122
|
plugins: {
|
|
1104
1123
|
title: {
|
|
1105
1124
|
display: !!title,
|
|
@@ -1156,7 +1175,7 @@ function AreaChart(_ref) {
|
|
|
1156
1175
|
}
|
|
1157
1176
|
}
|
|
1158
1177
|
}
|
|
1159
|
-
};
|
|
1178
|
+
});
|
|
1160
1179
|
}, [title, showDatalabels, theme, fontFamily, fontSize, labelColor, gridColor, stacked, createFluentTooltip]);
|
|
1161
1180
|
return React__default.createElement("div", {
|
|
1162
1181
|
className: styles.chartWithLegend
|
|
@@ -1195,7 +1214,8 @@ function BarChart(_ref) {
|
|
|
1195
1214
|
var _useChartUtils = useChartUtils(theme),
|
|
1196
1215
|
lightenColor = _useChartUtils.lightenColor,
|
|
1197
1216
|
getFluentPalette = _useChartUtils.getFluentPalette,
|
|
1198
|
-
createFluentTooltip = _useChartUtils.createFluentTooltip
|
|
1217
|
+
createFluentTooltip = _useChartUtils.createFluentTooltip,
|
|
1218
|
+
getInstantInteractionAnimations = _useChartUtils.getInstantInteractionAnimations;
|
|
1199
1219
|
var styles = useGraphGlobalStyles();
|
|
1200
1220
|
var seriesColors = useMemo(function () {
|
|
1201
1221
|
return data.reduce(function (acc, series, idx) {
|
|
@@ -1259,9 +1279,10 @@ function BarChart(_ref) {
|
|
|
1259
1279
|
labelColor = _useMemo.labelColor,
|
|
1260
1280
|
gridColor = _useMemo.gridColor;
|
|
1261
1281
|
var options = useMemo(function () {
|
|
1262
|
-
return {
|
|
1282
|
+
return _extends({
|
|
1263
1283
|
responsive: true,
|
|
1264
|
-
maintainAspectRatio: false
|
|
1284
|
+
maintainAspectRatio: false
|
|
1285
|
+
}, getInstantInteractionAnimations(), {
|
|
1265
1286
|
plugins: {
|
|
1266
1287
|
title: {
|
|
1267
1288
|
display: !!title,
|
|
@@ -1344,7 +1365,7 @@ function BarChart(_ref) {
|
|
|
1344
1365
|
}
|
|
1345
1366
|
}
|
|
1346
1367
|
})
|
|
1347
|
-
};
|
|
1368
|
+
});
|
|
1348
1369
|
}, [title, showDatalabels, theme, fontFamily, fontSize, labelColor, gridColor, stacked, createFluentTooltip]);
|
|
1349
1370
|
return React__default.createElement("div", {
|
|
1350
1371
|
className: styles.chartWithLegend
|
|
@@ -1386,7 +1407,8 @@ function BarHorizontalChart(_ref) {
|
|
|
1386
1407
|
var _useChartUtils = useChartUtils(theme),
|
|
1387
1408
|
lightenColor = _useChartUtils.lightenColor,
|
|
1388
1409
|
getFluentPalette = _useChartUtils.getFluentPalette,
|
|
1389
|
-
createFluentTooltip = _useChartUtils.createFluentTooltip
|
|
1410
|
+
createFluentTooltip = _useChartUtils.createFluentTooltip,
|
|
1411
|
+
getInstantInteractionAnimations = _useChartUtils.getInstantInteractionAnimations;
|
|
1390
1412
|
var seriesColors = useMemo(function () {
|
|
1391
1413
|
return data.reduce(function (acc, series, idx) {
|
|
1392
1414
|
var base = getFluentPalette(theme)[idx % getFluentPalette(theme).length];
|
|
@@ -1445,10 +1467,11 @@ function BarHorizontalChart(_ref) {
|
|
|
1445
1467
|
labelColor = _useMemo.labelColor,
|
|
1446
1468
|
gridColor = _useMemo.gridColor;
|
|
1447
1469
|
var options = useMemo(function () {
|
|
1448
|
-
return {
|
|
1470
|
+
return _extends({
|
|
1449
1471
|
indexAxis: 'y',
|
|
1450
1472
|
responsive: true,
|
|
1451
|
-
maintainAspectRatio: false
|
|
1473
|
+
maintainAspectRatio: false
|
|
1474
|
+
}, getInstantInteractionAnimations(), {
|
|
1452
1475
|
plugins: {
|
|
1453
1476
|
title: {
|
|
1454
1477
|
display: !!title,
|
|
@@ -1505,7 +1528,7 @@ function BarHorizontalChart(_ref) {
|
|
|
1505
1528
|
}
|
|
1506
1529
|
}
|
|
1507
1530
|
}
|
|
1508
|
-
};
|
|
1531
|
+
});
|
|
1509
1532
|
}, [title, showDatalabels, theme, fontFamily, fontSize, labelColor, gridColor, stacked, createFluentTooltip]);
|
|
1510
1533
|
return React__default.createElement("div", {
|
|
1511
1534
|
className: styles.chartWithLegend
|
|
@@ -1545,7 +1568,8 @@ function BubbleChart(_ref) {
|
|
|
1545
1568
|
var _useChartUtils = useChartUtils(theme),
|
|
1546
1569
|
lightenColor = _useChartUtils.lightenColor,
|
|
1547
1570
|
getFluentPalette = _useChartUtils.getFluentPalette,
|
|
1548
|
-
createFluentTooltip = _useChartUtils.createFluentTooltip
|
|
1571
|
+
createFluentTooltip = _useChartUtils.createFluentTooltip,
|
|
1572
|
+
getInstantInteractionAnimations = _useChartUtils.getInstantInteractionAnimations;
|
|
1549
1573
|
var styles = useGraphGlobalStyles();
|
|
1550
1574
|
var seriesColors = useMemo(function () {
|
|
1551
1575
|
return data.reduce(function (acc, series, idx) {
|
|
@@ -1600,9 +1624,10 @@ function BubbleChart(_ref) {
|
|
|
1600
1624
|
gridColor = _useMemo.gridColor;
|
|
1601
1625
|
var options = useMemo(function () {
|
|
1602
1626
|
var _data$2;
|
|
1603
|
-
return {
|
|
1627
|
+
return _extends({
|
|
1604
1628
|
responsive: true,
|
|
1605
|
-
maintainAspectRatio: false
|
|
1629
|
+
maintainAspectRatio: false
|
|
1630
|
+
}, getInstantInteractionAnimations(), {
|
|
1606
1631
|
plugins: {
|
|
1607
1632
|
title: {
|
|
1608
1633
|
display: !!title,
|
|
@@ -1658,7 +1683,7 @@ function BubbleChart(_ref) {
|
|
|
1658
1683
|
}
|
|
1659
1684
|
}
|
|
1660
1685
|
}
|
|
1661
|
-
};
|
|
1686
|
+
});
|
|
1662
1687
|
}, [title, showDataLabels, theme, getPrimary, getSecondary, data, fontFamily, fontSize, labelColor, gridColor, createFluentTooltip]);
|
|
1663
1688
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
1664
1689
|
className: styles.chartWithLegend
|
|
@@ -1687,7 +1712,9 @@ function ComboChart(_ref) {
|
|
|
1687
1712
|
_ref$showDataLabels = _ref.showDataLabels,
|
|
1688
1713
|
showDataLabels = _ref$showDataLabels === void 0 ? false : _ref$showDataLabels,
|
|
1689
1714
|
_ref$theme = _ref.theme,
|
|
1690
|
-
theme = _ref$theme === void 0 ? webLightTheme : _ref$theme
|
|
1715
|
+
theme = _ref$theme === void 0 ? webLightTheme : _ref$theme,
|
|
1716
|
+
_ref$axesMode = _ref.axesMode,
|
|
1717
|
+
axesMode = _ref$axesMode === void 0 ? 'legacy' : _ref$axesMode;
|
|
1691
1718
|
var _useState = useState(function () {
|
|
1692
1719
|
return data.map(function (s) {
|
|
1693
1720
|
return s.label;
|
|
@@ -1699,7 +1726,8 @@ function ComboChart(_ref) {
|
|
|
1699
1726
|
var _useChartUtils = useChartUtils(theme),
|
|
1700
1727
|
lightenColor = _useChartUtils.lightenColor,
|
|
1701
1728
|
getFluentPalette = _useChartUtils.getFluentPalette,
|
|
1702
|
-
createFluentTooltip = _useChartUtils.createFluentTooltip
|
|
1729
|
+
createFluentTooltip = _useChartUtils.createFluentTooltip,
|
|
1730
|
+
getInstantInteractionAnimations = _useChartUtils.getInstantInteractionAnimations;
|
|
1703
1731
|
var seriesColors = useMemo(function () {
|
|
1704
1732
|
return data.reduce(function (acc, series, idx) {
|
|
1705
1733
|
var base = getFluentPalette(theme)[idx % getFluentPalette(theme).length];
|
|
@@ -1741,7 +1769,8 @@ function ComboChart(_ref) {
|
|
|
1741
1769
|
return {
|
|
1742
1770
|
type: series.type,
|
|
1743
1771
|
label: series.label,
|
|
1744
|
-
|
|
1772
|
+
// default yAxis assignment: legacy uses single 'y', dual uses 'y-bar'/'y-line'
|
|
1773
|
+
yAxisID: (_series$yAxisID = series.yAxisID) != null ? _series$yAxisID : axesMode === 'dual' ? series.type === 'bar' ? 'y-bar' : 'y-line' : 'y',
|
|
1745
1774
|
data: allCategories.map(function (cat) {
|
|
1746
1775
|
var found = series.data.find(function (d) {
|
|
1747
1776
|
return getPrimary(d) === cat;
|
|
@@ -1772,9 +1801,10 @@ function ComboChart(_ref) {
|
|
|
1772
1801
|
labelColor = _useMemo.labelColor,
|
|
1773
1802
|
gridColor = _useMemo.gridColor;
|
|
1774
1803
|
var options = useMemo(function () {
|
|
1775
|
-
|
|
1804
|
+
var base = _extends({
|
|
1776
1805
|
responsive: true,
|
|
1777
|
-
maintainAspectRatio: false
|
|
1806
|
+
maintainAspectRatio: false
|
|
1807
|
+
}, getInstantInteractionAnimations(), {
|
|
1778
1808
|
plugins: {
|
|
1779
1809
|
title: {
|
|
1780
1810
|
display: !!title,
|
|
@@ -1802,9 +1832,61 @@ function ComboChart(_ref) {
|
|
|
1802
1832
|
display: false
|
|
1803
1833
|
},
|
|
1804
1834
|
tooltip: createFluentTooltip(theme)
|
|
1805
|
-
}
|
|
1835
|
+
}
|
|
1836
|
+
});
|
|
1837
|
+
if (axesMode === 'dual') {
|
|
1838
|
+
return _extends({}, base, {
|
|
1839
|
+
scales: {
|
|
1840
|
+
x: {
|
|
1841
|
+
stacked: true,
|
|
1842
|
+
ticks: {
|
|
1843
|
+
color: labelColor,
|
|
1844
|
+
font: {
|
|
1845
|
+
family: fontFamily,
|
|
1846
|
+
size: fontSize
|
|
1847
|
+
}
|
|
1848
|
+
},
|
|
1849
|
+
grid: {
|
|
1850
|
+
color: gridColor
|
|
1851
|
+
}
|
|
1852
|
+
},
|
|
1853
|
+
'y-bar': {
|
|
1854
|
+
type: 'linear',
|
|
1855
|
+
position: 'left',
|
|
1856
|
+
stacked: true,
|
|
1857
|
+
ticks: {
|
|
1858
|
+
color: labelColor,
|
|
1859
|
+
font: {
|
|
1860
|
+
family: fontFamily,
|
|
1861
|
+
size: fontSize
|
|
1862
|
+
}
|
|
1863
|
+
},
|
|
1864
|
+
grid: {
|
|
1865
|
+
color: gridColor
|
|
1866
|
+
}
|
|
1867
|
+
},
|
|
1868
|
+
'y-line': {
|
|
1869
|
+
type: 'linear',
|
|
1870
|
+
position: 'right',
|
|
1871
|
+
stacked: false,
|
|
1872
|
+
ticks: {
|
|
1873
|
+
color: labelColor,
|
|
1874
|
+
font: {
|
|
1875
|
+
family: fontFamily,
|
|
1876
|
+
size: fontSize
|
|
1877
|
+
}
|
|
1878
|
+
},
|
|
1879
|
+
grid: {
|
|
1880
|
+
color: gridColor
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
});
|
|
1885
|
+
}
|
|
1886
|
+
return _extends({}, base, {
|
|
1806
1887
|
scales: {
|
|
1807
1888
|
x: {
|
|
1889
|
+
stacked: false,
|
|
1808
1890
|
ticks: {
|
|
1809
1891
|
color: labelColor,
|
|
1810
1892
|
font: {
|
|
@@ -1817,7 +1899,9 @@ function ComboChart(_ref) {
|
|
|
1817
1899
|
}
|
|
1818
1900
|
},
|
|
1819
1901
|
y: {
|
|
1902
|
+
type: 'linear',
|
|
1820
1903
|
position: 'left',
|
|
1904
|
+
stacked: false,
|
|
1821
1905
|
ticks: {
|
|
1822
1906
|
color: labelColor,
|
|
1823
1907
|
font: {
|
|
@@ -1827,12 +1911,11 @@ function ComboChart(_ref) {
|
|
|
1827
1911
|
},
|
|
1828
1912
|
grid: {
|
|
1829
1913
|
color: gridColor
|
|
1830
|
-
}
|
|
1831
|
-
stacked: false
|
|
1914
|
+
}
|
|
1832
1915
|
}
|
|
1833
1916
|
}
|
|
1834
|
-
};
|
|
1835
|
-
}, [title, showDataLabels, theme, fontFamily, fontSize, labelColor, gridColor, createFluentTooltip]);
|
|
1917
|
+
});
|
|
1918
|
+
}, [title, showDataLabels, theme, fontFamily, fontSize, labelColor, gridColor, createFluentTooltip, getInstantInteractionAnimations, axesMode]);
|
|
1836
1919
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
1837
1920
|
className: styles.chartWithLegend
|
|
1838
1921
|
}, React__default.createElement("div", {
|
|
@@ -1890,7 +1973,8 @@ function DoughnutChart(_ref) {
|
|
|
1890
1973
|
var _useChartUtils = useChartUtils(theme),
|
|
1891
1974
|
lightenColor = _useChartUtils.lightenColor,
|
|
1892
1975
|
getFluentPalette = _useChartUtils.getFluentPalette,
|
|
1893
|
-
createFluentTooltip = _useChartUtils.createFluentTooltip
|
|
1976
|
+
createFluentTooltip = _useChartUtils.createFluentTooltip,
|
|
1977
|
+
getInstantInteractionAnimations = _useChartUtils.getInstantInteractionAnimations;
|
|
1894
1978
|
var _useState = useState([]),
|
|
1895
1979
|
hiddenLabels = _useState[0],
|
|
1896
1980
|
setHiddenLabels = _useState[1];
|
|
@@ -1965,9 +2049,10 @@ function DoughnutChart(_ref) {
|
|
|
1965
2049
|
});
|
|
1966
2050
|
}, [allLabels, valueMap, colors]);
|
|
1967
2051
|
var options = useMemo(function () {
|
|
1968
|
-
return {
|
|
2052
|
+
return _extends({
|
|
1969
2053
|
responsive: true,
|
|
1970
|
-
maintainAspectRatio: false
|
|
2054
|
+
maintainAspectRatio: false
|
|
2055
|
+
}, getInstantInteractionAnimations(), {
|
|
1971
2056
|
plugins: {
|
|
1972
2057
|
legend: {
|
|
1973
2058
|
display: false
|
|
@@ -1999,7 +2084,7 @@ function DoughnutChart(_ref) {
|
|
|
1999
2084
|
}
|
|
2000
2085
|
}
|
|
2001
2086
|
}
|
|
2002
|
-
};
|
|
2087
|
+
});
|
|
2003
2088
|
}, [title, theme, showDataLabels, createFluentTooltip]);
|
|
2004
2089
|
return React__default.createElement("div", {
|
|
2005
2090
|
className: styles.chartWithLegend
|
|
@@ -2040,7 +2125,8 @@ function FloatingBarChart(_ref) {
|
|
|
2040
2125
|
var _useChartUtils = useChartUtils(theme),
|
|
2041
2126
|
lightenColor = _useChartUtils.lightenColor,
|
|
2042
2127
|
getFluentPalette = _useChartUtils.getFluentPalette,
|
|
2043
|
-
createFluentTooltip = _useChartUtils.createFluentTooltip
|
|
2128
|
+
createFluentTooltip = _useChartUtils.createFluentTooltip,
|
|
2129
|
+
getInstantInteractionAnimations = _useChartUtils.getInstantInteractionAnimations;
|
|
2044
2130
|
var seriesColors = useMemo(function () {
|
|
2045
2131
|
return data.reduce(function (acc, series, idx) {
|
|
2046
2132
|
var base = getFluentPalette(theme)[idx % getFluentPalette(theme).length];
|
|
@@ -2100,9 +2186,10 @@ function FloatingBarChart(_ref) {
|
|
|
2100
2186
|
labelColor = _useMemo.labelColor,
|
|
2101
2187
|
gridColor = _useMemo.gridColor;
|
|
2102
2188
|
var options = useMemo(function () {
|
|
2103
|
-
return {
|
|
2189
|
+
return _extends({
|
|
2104
2190
|
responsive: true,
|
|
2105
|
-
maintainAspectRatio: false
|
|
2191
|
+
maintainAspectRatio: false
|
|
2192
|
+
}, getInstantInteractionAnimations(), {
|
|
2106
2193
|
plugins: {
|
|
2107
2194
|
title: {
|
|
2108
2195
|
display: !!title,
|
|
@@ -2157,7 +2244,7 @@ function FloatingBarChart(_ref) {
|
|
|
2157
2244
|
}
|
|
2158
2245
|
}
|
|
2159
2246
|
}
|
|
2160
|
-
};
|
|
2247
|
+
});
|
|
2161
2248
|
}, [title, theme, showDataLabels, labelColor, fontFamily, fontSize, gridColor, createFluentTooltip]);
|
|
2162
2249
|
return React__default.createElement("div", {
|
|
2163
2250
|
className: styles.chartWithLegend
|
|
@@ -2199,7 +2286,8 @@ function LineChart(_ref) {
|
|
|
2199
2286
|
var _useChartUtils = useChartUtils(theme),
|
|
2200
2287
|
lightenColor = _useChartUtils.lightenColor,
|
|
2201
2288
|
getFluentPalette = _useChartUtils.getFluentPalette,
|
|
2202
|
-
createFluentTooltip = _useChartUtils.createFluentTooltip
|
|
2289
|
+
createFluentTooltip = _useChartUtils.createFluentTooltip,
|
|
2290
|
+
getInstantInteractionAnimations = _useChartUtils.getInstantInteractionAnimations;
|
|
2203
2291
|
var seriesColors = useMemo(function () {
|
|
2204
2292
|
return data.reduce(function (acc, series, idx) {
|
|
2205
2293
|
var base = getFluentPalette(theme)[idx % getFluentPalette(theme).length];
|
|
@@ -2262,9 +2350,10 @@ function LineChart(_ref) {
|
|
|
2262
2350
|
labelColor = _useMemo.labelColor,
|
|
2263
2351
|
gridColor = _useMemo.gridColor;
|
|
2264
2352
|
var options = useMemo(function () {
|
|
2265
|
-
return {
|
|
2353
|
+
return _extends({
|
|
2266
2354
|
responsive: true,
|
|
2267
|
-
maintainAspectRatio: false
|
|
2355
|
+
maintainAspectRatio: false
|
|
2356
|
+
}, getInstantInteractionAnimations(), {
|
|
2268
2357
|
plugins: {
|
|
2269
2358
|
title: {
|
|
2270
2359
|
display: !!title,
|
|
@@ -2319,7 +2408,7 @@ function LineChart(_ref) {
|
|
|
2319
2408
|
}
|
|
2320
2409
|
}
|
|
2321
2410
|
}
|
|
2322
|
-
};
|
|
2411
|
+
});
|
|
2323
2412
|
}, [title, theme, showDataLabels, labelColor, fontFamily, fontSize, gridColor, createFluentTooltip]);
|
|
2324
2413
|
return React__default.createElement("div", {
|
|
2325
2414
|
className: styles.chartWithLegend
|
|
@@ -2427,9 +2516,10 @@ function PieChart(_ref) {
|
|
|
2427
2516
|
chartData = _useMemo2.chartData,
|
|
2428
2517
|
legendEntries = _useMemo2.legendEntries;
|
|
2429
2518
|
var options = useMemo(function () {
|
|
2430
|
-
return {
|
|
2519
|
+
return _extends({
|
|
2431
2520
|
responsive: true,
|
|
2432
|
-
maintainAspectRatio: false
|
|
2521
|
+
maintainAspectRatio: false
|
|
2522
|
+
}, getInstantInteractionAnimations(), {
|
|
2433
2523
|
plugins: {
|
|
2434
2524
|
tooltip: createFluentTooltip(theme),
|
|
2435
2525
|
legend: {
|
|
@@ -2458,7 +2548,7 @@ function PieChart(_ref) {
|
|
|
2458
2548
|
}
|
|
2459
2549
|
}
|
|
2460
2550
|
}
|
|
2461
|
-
};
|
|
2551
|
+
});
|
|
2462
2552
|
}, [theme, title, showDataLabels]);
|
|
2463
2553
|
return React__default.createElement("div", {
|
|
2464
2554
|
className: styles.chartWithLegend
|
|
@@ -2519,7 +2609,8 @@ function PolarChart(_ref) {
|
|
|
2519
2609
|
theme = _ref$theme === void 0 ? webLightTheme : _ref$theme;
|
|
2520
2610
|
var _useChartUtils = useChartUtils(theme),
|
|
2521
2611
|
getFluentPalette = _useChartUtils.getFluentPalette,
|
|
2522
|
-
lightenColor = _useChartUtils.lightenColor
|
|
2612
|
+
lightenColor = _useChartUtils.lightenColor,
|
|
2613
|
+
getInstantInteractionAnimations = _useChartUtils.getInstantInteractionAnimations;
|
|
2523
2614
|
var _useState = useState([]),
|
|
2524
2615
|
hiddenLabels = _useState[0],
|
|
2525
2616
|
setHiddenLabels = _useState[1];
|
|
@@ -2582,9 +2673,10 @@ function PolarChart(_ref) {
|
|
|
2582
2673
|
};
|
|
2583
2674
|
}, [filteredLabels, values, visibleColors]);
|
|
2584
2675
|
var options = useMemo(function () {
|
|
2585
|
-
return {
|
|
2676
|
+
return _extends({
|
|
2586
2677
|
responsive: true,
|
|
2587
|
-
maintainAspectRatio: false
|
|
2678
|
+
maintainAspectRatio: false
|
|
2679
|
+
}, getInstantInteractionAnimations(), {
|
|
2588
2680
|
plugins: {
|
|
2589
2681
|
title: {
|
|
2590
2682
|
display: !!title,
|
|
@@ -2631,7 +2723,7 @@ function PolarChart(_ref) {
|
|
|
2631
2723
|
}
|
|
2632
2724
|
}
|
|
2633
2725
|
}
|
|
2634
|
-
};
|
|
2726
|
+
});
|
|
2635
2727
|
}, [theme, title, showDataLabels, createFluentTooltip]);
|
|
2636
2728
|
return React__default.createElement("div", {
|
|
2637
2729
|
className: styles.chartWithLegend
|
|
@@ -2671,7 +2763,8 @@ function RadarChart(_ref) {
|
|
|
2671
2763
|
var styles = useGraphGlobalStyles();
|
|
2672
2764
|
var _useChartUtils = useChartUtils(theme),
|
|
2673
2765
|
lightenColor = _useChartUtils.lightenColor,
|
|
2674
|
-
getFluentPalette = _useChartUtils.getFluentPalette
|
|
2766
|
+
getFluentPalette = _useChartUtils.getFluentPalette,
|
|
2767
|
+
getInstantInteractionAnimations = _useChartUtils.getInstantInteractionAnimations;
|
|
2675
2768
|
var seriesColors = useMemo(function () {
|
|
2676
2769
|
return data.reduce(function (acc, series, idx) {
|
|
2677
2770
|
var base = getFluentPalette(theme)[idx % getFluentPalette(theme).length];
|
|
@@ -2730,9 +2823,10 @@ function RadarChart(_ref) {
|
|
|
2730
2823
|
labelColor = _useMemo.labelColor,
|
|
2731
2824
|
gridColor = _useMemo.gridColor;
|
|
2732
2825
|
var options = useMemo(function () {
|
|
2733
|
-
return {
|
|
2826
|
+
return _extends({
|
|
2734
2827
|
responsive: true,
|
|
2735
|
-
maintainAspectRatio: false
|
|
2828
|
+
maintainAspectRatio: false
|
|
2829
|
+
}, getInstantInteractionAnimations(), {
|
|
2736
2830
|
plugins: {
|
|
2737
2831
|
title: {
|
|
2738
2832
|
display: !!title,
|
|
@@ -2785,7 +2879,7 @@ function RadarChart(_ref) {
|
|
|
2785
2879
|
}
|
|
2786
2880
|
}
|
|
2787
2881
|
}
|
|
2788
|
-
};
|
|
2882
|
+
});
|
|
2789
2883
|
}, [theme, title, showDataLabels, createFluentTooltip, gridColor, labelColor, fontFamily, fontSize]);
|
|
2790
2884
|
return React__default.createElement("div", {
|
|
2791
2885
|
className: styles.chartWithLegend
|
|
@@ -2824,7 +2918,8 @@ function ScatterChart(_ref) {
|
|
|
2824
2918
|
var _useChartUtils = useChartUtils(theme),
|
|
2825
2919
|
getFluentPalette = _useChartUtils.getFluentPalette,
|
|
2826
2920
|
lightenColor = _useChartUtils.lightenColor,
|
|
2827
|
-
createFluentTooltip = _useChartUtils.createFluentTooltip
|
|
2921
|
+
createFluentTooltip = _useChartUtils.createFluentTooltip,
|
|
2922
|
+
getInstantInteractionAnimations = _useChartUtils.getInstantInteractionAnimations;
|
|
2828
2923
|
var seriesColors = useMemo(function () {
|
|
2829
2924
|
return data.reduce(function (acc, series, idx) {
|
|
2830
2925
|
var base = getFluentPalette(theme)[idx % getFluentPalette(theme).length];
|
|
@@ -2872,9 +2967,10 @@ function ScatterChart(_ref) {
|
|
|
2872
2967
|
labelColor = _useMemo.labelColor,
|
|
2873
2968
|
gridColor = _useMemo.gridColor;
|
|
2874
2969
|
var options = useMemo(function () {
|
|
2875
|
-
return {
|
|
2970
|
+
return _extends({
|
|
2876
2971
|
responsive: true,
|
|
2877
|
-
maintainAspectRatio: false
|
|
2972
|
+
maintainAspectRatio: false
|
|
2973
|
+
}, getInstantInteractionAnimations(), {
|
|
2878
2974
|
plugins: {
|
|
2879
2975
|
title: {
|
|
2880
2976
|
display: !!title,
|
|
@@ -2932,7 +3028,7 @@ function ScatterChart(_ref) {
|
|
|
2932
3028
|
}
|
|
2933
3029
|
}
|
|
2934
3030
|
}
|
|
2935
|
-
};
|
|
3031
|
+
});
|
|
2936
3032
|
}, [theme, title, showDataLabels, createFluentTooltip, labelColor, fontFamily, fontSize, gridColor]);
|
|
2937
3033
|
return React__default.createElement("div", {
|
|
2938
3034
|
className: styles.chartWithLegend
|
|
@@ -2972,7 +3068,8 @@ function StackedLineChart(_ref) {
|
|
|
2972
3068
|
var _useChartUtils = useChartUtils(theme),
|
|
2973
3069
|
lightenColor = _useChartUtils.lightenColor,
|
|
2974
3070
|
getFluentPalette = _useChartUtils.getFluentPalette,
|
|
2975
|
-
createFluentTooltip = _useChartUtils.createFluentTooltip
|
|
3071
|
+
createFluentTooltip = _useChartUtils.createFluentTooltip,
|
|
3072
|
+
getInstantInteractionAnimations = _useChartUtils.getInstantInteractionAnimations;
|
|
2976
3073
|
var seriesColors = useMemo(function () {
|
|
2977
3074
|
return data.reduce(function (acc, series, idx) {
|
|
2978
3075
|
var base = getFluentPalette(theme)[idx % getFluentPalette(theme).length];
|
|
@@ -3035,9 +3132,10 @@ function StackedLineChart(_ref) {
|
|
|
3035
3132
|
labelColor = _useMemo.labelColor,
|
|
3036
3133
|
gridColor = _useMemo.gridColor;
|
|
3037
3134
|
var options = useMemo(function () {
|
|
3038
|
-
return {
|
|
3135
|
+
return _extends({
|
|
3039
3136
|
responsive: true,
|
|
3040
|
-
maintainAspectRatio: false
|
|
3137
|
+
maintainAspectRatio: false
|
|
3138
|
+
}, getInstantInteractionAnimations(), {
|
|
3041
3139
|
plugins: {
|
|
3042
3140
|
title: {
|
|
3043
3141
|
display: !!title,
|
|
@@ -3094,7 +3192,7 @@ function StackedLineChart(_ref) {
|
|
|
3094
3192
|
}
|
|
3095
3193
|
}
|
|
3096
3194
|
}
|
|
3097
|
-
};
|
|
3195
|
+
});
|
|
3098
3196
|
}, [theme, title, showDataLabels, createFluentTooltip, labelColor, fontFamily, fontSize, gridColor]);
|
|
3099
3197
|
return React__default.createElement("div", {
|
|
3100
3198
|
className: styles.chartWithLegend
|
|
@@ -3136,7 +3234,8 @@ function SteamChart(_ref) {
|
|
|
3136
3234
|
var styles = useGraphGlobalStyles();
|
|
3137
3235
|
var _useChartUtils = useChartUtils(theme),
|
|
3138
3236
|
lightenColor = _useChartUtils.lightenColor,
|
|
3139
|
-
getFluentPalette = _useChartUtils.getFluentPalette
|
|
3237
|
+
getFluentPalette = _useChartUtils.getFluentPalette,
|
|
3238
|
+
getInstantInteractionAnimations = _useChartUtils.getInstantInteractionAnimations;
|
|
3140
3239
|
var seriesColors = useMemo(function () {
|
|
3141
3240
|
return data.reduce(function (acc, series, idx) {
|
|
3142
3241
|
var base = getFluentPalette(theme)[idx % getFluentPalette(theme).length];
|
|
@@ -3210,13 +3309,10 @@ function SteamChart(_ref) {
|
|
|
3210
3309
|
labelColor = _useMemo.labelColor,
|
|
3211
3310
|
gridColor = _useMemo.gridColor;
|
|
3212
3311
|
var options = useMemo(function () {
|
|
3213
|
-
return {
|
|
3312
|
+
return _extends({
|
|
3214
3313
|
responsive: true,
|
|
3215
|
-
maintainAspectRatio: false
|
|
3216
|
-
|
|
3217
|
-
duration: 800,
|
|
3218
|
-
easing: 'easeOutQuart'
|
|
3219
|
-
},
|
|
3314
|
+
maintainAspectRatio: false
|
|
3315
|
+
}, getInstantInteractionAnimations(), {
|
|
3220
3316
|
plugins: {
|
|
3221
3317
|
title: {
|
|
3222
3318
|
display: !!title,
|
|
@@ -3282,7 +3378,7 @@ function SteamChart(_ref) {
|
|
|
3282
3378
|
max: showPercent ? 100 : undefined
|
|
3283
3379
|
}
|
|
3284
3380
|
}
|
|
3285
|
-
};
|
|
3381
|
+
});
|
|
3286
3382
|
}, [theme, title, showDataLabels, createFluentTooltip, labelColor, fontFamily, fontSize, gridColor, showPercent]);
|
|
3287
3383
|
return React__default.createElement("div", {
|
|
3288
3384
|
className: styles.chartWithLegend
|
|
@@ -4088,5 +4184,5 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
4088
4184
|
}, renderCards));
|
|
4089
4185
|
};
|
|
4090
4186
|
|
|
4091
|
-
export { AreaChart, BarChart, BarHorizontalChart, BubbleChart, ComboChart, Dashboard, DoughnutChart, FloatingBarChart, LineChart, PieChart, PolarChart, RadarChart, ScatterChart, StackedLineChart, SteamChart, createAxisLabelFormatter, createFluentTooltip, getFluentPalette, lightenColor, useChartUtils, useChartUtils as useGraphUtils };
|
|
4187
|
+
export { AreaChart, BarChart, BarHorizontalChart, BubbleChart, ComboChart, Dashboard, DoughnutChart, FloatingBarChart, LineChart, PieChart, PolarChart, RadarChart, ScatterChart, StackedLineChart, SteamChart, createAxisLabelFormatter, createFluentTooltip, getFluentPalette, getInstantInteractionAnimations, lightenColor, useChartUtils, useChartUtils as useGraphUtils };
|
|
4092
4188
|
//# sourceMappingURL=fluentui-react-charts.esm.js.map
|