@fluentui/react-charting 5.23.58 → 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.
Files changed (41) hide show
  1. package/CHANGELOG.json +16 -1
  2. package/CHANGELOG.md +11 -2
  3. package/dist/react-charting.d.ts +9 -0
  4. package/dist/react-charting.js +1 -1
  5. package/dist/react-charting.min.js +1 -1
  6. package/etc/react-charting.api.md +2 -0
  7. package/lib/components/DeclarativeChart/DeclarativeChart.js +9 -8
  8. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  9. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +8 -4
  10. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  11. package/lib/components/LineChart/LineChart.base.d.ts +8 -0
  12. package/lib/components/LineChart/LineChart.base.js +94 -22
  13. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  14. package/lib/components/LineChart/LineChart.types.d.ts +5 -0
  15. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  16. package/lib/types/IDataPoint.d.ts +4 -0
  17. package/lib/types/IDataPoint.js.map +1 -1
  18. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +9 -8
  19. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  20. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +8 -4
  21. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  22. package/lib-amd/components/LineChart/LineChart.base.d.ts +8 -0
  23. package/lib-amd/components/LineChart/LineChart.base.js +94 -23
  24. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  25. package/lib-amd/components/LineChart/LineChart.types.d.ts +5 -0
  26. package/lib-amd/components/LineChart/LineChart.types.js.map +1 -1
  27. package/lib-amd/types/IDataPoint.d.ts +4 -0
  28. package/lib-amd/types/IDataPoint.js.map +1 -1
  29. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +9 -8
  30. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  31. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +8 -4
  32. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  33. package/lib-commonjs/components/LineChart/LineChart.base.d.ts +8 -0
  34. package/lib-commonjs/components/LineChart/LineChart.base.js +94 -22
  35. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  36. package/lib-commonjs/components/LineChart/LineChart.types.d.ts +5 -0
  37. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  38. package/lib-commonjs/types/IDataPoint.d.ts +4 -0
  39. package/lib-commonjs/types/IDataPoint.js.map +1 -1
  40. package/package.json +1 -1
  41. package/src/components/LineChart/LineChart.types.ts +6 -0
@@ -4,6 +4,7 @@ import { select as d3Select, pointer } from 'd3-selection';
4
4
  import { bisector } from 'd3-array';
5
5
  import { Legends } from '../Legends/index';
6
6
  import { line as d3Line, curveLinear as d3curveLinear } from 'd3-shape';
7
+ import { max as d3Max, min as d3Min } from 'd3-array';
7
8
  import { classNamesFunction, getId, find, memoizeFunction, getRTL, initializeComponentRef, } from '@fluentui/react/lib/Utilities';
8
9
  import { CartesianChart, } from '../../index';
9
10
  import { DirectionalHint } from '@fluentui/react/lib/Callout';
