@fluentui/react-charting 5.24.31 → 5.24.33
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 +57 -1
- package/CHANGELOG.md +23 -2
- package/dist/react-charting.d.ts +131 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +44 -2
- package/lib/components/AreaChart/AreaChart.base.js +18 -22
- package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.base.js +12 -6
- package/lib/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +1 -4
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +107 -52
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +13 -2
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +260 -100
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.d.ts +7 -2
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
- package/lib/components/LineChart/LineChart.base.js +49 -39
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.base.js +5 -11
- package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js.map +1 -1
- package/lib/types/IDataPoint.d.ts +121 -1
- package/lib/types/IDataPoint.js.map +1 -1
- package/lib/utilities/utilities.d.ts +18 -4
- package/lib/utilities/utilities.js +14 -5
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-amd/components/AreaChart/AreaChart.base.js +16 -20
- package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-amd/components/ChartTable/ChartTable.base.js +12 -7
- package/lib-amd/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +1 -4
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +106 -51
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +13 -2
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +257 -97
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.d.ts +7 -2
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.js +48 -38
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.base.js +3 -9
- package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-amd/index.d.ts +1 -1
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/types/IDataPoint.d.ts +121 -1
- package/lib-amd/types/IDataPoint.js.map +1 -1
- package/lib-amd/utilities/utilities.d.ts +18 -4
- package/lib-amd/utilities/utilities.js +16 -6
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.base.js +16 -20
- package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.base.js +12 -6
- package/lib-commonjs/components/ChartTable/ChartTable.base.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +1 -4
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +106 -51
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +13 -2
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +257 -97
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.d.ts +7 -2
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.js +48 -38
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +3 -9
- package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
- package/lib-commonjs/index.d.ts +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/IDataPoint.d.ts +121 -1
- package/lib-commonjs/types/IDataPoint.js.map +1 -1
- package/lib-commonjs/utilities/utilities.d.ts +18 -4
- package/lib-commonjs/utilities/utilities.js +16 -6
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +2 -2
- package/project.json +155 -0
|
@@ -315,11 +315,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
315
315
|
var formattedDate = xPointToHighlight instanceof Date
|
|
316
316
|
? (0, chart_utilities_1.formatDateToLocaleString)(xPointToHighlight, _this_1.props.culture, _this_1.props.useUTC)
|
|
317
317
|
: xPointToHighlight;
|
|
318
|
-
var
|
|
319
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
320
|
-
var found = (0, Utilities_1.find)(_this_1._calloutPoints, function (element) {
|
|
321
|
-
return element.x === modifiedXVal;
|
|
322
|
-
});
|
|
318
|
+
var found = (0, index_3.findCalloutPoints)(_this_1._calloutPoints, xPointToHighlight);
|
|
323
319
|
var pointToHighlight = lineChartData[linenumber].data[index];
|
|
324
320
|
var pointToHighlightUpdated = _this_1.state.nearestCircleToHighlight === null ||
|
|
325
321
|
(_this_1.state.nearestCircleToHighlight !== null &&
|
|
@@ -362,8 +358,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
362
358
|
_this_1._handleFocus = function (lineId, x, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData) {
|
|
363
359
|
_this_1._uniqueCallOutID = circleId;
|
|
364
360
|
var formattedData = x instanceof Date ? (0, chart_utilities_1.formatDateToLocaleString)(x, _this_1.props.culture, _this_1.props.useUTC) : x;
|
|
365
|
-
var
|
|
366
|
-
var found = (0, Utilities_1.find)(_this_1._calloutPoints, function (element) { return element.x === xVal; });
|
|
361
|
+
var found = (0, index_3.findCalloutPoints)(_this_1._calloutPoints, x);
|
|
367
362
|
// if no points need to be called out then don't show vertical line and callout card
|
|
368
363
|
if (found) {
|
|
369
364
|
var _this_2 = _this_1;
|
|
@@ -394,16 +389,14 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
394
389
|
_this_1._handleHover = function (x, y, lineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, yScale, legendVal, lineColor, mouseEvent) {
|
|
395
390
|
mouseEvent.persist();
|
|
396
391
|
var formattedData = x instanceof Date ? (0, chart_utilities_1.formatDateToLocaleString)(x, _this_1.props.culture, _this_1.props.useUTC) : x;
|
|
397
|
-
var xVal = x instanceof Date ? x.getTime() : x;
|
|
398
|
-
var yVal = y instanceof Date ? y.getTime() : y;
|
|
399
392
|
var _this = _this_1;
|
|
400
|
-
var found = (0,
|
|
393
|
+
var found = (0, index_3.findCalloutPoints)(_this_1._calloutPoints, x);
|
|
401
394
|
var hoverDp = undefined;
|
|
402
395
|
if (_this_1.props.isCalloutForStack === false && (found === null || found === void 0 ? void 0 : found.values)) {
|
|
403
|
-
var dp = (0, Utilities_1.find)(found.values, function (val) { return (val === null || val === void 0 ? void 0 : val.y) ===
|
|
396
|
+
var dp = (0, Utilities_1.find)(found.values, function (val) { return (val === null || val === void 0 ? void 0 : val.y) === y; });
|
|
404
397
|
if (dp) {
|
|
405
398
|
hoverDp = {
|
|
406
|
-
x:
|
|
399
|
+
x: x,
|
|
407
400
|
values: [dp],
|
|
408
401
|
};
|
|
409
402
|
}
|
|
@@ -421,7 +414,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
421
414
|
refSelected: "#".concat(circleId),
|
|
422
415
|
hoverXValue: xAxisCalloutData ? xAxisCalloutData : '' + formattedData,
|
|
423
416
|
YValueHover: found.values,
|
|
424
|
-
YValue:
|
|
417
|
+
YValue: y,
|
|
425
418
|
legendVal: legendVal,
|
|
426
419
|
lineColor: lineColor,
|
|
427
420
|
stackCalloutProps: found,
|
|
@@ -608,7 +601,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
608
601
|
_this_1._refArray = [];
|
|
609
602
|
_this_1._points = _this_1._injectIndexPropertyInLineChartData(_this_1.props.data.lineChartData);
|
|
610
603
|
_this_1._colorFillBars = [];
|
|
611
|
-
_this_1._calloutPoints = (0, index_3.calloutData)(_this_1._points) ||
|
|
604
|
+
_this_1._calloutPoints = (0, index_3.calloutData)(_this_1._points) || {};
|
|
612
605
|
_this_1._circleId = (0, Utilities_1.getId)('circle');
|
|
613
606
|
_this_1._lineId = (0, Utilities_1.getId)('lineID');
|
|
614
607
|
_this_1._borderId = (0, Utilities_1.getId)('borderID');
|
|
@@ -644,7 +637,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
644
637
|
prevProps.width !== this.props.width ||
|
|
645
638
|
prevProps.data !== this.props.data) {
|
|
646
639
|
this._points = this._injectIndexPropertyInLineChartData(this.props.data.lineChartData);
|
|
647
|
-
this._calloutPoints = (0, index_3.calloutData)(this._points) ||
|
|
640
|
+
this._calloutPoints = (0, index_3.calloutData)(this._points) || {};
|
|
648
641
|
}
|
|
649
642
|
};
|
|
650
643
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
@@ -769,7 +762,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
769
762
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
770
763
|
LineChartBase.prototype._createLines = function (xElement, containerHeight) {
|
|
771
764
|
var _this_1 = this;
|
|
772
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26;
|
|
765
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27;
|
|
773
766
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
774
767
|
var lines = [];
|
|
775
768
|
if (this.state.isSelectedLegend) {
|
|
@@ -813,12 +806,12 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
813
806
|
})
|
|
814
807
|
: 0;
|
|
815
808
|
if (this_1._points[i].data.length === 1) {
|
|
816
|
-
var
|
|
809
|
+
var _28 = this_1._points[i].data[0], x1_1 = _28.x, y1 = _28.y, xAxisCalloutData_1 = _28.xAxisCalloutData, xAxisCalloutAccessibilityData_1 = _28.xAxisCalloutAccessibilityData;
|
|
817
810
|
var xPoint = this_1._xAxisScale(x1_1);
|
|
818
811
|
var yPoint = yScale(y1);
|
|
819
812
|
if ((0, index_3.isPlottable)(xPoint, yPoint)) {
|
|
820
813
|
var circleId_1 = "".concat(this_1._circleId, "_").concat(i);
|
|
821
|
-
var
|
|
814
|
+
var isLegendSelected_1 = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
|
|
822
815
|
var currentMarkerSize = this_1._points[i].data[0].markerSize;
|
|
823
816
|
var supportsTextMode = (_b = (_a = this_1._points[i].lineOptions) === null || _a === void 0 ? void 0 : _a.mode) === null || _b === void 0 ? void 0 : _b.includes('text');
|
|
824
817
|
var text = this_1._points[i].data[0].text;
|
|
@@ -827,14 +820,14 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
827
820
|
? (currentMarkerSize * extraMaxPixels) / maxMarkerSize
|
|
828
821
|
: activePoint === circleId_1
|
|
829
822
|
? 5.5
|
|
830
|
-
: 3.5, cx: xPoint, cy: yPoint, fill: activePoint === circleId_1 ? theme.semanticColors.bodyBackground : lineColor, opacity:
|
|
823
|
+
: 3.5, cx: xPoint, cy: yPoint, fill: activePoint === circleId_1 ? theme.semanticColors.bodyBackground : lineColor, opacity: isLegendSelected_1 ? 1 : 0.1, onMouseOver: this_1._handleHover.bind(this_1, x1_1, y1, verticaLineHeight, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseMove: this_1._handleHover.bind(this_1, x1_1, y1, verticaLineHeight, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseOut: this_1._handleMouseOut, strokeWidth: activePoint === circleId_1 ? DEFAULT_LINE_STROKE_SIZE : 0, stroke: activePoint === circleId_1 ? lineColor : '', role: "img", "aria-label": this_1._getAriaLabel(i, 0), "data-is-focusable": isLegendSelected_1, ref: function (e) {
|
|
831
824
|
_this_1._refCallback(e, circleId_1);
|
|
832
825
|
}, onFocus: function () {
|
|
833
826
|
return _this_1._handleFocus(circleId_1, x1_1, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1);
|
|
834
827
|
}, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[0].onDataPointClick))),
|
|
835
828
|
!this_1._isScatterPolar && supportsTextMode && text && (React.createElement("text", { key: "".concat(circleId_1, "-label"), x: xPoint, y: yPoint +
|
|
836
829
|
Math.max(currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 3.5, 4) +
|
|
837
|
-
12, className: classNames.markerLabel, opacity:
|
|
830
|
+
12, className: classNames.markerLabel, opacity: isLegendSelected_1 ? 1 : 0.1 }, text))));
|
|
838
831
|
}
|
|
839
832
|
}
|
|
840
833
|
var gapIndex = 0;
|
|
@@ -852,7 +845,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
852
845
|
var lineId = "".concat(this_1._lineId, "_").concat(i);
|
|
853
846
|
var borderId = "".concat(this_1._borderId, "_").concat(i);
|
|
854
847
|
var strokeWidth = ((_f = this_1._points[i].lineOptions) === null || _f === void 0 ? void 0 : _f.strokeWidth) || this_1.props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
|
|
855
|
-
var
|
|
848
|
+
var isLegendSelected_2 = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
|
|
856
849
|
var lineData = [];
|
|
857
850
|
for (var k = 0; k < this_1._points[i].data.length; k++) {
|
|
858
851
|
lineData.push([
|
|
@@ -865,7 +858,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
865
858
|
// Check if lines should be drawn based on mode
|
|
866
859
|
var lineMode = (_g = this_1._points[i].lineOptions) === null || _g === void 0 ? void 0 : _g.mode;
|
|
867
860
|
var shouldDrawLines = lineMode !== 'markers';
|
|
868
|
-
if (shouldDrawLines &&
|
|
861
|
+
if (shouldDrawLines && isLegendSelected_2) {
|
|
869
862
|
var lineBorderWidth = ((_h = this_1._points[i].lineOptions) === null || _h === void 0 ? void 0 : _h.lineBorderWidth)
|
|
870
863
|
? Number.parseFloat(this_1._points[i].lineOptions.lineBorderWidth.toString())
|
|
871
864
|
: 0;
|
|
@@ -884,7 +877,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
884
877
|
var showMarkers = (lineMode === null || lineMode === void 0 ? void 0 : lineMode.includes('markers')) || !lineMode; // Show markers by default if no mode specified
|
|
885
878
|
if (showMarkers) {
|
|
886
879
|
for (var k = 0; k < this_1._points[i].data.length; k++) {
|
|
887
|
-
var
|
|
880
|
+
var _29 = this_1._points[i].data[k], x = _29.x, y = _29.y;
|
|
888
881
|
var xPoint = this_1._xAxisScale(x instanceof Date ? x.getTime() : x);
|
|
889
882
|
var yPoint = yScale(y);
|
|
890
883
|
if ((0, index_3.isPlottable)(xPoint, yPoint)) {
|
|
@@ -896,7 +889,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
896
889
|
? 5.5
|
|
897
890
|
: 3.5, cx: xPoint, cy: yPoint, fill: activePoint === this_1._circleId
|
|
898
891
|
? theme.semanticColors.bodyBackground
|
|
899
|
-
: perPointColor || ((_u = this_1._points[i]) === null || _u === void 0 ? void 0 : _u.color) || lineColor, stroke: perPointColor || lineColor, strokeWidth: 1, opacity:
|
|
892
|
+
: perPointColor || ((_u = this_1._points[i]) === null || _u === void 0 ? void 0 : _u.color) || lineColor, stroke: perPointColor || lineColor, strokeWidth: 1, opacity: isLegendSelected_2 ? 1 : 0.1, onMouseMove: this_1._onMouseOverLargeDataset.bind(this_1, i, verticaLineHeight, yScale), onMouseOver: this_1._onMouseOverLargeDataset.bind(this_1, i, verticaLineHeight, yScale), onMouseOut: this_1._handleMouseOut }));
|
|
900
893
|
}
|
|
901
894
|
}
|
|
902
895
|
}
|
|
@@ -909,14 +902,14 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
909
902
|
var lineId = "".concat(this_1._lineId, "_").concat(i, "_").concat(j);
|
|
910
903
|
var borderId = "".concat(this_1._borderId, "_").concat(i, "_").concat(j);
|
|
911
904
|
var circleId = "".concat(this_1._circleId, "_").concat(i, "_").concat(j);
|
|
912
|
-
var
|
|
913
|
-
var
|
|
905
|
+
var _30 = this_1._points[i].data[j - 1], x1 = _30.x, y1 = _30.y, xAxisCalloutData = _30.xAxisCalloutData, xAxisCalloutAccessibilityData = _30.xAxisCalloutAccessibilityData;
|
|
906
|
+
var _31 = this_1._points[i].data[j], x2 = _31.x, y2 = _31.y;
|
|
914
907
|
var xPoint1 = this_1._xAxisScale(x1);
|
|
915
908
|
var yPoint1 = yScale(y1);
|
|
916
909
|
var xPoint2 = this_1._xAxisScale(x2);
|
|
917
910
|
var yPoint2 = yScale(y2);
|
|
918
911
|
var strokeWidth = ((_v = this_1._points[i].lineOptions) === null || _v === void 0 ? void 0 : _v.strokeWidth) || this_1.props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
|
|
919
|
-
var
|
|
912
|
+
var isLegendSelected_3 = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
|
|
920
913
|
var currentPointHidden = this_1._points[i].hideNonActiveDots && activePoint !== circleId;
|
|
921
914
|
var supportsTextMode = (_x = (_w = this_1._points[i].lineOptions) === null || _w === void 0 ? void 0 : _w.mode) === null || _x === void 0 ? void 0 : _x.includes('text');
|
|
922
915
|
var text = this_1._points[i].data[j - 1].text;
|
|
@@ -924,21 +917,21 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
924
917
|
if ((0, index_3.isPlottable)(xPoint1, yPoint1)) {
|
|
925
918
|
var path = this_1._getPath(xPoint1, yPoint1, circleId, j, false, this_1._points[i].index);
|
|
926
919
|
pointsForLine.push(((_z = (_y = this_1._points[i].lineOptions) === null || _y === void 0 ? void 0 : _y.mode) === null || _z === void 0 ? void 0 : _z.includes('markers')) || supportsTextMode ? (React.createElement(React.Fragment, null,
|
|
927
|
-
React.createElement("circle", tslib_1.__assign({ id: circleId, key: circleId, r: currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, cx: xPoint1, cy: yPoint1, "data-is-focusable":
|
|
920
|
+
React.createElement("circle", tslib_1.__assign({ id: circleId, key: circleId, r: currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, cx: xPoint1, cy: yPoint1, "data-is-focusable": isLegendSelected_3, onMouseOver: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, yScale, legendVal, lineColor), onMouseMove: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, yScale, legendVal, lineColor), onMouseOut: this_1._handleMouseOut, onFocus: function () {
|
|
928
921
|
return _this_1._handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData);
|
|
929
|
-
}, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j - 1].onDataPointClick), { opacity:
|
|
922
|
+
}, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j - 1].onDataPointClick), { opacity: isLegendSelected_3 && !currentPointHidden ? 1 : 0.01, fill: ((_0 = this_1._points[i].data[j - 1]) === null || _0 === void 0 ? void 0 : _0.markerColor) || this_1._getPointFill(lineColor, circleId, j, false), stroke: ((_1 = this_1._points[i].data[j - 1]) === null || _1 === void 0 ? void 0 : _1.markerColor) || lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": (_2 = this_1._points[i].data[j - 1].text) !== null && _2 !== void 0 ? _2 : this_1._getAriaLabel(i, j - 1) })),
|
|
930
923
|
!this_1._isScatterPolar && supportsTextMode && text && (React.createElement("text", { key: "".concat(circleId, "-label"), x: xPoint1, y: yPoint1 +
|
|
931
924
|
Math.max(currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, 4) +
|
|
932
|
-
12, className: classNames.markerLabel, opacity:
|
|
925
|
+
12, className: classNames.markerLabel, opacity: isLegendSelected_3 && !currentPointHidden ? 1 : 0.01 }, text)))) : (React.createElement("path", tslib_1.__assign({ id: circleId, key: circleId, d: path, "data-is-focusable": isLegendSelected_3, onMouseOver: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, yScale, legendVal, lineColor), onMouseMove: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, yScale, legendVal, lineColor), onMouseOut: this_1._handleMouseOut, onFocus: function () {
|
|
933
926
|
return _this_1._handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData);
|
|
934
|
-
}, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j - 1].onDataPointClick), { opacity:
|
|
927
|
+
}, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j - 1].onDataPointClick), { opacity: isLegendSelected_3 && !currentPointHidden ? 1 : 0.01, fill: ((_3 = this_1._points[i].data[j - 1]) === null || _3 === void 0 ? void 0 : _3.markerColor) || this_1._getPointFill(lineColor, circleId, j, false), stroke: ((_4 = this_1._points[i].data[j - 1]) === null || _4 === void 0 ? void 0 : _4.markerColor) || lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j - 1) }))));
|
|
935
928
|
}
|
|
936
929
|
if (j + 1 === this_1._points[i].data.length) {
|
|
937
930
|
// If this is last point of the line segment.
|
|
938
931
|
var lastCircleId_1 = "".concat(circleId).concat(j, "L");
|
|
939
932
|
var hiddenHoverCircleId = "".concat(circleId).concat(j, "D");
|
|
940
933
|
var lastPointHidden = this_1._points[i].hideNonActiveDots && activePoint !== lastCircleId_1;
|
|
941
|
-
var
|
|
934
|
+
var _32 = this_1._points[i].data[j], lastCirlceXCallout_1 = _32.xAxisCalloutData, lastCirlceXCalloutAccessibilityData_1 = _32.xAxisCalloutAccessibilityData;
|
|
942
935
|
currentMarkerSize = this_1._points[i].data[j].markerSize;
|
|
943
936
|
var lastSupportsTextMode = (_6 = (_5 = this_1._points[i].lineOptions) === null || _5 === void 0 ? void 0 : _5.mode) === null || _6 === void 0 ? void 0 : _6.includes('text');
|
|
944
937
|
var lastText = this_1._points[i].data[j].text;
|
|
@@ -946,21 +939,21 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
946
939
|
var path = this_1._getPath(xPoint2, yPoint2, lastCircleId_1, j, true, this_1._points[i].index);
|
|
947
940
|
pointsForLine.push(React.createElement(React.Fragment, { key: "".concat(lastCircleId_1, "_container") },
|
|
948
941
|
((_8 = (_7 = this_1._points[i].lineOptions) === null || _7 === void 0 ? void 0 : _7.mode) === null || _8 === void 0 ? void 0 : _8.includes('markers')) || lastSupportsTextMode ? (React.createElement(React.Fragment, null,
|
|
949
|
-
React.createElement("circle", tslib_1.__assign({ id: lastCircleId_1, key: lastCircleId_1, r: currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, cx: xPoint2, cy: yPoint2, "data-is-focusable":
|
|
942
|
+
React.createElement("circle", tslib_1.__assign({ id: lastCircleId_1, key: lastCircleId_1, r: currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, cx: xPoint2, cy: yPoint2, "data-is-focusable": isLegendSelected_3, onMouseOver: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseMove: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseOut: this_1._handleMouseOut, onFocus: function () {
|
|
950
943
|
return _this_1._handleFocus(lineId, x2, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1);
|
|
951
|
-
}, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j].onDataPointClick), { opacity:
|
|
944
|
+
}, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j].onDataPointClick), { opacity: isLegendSelected_3 && !lastPointHidden ? 1 : 0.01, fill: this_1._getPointFill(lineColor, lastCircleId_1, j, true), stroke: lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": (_9 = this_1._points[i].data[j].text) !== null && _9 !== void 0 ? _9 : this_1._getAriaLabel(i, j) })),
|
|
952
945
|
!this_1._isScatterPolar && lastSupportsTextMode && lastText && (React.createElement("text", { key: "".concat(lastCircleId_1, "-label"), x: xPoint2, y: yPoint2 +
|
|
953
946
|
Math.max(currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, 4) +
|
|
954
|
-
12, className: classNames.markerLabel, opacity:
|
|
947
|
+
12, className: classNames.markerLabel, opacity: isLegendSelected_3 && !currentPointHidden ? 1 : 0.01 }, text)))) : (React.createElement("path", tslib_1.__assign({ id: lastCircleId_1, key: lastCircleId_1, d: path, "data-is-focusable": isLegendSelected_3, onMouseOver: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseMove: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseOut: this_1._handleMouseOut, onFocus: function () {
|
|
955
948
|
return _this_1._handleFocus(lineId, x2, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1);
|
|
956
|
-
}, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j].onDataPointClick), { opacity:
|
|
949
|
+
}, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j].onDataPointClick), { opacity: isLegendSelected_3 && !lastPointHidden ? 1 : 0.01, fill: ((_10 = this_1._points[i].data[j]) === null || _10 === void 0 ? void 0 : _10.markerColor) || this_1._getPointFill(lineColor, lastCircleId_1, j, true), stroke: ((_11 = this_1._points[i].data[j]) === null || _11 === void 0 ? void 0 : _11.markerColor) || lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j) }))),
|
|
957
950
|
React.createElement("circle", { id: hiddenHoverCircleId, key: hiddenHoverCircleId, r: 8, cx: xPoint2, cy: yPoint2, opacity: 0, width: 0, onMouseOver: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseMove: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseOut: this_1._handleMouseOut, strokeWidth: 0, focusable: false, onBlur: this_1._handleMouseOut })));
|
|
958
951
|
}
|
|
959
952
|
}
|
|
960
953
|
if ((0, index_3.isPlottable)(xPoint1, yPoint1) &&
|
|
961
954
|
(0, index_3.isPlottable)(xPoint2, yPoint2) &&
|
|
962
955
|
(!this_1._hasMarkersMode || ((_13 = (_12 = this_1._points[i].lineOptions) === null || _12 === void 0 ? void 0 : _12.mode) === null || _13 === void 0 ? void 0 : _13.includes('lines')))) {
|
|
963
|
-
if (
|
|
956
|
+
if (isLegendSelected_3) {
|
|
964
957
|
// don't draw line if it is in a gap
|
|
965
958
|
if (!isInGap) {
|
|
966
959
|
var lineBorderWidth = ((_14 = this_1._points[i].lineOptions) === null || _14 === void 0 ? void 0 : _14.lineBorderWidth)
|
|
@@ -985,12 +978,29 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
|
|
|
985
978
|
_loop_2(j);
|
|
986
979
|
}
|
|
987
980
|
}
|
|
981
|
+
// Add filled area for scatterpolar charts
|
|
982
|
+
var fillMode = (_26 = this_1._points[i].lineOptions) === null || _26 === void 0 ? void 0 : _26.fill;
|
|
983
|
+
var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
|
|
984
|
+
if (fillMode === 'toself' && this_1._points[i].data.length >= 3 && isLegendSelected && this_1._isScatterPolar) {
|
|
985
|
+
var getScaledXValue_1 = function (dataPoint) {
|
|
986
|
+
return _this_1._xAxisScale(dataPoint.x instanceof Date ? dataPoint.x : dataPoint.x);
|
|
987
|
+
};
|
|
988
|
+
var fillPathGenerator = (0, d3_shape_1.line)()
|
|
989
|
+
.x(function (dataPoint) { return getScaledXValue_1(dataPoint); })
|
|
990
|
+
.y(function (dataPoint) { return yScale(dataPoint.y); })
|
|
991
|
+
.curve((0, index_3.getCurveFactory)(lineCurve))
|
|
992
|
+
.defined(function (dataPoint) { return (0, index_3.isPlottable)(getScaledXValue_1(dataPoint), yScale(dataPoint.y)); });
|
|
993
|
+
var fillPath = fillPathGenerator(this_1._points[i].data);
|
|
994
|
+
if (fillPath) {
|
|
995
|
+
linesForLine.push(React.createElement("path", { key: "scatterpolar_fill_".concat(i), d: "".concat(fillPath, "Z"), fill: lineColor, fillOpacity: 0.5, stroke: lineColor, strokeWidth: 2, strokeOpacity: 0.8, pointerEvents: "none" }));
|
|
996
|
+
}
|
|
997
|
+
}
|
|
988
998
|
if (this_1._isScatterPolar) {
|
|
989
999
|
pointsForLine.push.apply(pointsForLine, (0, scatterpolar_utils_1.renderScatterPolarCategoryLabels)({
|
|
990
1000
|
xAxisScale: this_1._xAxisScale,
|
|
991
1001
|
yAxisScale: yScale,
|
|
992
1002
|
className: classNames.markerLabel || '',
|
|
993
|
-
lineOptions: (
|
|
1003
|
+
lineOptions: (_27 = this_1._points[i]) === null || _27 === void 0 ? void 0 : _27.lineOptions,
|
|
994
1004
|
}));
|
|
995
1005
|
}
|
|
996
1006
|
lines.push(React.createElement("g", { key: "line_".concat(i), role: "region", "aria-label": "".concat(legendVal, ", line ").concat(i + 1, " of ").concat(this_1._points.length, " with ").concat(this_1._points[i].data.length, " data points.") },
|