@fluentui/react-charting 5.24.21 → 5.24.22

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.
Files changed (84) hide show
  1. package/CHANGELOG.json +40 -1
  2. package/CHANGELOG.md +15 -2
  3. package/bundle-size/ScatterChart.fixture.js +7 -0
  4. package/dist/react-charting.d.ts +27 -2
  5. package/dist/react-charting.js +1 -1
  6. package/dist/react-charting.min.js +1 -1
  7. package/etc/react-charting.api.md +8 -2
  8. package/lib/components/AreaChart/AreaChart.base.js +3 -3
  9. package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
  10. package/lib/components/CommonComponents/CartesianChart.base.js +4 -4
  11. package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
  12. package/lib/components/CommonComponents/CartesianChart.types.d.ts +18 -3
  13. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  14. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +10 -0
  15. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +187 -11
  16. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  17. package/lib/components/LineChart/LineChart.base.d.ts +0 -9
  18. package/lib/components/LineChart/LineChart.base.js +82 -138
  19. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  20. package/lib/components/ScatterChart/ScatterChart.base.js +37 -62
  21. package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
  22. package/lib/components/VerticalBarChart/VerticalBarChart.base.js +2 -2
  23. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  24. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +2 -2
  25. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  26. package/lib/index.d.ts +1 -1
  27. package/lib/index.js.map +1 -1
  28. package/lib/types/IDataPoint.d.ts +9 -0
  29. package/lib/types/IDataPoint.js.map +1 -1
  30. package/lib/utilities/utilities.d.ts +29 -28
  31. package/lib/utilities/utilities.js +127 -110
  32. package/lib/utilities/utilities.js.map +1 -1
  33. package/lib-amd/components/AreaChart/AreaChart.base.js +2 -2
  34. package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
  35. package/lib-amd/components/CommonComponents/CartesianChart.base.js +4 -4
  36. package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
  37. package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +18 -3
  38. package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
  39. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +10 -0
  40. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +188 -11
  41. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  42. package/lib-amd/components/LineChart/LineChart.base.d.ts +0 -9
  43. package/lib-amd/components/LineChart/LineChart.base.js +80 -136
  44. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  45. package/lib-amd/components/ScatterChart/ScatterChart.base.js +35 -60
  46. package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
  47. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +1 -1
  48. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  49. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +1 -1
  50. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  51. package/lib-amd/index.d.ts +1 -1
  52. package/lib-amd/index.js.map +1 -1
  53. package/lib-amd/types/IDataPoint.d.ts +9 -0
  54. package/lib-amd/types/IDataPoint.js.map +1 -1
  55. package/lib-amd/utilities/utilities.d.ts +29 -28
  56. package/lib-amd/utilities/utilities.js +133 -113
  57. package/lib-amd/utilities/utilities.js.map +1 -1
  58. package/lib-commonjs/components/AreaChart/AreaChart.base.js +2 -2
  59. package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
  60. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +4 -4
  61. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
  62. package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +18 -3
  63. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  64. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +10 -0
  65. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +188 -11
  66. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  67. package/lib-commonjs/components/LineChart/LineChart.base.d.ts +0 -9
  68. package/lib-commonjs/components/LineChart/LineChart.base.js +80 -136
  69. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  70. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +35 -60
  71. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
  72. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +1 -1
  73. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  74. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +1 -1
  75. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  76. package/lib-commonjs/index.d.ts +1 -1
  77. package/lib-commonjs/index.js.map +1 -1
  78. package/lib-commonjs/types/IDataPoint.d.ts +9 -0
  79. package/lib-commonjs/types/IDataPoint.js.map +1 -1
  80. package/lib-commonjs/utilities/utilities.d.ts +29 -28
  81. package/lib-commonjs/utilities/utilities.js +134 -114
  82. package/lib-commonjs/utilities/utilities.js.map +1 -1
  83. package/package.json +4 -4
  84. package/src/components/CommonComponents/CartesianChart.types.ts +22 -2
@@ -44,12 +44,7 @@ export declare class LineChartBase extends React.Component<ILineChartProps, ILin
44
44
  private _isRTL;
45
45
  private _cartesianChartRef;
46
46
  private _legendsRef;
47
- private _xMin;
48
- private _xMax;
49
- private _xPadding;
50
- private _yPaddingPrimary;
51
47
  private _yScaleSecondary;
