@fluentui/react-charts 0.0.0-nightly-20250828-0408.1 → 0.0.0-nightly-20250829-0406.1

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 (57) hide show
  1. package/CHANGELOG.md +15 -15
  2. package/dist/index.d.ts +27 -2
  3. package/lib/components/AreaChart/AreaChart.js +3 -3
  4. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  5. package/lib/components/CommonComponents/CartesianChart.js +4 -4
  6. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  7. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  8. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  9. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +40 -3
  10. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  11. package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
  12. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  13. package/lib/components/LineChart/LineChart.js +195 -241
  14. package/lib/components/LineChart/LineChart.js.map +1 -1
  15. package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  16. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  17. package/lib/components/ScatterChart/ScatterChart.js +30 -45
  18. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  19. package/lib/components/VerticalBarChart/VerticalBarChart.js +2 -2
  20. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  21. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +2 -2
  22. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  23. package/lib/types/DataPoint.js +6 -1
  24. package/lib/types/DataPoint.js.map +1 -1
  25. package/lib/utilities/Common.styles.raw.js.map +1 -1
  26. package/lib/utilities/image-export-utils.js.map +1 -1
  27. package/lib/utilities/utilities.js +130 -127
  28. package/lib/utilities/utilities.js.map +1 -1
  29. package/lib/utilities/vbc-utils.js.map +1 -1
  30. package/lib-commonjs/components/AreaChart/AreaChart.js +2 -2
  31. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  32. package/lib-commonjs/components/CommonComponents/CartesianChart.js +4 -4
  33. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  34. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  35. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  36. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +39 -2
  37. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  38. package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -1
  39. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  40. package/lib-commonjs/components/LineChart/LineChart.js +193 -239
  41. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  42. package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  43. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  44. package/lib-commonjs/components/ScatterChart/ScatterChart.js +28 -43
  45. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  46. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +1 -1
  47. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  48. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +1 -1
  49. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  50. package/lib-commonjs/types/DataPoint.js +6 -1
  51. package/lib-commonjs/types/DataPoint.js.map +1 -1
  52. package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -1
  53. package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
  54. package/lib-commonjs/utilities/utilities.js +142 -118
  55. package/lib-commonjs/utilities/utilities.js.map +1 -1
  56. package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
  57. package/package.json +12 -12
@@ -4,13 +4,13 @@ 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 } from 'd3-shape';
7
- import { max as d3Max, min as d3Min } from 'd3-array';
7
+ import { max as d3Max } from 'd3-array';
8
8
  import { useId } from '@fluentui/react-utilities';
9
9
  import { find } from '../../utilities/index';
10
10
  import { CartesianChart } from '../../index';
11
11
  import { EventsAnnotation } from './eventAnnotation/EventAnnotation';
12
12
  import { tokens } from '@fluentui/react-theme';
13
- import { calloutData, ChartTypes, getXAxisType, XAxisTypes, tooltipOfAxislabels, Points, pointTypes, getTypeOfAxis, getNextColor, getColorFromToken, findNumericMinMaxOfY, createNumericYAxis, domainRangeOfDateForAreaLineVerticalBarChart, domainRangeOfNumericForAreaChart, createStringYAxis, useRtl, formatDate, getCurveFactory, isScatterPolarSeries } from '../../utilities/index';
13
+ import { calloutData, ChartTypes, getXAxisType, XAxisTypes, tooltipOfAxislabels, Points, pointTypes, getTypeOfAxis, getNextColor, getColorFromToken, findNumericMinMaxOfY, createNumericYAxis, domainRangeOfDateForAreaLineScatterVerticalBarCharts, domainRangeOfNumericForAreaLineScatterCharts, createStringYAxis, useRtl, formatDate, getCurveFactory, isScatterPolarSeries, getDomainPaddingForMarkers, isPlottable, getRangeForScatterMarkerSize } from '../../utilities/index';
14
14
  import { toImage } from '../../utilities/image-export-utils';
15
15
  import { renderScatterPolarCategoryLabels } from '../../utilities/scatterpolar-utils';
16
16
  var PointSize = /*#__PURE__*/ function(PointSize) {
@@ -122,11 +122,6 @@ const PATH_MULTIPLY_SIZE = 2.5;
122
122
  const _isRTL = useRtl();
123
123
  let xAxisCalloutAccessibilityData = {};
124
124
  const cartesianChartRef = React.useRef(null);
125
- let _xMin = Number.NEGATIVE_INFINITY;
126
- let _yMin = Number.NEGATIVE_INFINITY;
127
- let _xMax = Number.POSITIVE_INFINITY;
128
- let _xPadding = 0;
129
- let _yPadding = 0;
130
125
  let _yScaleSecondary;
131
126
  const _legendsRef = React.useRef(null);
132
127
  props.eventAnnotationProps && props.eventAnnotationProps.labelHeight && (eventLabelHeight = props.eventAnnotationProps.labelHeight);
@@ -178,14 +173,10 @@ const PATH_MULTIPLY_SIZE = 2.5;
178
173
  }, []);
