@fluentui/react-charting 5.23.89 → 5.23.90
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 +28 -1
- package/CHANGELOG.md +13 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/lib/components/LineChart/LineChart.base.js +19 -9
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.js +19 -9
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.js +19 -9
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/package.json +3 -3
|
@@ -716,25 +716,35 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
716
716
|
var _this_1 = this;
|
|
717
717
|
var _a = this.props, legendProps = _a.legendProps, _b = _a.allowMultipleShapesForPoints, allowMultipleShapesForPoints = _b === void 0 ? false : _b;
|
|
718
718
|
var isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);
|
|
719
|
-
var
|
|
720
|
-
|
|
719
|
+
var mapLegendToPoints = {};
|
|
720
|
+
data.forEach(function (point) {
|
|
721
|
+
if (point.legend) {
|
|
722
|
+
if (!mapLegendToPoints[point.legend]) {
|
|
723
|
+
mapLegendToPoints[point.legend] = [];
|
|
724
|
+
}
|
|
725
|
+
mapLegendToPoints[point.legend].push(point);
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
var legendDataItems = Object.entries(mapLegendToPoints).map(function (_a) {
|
|
729
|
+
var legendTitle = _a[0], points = _a[1];
|
|
730
|
+
var representativePoint = points[0];
|
|
721
731
|
// mapping data to the format Legends component needs
|
|
722
|
-
var legend = tslib_1.__assign(tslib_1.__assign({ title:
|
|
732
|
+
var legend = tslib_1.__assign(tslib_1.__assign({ title: legendTitle, color: representativePoint.color, action: function () {
|
|
723
733
|
if (isLegendMultiSelectEnabled) {
|
|
724
|
-
_this_1._handleMultipleLineLegendSelectionAction(
|
|
734
|
+
points.forEach(function (p) { return _this_1._handleMultipleLineLegendSelectionAction(p); });
|
|
725
735
|
}
|
|
726
736
|
else {
|
|
727
|
-
_this_1._handleSingleLegendSelectionAction(
|
|
737
|
+
points.forEach(function (p) { return _this_1._handleSingleLegendSelectionAction(p); });
|
|
728
738
|
}
|
|
729
739
|
}, onMouseOutAction: function () {
|
|
730
740
|
_this_1.setState({ activeLegend: '' });
|
|
731
741
|
}, hoverAction: function () {
|
|
732
742
|
_this_1._handleChartMouseLeave();
|
|
733
|
-
_this_1.setState({ activeLegend:
|
|
734
|
-
} }, (
|
|
735
|
-
shape:
|
|
743
|
+
_this_1.setState({ activeLegend: legendTitle });
|
|
744
|
+
} }, (representativePoint.legendShape && {
|
|
745
|
+
shape: representativePoint.legendShape,
|
|
736
746
|
})), (allowMultipleShapesForPoints && {
|
|
737
|
-
shape: index_3.Points[
|
|
747
|
+
shape: index_3.Points[representativePoint.index % Object.keys(index_3.pointTypes).length],
|
|
738
748
|
}));
|
|
739
749
|
return legend;
|
|
740
750
|
});
|