52
- private _yPaddingSecondary;
53
48
  private _hasMarkersMode;
54
49
  private _isXAxisDateType;
55
50
  private _isScatterPolar;
@@ -71,7 +66,6 @@ export declare class LineChartBase extends React.Component<ILineChartProps, ILin
71
66
  private _getBoxWidthOfShape;
72
67
  private _getPath;
73
68
  private _getPointFill;
74
- private _getRangeForScatterMarkerSize;
75
69
  private _createLines;
76
70
  private _createColorFillBars;
77
71
  private _getStripePattern;
@@ -104,10 +98,7 @@ export declare class LineChartBase extends React.Component<ILineChartProps, ILin
104
98
  private _noLegendHighlighted;
105
99
  private _getColorFillBarOpacity;
106
100
  private _getAriaLabel;
107
- private _getDomainNRangeValuesOfDateWithPadding;
108
- private _getDomainNRangeValuesWithPadding;
109
101
  private _isChartEmpty;
110
102
  private _getChartTitle;
111
- private _setXMinMaxValues;
112
103
  }
113
104
  export {};
@@ -66,11 +66,6 @@ var LineChartBase = /** @class */ (function (_super) {
66
66
  _this_1._yScalePrimary = '';
67
67
  _this_1.eventLabelHeight = 36;
68
68
  _this_1._isRTL = (0, Utilities_1.getRTL)();
69
- _this_1._xMin = Number.NEGATIVE_INFINITY;
70
- _this_1._xMax = Number.POSITIVE_INFINITY;
71
- _this_1._xPadding = 0;
72
- _this_1._yPaddingPrimary = 0;
73
- _this_1._yPaddingSecondary = 0;
74
69
  _this_1._hasMarkersMode = false;
75
70
  _this_1._isXAxisDateType = false;
76
71
  _this_1._isScatterPolar = false;
@@ -80,17 +75,11 @@ var LineChartBase = /** @class */ (function (_super) {
80
75
  };
81
76
  _this_1._getDomainNRangeValues = function (points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues, shiftX) {
82
77
  var domainNRangeValue;
83
- if (_this_1._hasMarkersMode && xAxisType === index_3.XAxisTypes.NumericAxis) {
84
- domainNRangeValue = _this_1._getDomainNRangeValuesWithPadding(points, margins, width, isRTL);
85
- }
86
- else if (_this_1._hasMarkersMode && xAxisType === index_3.XAxisTypes.DateAxis) {
87
- domainNRangeValue = _this_1._getDomainNRangeValuesOfDateWithPadding(points, margins, width, isRTL, tickValues, chartType, barWidth);
88
- }
89
- else if (xAxisType === index_3.XAxisTypes.NumericAxis) {
90
- domainNRangeValue = (0, index_3.domainRangeOfNumericForAreaChart)(points, margins, width, isRTL);
78
+ if (xAxisType === index_3.XAxisTypes.NumericAxis) {
79
+ domainNRangeValue = (0, index_3.domainRangeOfNumericForAreaLineScatterCharts)(points, margins, width, isRTL, _this_1.props.xScaleType, _this_1._hasMarkersMode);
91
80
  }
92
81
  else if (xAxisType === index_3.XAxisTypes.DateAxis) {
93
- domainNRangeValue = (0, index_3.domainRangeOfDateForAreaLineVerticalBarChart)(points, margins, width, isRTL, tickValues, chartType, barWidth);
82
+ domainNRangeValue = (0, index_3.domainRangeOfDateForAreaLineScatterVerticalBarCharts)(points, margins, width, isRTL, tickValues, chartType, barWidth, _this_1._hasMarkersMode);
94
83
  }
95
84
  else {
96
85
  domainNRangeValue = { dStartValue: 0, dEndValue: 0, rStartValue: 0, rEndValue: 0 };
@@ -136,20 +125,14 @@ var LineChartBase = /** @class */ (function (_super) {
136
125
  };
137
126
  _this_1._getNumericMinMaxOfY = function (points, yAxisType, useSecondaryYScale) {
138
127
  // eslint-disable-next-line @typescript-eslint/no-shadow
139
- var _a = (0, index_3.findNumericMinMaxOfY)(points, yAxisType, useSecondaryYScale), startValue = _a.startValue, endValue = _a.endValue;
140
- var yPadding = 0;
128
+ var _a = (0, index_3.findNumericMinMaxOfY)(points, yAxisType, useSecondaryYScale, useSecondaryYScale ? _this_1.props.secondaryYScaleType : _this_1.props.yScaleType), startValue = _a.startValue, endValue = _a.endValue;
129
+ var yPadding = { start: 0, end: 0 };
141
130
  if (_this_1._hasMarkersMode) {
142
- yPadding = (endValue - startValue) * 0.1;
143
- if (useSecondaryYScale) {
144
- _this_1._yPaddingSecondary = yPadding;
145
- }
146
- else {
147
- _this_1._yPaddingPrimary = yPadding;
148
- }
131
+ yPadding = (0, index_3.getDomainPaddingForMarkers)(startValue, endValue, useSecondaryYScale ? _this_1.props.secondaryYScaleType : _this_1.props.yScaleType);
149
132
  }
150
133
  return {
151
- startValue: startValue - yPadding,
152
- endValue: endValue + yPadding,
134
+ startValue: startValue - yPadding.start,
135
+ endValue: endValue + yPadding.end,
153
136
  };
154
137
  };
155
138
  _this_1._getMargins = function (margins) {
@@ -615,71 +598,10 @@ var LineChartBase = /** @class */ (function (_super) {
615
598
  var yValue = point.yAxisCalloutData || point.y;
616
599
  return ((_a = point.callOutAccessibilityData) === null || _a === void 0 ? void 0 : _a.ariaLabel) || "".concat(xValue, ". ").concat(legend, ", ").concat(yValue, ".");
617
600
  };
618
- _this_1._getDomainNRangeValuesOfDateWithPadding = function (points, margins, width, isRTL, tickValues, chartType, barWidth) {
619
- if (tickValues === void 0) { tickValues = []; }
620
- _this_1._setXMinMaxValues(points);
621
- // Include tickValues if present
622
- var sDate = tickValues && tickValues.length > 0
623
- ? (0, d3_array_2.min)(tslib_1.__spreadArray(tslib_1.__spreadArray([], tickValues, true), [new Date(_this_1._xMin)], false))
624
- : new Date(_this_1._xMin);
625
- var lDate = tickValues && tickValues.length > 0
626
- ? (0, d3_array_2.max)(tslib_1.__spreadArray(tslib_1.__spreadArray([], tickValues, true), [new Date(_this_1._xMax)], false))
627
- : new Date(_this_1._xMax);
628
- // Calculate time-based padding (e.g. 10% of the date range)
629
- var dateRange = lDate.getTime() - sDate.getTime();
630
- var datePadding = _this_1._hasMarkersMode ? dateRange * 0.1 : 0;
631
- var paddedSDate = new Date(sDate.getTime() - datePadding);
632
- var paddedLDate = new Date(lDate.getTime() + datePadding);
633
- var rStartValue = margins.left;
634
- var rEndValue = width - margins.right;
635
- return isRTL
636
- ? {
637
- dStartValue: paddedLDate,
638
- dEndValue: paddedSDate,
639
- rStartValue: rStartValue,
640
- rEndValue: rEndValue,
641
- }
642
- : {
643
- dStartValue: paddedSDate,
644
- dEndValue: paddedLDate,
645
- rStartValue: rStartValue,
646
- rEndValue: rEndValue,
647
- };
648
- };
649
- _this_1._getDomainNRangeValuesWithPadding = function (points, margins, width, isRTL) {
650
- _this_1._setXMinMaxValues(points);
651
- if (_this_1._hasMarkersMode) {
652
- _this_1._xPadding = (_this_1._xMax - _this_1._xMin) * 0.1;
653
- }
654
- var rStartValue = margins.left;
655
- var rEndValue = width - margins.right;
656
- return isRTL
657
- ? {
658
- dStartValue: _this_1._xMax + _this_1._xPadding,
659
- dEndValue: _this_1._xMin - _this_1._xPadding,
660
- rStartValue: rStartValue,
661
- rEndValue: rEndValue,
662
- }
663
- : {
664
- dStartValue: _this_1._xMin - _this_1._xPadding,
665
- dEndValue: _this_1._xMax + _this_1._xPadding,
666
- rStartValue: rStartValue,
667
- rEndValue: rEndValue,
668
- };
669
- };
670
601
  _this_1._getChartTitle = function () {
671
602
  var _a = _this_1.props.data, chartTitle = _a.chartTitle, lineChartData = _a.lineChartData;
672
603
  return (chartTitle ? "".concat(chartTitle, ". ") : '') + "Line chart with ".concat((lineChartData === null || lineChartData === void 0 ? void 0 : lineChartData.length) || 0, " lines. ");
673
604
  };
674
- _this_1._setXMinMaxValues = function (points) {
675
- var getX = function (item) { return (_this_1._isXAxisDateType ? item.x : item.x); };
676
- var minVal = (0, d3_array_2.min)(points, function (point) { return (0, d3_array_2.min)(point.data, getX); });
677
- var maxVal = (0, d3_array_2.max)(points, function (point) { return (0, d3_array_2.max)(point.data, getX); });
678
- _this_1._xMin = _this_1._isXAxisDateType ? minVal.getTime() : minVal;
679
- _this_1._xMax = _this_1._isXAxisDateType ? maxVal.getTime() : maxVal;
680
- _this_1._xMin = _this_1._xMin === Number.NEGATIVE_INFINITY || !_this_1._xMin ? 0 : _this_1._xMin;
681
- _this_1._xMax = _this_1._xMax === Number.POSITIVE_INFINITY || !_this_1._xMax ? 0 : _this_1._xMax;
682
- };
683
605
  (0, Utilities_1.initializeComponentRef)(_this_1);
684
606
  _this_1.state = {
685
607
  hoverXValue: '',
@@ -858,14 +780,6 @@ var LineChartBase = /** @class */ (function (_super) {
858
780
  : [];
859
781
  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, { ref: this._legendsRef })));
860
782
  };
861
- LineChartBase.prototype._getRangeForScatterMarkerSize = function (yScale, yPadding) {
862
- var extraXPixels = this._isRTL
863
- ? this._xAxisScale(this._xMax - this._xPadding) - this._xAxisScale(this._xMax)
864
- : this._xAxisScale(this._xMin + this._xPadding) - this._xAxisScale(this._xMin);
865
- var yMin = yScale.domain()[0];
866
- var extraYPixels = yScale(yMin) - yScale(yMin + yPadding);
867
- return Math.min(extraXPixels, extraYPixels);
868
- };
869
783
  // eslint-disable-next-line @typescript-eslint/no-deprecated
870
784
  LineChartBase.prototype._createLines = function (xElement, containerHeight) {
871
785
  var _this_1 = this;
@@ -898,27 +812,44 @@ var LineChartBase = /** @class */ (function (_super) {
898
812
  var activePoint = this_1.state.activePoint;
899
813
  var theme = this_1.props.theme;
900
814
  var verticaLineHeight = containerHeight - this_1.margins.bottom + 6;
901
- var yScale = this_1._points[i].useSecondaryYScale && this_1._yScaleSecondary ? this_1._yScaleSecondary : this_1._yScalePrimary;
902
- var yPadding = this_1._points[i].useSecondaryYScale && this_1._yScaleSecondary ? this_1._yPaddingSecondary : this_1._yPaddingPrimary;
903
- var extraMaxPixels = this_1._hasMarkersMode ? this_1._getRangeForScatterMarkerSize(yScale, yPadding) : 0;
815
+ var useSecondaryYScale = !!(this_1._points[i].useSecondaryYScale && this_1._yScaleSecondary);
816
+ var yScale = useSecondaryYScale ? this_1._yScaleSecondary : this_1._yScalePrimary;
817
+ var extraMaxPixels = this_1._hasMarkersMode
818
+ ? (0, index_3.getRangeForScatterMarkerSize)({
819
+ data: this_1._points,
820
+ xScale: this_1._xAxisScale,
821
+ yScalePrimary: this_1._yScalePrimary,
822
+ yScaleSecondary: this_1._yScaleSecondary,
823
+ useSecondaryYScale: useSecondaryYScale,
824
+ xScaleType: this_1.props.xScaleType,
825
+ yScaleType: this_1.props.yScaleType,
826
+ secondaryYScaleType: this_1.props.secondaryYScaleType,
827
+ })
828
+ : 0;
904
829
  if (this_1._points[i].data.length === 1) {
905
830
  var _18 = this_1._points[i].data[0], x1_1 = _18.x, y1 = _18.y, xAxisCalloutData_1 = _18.xAxisCalloutData, xAxisCalloutAccessibilityData_1 = _18.xAxisCalloutAccessibilityData;
906
- var circleId_1 = "".concat(this_1._circleId, "_").concat(i);
907
- var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
908
- var currentMarkerSize = this_1._points[i].data[0].markerSize;
909
- 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');
910
- var text = this_1._points[i].data[0].text;
911
- pointsForLine.push(React.createElement(React.Fragment, { key: "".concat(circleId_1, "_fragment") },
912
- React.createElement("circle", tslib_1.__assign({ id: circleId_1, key: circleId_1, r: currentMarkerSize
913
- ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize
914
- : activePoint === circleId_1
915
- ? 5.5
916
- : 3.5, cx: this_1._xAxisScale(x1_1), cy: yScale(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, 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, ref: function (e) {
917
- _this_1._refCallback(e, circleId_1);
918
- }, 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))),
919
- !this_1._isScatterPolar && supportsTextMode && text && (React.createElement("text", { key: "".concat(circleId_1, "-label"), x: this_1._xAxisScale(x1_1), y: yScale(y1) +
920
- Math.max(currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 3.5, 4) +
921
- 12, className: classNames.markerLabel, opacity: isLegendSelected ? 1 : 0.1 }, text))));
831
+ var xPoint = this_1._xAxisScale(x1_1);
832
+ var yPoint = yScale(y1);
833
+ if ((0, index_3.isPlottable)(xPoint, yPoint)) {
834
+ var circleId_1 = "".concat(this_1._circleId, "_").concat(i);
835
+ var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
836
+ var currentMarkerSize = this_1._points[i].data[0].markerSize;
837
+ 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');
838
+ var text = this_1._points[i].data[0].text;
839
+ pointsForLine.push(React.createElement(React.Fragment, { key: "".concat(circleId_1, "_fragment") },
840
+ React.createElement("circle", tslib_1.__assign({ id: circleId_1, key: circleId_1, r: currentMarkerSize
841
+ ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize
842
+ : activePoint === circleId_1
843
+ ? 5.5
844
+ : 3.5, cx: xPoint, cy: yPoint, 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, 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, ref: function (e) {
845
+ _this_1._refCallback(e, circleId_1);
846
+ }, onFocus: function () {
847
+ return _this_1._handleFocus(circleId_1, x1_1, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1);
848
+ }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[0].onDataPointClick))),
849
+ !this_1._isScatterPolar && supportsTextMode && text && (React.createElement("text", { key: "".concat(circleId_1, "-label"), x: xPoint, y: yPoint +
850
+ Math.max(currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 3.5, 4) +
851
+ 12, className: classNames.markerLabel, opacity: isLegendSelected ? 1 : 0.1 }, text))));
852
+ }
922
853
  }
923
854
  var gapIndex = 0;
924
855
  var gaps = (_d = (_c = this_1._points[i].gaps) === null || _c === void 0 ? void 0 : _c.sort(function (a, b) { return a.startIndex - b.startIndex; })) !== null && _d !== void 0 ? _d : [];
@@ -930,7 +861,8 @@ var LineChartBase = /** @class */ (function (_super) {
930
861
  .x(function (d) { return _this_1._xAxisScale(d[0]); })
931
862
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
932
863
  .y(function (d) { return yScale(d[1]); })
933
- .curve((0, index_3.getCurveFactory)(lineCurve));
864
+ .curve((0, index_3.getCurveFactory)(lineCurve))
865
+ .defined(function (d) { return (0, index_3.isPlottable)(_this_1._xAxisScale(d[0]), yScale(d[1])); });
934
866
  var lineId = "".concat(this_1._lineId, "_").concat(i);
935
867
  var borderId = "".concat(this_1._borderId, "_").concat(i);
936
868
  var strokeWidth = ((_f = this_1._points[i].lineOptions) === null || _f === void 0 ? void 0 : _f.strokeWidth) || this_1.props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
@@ -969,43 +901,55 @@ var LineChartBase = /** @class */ (function (_super) {
969
901
  var circleId = "".concat(this_1._circleId, "_").concat(i, "_").concat(j);
970
902
  var _19 = this_1._points[i].data[j - 1], x1 = _19.x, y1 = _19.y, xAxisCalloutData = _19.xAxisCalloutData, xAxisCalloutAccessibilityData = _19.xAxisCalloutAccessibilityData;
971
903
  var _20 = this_1._points[i].data[j], x2 = _20.x, y2 = _20.y;
972
- var path = this_1._getPath(this_1._xAxisScale(x1), yScale(y1), circleId, j, false, this_1._points[i].index);
904
+ var xPoint1 = this_1._xAxisScale(x1);
905
+ var yPoint1 = yScale(y1);
906
+ var xPoint2 = this_1._xAxisScale(x2);
907
+ var yPoint2 = yScale(y2);
973
908
  var strokeWidth = ((_s = this_1._points[i].lineOptions) === null || _s === void 0 ? void 0 : _s.strokeWidth) || this_1.props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
974
909
  var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
975
910
  var currentPointHidden = this_1._points[i].hideNonActiveDots && activePoint !== circleId;
976
911
  var supportsTextMode = (_u = (_t = this_1._points[i].lineOptions) === null || _t === void 0 ? void 0 : _t.mode) === null || _u === void 0 ? void 0 : _u.includes('text');
977
912
  var text = this_1._points[i].data[j - 1].text;
978
913
  var currentMarkerSize = this_1._points[i].data[j - 1].markerSize;
979
- pointsForLine.push(((_w = (_v = this_1._points[i].lineOptions) === null || _v === void 0 ? void 0 : _v.mode) === null || _w === void 0 ? void 0 : _w.includes('markers')) || supportsTextMode ? (React.createElement(React.Fragment, null,
980
- React.createElement("circle", tslib_1.__assign({ id: circleId, key: circleId, r: currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, cx: this_1._xAxisScale(x1), cy: yScale(y1), "data-is-focusable": isLegendSelected, 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 () {
914
+ if ((0, index_3.isPlottable)(xPoint1, yPoint1)) {
915
+ var path = this_1._getPath(xPoint1, yPoint1, circleId, j, false, this_1._points[i].index);
916
+ pointsForLine.push(((_w = (_v = this_1._points[i].lineOptions) === null || _v === void 0 ? void 0 : _v.mode) === null || _w === void 0 ? void 0 : _w.includes('markers')) || supportsTextMode ? (React.createElement(React.Fragment, null,
917
+ React.createElement("circle", tslib_1.__assign({ id: circleId, key: circleId, r: currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, cx: xPoint1, cy: yPoint1, "data-is-focusable": isLegendSelected, 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 () {
918
+ return _this_1._handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData);
919
+ }, 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": (_x = this_1._points[i].data[j - 1].text) !== null && _x !== void 0 ? _x : this_1._getAriaLabel(i, j - 1) })),
920
+ !this_1._isScatterPolar && supportsTextMode && text && (React.createElement("text", { key: "".concat(circleId, "-label"), x: xPoint1, y: yPoint1 +
921
+ Math.max(currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, 4) +
922
+ 12, className: classNames.markerLabel, opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01 }, text)))) : (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, 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 () {
981
923
  return _this_1._handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData);
982
- }, 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": (_x = this_1._points[i].data[j - 1].text) !== null && _x !== void 0 ? _x : this_1._getAriaLabel(i, j - 1) })),
983
- !this_1._isScatterPolar && supportsTextMode && text && (React.createElement("text", { key: "".concat(circleId, "-label"), x: this_1._xAxisScale(x1), y: yScale(y1) +
984
- Math.max(currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, 4) +
985
- 12, className: classNames.markerLabel, opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01 }, text)))) : (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, 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 () { 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) }))));
924
+ }, 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) }))));
925
+ }
986
926
  if (j + 1 === this_1._points[i].data.length) {
987
927
  // If this is last point of the line segment.
988
928
  var lastCircleId_1 = "".concat(circleId).concat(j, "L");
989
929
  var hiddenHoverCircleId = "".concat(circleId).concat(j, "D");
990
930
  var lastPointHidden = this_1._points[i].hideNonActiveDots && activePoint !== lastCircleId_1;
991
- path = this_1._getPath(this_1._xAxisScale(x2), yScale(y2), lastCircleId_1, j, true, this_1._points[i].index);
992
931
  var _21 = this_1._points[i].data[j], lastCirlceXCallout_1 = _21.xAxisCalloutData, lastCirlceXCalloutAccessibilityData_1 = _21.xAxisCalloutAccessibilityData;
993
932
  currentMarkerSize = this_1._points[i].data[j].markerSize;
994
933
  var lastSupportsTextMode = (_z = (_y = this_1._points[i].lineOptions) === null || _y === void 0 ? void 0 : _y.mode) === null || _z === void 0 ? void 0 : _z.includes('text');
995
934
  var lastText = this_1._points[i].data[j].text;
996
- pointsForLine.push(React.createElement(React.Fragment, { key: "".concat(lastCircleId_1, "_container") },
997
- ((_1 = (_0 = this_1._points[i].lineOptions) === null || _0 === void 0 ? void 0 : _0.mode) === null || _1 === void 0 ? void 0 : _1.includes('markers')) || lastSupportsTextMode ? (React.createElement(React.Fragment, null,
998
- React.createElement("circle", tslib_1.__assign({ id: lastCircleId_1, key: lastCircleId_1, r: currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, cx: this_1._xAxisScale(x2), cy: yScale(y2), "data-is-focusable": isLegendSelected, 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 () {
935
+ if ((0, index_3.isPlottable)(xPoint2, yPoint2)) {
936
+ var path = this_1._getPath(xPoint2, yPoint2, lastCircleId_1, j, true, this_1._points[i].index);
937
+ pointsForLine.push(React.createElement(React.Fragment, { key: "".concat(lastCircleId_1, "_container") },
938
+ ((_1 = (_0 = this_1._points[i].lineOptions) === null || _0 === void 0 ? void 0 : _0.mode) === null || _1 === void 0 ? void 0 : _1.includes('markers')) || lastSupportsTextMode ? (React.createElement(React.Fragment, null,
939
+ 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, 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 () {
940
+ return _this_1._handleFocus(lineId, x2, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1);
941
+ }, 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": (_2 = this_1._points[i].data[j].text) !== null && _2 !== void 0 ? _2 : this_1._getAriaLabel(i, j) })),
942
+ !this_1._isScatterPolar && lastSupportsTextMode && lastText && (React.createElement("text", { key: "".concat(lastCircleId_1, "-label"), x: xPoint2, y: yPoint2 +
943
+ Math.max(currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, 4) +
944
+ 12, className: classNames.markerLabel, opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01 }, text)))) : (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, 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 () {
999
945
  return _this_1._handleFocus(lineId, x2, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1);
1000
- }, 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": (_2 = this_1._points[i].data[j].text) !== null && _2 !== void 0 ? _2 : this_1._getAriaLabel(i, j) })),
1001
- !this_1._isScatterPolar && lastSupportsTextMode && lastText && (React.createElement("text", { key: "".concat(lastCircleId_1, "-label"), x: this_1._xAxisScale(x2), y: yScale(y2) +
1002
- Math.max(currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, 4) +
1003
- 12, className: classNames.markerLabel, opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01 }, text)))) : (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, 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 () {
1004
- return _this_1._handleFocus(lineId, x2, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1);
1005
- }, 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) }))),
1006
- React.createElement("circle", { id: hiddenHoverCircleId, key: hiddenHoverCircleId, r: 8, cx: this_1._xAxisScale(x2), cy: yScale(y2), 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 })));
946
+ }, 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) }))),
947
+ 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 })));
948
+ }
1007
949
  }
1008
- if (!this_1._hasMarkersMode || ((_4 = (_3 = this_1._points[i].lineOptions) === null || _3 === void 0 ? void 0 : _3.mode) === null || _4 === void 0 ? void 0 : _4.includes('lines'))) {
950
+ if ((0, index_3.isPlottable)(xPoint1, yPoint1) &&
951
+ (0, index_3.isPlottable)(xPoint2, yPoint2) &&
952
+ (!this_1._hasMarkersMode || ((_4 = (_3 = this_1._points[i].lineOptions) === null || _3 === void 0 ? void 0 : _3.mode) === null || _4 === void 0 ? void 0 : _4.includes('lines')))) {
1009
953
  if (isLegendSelected) {
1010
954
  // don't draw line if it is in a gap
1011
955
  if (!isInGap) {
@@ -1013,16 +957,16 @@ var LineChartBase = /** @class */ (function (_super) {
1013
957
  ? Number.parseFloat(this_1._points[i].lineOptions.lineBorderWidth.toString())
1014
958
  : 0;
1015
959
  if (lineBorderWidth > 0) {
1016
- bordersForLine.push(React.createElement("line", { id: borderId, key: borderId, x1: this_1._xAxisScale(x1), y1: yScale(y1), x2: this_1._xAxisScale(x2), y2: yScale(y2), strokeLinecap: (_7 = (_6 = this_1._points[i].lineOptions) === null || _6 === void 0 ? void 0 : _6.strokeLinecap) !== null && _7 !== void 0 ? _7 : 'round', strokeWidth: Number.parseFloat(strokeWidth.toString()) + lineBorderWidth, stroke: ((_8 = this_1._points[i].lineOptions) === null || _8 === void 0 ? void 0 : _8.lineBorderColor) || theme.semanticColors.bodyBackground, opacity: 1 }));
960
+ bordersForLine.push(React.createElement("line", { id: borderId, key: borderId, x1: xPoint1, y1: yPoint1, x2: xPoint2, y2: yPoint2, strokeLinecap: (_7 = (_6 = this_1._points[i].lineOptions) === null || _6 === void 0 ? void 0 : _6.strokeLinecap) !== null && _7 !== void 0 ? _7 : 'round', strokeWidth: Number.parseFloat(strokeWidth.toString()) + lineBorderWidth, stroke: ((_8 = this_1._points[i].lineOptions) === null || _8 === void 0 ? void 0 : _8.lineBorderColor) || theme.semanticColors.bodyBackground, opacity: 1 }));
1017
961
  }
1018
- linesForLine.push(React.createElement("line", tslib_1.__assign({ id: lineId, key: lineId, x1: this_1._xAxisScale(x1), y1: yScale(y1), x2: this_1._xAxisScale(x2), y2: yScale(y2), strokeWidth: strokeWidth, ref: function (e) {
962
+ linesForLine.push(React.createElement("line", tslib_1.__assign({ id: lineId, key: lineId, x1: xPoint1, y1: yPoint1, x2: xPoint2, y2: yPoint2, strokeWidth: strokeWidth, ref: function (e) {
1019
963
  _this_1._refCallback(e, lineId);
1020
964
  }, 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, stroke: lineColor, strokeLinecap: (_10 = (_9 = this_1._points[i].lineOptions) === null || _9 === void 0 ? void 0 : _9.strokeLinecap) !== null && _10 !== void 0 ? _10 : 'round', strokeDasharray: (_11 = this_1._points[i].lineOptions) === null || _11 === void 0 ? void 0 : _11.strokeDasharray, strokeDashoffset: (_12 = this_1._points[i].lineOptions) === null || _12 === void 0 ? void 0 : _12.strokeDashoffset, opacity: 1 }, this_1._getClickHandler(this_1._points[i].onLineClick))));
1021
965
  }
1022
966
  }
1023
967
  else {
1024
968
  if (!isInGap) {
1025
- linesForLine.push(React.createElement("line", { id: lineId, key: lineId, x1: this_1._xAxisScale(x1), y1: yScale(y1), x2: this_1._xAxisScale(x2), y2: yScale(y2), strokeWidth: strokeWidth, stroke: lineColor, strokeLinecap: (_14 = (_13 = this_1._points[i].lineOptions) === null || _13 === void 0 ? void 0 : _13.strokeLinecap) !== null && _14 !== void 0 ? _14 : 'round', strokeDasharray: (_15 = this_1._points[i].lineOptions) === null || _15 === void 0 ? void 0 : _15.strokeDasharray, strokeDashoffset: (_16 = this_1._points[i].lineOptions) === null || _16 === void 0 ? void 0 : _16.strokeDashoffset, opacity: 0.1 }));
969
+ linesForLine.push(React.createElement("line", { id: lineId, key: lineId, x1: xPoint1, y1: yPoint1, x2: xPoint2, y2: yPoint2, strokeWidth: strokeWidth, stroke: lineColor, strokeLinecap: (_14 = (_13 = this_1._points[i].lineOptions) === null || _13 === void 0 ? void 0 : _13.strokeLinecap) !== null && _14 !== void 0 ? _14 : 'round', strokeDasharray: (_15 = this_1._points[i].lineOptions) === null || _15 === void 0 ? void 0 : _15.strokeDasharray, strokeDashoffset: (_16 = this_1._points[i].lineOptions) === null || _16 === void 0 ? void 0 : _16.strokeDashoffset, opacity: 0.1 }));
1026
970
  }
1027
971
  }
1028
972
  }