179
174
  function _getDomainNRangeValues(points, margins, width, chartType, isRTL, xAxisType, barWidth, tickValues, shiftX) {
180
175
  let domainNRangeValue;
181
- if (_hasMarkersMode && xAxisType === XAxisTypes.NumericAxis) {
182
- domainNRangeValue = _getDomainNRangeValuesWithPadding(points, margins, width, isRTL);
183
- } else if (_hasMarkersMode && xAxisType === XAxisTypes.DateAxis) {
184
- domainNRangeValue = _getDomainNRangeValuesOfDateWithPadding(points, margins, width, isRTL, tickValues, chartType, barWidth);
185
- } else if (xAxisType === XAxisTypes.NumericAxis) {
186
- domainNRangeValue = domainRangeOfNumericForAreaChart(points, margins, width, isRTL);
176
+ if (xAxisType === XAxisTypes.NumericAxis) {
177
+ domainNRangeValue = domainRangeOfNumericForAreaLineScatterCharts(points, margins, width, isRTL, props.xScaleType, _hasMarkersMode);
187
178
  } else if (xAxisType === XAxisTypes.DateAxis) {
188
- domainNRangeValue = domainRangeOfDateForAreaLineVerticalBarChart(points, margins, width, isRTL, tickValues, chartType, barWidth);
179
+ domainNRangeValue = domainRangeOfDateForAreaLineScatterVerticalBarCharts(points, margins, width, isRTL, tickValues, chartType, barWidth, _hasMarkersMode);
189
180
  } else {
190
181
  domainNRangeValue = {
191
182
  dStartValue: 0,
@@ -240,16 +231,19 @@ const PATH_MULTIPLY_SIZE = 2.5;
240
231
  function _getCustomizedCallout() {
241
232
  return props.onRenderCalloutPerStack ? props.onRenderCalloutPerStack(stackCalloutProps) : props.onRenderCalloutPerDataPoint ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps) : null;
242
233
  }
243
- function _getNumericMinMaxOfY(points) {
234
+ function _getNumericMinMaxOfY(points, yAxisType, useSecondaryYScale) {
244
235
  // eslint-disable-next-line @typescript-eslint/no-shadow
245
- const { startValue, endValue } = findNumericMinMaxOfY(points);
246
- _yMin = startValue;
236
+ const { startValue, endValue } = findNumericMinMaxOfY(points, yAxisType, useSecondaryYScale, useSecondaryYScale ? props.secondaryYScaleType : props.yScaleType);
237
+ let yPadding = {
238
+ start: 0,
239
+ end: 0
240
+ };
247
241
  if (_hasMarkersMode) {
248
- _yPadding = (endValue - startValue) * 0.1;
242
+ yPadding = getDomainPaddingForMarkers(startValue, endValue, useSecondaryYScale ? props.secondaryYScaleType : props.yScaleType);
249
243
  }
250
244
  return {
251
- startValue: startValue - _yPadding,
252
- endValue: endValue + _yPadding
245
+ startValue: startValue - yPadding.start,
246
+ endValue: endValue + yPadding.end
253
247
  };
254
248
  }
255
249
  function _getMargins(_margins) {
@@ -411,11 +405,6 @@ const PATH_MULTIPLY_SIZE = 2.5;
411
405
  }
412
406
  }
413
407
  }
414
- function _getRangeForScatterMarkerSize(yScale, yPadding) {
415
- const extraXPixels = _isRTL ? _xAxisScale(_xMax - _xPadding) - _xAxisScale(_xMax) : _xAxisScale(_xMin + _xPadding) - _xAxisScale(_xMin);
416
- const extraYPixels = yScale(_yMin) - yScale(_yMin + _yPadding);
417
- return Math.min(extraXPixels, extraYPixels);
418
- }
419
408
  function _createLines(xElement, containerHeight) {
420
409
  const lines = [];
421
410
  if (isSelectedLegend) {
@@ -423,7 +412,6 @@ const PATH_MULTIPLY_SIZE = 2.5;
423
412
  } else {
424
413
  _points = _injectIndexPropertyInLineChartData(props.data.lineChartData);
425
414
  }
426
- const extraMaxPixels = _hasMarkersMode ? _getRangeForScatterMarkerSize(_yScalePrimary, _yPadding) : 0;
427
415
  const maxMarkerSize = d3Max(_points, (point)=>{
428
416
  return d3Max(point.data, (item)=>{
429
417
  return item.markerSize;
@@ -437,49 +425,64 @@ const PATH_MULTIPLY_SIZE = 2.5;
437
425
  const legendVal = _points[i].legend;
438
426
  const lineColor = _points[i].color;
439
427
  const verticaLineHeight = containerHeight - margins.bottom + 6;
440
- const yScale = _points[i].useSecondaryYScale && _yScaleSecondary ? _yScaleSecondary : _yScalePrimary;
428
+ const useSecondaryYScale = !!(_points[i].useSecondaryYScale && _yScaleSecondary);
429
+ const yScale = useSecondaryYScale ? _yScaleSecondary : _yScalePrimary;
430
+ const extraMaxPixels = _hasMarkersMode ? getRangeForScatterMarkerSize({
431
+ data: _points,
432
+ xScale: _xAxisScale,
433
+ yScalePrimary: _yScalePrimary,
434
+ yScaleSecondary: _yScaleSecondary,
435
+ useSecondaryYScale,
436
+ xScaleType: props.xScaleType,
437
+ yScaleType: props.yScaleType,
438
+ secondaryYScaleType: props.secondaryYScaleType
439
+ }) : 0;
441
440
  if (_points[i].data.length === 1) {
442
- var _points_i_lineOptions_mode, _points_i_lineOptions1;
443
441
  // eslint-disable-next-line @typescript-eslint/no-shadow
444
442
  const { x: x1, y: y1, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points[i].data[0];
445
- const circleId = `${_circleId}_${i}`;
446
- const isLegendSelected = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;
447
- const currentMarkerSize = _points[i].data[0].markerSize;
448
- const supportsTextMode = (_points_i_lineOptions1 = _points[i].lineOptions) === null || _points_i_lineOptions1 === void 0 ? void 0 : (_points_i_lineOptions_mode = _points_i_lineOptions1.mode) === null || _points_i_lineOptions_mode === void 0 ? void 0 : _points_i_lineOptions_mode.includes('text');
449
- const text = _points[i].data[0].text;
450
- var _points_i_data__text;
451
- pointsForLine.push(/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(React.Fragment, {
452
- key: `${circleId}_fragment`
453
- }, /*#__PURE__*/ React.createElement("circle", {
454
- id: circleId,
455
- key: circleId,
456
- r: currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : activePoint === circleId ? 5.5 : 3.5,
457
- cx: _xAxisScale(x1),
458
- cy: yScale(y1),
459
- fill: activePoint === circleId ? tokens.colorNeutralBackground1 : lineColor,
460
- opacity: isLegendSelected ? 1 : 0.1,
461
- tabIndex: isLegendSelected ? 0 : undefined,
462
- onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale, legendVal, lineColor),
463
- onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale, legendVal, lineColor),
464
- onMouseOut: _handleMouseOut,
465
- strokeWidth: activePoint === circleId ? DEFAULT_LINE_STROKE_SIZE : 0,
466
- stroke: activePoint === circleId ? lineColor : '',
467
- role: "img",
468
- "aria-label": (_points_i_data__text = _points[i].data[0].text) !== null && _points_i_data__text !== void 0 ? _points_i_data__text : _getAriaLabel(i, 0),
469
- "data-is-focusable": isLegendSelected,
470
- ref: (e)=>{
471
- _refCallback(e, circleId);
472
- },
473
- onFocus: (event)=>_handleFocus(event, circleId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData),
474
- onBlur: _handleMouseOut,
475
- ..._getClickHandler(_points[i].data[0].onDataPointClick)
476
- }), !_isScatterPolar && supportsTextMode && text && /*#__PURE__*/ React.createElement("text", {
477
- key: `${circleId}-label`,
478
- x: _xAxisScale(x1),
479
- y: yScale(y1) + Math.max(currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 3.5, 4) + 12,
480
- className: classes.markerLabel,
481
- opacity: isLegendSelected ? 1 : 0.1
482
- }, text))));
443
+ const xPoint = _xAxisScale(x1);
444
+ const yPoint = yScale(y1);
445
+ if (isPlottable(xPoint, yPoint)) {
446
+ var _points_i_lineOptions_mode, _points_i_lineOptions1;
447
+ const circleId = `${_circleId}_${i}`;
448
+ const isLegendSelected = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;
449
+ const currentMarkerSize = _points[i].data[0].markerSize;
450
+ const supportsTextMode = (_points_i_lineOptions1 = _points[i].lineOptions) === null || _points_i_lineOptions1 === void 0 ? void 0 : (_points_i_lineOptions_mode = _points_i_lineOptions1.mode) === null || _points_i_lineOptions_mode === void 0 ? void 0 : _points_i_lineOptions_mode.includes('text');
451
+ const text = _points[i].data[0].text;
452
+ var _points_i_data__text;
453
+ pointsForLine.push(/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(React.Fragment, {
454
+ key: `${circleId}_fragment`
455
+ }, /*#__PURE__*/ React.createElement("circle", {
456
+ id: circleId,
457
+ key: circleId,
458
+ r: currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : activePoint === circleId ? 5.5 : 3.5,
459
+ cx: xPoint,
460
+ cy: yPoint,
461
+ fill: activePoint === circleId ? tokens.colorNeutralBackground1 : lineColor,
462
+ opacity: isLegendSelected ? 1 : 0.1,
463
+ tabIndex: isLegendSelected ? 0 : undefined,
464
+ onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale, legendVal, lineColor),
465
+ onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale, legendVal, lineColor),
466
+ onMouseOut: _handleMouseOut,
467
+ strokeWidth: activePoint === circleId ? DEFAULT_LINE_STROKE_SIZE : 0,
468
+ stroke: activePoint === circleId ? lineColor : '',
469
+ role: "img",
470
+ "aria-label": (_points_i_data__text = _points[i].data[0].text) !== null && _points_i_data__text !== void 0 ? _points_i_data__text : _getAriaLabel(i, 0),
471
+ "data-is-focusable": isLegendSelected,
472
+ ref: (e)=>{
473
+ _refCallback(e, circleId);
474
+ },
475
+ onFocus: (event)=>_handleFocus(event, circleId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData),
476
+ onBlur: _handleMouseOut,
477
+ ..._getClickHandler(_points[i].data[0].onDataPointClick)
478
+ }), !_isScatterPolar && supportsTextMode && text && /*#__PURE__*/ React.createElement("text", {
479
+ key: `${circleId}-label`,
480
+ x: xPoint,
481
+ y: yPoint + Math.max(currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 3.5, 4) + 12,
482
+ className: classes.markerLabel,
483
+ opacity: isLegendSelected ? 1 : 0.1
484
+ }, text))));
485
+ }
483
486
  }
484
487
  let gapIndex = 0;
485
488
  var _points_i_gaps_sort;
@@ -490,7 +493,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
490
493
  var _points_i_lineOptions2;
491
494
  const line = d3Line()// eslint-disable-next-line @typescript-eslint/no-explicit-any
492
495
  .x((d)=>_xAxisScale(d[0]))// eslint-disable-next-line @typescript-eslint/no-explicit-any
493
- .y((d)=>yScale(d[1])).curve(getCurveFactory(lineCurve));
496
+ .y((d)=>yScale(d[1])).curve(getCurveFactory(lineCurve)).defined((d)=>isPlottable(_xAxisScale(d[0]), yScale(d[1])));
494
497
  const lineId = `${_lineId}_${i}`;
495
498
  const borderId = `${_borderId}_${i}`;
496
499
  const strokeWidth = ((_points_i_lineOptions2 = _points[i].lineOptions) === null || _points_i_lineOptions2 === void 0 ? void 0 : _points_i_lineOptions2.strokeWidth) || props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
@@ -567,7 +570,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
567
570
  }));