@@ -59,9 +60,17 @@ var LineChartBase = /** @class */ (function (_super) {
59
60
  _this_1._yAxisScale = '';
60
61
  _this_1.eventLabelHeight = 36;
61
62
  _this_1._isRTL = getRTL();
63
+ _this_1._xMin = Number.NEGATIVE_INFINITY;
64
+ _this_1._yMin = Number.NEGATIVE_INFINITY;
65
+ _this_1._xMax = Number.POSITIVE_INFINITY;
66
+ _this_1._xPadding = 0;
67
+ _this_1._yPadding = 0;
62
68
  _this_1._getDomainNRangeValues = function (points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues, shiftX) {
63
69
  var domainNRangeValue;
64
- if (xAxisType === XAxisTypes.NumericAxis) {
70
+ if (_this_1.props.lineMode === 'scatter' && xAxisType === XAxisTypes.NumericAxis) {
71
+ domainNRangeValue = _this_1._getDomainNRangeValuesWithPadding(points, margins, width, isRTL);
72
+ }
73
+ else if (xAxisType === XAxisTypes.NumericAxis) {
65
74
  domainNRangeValue = domainRangeOfNumericForAreaChart(points, margins, width, isRTL);
66
75
  }
67
76
  else if (xAxisType === XAxisTypes.DateAxis) {
@@ -105,6 +114,18 @@ var LineChartBase = /** @class */ (function (_super) {
105
114
  ? _this_1.props.onRenderCalloutPerDataPoint(_this_1.state.dataPointCalloutProps)
106
115
  : null;
107
116
  };
117
+ _this_1._getNumericMinMaxOfY = function (points) {
118
+ // eslint-disable-next-line @typescript-eslint/no-shadow
119
+ var _a = findNumericMinMaxOfY(points), startValue = _a.startValue, endValue = _a.endValue;
120
+ _this_1._yMin = startValue;
121
+ if (_this_1.props.lineMode === 'scatter') {
122
+ _this_1._yPadding = (endValue - startValue) * 0.1;
123
+ }
124
+ return {
125
+ startValue: startValue - _this_1._yPadding,
126
+ endValue: endValue + _this_1._yPadding,
127
+ };
128
+ };
108
129
  _this_1._getMargins = function (margins) {
109
130
  _this_1.margins = margins;
110
131
  };
@@ -548,6 +569,34 @@ var LineChartBase = /** @class */ (function (_super) {
548
569
  var yValue = point.yAxisCalloutData || point.y;
549
570
  return ((_a = point.callOutAccessibilityData) === null || _a === void 0 ? void 0 : _a.ariaLabel) || "".concat(xValue, ". ").concat(legend, ", ").concat(yValue, ".");
550
571
  };
572
+ _this_1._getDomainNRangeValuesWithPadding = function (points, margins, width, isRTL) {
573
+ _this_1._xMin = d3Min(points, function (point) {
574
+ return d3Min(point.data, function (item) { return item.x; });
575
+ });
576
+ _this_1._xMax = d3Max(points, function (point) {
577
+ return d3Max(point.data, function (item) {
578
+ return item.x;
579
+ });
580
+ });
581
+ if (_this_1.props.lineMode === 'scatter') {
582
+ _this_1._xPadding = (_this_1._xMax - _this_1._xMin) * 0.1;
583
+ }
584
+ var rStartValue = margins.left;
585
+ var rEndValue = width - margins.right;
586
+ return isRTL
587
+ ? {
588
+ dStartValue: _this_1._xMax + _this_1._xPadding,
589
+ dEndValue: _this_1._xMin - _this_1._xPadding,
590
+ rStartValue: rStartValue,
591
+ rEndValue: rEndValue,
592
+ }
593
+ : {
594
+ dStartValue: _this_1._xMin - _this_1._xPadding,
595
+ dEndValue: _this_1._xMax + _this_1._xPadding,
596
+ rStartValue: rStartValue,
597
+ rEndValue: rEndValue,
598
+ };
599
+ };
551
600
  _this_1._getChartTitle = function () {
552
601
  var _a = _this_1.props.data, chartTitle = _a.chartTitle, lineChartData = _a.lineChartData;
553
602
  return (chartTitle ? "".concat(chartTitle, ". ") : '') + "Line chart with ".concat((lineChartData === null || lineChartData === void 0 ? void 0 : lineChartData.length) || 0, " lines. ");
@@ -632,7 +681,7 @@ var LineChartBase = /** @class */ (function (_super) {
632
681
  tickValues: tickValues,
633
682
  tickFormat: tickFormat,
634
683
  };
635
- return !this._isChartEmpty() ? (React.createElement(CartesianChart, __assign({}, this.props, { chartTitle: this._getChartTitle(), points: points, chartType: ChartTypes.LineChart, isCalloutForStack: true, calloutProps: calloutProps, tickParams: tickParams, legendBars: legendBars, createYAxis: createNumericYAxis, getmargins: this._getMargins, getMinMaxOfYAxis: findNumericMinMaxOfY, getGraphData: this._initializeLineChartData, xAxisType: isXAxisDateType ? XAxisTypes.DateAxis : XAxisTypes.NumericAxis, customizedCallout: this._getCustomizedCallout(), getDomainNRangeValues: this._getDomainNRangeValues, createStringYAxis: createStringYAxis, onChartMouseLeave: this._handleChartMouseLeave, enableFirstRenderOptimization: this.props.enablePerfOptimization && this._firstRenderOptimization, ref: this._cartesianChartRef,
684
+ return !this._isChartEmpty() ? (React.createElement(CartesianChart, __assign({}, this.props, { chartTitle: this._getChartTitle(), points: points, chartType: ChartTypes.LineChart, isCalloutForStack: true, calloutProps: calloutProps, tickParams: tickParams, legendBars: legendBars, createYAxis: createNumericYAxis, getmargins: this._getMargins, getMinMaxOfYAxis: this._getNumericMinMaxOfY, getGraphData: this._initializeLineChartData, xAxisType: isXAxisDateType ? XAxisTypes.DateAxis : XAxisTypes.NumericAxis, customizedCallout: this._getCustomizedCallout(), getDomainNRangeValues: this._getDomainNRangeValues, createStringYAxis: createStringYAxis, onChartMouseLeave: this._handleChartMouseLeave, enableFirstRenderOptimization: this.props.enablePerfOptimization && this._firstRenderOptimization, ref: this._cartesianChartRef,
636
685
  /* eslint-disable react/jsx-no-bind */
637
686
  // eslint-disable-next-line react/no-children-prop
638
687
  children: function (props) {
@@ -714,6 +763,13 @@ var LineChartBase = /** @class */ (function (_super) {
714
763
  : [];
715
764
  return (React.createElement(Legends, __assign({ legends: __spreadArray(__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)));
716
765
  };
766
+ LineChartBase.prototype._getRangeForScatterMarkerSize = function () {
767
+ var extraXPixels = this._isRTL
768
+ ? this._xAxisScale(this._xMax - this._xPadding) - this._xAxisScale(this._xMax)
769
+ : this._xAxisScale(this._xMin + this._xPadding) - this._xAxisScale(this._xMin);
770
+ var extraYPixels = this._yAxisScale(this._yMin) - this._yAxisScale(this._yMin + this._yPadding);
771
+ return Math.min(extraXPixels, extraYPixels);
772
+ };
717
773
  LineChartBase.prototype._createLines = function (xElement, containerHeight) {
718
774
  var _this_1 = this;
719
775
  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;
@@ -724,6 +780,12 @@ var LineChartBase = /** @class */ (function (_super) {
724
780
  else {
725
781
  this._points = this._injectIndexPropertyInLineChartData(this.props.data.lineChartData);
726
782
  }
783
+ var extraMaxPixels = this.props.lineMode === 'scatter' ? this._getRangeForScatterMarkerSize() : 0;
784
+ var maxMarkerSize = d3Max(this._points, function (point) {
785
+ return d3Max(point.data, function (item) {
786
+ return item.markerSize;
787
+ });
788
+ });
727
789
  var _loop_1 = function (i) {
728
790
  var linesForLine = [];
729
791
  var bordersForLine = [];
@@ -737,7 +799,12 @@ var LineChartBase = /** @class */ (function (_super) {
737
799
  var _2 = this_1._points[i].data[0], x1_1 = _2.x, y1 = _2.y, xAxisCalloutData_1 = _2.xAxisCalloutData, xAxisCalloutAccessibilityData_1 = _2.xAxisCalloutAccessibilityData;
738
800
  var circleId_1 = "".concat(this_1._circleId, "_").concat(i);
739
801
  var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
740
- pointsForLine.push(React.createElement("circle", __assign({ id: circleId_1, key: circleId_1, r: activePoint === circleId_1 ? 5.5 : 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) {
802
+ var currentMarkerSize = this_1._points[i].data[0].markerSize;
803
+ pointsForLine.push(React.createElement("circle", __assign({ id: circleId_1, key: circleId_1, r: currentMarkerSize
804
+ ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize
805
+ : activePoint === circleId_1
806
+ ? 5.5
807
+ : 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) {
741
808
  _this_1._refCallback(e, circleId_1);
742
809
  }, 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))));
743
810
  }
@@ -793,7 +860,8 @@ var LineChartBase = /** @class */ (function (_super) {
793
860
  var strokeWidth = ((_p = this_1._points[i].lineOptions) === null || _p === void 0 ? void 0 : _p.strokeWidth) || this_1.props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
794
861
  var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
795
862
  var currentPointHidden = this_1._points[i].hideNonActiveDots && activePoint !== circleId;
796
- pointsForLine.push(React.createElement("path", __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) })));
863
+ var currentMarkerSize = this_1._points[i].data[j - 1].markerSize;
864
+ pointsForLine.push(this_1.props.lineMode === 'scatter' ? (React.createElement("circle", __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", __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) }))));
797
865
  if (j + 1 === this_1._points[i].data.length) {
798
866
  // If this is last point of the line segment.
799
867
  var lastCircleId_1 = "".concat(circleId).concat(j, "L");
@@ -801,30 +869,34 @@ var LineChartBase = /** @class */ (function (_super) {
801
869
  var lastPointHidden = this_1._points[i].hideNonActiveDots && activePoint !== lastCircleId_1;
802
870
  path = this_1._getPath(this_1._xAxisScale(x2), this_1._yAxisScale(y2), lastCircleId_1, j, true, this_1._points[i].index);
803
871
  var _5 = this_1._points[i].data[j], lastCirlceXCallout_1 = _5.xAxisCalloutData, lastCirlceXCalloutAccessibilityData_1 = _5.xAxisCalloutAccessibilityData;
872
+ currentMarkerSize = this_1._points[i].data[j].markerSize;
804
873
  pointsForLine.push(React.createElement(React.Fragment, { key: "".concat(lastCircleId_1, "_container") },
805
- React.createElement("path", __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 () {
874
+ this_1.props.lineMode === 'scatter' ? (React.createElement("circle", __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 () {
875
+ return _this_1._handleFocus(lineId, x2, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1);
876
+ }, 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", __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 () {
806
877
  return _this_1._handleFocus(lineId, x2, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1);
807
- }, 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) })),
878
+ }, 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) }))),
808
879
  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 })));
809
- /* eslint-enable react/jsx-no-bind */
810
880
  }
811
- if (isLegendSelected) {
812
- // don't draw line if it is in a gap
813
- if (!isInGap) {
814
- var lineBorderWidth = ((_q = this_1._points[i].lineOptions) === null || _q === void 0 ? void 0 : _q.lineBorderWidth)
815
- ? Number.parseFloat(this_1._points[i].lineOptions.lineBorderWidth.toString())
816
- : 0;
817
- if (lineBorderWidth > 0) {
818
- 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 }));
881
+ if (this_1.props.lineMode !== 'scatter') {
882
+ if (isLegendSelected) {
883
+ // don't draw line if it is in a gap
884
+ if (!isInGap) {
885
+ var lineBorderWidth = ((_q = this_1._points[i].lineOptions) === null || _q === void 0 ? void 0 : _q.lineBorderWidth)
886
+ ? Number.parseFloat(this_1._points[i].lineOptions.lineBorderWidth.toString())
887
+ : 0;
888
+ if (lineBorderWidth > 0) {
889
+ 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 }));
890
+ }
891
+ linesForLine.push(React.createElement("line", __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) {
892
+ _this_1._refCallback(e, lineId);
893
+ }, 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))));
819
894
  }
820
- linesForLine.push(React.createElement("line", __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) {
821
- _this_1._refCallback(e, lineId);
822
- }, 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))));
823
895
  }
824
- }
825
- else {
826
- if (!isInGap) {
827
- 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 }));
896
+ else {
897
+ if (!isInGap) {
898
+ 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 }));
899
+ }
828
900
  }
829
901
  }
830
902
  };