@fluentui/react-charting 5.23.57 → 5.23.59
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 +31 -1
- package/CHANGELOG.md +20 -2
- package/dist/react-charting.d.ts +9 -0
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +2 -0
- package/lib/components/DeclarativeChart/DeclarativeChart.js +9 -8
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +8 -4
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/LineChart/LineChart.base.d.ts +8 -0
- package/lib/components/LineChart/LineChart.base.js +94 -22
- package/lib/components/LineChart/LineChart.base.js.map +1 -1
- package/lib/components/LineChart/LineChart.types.d.ts +5 -0
- package/lib/components/LineChart/LineChart.types.js.map +1 -1
- package/lib/types/IDataPoint.d.ts +4 -0
- package/lib/types/IDataPoint.js.map +1 -1
- package/lib/utilities/utilities.js +14 -1
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +9 -8
- package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +8 -4
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.base.d.ts +8 -0
- package/lib-amd/components/LineChart/LineChart.base.js +94 -23
- package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.types.d.ts +5 -0
- package/lib-amd/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-amd/types/IDataPoint.d.ts +4 -0
- package/lib-amd/types/IDataPoint.js.map +1 -1
- package/lib-amd/utilities/utilities.js +14 -1
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +9 -8
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +8 -4
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.base.d.ts +8 -0
- package/lib-commonjs/components/LineChart/LineChart.base.js +94 -22
- package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.d.ts +5 -0
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-commonjs/types/IDataPoint.d.ts +4 -0
- package/lib-commonjs/types/IDataPoint.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +14 -1
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +1 -1
- package/src/components/LineChart/LineChart.types.ts +6 -0
|
@@ -7,6 +7,7 @@ var d3_selection_1 = require("d3-selection");
|
|
|
7
7
|
var d3_array_1 = require("d3-array");
|
|
8
8
|
var index_1 = require("../Legends/index");
|
|
9
9
|
var d3_shape_1 = require("d3-shape");
|
|
10
|
+
var d3_array_2 = require("d3-array");
|
|
10
11
|
var Utilities_1 = require("@fluentui/react/lib/Utilities");
|
|
11
12
|
var index_2 = require("../../index");
|
|
12
13
|
var Callout_1 = require("@fluentui/react/lib/Callout");
|
|
@@ -62,9 +63,17 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
62
63
|
_this_1._yAxisScale = '';
|
|
63
64
|
_this_1.eventLabelHeight = 36;
|
|
64
65
|
_this_1._isRTL = (0, Utilities_1.getRTL)();
|
|
66
|
+
_this_1._xMin = Number.NEGATIVE_INFINITY;
|
|
67
|
+
_this_1._yMin = Number.NEGATIVE_INFINITY;
|
|
68
|
+
_this_1._xMax = Number.POSITIVE_INFINITY;
|
|
69
|
+
_this_1._xPadding = 0;
|
|
70
|
+
_this_1._yPadding = 0;
|
|
65
71
|
_this_1._getDomainNRangeValues = function (points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues, shiftX) {
|
|
66
72
|
var domainNRangeValue;
|
|
67
|
-
if (xAxisType === index_3.XAxisTypes.NumericAxis) {
|
|
73
|
+
if (_this_1.props.lineMode === 'scatter' && xAxisType === index_3.XAxisTypes.NumericAxis) {
|
|
74
|
+
domainNRangeValue = _this_1._getDomainNRangeValuesWithPadding(points, margins, width, isRTL);
|
|
75
|
+
}
|
|
76
|
+
else if (xAxisType === index_3.XAxisTypes.NumericAxis) {
|
|
68
77
|
domainNRangeValue = (0, index_3.domainRangeOfNumericForAreaChart)(points, margins, width, isRTL);
|
|
69
78
|
}
|
|
70
79
|
else if (xAxisType === index_3.XAxisTypes.DateAxis) {
|
|
@@ -108,6 +117,18 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
108
117
|
? _this_1.props.onRenderCalloutPerDataPoint(_this_1.state.dataPointCalloutProps)
|
|
109
118
|
: null;
|
|
110
119
|
};
|
|
120
|
+
_this_1._getNumericMinMaxOfY = function (points) {
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
122
|
+
var _a = (0, index_3.findNumericMinMaxOfY)(points), startValue = _a.startValue, endValue = _a.endValue;
|
|
123
|
+
_this_1._yMin = startValue;
|
|
124
|
+
if (_this_1.props.lineMode === 'scatter') {
|
|
125
|
+
_this_1._yPadding = (endValue - startValue) * 0.1;
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
startValue: startValue - _this_1._yPadding,
|
|
129
|
+
endValue: endValue + _this_1._yPadding,
|
|
130
|
+
};
|
|
131
|
+
};
|
|
111
132
|
_this_1._getMargins = function (margins) {
|
|
112
133
|
_this_1.margins = margins;
|
|
113
134
|
};
|
|
@@ -551,6 +572,34 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
551
572
|
var yValue = point.yAxisCalloutData || point.y;
|
|
552
573
|
return ((_a = point.callOutAccessibilityData) === null || _a === void 0 ? void 0 : _a.ariaLabel) || "".concat(xValue, ". ").concat(legend, ", ").concat(yValue, ".");
|
|
553
574
|
};
|
|
575
|
+
_this_1._getDomainNRangeValuesWithPadding = function (points, margins, width, isRTL) {
|
|
576
|
+
_this_1._xMin = (0, d3_array_2.min)(points, function (point) {
|
|
577
|
+
return (0, d3_array_2.min)(point.data, function (item) { return item.x; });
|
|
578
|
+
});
|
|
579
|
+
_this_1._xMax = (0, d3_array_2.max)(points, function (point) {
|
|
580
|
+
return (0, d3_array_2.max)(point.data, function (item) {
|
|
581
|
+
return item.x;
|
|
582
|
+
});
|
|
583
|
+
});
|
|
584
|
+
if (_this_1.props.lineMode === 'scatter') {
|
|
585
|
+
_this_1._xPadding = (_this_1._xMax - _this_1._xMin) * 0.1;
|
|
586
|
+
}
|
|
587
|
+
var rStartValue = margins.left;
|
|
588
|
+
var rEndValue = width - margins.right;
|
|
589
|
+
return isRTL
|
|
590
|
+
? {
|
|
591
|
+
dStartValue: _this_1._xMax + _this_1._xPadding,
|
|
592
|
+
dEndValue: _this_1._xMin - _this_1._xPadding,
|
|
593
|
+
rStartValue: rStartValue,
|
|
594
|
+
rEndValue: rEndValue,
|
|
595
|
+
}
|
|
596
|
+
: {
|
|
597
|
+
dStartValue: _this_1._xMin - _this_1._xPadding,
|
|
598
|
+
dEndValue: _this_1._xMax + _this_1._xPadding,
|
|
599
|
+
rStartValue: rStartValue,
|
|
600
|
+
rEndValue: rEndValue,
|
|
601
|
+
};
|
|
602
|
+
};
|
|
554
603
|
_this_1._getChartTitle = function () {
|
|
555
604
|
var _a = _this_1.props.data, chartTitle = _a.chartTitle, lineChartData = _a.lineChartData;
|
|
556
605
|
return (chartTitle ? "".concat(chartTitle, ". ") : '') + "Line chart with ".concat((lineChartData === null || lineChartData === void 0 ? void 0 : lineChartData.length) || 0, " lines. ");
|
|
@@ -635,7 +684,7 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
635
684
|
tickValues: tickValues,
|
|
636
685
|
tickFormat: tickFormat,
|
|
637
686
|
};
|
|
638
|
-
return !this._isChartEmpty() ? (React.createElement(index_2.CartesianChart, tslib_1.__assign({}, this.props, { chartTitle: this._getChartTitle(), points: points, chartType: index_3.ChartTypes.LineChart, isCalloutForStack: true, calloutProps: calloutProps, tickParams: tickParams, legendBars: legendBars, createYAxis: index_3.createNumericYAxis, getmargins: this._getMargins, getMinMaxOfYAxis:
|
|
687
|
+
return !this._isChartEmpty() ? (React.createElement(index_2.CartesianChart, tslib_1.__assign({}, this.props, { chartTitle: this._getChartTitle(), points: points, chartType: index_3.ChartTypes.LineChart, isCalloutForStack: true, calloutProps: calloutProps, tickParams: tickParams, legendBars: legendBars, createYAxis: index_3.createNumericYAxis, getmargins: this._getMargins, getMinMaxOfYAxis: this._getNumericMinMaxOfY, getGraphData: this._initializeLineChartData, xAxisType: isXAxisDateType ? index_3.XAxisTypes.DateAxis : index_3.XAxisTypes.NumericAxis, customizedCallout: this._getCustomizedCallout(), getDomainNRangeValues: this._getDomainNRangeValues, createStringYAxis: index_3.createStringYAxis, onChartMouseLeave: this._handleChartMouseLeave, enableFirstRenderOptimization: this.props.enablePerfOptimization && this._firstRenderOptimization, ref: this._cartesianChartRef,
|
|
639
688
|
/* eslint-disable react/jsx-no-bind */
|
|
640
689
|
// eslint-disable-next-line react/no-children-prop
|
|
641
690
|
children: function (props) {
|
|
@@ -717,6 +766,13 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
717
766
|
: [];
|
|
718
767
|
return (React.createElement(index_1.Legends, tslib_1.__assign({ legends: tslib_1.__spreadArray(tslib_1.__spreadArray([], legendDataItems, true), colorFillBarsLegendDataItems, true), enabledWrapLines: this.props.enabledLegendsWrapLines, overflowProps: this.props.legendsOverflowProps, focusZonePropsInHoverCard: this.props.focusZonePropsForLegendsInHoverCard, overflowText: this.props.legendsOverflowText }, (isLegendMultiSelectEnabled && { onLegendHoverCardLeave: this._onHoverCardHide }), this.props.legendProps)));
|
|
719
768
|
};
|
|
769
|
+
LineChartBase.prototype._getRangeForScatterMarkerSize = function () {
|
|
770
|
+
var extraXPixels = this._isRTL
|
|
771
|
+
? this._xAxisScale(this._xMax - this._xPadding) - this._xAxisScale(this._xMax)
|
|
772
|
+
: this._xAxisScale(this._xMin + this._xPadding) - this._xAxisScale(this._xMin);
|
|
773
|
+
var extraYPixels = this._yAxisScale(this._yMin) - this._yAxisScale(this._yMin + this._yPadding);
|
|
774
|
+
return Math.min(extraXPixels, extraYPixels);
|
|
775
|
+
};
|
|
720
776
|
LineChartBase.prototype._createLines = function (xElement, containerHeight) {
|
|
721
777
|
var _this_1 = this;
|
|
722
778
|
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;
|
|
@@ -727,6 +783,12 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
727
783
|
else {
|
|
728
784
|
this._points = this._injectIndexPropertyInLineChartData(this.props.data.lineChartData);
|
|
729
785
|
}
|
|
786
|
+
var extraMaxPixels = this.props.lineMode === 'scatter' ? this._getRangeForScatterMarkerSize() : 0;
|
|
787
|
+
var maxMarkerSize = (0, d3_array_2.max)(this._points, function (point) {
|
|
788
|
+
return (0, d3_array_2.max)(point.data, function (item) {
|
|
789
|
+
return item.markerSize;
|
|
790
|
+
});
|
|
791
|
+
});
|
|
730
792
|
var _loop_1 = function (i) {
|
|
731
793
|
var linesForLine = [];
|
|
732
794
|
var bordersForLine = [];
|
|
@@ -740,7 +802,12 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
740
802
|
var _2 = this_1._points[i].data[0], x1_1 = _2.x, y1 = _2.y, xAxisCalloutData_1 = _2.xAxisCalloutData, xAxisCalloutAccessibilityData_1 = _2.xAxisCalloutAccessibilityData;
|
|
741
803
|
var circleId_1 = "".concat(this_1._circleId, "_").concat(i);
|
|
742
804
|
var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
|
|
743
|
-
|
|
805
|
+
var currentMarkerSize = this_1._points[i].data[0].markerSize;
|
|
806
|
+
pointsForLine.push(React.createElement("circle", tslib_1.__assign({ id: circleId_1, key: circleId_1, r: currentMarkerSize
|
|
807
|
+
? (currentMarkerSize * extraMaxPixels) / maxMarkerSize
|
|
808
|
+
: activePoint === circleId_1
|
|
809
|
+
? 5.5
|
|
810
|
+
: 3.5, cx: this_1._xAxisScale(x1_1), cy: this_1._yAxisScale(y1), fill: activePoint === circleId_1 ? theme.semanticColors.bodyBackground : lineColor, opacity: isLegendSelected ? 1 : 0.1, onMouseOver: this_1._handleHover.bind(this_1, x1_1, y1, verticaLineHeight, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1), onMouseMove: this_1._handleHover.bind(this_1, x1_1, y1, verticaLineHeight, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1), 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, ref: function (e) {
|
|
744
811
|
_this_1._refCallback(e, circleId_1);
|
|
745
812
|
}, onFocus: function () { return _this_1._handleFocus(circleId_1, x1_1, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1); }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[0].onDataPointClick))));
|
|
746
813
|
}
|
|
@@ -796,7 +863,8 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
796
863
|
var strokeWidth = ((_p = this_1._points[i].lineOptions) === null || _p === void 0 ? void 0 : _p.strokeWidth) || this_1.props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
|
|
797
864
|
var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
|
|
798
865
|
var currentPointHidden = this_1._points[i].hideNonActiveDots && activePoint !== circleId;
|
|
799
|
-
|
|
866
|
+
var currentMarkerSize = this_1._points[i].data[j - 1].markerSize;
|
|
867
|
+
pointsForLine.push(this_1.props.lineMode === 'scatter' ? (React.createElement("circle", tslib_1.__assign({ id: circleId, key: circleId, r: currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, cx: this_1._xAxisScale(x1), cy: this_1._yAxisScale(y1), "data-is-focusable": isLegendSelected, onMouseOver: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseMove: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseOut: this_1._handleMouseOut, onFocus: function () { return _this_1._handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData); }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j - 1].onDataPointClick), { opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01, fill: this_1._getPointFill(lineColor, circleId, j, false), stroke: lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j - 1) }))) : (React.createElement("path", tslib_1.__assign({ id: circleId, key: circleId, d: path, "data-is-focusable": isLegendSelected, onMouseOver: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseMove: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseOut: this_1._handleMouseOut, onFocus: function () { return _this_1._handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData); }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j - 1].onDataPointClick), { opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01, fill: this_1._getPointFill(lineColor, circleId, j, false), stroke: lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j - 1) }))));
|
|
800
868
|
if (j + 1 === this_1._points[i].data.length) {
|
|
801
869
|
// If this is last point of the line segment.
|
|
802
870
|
var lastCircleId_1 = "".concat(circleId).concat(j, "L");
|
|
@@ -804,30 +872,34 @@ var LineChartBase = /** @class */ (function (_super) {
|
|
|
804
872
|
var lastPointHidden = this_1._points[i].hideNonActiveDots && activePoint !== lastCircleId_1;
|
|
805
873
|
path = this_1._getPath(this_1._xAxisScale(x2), this_1._yAxisScale(y2), lastCircleId_1, j, true, this_1._points[i].index);
|
|
806
874
|
var _5 = this_1._points[i].data[j], lastCirlceXCallout_1 = _5.xAxisCalloutData, lastCirlceXCalloutAccessibilityData_1 = _5.xAxisCalloutAccessibilityData;
|
|
875
|
+
currentMarkerSize = this_1._points[i].data[j].markerSize;
|
|
807
876
|
pointsForLine.push(React.createElement(React.Fragment, { key: "".concat(lastCircleId_1, "_container") },
|
|
808
|
-
React.createElement("
|
|
877
|
+
this_1.props.lineMode === 'scatter' ? (React.createElement("circle", tslib_1.__assign({ id: lastCircleId_1, key: lastCircleId_1, r: currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, cx: this_1._xAxisScale(x2), cy: this_1._yAxisScale(y2), "data-is-focusable": isLegendSelected, onMouseOver: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1), onMouseMove: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1), onMouseOut: this_1._handleMouseOut, onFocus: function () {
|
|
878
|
+
return _this_1._handleFocus(lineId, x2, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1);
|
|
879
|
+
}, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j].onDataPointClick), { opacity: isLegendSelected && !lastPointHidden ? 1 : 0.01, fill: this_1._getPointFill(lineColor, lastCircleId_1, j, true), stroke: lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j) }))) : (React.createElement("path", tslib_1.__assign({ id: lastCircleId_1, key: lastCircleId_1, d: path, "data-is-focusable": isLegendSelected, onMouseOver: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1), onMouseMove: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1), onMouseOut: this_1._handleMouseOut, onFocus: function () {
|
|
809
880
|
return _this_1._handleFocus(lineId, x2, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1);
|
|
810
|
-
}, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j].onDataPointClick), { opacity: isLegendSelected && !lastPointHidden ? 1 : 0.01, fill: this_1._getPointFill(lineColor, lastCircleId_1, j, true), stroke: lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j) })),
|
|
881
|
+
}, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j].onDataPointClick), { opacity: isLegendSelected && !lastPointHidden ? 1 : 0.01, fill: this_1._getPointFill(lineColor, lastCircleId_1, j, true), stroke: lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j) }))),
|
|
811
882
|
React.createElement("circle", { id: hiddenHoverCircleId, key: hiddenHoverCircleId, r: 8, cx: this_1._xAxisScale(x2), cy: this_1._yAxisScale(y2), opacity: 0, width: 0, onMouseOver: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1), onMouseMove: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1), onMouseOut: this_1._handleMouseOut, strokeWidth: 0, focusable: false, onBlur: this_1._handleMouseOut })));
|
|
812
|
-
/* eslint-enable react/jsx-no-bind */
|
|
813
883
|
}
|
|
814
|
-
if (
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
884
|
+
if (this_1.props.lineMode !== 'scatter') {
|
|
885
|
+
if (isLegendSelected) {
|
|
886
|
+
// don't draw line if it is in a gap
|
|
887
|
+
if (!isInGap) {
|
|
888
|
+
var lineBorderWidth = ((_q = this_1._points[i].lineOptions) === null || _q === void 0 ? void 0 : _q.lineBorderWidth)
|
|
889
|
+
? Number.parseFloat(this_1._points[i].lineOptions.lineBorderWidth.toString())
|
|
890
|
+
: 0;
|
|
891
|
+
if (lineBorderWidth > 0) {
|
|
892
|
+
bordersForLine.push(React.createElement("line", { id: borderId, key: borderId, x1: this_1._xAxisScale(x1), y1: this_1._yAxisScale(y1), x2: this_1._xAxisScale(x2), y2: this_1._yAxisScale(y2), strokeLinecap: (_s = (_r = this_1._points[i].lineOptions) === null || _r === void 0 ? void 0 : _r.strokeLinecap) !== null && _s !== void 0 ? _s : 'round', strokeWidth: Number.parseFloat(strokeWidth.toString()) + lineBorderWidth, stroke: ((_t = this_1._points[i].lineOptions) === null || _t === void 0 ? void 0 : _t.lineBorderColor) || theme.semanticColors.bodyBackground, opacity: 1 }));
|
|
893
|
+
}
|
|
894
|
+
linesForLine.push(React.createElement("line", tslib_1.__assign({ id: lineId, key: lineId, x1: this_1._xAxisScale(x1), y1: this_1._yAxisScale(y1), x2: this_1._xAxisScale(x2), y2: this_1._yAxisScale(y2), strokeWidth: strokeWidth, ref: function (e) {
|
|
895
|
+
_this_1._refCallback(e, lineId);
|
|
896
|
+
}, onMouseOver: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseMove: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseOut: this_1._handleMouseOut, stroke: lineColor, strokeLinecap: (_v = (_u = this_1._points[i].lineOptions) === null || _u === void 0 ? void 0 : _u.strokeLinecap) !== null && _v !== void 0 ? _v : 'round', strokeDasharray: (_w = this_1._points[i].lineOptions) === null || _w === void 0 ? void 0 : _w.strokeDasharray, strokeDashoffset: (_x = this_1._points[i].lineOptions) === null || _x === void 0 ? void 0 : _x.strokeDashoffset, opacity: 1 }, this_1._getClickHandler(this_1._points[i].onLineClick))));
|
|
822
897
|
}
|
|
823
|
-
linesForLine.push(React.createElement("line", tslib_1.__assign({ id: lineId, key: lineId, x1: this_1._xAxisScale(x1), y1: this_1._yAxisScale(y1), x2: this_1._xAxisScale(x2), y2: this_1._yAxisScale(y2), strokeWidth: strokeWidth, ref: function (e) {
|
|
824
|
-
_this_1._refCallback(e, lineId);
|
|
825
|
-
}, onMouseOver: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseMove: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData), onMouseOut: this_1._handleMouseOut, stroke: lineColor, strokeLinecap: (_v = (_u = this_1._points[i].lineOptions) === null || _u === void 0 ? void 0 : _u.strokeLinecap) !== null && _v !== void 0 ? _v : 'round', strokeDasharray: (_w = this_1._points[i].lineOptions) === null || _w === void 0 ? void 0 : _w.strokeDasharray, strokeDashoffset: (_x = this_1._points[i].lineOptions) === null || _x === void 0 ? void 0 : _x.strokeDashoffset, opacity: 1 }, this_1._getClickHandler(this_1._points[i].onLineClick))));
|
|
826
898
|
}
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
899
|
+
else {
|
|
900
|
+
if (!isInGap) {
|
|
901
|
+
linesForLine.push(React.createElement("line", { id: lineId, key: lineId, x1: this_1._xAxisScale(x1), y1: this_1._yAxisScale(y1), x2: this_1._xAxisScale(x2), y2: this_1._yAxisScale(y2), strokeWidth: strokeWidth, stroke: lineColor, strokeLinecap: (_z = (_y = this_1._points[i].lineOptions) === null || _y === void 0 ? void 0 : _y.strokeLinecap) !== null && _z !== void 0 ? _z : 'round', strokeDasharray: (_0 = this_1._points[i].lineOptions) === null || _0 === void 0 ? void 0 : _0.strokeDasharray, strokeDashoffset: (_1 = this_1._points[i].lineOptions) === null || _1 === void 0 ? void 0 : _1.strokeDashoffset, opacity: 0.1 }));
|
|
902
|
+
}
|
|
831
903
|
}
|
|
832
904
|
}
|
|
833
905
|
};
|