568
571
  } else if (!props.optimizeLargeData) {
569
572
  for(let j = 1; j < _points[i].data.length; j++){
570
- var _points_i_lineOptions8, _points_i_lineOptions_mode1, _points_i_lineOptions9, _points_i_lineOptions_mode2, _points_i_lineOptions10, _points_i_lineOptions_mode3, _points_i_lineOptions11;
573
+ var _points_i_lineOptions8, _points_i_lineOptions_mode1, _points_i_lineOptions9, _points_i_lineOptions_mode2, _points_i_lineOptions10;
571
574
  const gapResult = _checkInGap(j, gaps, gapIndex);
572
575
  const isInGap = gapResult.isInGap;
573
576
  gapIndex = gapResult.gapIndex;
@@ -576,132 +579,141 @@ const PATH_MULTIPLY_SIZE = 2.5;
576
579
  const circleId = `${_circleId}_${i}_${j}`;
577
580
  const { x: x1, y: y1, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points[i].data[j - 1];
578
581
  const { x: x2, y: y2 } = _points[i].data[j];
579
- let path = _getPath(_xAxisScale(x1), yScale(y1), circleId, j, false, _points[i].index);
582
+ const xPoint1 = _xAxisScale(x1);
583
+ const yPoint1 = yScale(y1);
584
+ const xPoint2 = _xAxisScale(x2);
585
+ const yPoint2 = yScale(y2);
580
586
  const strokeWidth = ((_points_i_lineOptions8 = _points[i].lineOptions) === null || _points_i_lineOptions8 === void 0 ? void 0 : _points_i_lineOptions8.strokeWidth) || props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
581
587
  const isLegendSelected = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;
582
588
  const currentPointHidden = _points[i].hideNonActiveDots && activePoint !== circleId;
583
589
  const supportsTextMode = (_points_i_lineOptions9 = _points[i].lineOptions) === null || _points_i_lineOptions9 === void 0 ? void 0 : (_points_i_lineOptions_mode1 = _points_i_lineOptions9.mode) === null || _points_i_lineOptions_mode1 === void 0 ? void 0 : _points_i_lineOptions_mode1.includes('text');
584
590
  const text = _points[i].data[j - 1].text;
585
591
  let currentMarkerSize = _points[i].data[j - 1].markerSize;
586
- var _points_i_data__text1;
587
- pointsForLine.push(((_points_i_lineOptions10 = _points[i].lineOptions) === null || _points_i_lineOptions10 === void 0 ? void 0 : (_points_i_lineOptions_mode2 = _points_i_lineOptions10.mode) === null || _points_i_lineOptions_mode2 === void 0 ? void 0 : _points_i_lineOptions_mode2.includes('markers')) || supportsTextMode ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("circle", {
588
- id: circleId,
589
- key: circleId,
590
- r: currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 4,
591
- cx: _xAxisScale(x1),
592
- cy: yScale(y1),
593
- "data-is-focusable": isLegendSelected,
594
- onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale, legendVal, lineColor),
595
- onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale, legendVal, lineColor),
596
- onMouseOut: _handleMouseOut,
597
- onFocus: (event)=>_handleFocus(event, lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData),
598
- onBlur: _handleMouseOut,
599
- ..._getClickHandler(_points[i].data[j - 1].onDataPointClick),
600
- opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01,
601
- fill: _getPointFill(lineColor, circleId, j, false),
602
- stroke: lineColor,
603
- strokeWidth: strokeWidth,
604
- role: "img",
605
- "aria-label": (_points_i_data__text1 = _points[i].data[j - 1].text) !== null && _points_i_data__text1 !== void 0 ? _points_i_data__text1 : _getAriaLabel(i, j - 1)
606
- }), !_isScatterPolar && supportsTextMode && text && /*#__PURE__*/ React.createElement("text", {
607
- key: `${circleId}-label`,
608
- x: _xAxisScale(x1),
609
- y: yScale(y1) + Math.max(currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 4, 4) + 12,
610
- className: classes.markerLabel,
611
- opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01
612
- }, text)) : /*#__PURE__*/ React.createElement("path", {
613
- id: circleId,
614
- key: circleId,
615
- d: path,
616
- "data-is-focusable": isLegendSelected,
617
- onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale, legendVal, lineColor),
618
- onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale, legendVal, lineColor),
619
- onMouseOut: _handleMouseOut,
620
- onFocus: (event)=>_handleFocus(event, lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData),
621
- onBlur: _handleMouseOut,
622
- ..._getClickHandler(_points[i].data[j - 1].onDataPointClick),
623
- opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01,
624
- fill: _getPointFill(lineColor, circleId, j, false),
625
- stroke: lineColor,
626
- strokeWidth: strokeWidth,
627
- role: "img",
628
- "aria-label": _getAriaLabel(i, j - 1),
629
- tabIndex: isLegendSelected ? 0 : undefined
630
- }));
631
- if (j + 1 === _points[i].data.length) {
632
- var _points_i_lineOptions_mode4, _points_i_lineOptions12, _points_i_lineOptions_mode5, _points_i_lineOptions13;
633
- // If this is last point of the line segment.
634
- const lastCircleId = `${circleId}${j}L`;
635
- const hiddenHoverCircleId = `${circleId}${j}D`;
636
- const lastPointHidden = _points[i].hideNonActiveDots && activePoint !== lastCircleId;
637
- path = _getPath(_xAxisScale(x2), yScale(y2), lastCircleId, j, true, _points[i].index);
638
- const { xAxisCalloutData: lastCirlceXCallout, xAxisCalloutAccessibilityData: lastCirlceXCalloutAccessibilityData } = _points[i].data[j];
639
- currentMarkerSize = _points[i].data[j].markerSize;
640
- const lastSupportsTextMode = (_points_i_lineOptions12 = _points[i].lineOptions) === null || _points_i_lineOptions12 === void 0 ? void 0 : (_points_i_lineOptions_mode4 = _points_i_lineOptions12.mode) === null || _points_i_lineOptions_mode4 === void 0 ? void 0 : _points_i_lineOptions_mode4.includes('text');
641
- const lastText = _points[i].data[j].text;
642
- var _points_i_data_j_text;
643
- pointsForLine.push(/*#__PURE__*/ React.createElement(React.Fragment, {
644
- key: `${lastCircleId}_container`
645
- }, ((_points_i_lineOptions13 = _points[i].lineOptions) === null || _points_i_lineOptions13 === void 0 ? void 0 : (_points_i_lineOptions_mode5 = _points_i_lineOptions13.mode) === null || _points_i_lineOptions_mode5 === void 0 ? void 0 : _points_i_lineOptions_mode5.includes('markers')) || lastSupportsTextMode ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("circle", {
646
- id: lastCircleId,
647
- key: lastCircleId,
592
+ if (isPlottable(xPoint1, yPoint1)) {
593
+ var _points_i_lineOptions_mode3, _points_i_lineOptions11;
594
+ const path = _getPath(xPoint1, yPoint1, circleId, j, false, _points[i].index);
595
+ var _points_i_data__text1;
596
+ pointsForLine.push(((_points_i_lineOptions11 = _points[i].lineOptions) === null || _points_i_lineOptions11 === void 0 ? void 0 : (_points_i_lineOptions_mode3 = _points_i_lineOptions11.mode) === null || _points_i_lineOptions_mode3 === void 0 ? void 0 : _points_i_lineOptions_mode3.includes('markers')) || supportsTextMode ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("circle", {
597
+ id: circleId,
598
+ key: circleId,
648
599
  r: currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 4,
649
- cx: _xAxisScale(x2),
650
- cy: yScale(y2),
600
+ cx: xPoint1,
601
+ cy: yPoint1,
651
602
  "data-is-focusable": isLegendSelected,
652
- onMouseOver: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale, legendVal, lineColor),
653
- onMouseMove: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale, legendVal, lineColor),
603
+ onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale, legendVal, lineColor),
604
+ onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale, legendVal, lineColor),
654
605
  onMouseOut: _handleMouseOut,
655
- onFocus: (event)=>_handleFocus(event, lineId, x2, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData),
606
+ onFocus: (event)=>_handleFocus(event, lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData),
656
607
  onBlur: _handleMouseOut,
657
- ..._getClickHandler(_points[i].data[j].onDataPointClick),
658
- opacity: isLegendSelected && !lastPointHidden ? 1 : 0.01,
659
- fill: _getPointFill(lineColor, lastCircleId, j, true),
608
+ ..._getClickHandler(_points[i].data[j - 1].onDataPointClick),
609
+ opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01,
610
+ fill: _getPointFill(lineColor, circleId, j, false),
660
611
  stroke: lineColor,
661
612
  strokeWidth: strokeWidth,
662
613
  role: "img",
663
- "aria-label": (_points_i_data_j_text = _points[i].data[j].text) !== null && _points_i_data_j_text !== void 0 ? _points_i_data_j_text : _getAriaLabel(i, j)
664
- }), !_isScatterPolar && lastSupportsTextMode && lastText && /*#__PURE__*/ React.createElement("text", {
665
- key: `${lastCircleId}-label`,
666
- x: _xAxisScale(x2),
667
- y: yScale(y2) + Math.max(currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 4, 4) + 12,
668
- className: classes.markerLabel
614
+ "aria-label": (_points_i_data__text1 = _points[i].data[j - 1].text) !== null && _points_i_data__text1 !== void 0 ? _points_i_data__text1 : _getAriaLabel(i, j - 1)
615
+ }), !_isScatterPolar && supportsTextMode && text && /*#__PURE__*/ React.createElement("text", {
616
+ key: `${circleId}-label`,
617
+ x: xPoint1,
618
+ y: yPoint1 + Math.max(currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 4, 4) + 12,
619
+ className: classes.markerLabel,
620
+ opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01
669
621
  }, text)) : /*#__PURE__*/ React.createElement("path", {
670
- id: lastCircleId,
671
- key: lastCircleId,
622
+ id: circleId,
623
+ key: circleId,
672
624
  d: path,
673
625
  "data-is-focusable": isLegendSelected,
674
- onMouseOver: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale, legendVal, lineColor),
675
- onMouseMove: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale, legendVal, lineColor),
626
+ onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale, legendVal, lineColor),
627
+ onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale, legendVal, lineColor),
676
628
  onMouseOut: _handleMouseOut,
677
- onFocus: (event)=>_handleFocus(event, lineId, x2, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData),
629
+ onFocus: (event)=>_handleFocus(event, lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData),
678
630
  onBlur: _handleMouseOut,
679
- ..._getClickHandler(_points[i].data[j].onDataPointClick),
680
- opacity: isLegendSelected && !lastPointHidden ? 1 : 0.01,
681
- fill: _getPointFill(lineColor, lastCircleId, j, true),
631
+ ..._getClickHandler(_points[i].data[j - 1].onDataPointClick),
632
+ opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01,
633
+ fill: _getPointFill(lineColor, circleId, j, false),
682
634
  stroke: lineColor,
683
635
  strokeWidth: strokeWidth,
684
636
  role: "img",
685
- "aria-label": _getAriaLabel(i, j),
637
+ "aria-label": _getAriaLabel(i, j - 1),
686
638
  tabIndex: isLegendSelected ? 0 : undefined
687
- }), /*#__PURE__*/ React.createElement("circle", {
688
- id: hiddenHoverCircleId,
689
- key: hiddenHoverCircleId,
690
- r: 8,
691
- cx: _xAxisScale(x2),
692
- cy: yScale(y2),
693
- opacity: 0,
694
- width: 0,
695
- onMouseOver: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale, legendVal, lineColor),
696
- onMouseMove: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale, legendVal, lineColor),
697
- onFocus: (event)=>_handleFocus(event, circleId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData),
698
- onMouseOut: _handleMouseOut,
699
- strokeWidth: 0,
700
- focusable: false,
701
- onBlur: _handleMouseOut
702
- })));
639
+ }));
703
640
  }
704
- if (!_hasMarkersMode || ((_points_i_lineOptions11 = _points[i].lineOptions) === null || _points_i_lineOptions11 === void 0 ? void 0 : (_points_i_lineOptions_mode3 = _points_i_lineOptions11.mode) === null || _points_i_lineOptions_mode3 === void 0 ? void 0 : _points_i_lineOptions_mode3.includes('lines'))) {
641
+ if (j + 1 === _points[i].data.length) {
642
+ var _points_i_lineOptions_mode4, _points_i_lineOptions12;
643
+ // If this is last point of the line segment.
644
+ const lastCircleId = `${circleId}${j}L`;
645
+ const hiddenHoverCircleId = `${circleId}${j}D`;
646
+ const lastPointHidden = _points[i].hideNonActiveDots && activePoint !== lastCircleId;
647
+ const { xAxisCalloutData: lastCirlceXCallout, xAxisCalloutAccessibilityData: lastCirlceXCalloutAccessibilityData } = _points[i].data[j];
648
+ currentMarkerSize = _points[i].data[j].markerSize;
649
+ const lastSupportsTextMode = (_points_i_lineOptions12 = _points[i].lineOptions) === null || _points_i_lineOptions12 === void 0 ? void 0 : (_points_i_lineOptions_mode4 = _points_i_lineOptions12.mode) === null || _points_i_lineOptions_mode4 === void 0 ? void 0 : _points_i_lineOptions_mode4.includes('text');
650
+ const lastText = _points[i].data[j].text;
651
+ if (isPlottable(xPoint2, yPoint2)) {
652
+ var _points_i_lineOptions_mode5, _points_i_lineOptions13;
653
+ const path = _getPath(xPoint2, yPoint2, lastCircleId, j, true, _points[i].index);
654
+ var _points_i_data_j_text;
655
+ pointsForLine.push(/*#__PURE__*/ React.createElement(React.Fragment, {
656
+ key: `${lastCircleId}_container`
657
+ }, ((_points_i_lineOptions13 = _points[i].lineOptions) === null || _points_i_lineOptions13 === void 0 ? void 0 : (_points_i_lineOptions_mode5 = _points_i_lineOptions13.mode) === null || _points_i_lineOptions_mode5 === void 0 ? void 0 : _points_i_lineOptions_mode5.includes('markers')) || lastSupportsTextMode ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("circle", {
658
+ id: lastCircleId,
659
+ key: lastCircleId,
660
+ r: currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 4,
661
+ cx: xPoint2,
662
+ cy: yPoint2,
663
+ "data-is-focusable": isLegendSelected,
664
+ onMouseOver: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale, legendVal, lineColor),
665
+ onMouseMove: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale, legendVal, lineColor),
666
+ onMouseOut: _handleMouseOut,
667
+ onFocus: (event)=>_handleFocus(event, lineId, x2, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData),
668
+ onBlur: _handleMouseOut,
669
+ ..._getClickHandler(_points[i].data[j].onDataPointClick),
670
+ opacity: isLegendSelected && !lastPointHidden ? 1 : 0.01,
671
+ fill: _getPointFill(lineColor, lastCircleId, j, true),
672
+ stroke: lineColor,
673
+ strokeWidth: strokeWidth,
674
+ role: "img",
675
+ "aria-label": (_points_i_data_j_text = _points[i].data[j].text) !== null && _points_i_data_j_text !== void 0 ? _points_i_data_j_text : _getAriaLabel(i, j)
676
+ }), !_isScatterPolar && lastSupportsTextMode && lastText && /*#__PURE__*/ React.createElement("text", {
677
+ key: `${lastCircleId}-label`,
678
+ x: xPoint2,
679
+ y: yPoint2 + Math.max(currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 4, 4) + 12,
680
+ className: classes.markerLabel
681
+ }, text)) : /*#__PURE__*/ React.createElement("path", {
682
+ id: lastCircleId,
683
+ key: lastCircleId,
684
+ d: path,
685
+ "data-is-focusable": isLegendSelected,
686
+ onMouseOver: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale, legendVal, lineColor),
687
+ onMouseMove: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale, legendVal, lineColor),
688
+ onMouseOut: _handleMouseOut,
689
+ onFocus: (event)=>_handleFocus(event, lineId, x2, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData),
690
+ onBlur: _handleMouseOut,
691
+ ..._getClickHandler(_points[i].data[j].onDataPointClick),
692
+ opacity: isLegendSelected && !lastPointHidden ? 1 : 0.01,
693
+ fill: _getPointFill(lineColor, lastCircleId, j, true),
694
+ stroke: lineColor,
695
+ strokeWidth: strokeWidth,
696
+ role: "img",
697
+ "aria-label": _getAriaLabel(i, j),
698
+ tabIndex: isLegendSelected ? 0 : undefined
699
+ }), /*#__PURE__*/ React.createElement("circle", {
700
+ id: hiddenHoverCircleId,
701
+ key: hiddenHoverCircleId,
702
+ r: 8,
703
+ cx: xPoint2,
704
+ cy: yPoint2,
705
+ opacity: 0,
706
+ width: 0,
707
+ onMouseOver: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale, legendVal, lineColor),
708
+ onMouseMove: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale, legendVal, lineColor),
709
+ onMouseOut: _handleMouseOut,
710
+ strokeWidth: 0,
711
+ focusable: false,
712
+ onBlur: _handleMouseOut
713
+ })));
714
+ }
715
+ }
716
+ if (isPlottable(xPoint1, yPoint1) && isPlottable(xPoint2, yPoint2) && (!_hasMarkersMode || ((_points_i_lineOptions10 = _points[i].lineOptions) === null || _points_i_lineOptions10 === void 0 ? void 0 : (_points_i_lineOptions_mode2 = _points_i_lineOptions10.mode) === null || _points_i_lineOptions_mode2 === void 0 ? void 0 : _points_i_lineOptions_mode2.includes('lines')))) {
705
717
  if (isLegendSelected) {
706
718
  // don't draw line if it is in a gap
707
719
  if (!isInGap) {
@@ -713,10 +725,10 @@ const PATH_MULTIPLY_SIZE = 2.5;
713
725
  bordersForLine.push(/*#__PURE__*/ React.createElement("line", {
714
726
  id: borderId,
715
727
  key: borderId,
716
- x1: _xAxisScale(x1),
717
- y1: yScale(y1),
718
- x2: _xAxisScale(x2),
719
- y2: yScale(y2),
728
+ x1: xPoint1,
729
+ y1: yPoint1,
730
+ x2: xPoint2,
731
+ y2: yPoint2,
720
732
  strokeLinecap: (_points_i_lineOptions_strokeLinecap3 = (_points_i_lineOptions18 = _points[i].lineOptions) === null || _points_i_lineOptions18 === void 0 ? void 0 : _points_i_lineOptions18.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap3 !== void 0 ? _points_i_lineOptions_strokeLinecap3 : 'round',
721
733
  strokeWidth: Number.parseFloat(strokeWidth.toString()) + lineBorderWidth,
722
734
  stroke: ((_points_i_lineOptions19 = _points[i].lineOptions) === null || _points_i_lineOptions19 === void 0 ? void 0 : _points_i_lineOptions19.lineBorderColor) || tokens.colorNeutralBackground1,
@@ -727,10 +739,10 @@ const PATH_MULTIPLY_SIZE = 2.5;
727
739
  linesForLine.push(/*#__PURE__*/ React.createElement("line", {
728
740
  id: lineId,
729
741
  key: lineId,
730
- x1: _xAxisScale(x1),
731
- y1: yScale(y1),
732
- x2: _xAxisScale(x2),
733
- y2: yScale(y2),
742
+ x1: xPoint1,
743
+ y1: yPoint1,
744
+ x2: xPoint2,
745
+ y2: yPoint2,
734
746
  strokeWidth: strokeWidth,
735
747
  ref: (e)=>{
736
748
  _refCallback(e, lineId);
@@ -753,10 +765,10 @@ const PATH_MULTIPLY_SIZE = 2.5;
753
765
  linesForLine.push(/*#__PURE__*/ React.createElement("line", {
754
766
  id: lineId,
755
767
  key: lineId,
756
- x1: _xAxisScale(x1),
757
- y1: yScale(y1),
758
- x2: _xAxisScale(x2),
759
- y2: yScale(y2),
768
+ x1: xPoint1,
769
+ y1: yPoint1,
770
+ x2: xPoint2,
771
+ y2: yPoint2,
760
772
  strokeWidth: strokeWidth,
761
773
  stroke: lineColor,
762
774
  strokeLinecap: (_points_i_lineOptions_strokeLinecap5 = (_points_i_lineOptions20 = _points[i].lineOptions) === null || _points_i_lineOptions20 === void 0 ? void 0 : _points_i_lineOptions20.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap5 !== void 0 ? _points_i_lineOptions_strokeLinecap5 : 'round',
@@ -1129,67 +1141,9 @@ const PATH_MULTIPLY_SIZE = 2.5;
1129
1141
  const yValue = point.yAxisCalloutData || point.y;
1130
1142
  return ((_point_callOutAccessibilityData = point.callOutAccessibilityData) === null || _point_callOutAccessibilityData === void 0 ? void 0 : _point_callOutAccessibilityData.ariaLabel) || `${xValue}. ${legend}, ${yValue}.`;
1131
1143
  }
1132
- function _getDomainNRangeValuesOfDateWithPadding(points, margins, width, isRTL, tickValues = [], chartType, barWidth) {
1133
- _setXMinMaxValues(points);
1134
- // Include tickValues if present
1135
- const sDate = tickValues && tickValues.length > 0 ? d3Min([
1136
- ...tickValues,
1137
- new Date(_xMin)
1138
- ]) : new Date(_xMin);
1139
- const lDate = tickValues && tickValues.length > 0 ? d3Max([
1140
- ...tickValues,
1141
- new Date(_xMax)
1142
- ]) : new Date(_xMax);
1143
- // Calculate time-based padding (e.g. 10% of the date range)
1144
- const dateRange = lDate.getTime() - sDate.getTime();
1145
- const datePadding = _hasMarkersMode ? dateRange * 0.1 : 0;
1146
- const paddedSDate = new Date(sDate.getTime() - datePadding);
1147
- const paddedLDate = new Date(lDate.getTime() + datePadding);
1148
- const rStartValue = margins.left;
1149
- const rEndValue = width - margins.right;
1150
- return isRTL ? {
1151
- dStartValue: paddedLDate,
1152
- dEndValue: paddedSDate,
1153
- rStartValue,
1154
- rEndValue
1155
- } : {
1156
- dStartValue: paddedSDate,
1157
- dEndValue: paddedLDate,
1158
- rStartValue,
1159
- rEndValue
1160
- };
1161
- }
1162
- function _getDomainNRangeValuesWithPadding(points, margins, width, isRTL) {
1163
- _setXMinMaxValues(points);
1164
- if (_hasMarkersMode) {
1165
- _xPadding = (_xMax - _xMin) * 0.1;
1166
- }
1167
- const rStartValue = margins.left;
1168
- const rEndValue = width - margins.right;
1169
- return isRTL ? {
1170
- dStartValue: _xMax + _xPadding,
1171
- dEndValue: _xMin - _xPadding,
1172
- rStartValue,
1173
- rEndValue
1174
- } : {
1175
- dStartValue: _xMin - _xPadding,
1176
- dEndValue: _xMax + _xPadding,
1177
- rStartValue,
1178
- rEndValue
1179
- };
1180
- }
1181
1144
  function _isChartEmpty() {
1182
1145
  return !(props.data && props.data.lineChartData && props.data.lineChartData.length > 0 && props.data.lineChartData.filter((item)=>item.data.length).length > 0);
1183
1146
  }
1184
- function _setXMinMaxValues(points) {
1185
- const getX = (item)=>_isXAxisDateType ? item.x : item.x;
1186
- const minVal = d3Min(points, (point)=>d3Min(point.data, getX));
1187
- const maxVal = d3Max(points, (point)=>d3Max(point.data, getX));
1188
- _xMin = _isXAxisDateType ? minVal.getTime() : minVal;
1189
- _xMax = _isXAxisDateType ? maxVal.getTime() : maxVal;
1190
- _xMin = _xMin === Number.NEGATIVE_INFINITY || !_xMin ? 0 : _xMin;
1191
- _xMax = _xMax === Number.POSITIVE_INFINITY || !_xMax ? 0 : _xMax;
1192
- }
1193
1147
  const { legendProps, tickValues, tickFormat, eventAnnotationProps } = props;
1194
1148
  _points = _injectIndexPropertyInLineChartData(props.data.lineChartData);
1195
1149
  _isXAxisDateType = getXAxisType(_points);