@fluentui/react-charting 5.24.31 → 5.24.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CHANGELOG.json +57 -1
  2. package/CHANGELOG.md +23 -2
  3. package/dist/react-charting.d.ts +131 -2
  4. package/dist/react-charting.js +1 -1
  5. package/dist/react-charting.min.js +1 -1
  6. package/etc/react-charting.api.md +44 -2
  7. package/lib/components/AreaChart/AreaChart.base.js +18 -22
  8. package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
  9. package/lib/components/ChartTable/ChartTable.base.js +12 -6
  10. package/lib/components/ChartTable/ChartTable.base.js.map +1 -1
  11. package/lib/components/DeclarativeChart/DeclarativeChart.js +1 -4
  12. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  13. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +107 -52
  14. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  15. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +13 -2
  16. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +260 -100
  17. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  18. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.d.ts +7 -2
  19. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  20. package/lib/components/LineChart/LineChart.base.js +49 -39
  21. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  22. package/lib/components/ScatterChart/ScatterChart.base.js +5 -11
  23. package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
  24. package/lib/index.d.ts +1 -1
  25. package/lib/index.js.map +1 -1
  26. package/lib/types/IDataPoint.d.ts +121 -1
  27. package/lib/types/IDataPoint.js.map +1 -1
  28. package/lib/utilities/utilities.d.ts +18 -4
  29. package/lib/utilities/utilities.js +14 -5
  30. package/lib/utilities/utilities.js.map +1 -1
  31. package/lib-amd/components/AreaChart/AreaChart.base.js +16 -20
  32. package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
  33. package/lib-amd/components/ChartTable/ChartTable.base.js +12 -7
  34. package/lib-amd/components/ChartTable/ChartTable.base.js.map +1 -1
  35. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +1 -4
  36. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  37. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +106 -51
  38. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  39. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +13 -2
  40. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +257 -97
  41. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  42. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.d.ts +7 -2
  43. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  44. package/lib-amd/components/LineChart/LineChart.base.js +48 -38
  45. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  46. package/lib-amd/components/ScatterChart/ScatterChart.base.js +3 -9
  47. package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
  48. package/lib-amd/index.d.ts +1 -1
  49. package/lib-amd/index.js.map +1 -1
  50. package/lib-amd/types/IDataPoint.d.ts +121 -1
  51. package/lib-amd/types/IDataPoint.js.map +1 -1
  52. package/lib-amd/utilities/utilities.d.ts +18 -4
  53. package/lib-amd/utilities/utilities.js +16 -6
  54. package/lib-amd/utilities/utilities.js.map +1 -1
  55. package/lib-commonjs/components/AreaChart/AreaChart.base.js +16 -20
  56. package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
  57. package/lib-commonjs/components/ChartTable/ChartTable.base.js +12 -6
  58. package/lib-commonjs/components/ChartTable/ChartTable.base.js.map +1 -1
  59. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +1 -4
  60. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  61. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +106 -51
  62. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  63. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.d.ts +13 -2
  64. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +257 -97
  65. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  66. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.d.ts +7 -2
  67. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  68. package/lib-commonjs/components/LineChart/LineChart.base.js +48 -38
  69. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  70. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +3 -9
  71. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
  72. package/lib-commonjs/index.d.ts +1 -1
  73. package/lib-commonjs/index.js.map +1 -1
  74. package/lib-commonjs/types/IDataPoint.d.ts +121 -1
  75. package/lib-commonjs/types/IDataPoint.js.map +1 -1
  76. package/lib-commonjs/utilities/utilities.d.ts +18 -4
  77. package/lib-commonjs/utilities/utilities.js +16 -6
  78. package/lib-commonjs/utilities/utilities.js.map +1 -1
  79. package/package.json +2 -2
  80. package/project.json +155 -0
@@ -329,11 +329,7 @@ var LineChartBase = /** @class */ (function (_super) {
329
329
  var formattedDate = xPointToHighlight instanceof Date
330
330
  ? (0, chart_utilities_1.formatDateToLocaleString)(xPointToHighlight, _this_1.props.culture, _this_1.props.useUTC)
331
331
  : xPointToHighlight;
332
- var modifiedXVal = xPointToHighlight instanceof Date ? xPointToHighlight.getTime() : xPointToHighlight;
333
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
334
- var found = (0, Utilities_1.find)(_this_1._calloutPoints, function (element) {
335
- return element.x === modifiedXVal;
336
- });
332
+ var found = (0, index_3.findCalloutPoints)(_this_1._calloutPoints, xPointToHighlight);
337
333
  var pointToHighlight = lineChartData[linenumber].data[index];
338
334
  var pointToHighlightUpdated = _this_1.state.nearestCircleToHighlight === null ||
339
335
  (_this_1.state.nearestCircleToHighlight !== null &&
@@ -376,8 +372,7 @@ var LineChartBase = /** @class */ (function (_super) {
376
372
  _this_1._handleFocus = function (lineId, x, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData) {
377
373
  _this_1._uniqueCallOutID = circleId;
378
374
  var formattedData = x instanceof Date ? (0, chart_utilities_1.formatDateToLocaleString)(x, _this_1.props.culture, _this_1.props.useUTC) : x;
379
- var xVal = x instanceof Date ? x.getTime() : x;
380
- var found = (0, Utilities_1.find)(_this_1._calloutPoints, function (element) { return element.x === xVal; });
375
+ var found = (0, index_3.findCalloutPoints)(_this_1._calloutPoints, x);
381
376
  // if no points need to be called out then don't show vertical line and callout card
382
377
  if (found) {
383
378
  var _this_2 = _this_1;
@@ -408,16 +403,14 @@ var LineChartBase = /** @class */ (function (_super) {
408
403
  _this_1._handleHover = function (x, y, lineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, yScale, legendVal, lineColor, mouseEvent) {
409
404
  mouseEvent.persist();
410
405
  var formattedData = x instanceof Date ? (0, chart_utilities_1.formatDateToLocaleString)(x, _this_1.props.culture, _this_1.props.useUTC) : x;
411
- var xVal = x instanceof Date ? x.getTime() : x;
412
- var yVal = y instanceof Date ? y.getTime() : y;
413
406
  var _this = _this_1;
414
- var found = (0, Utilities_1.find)(_this_1._calloutPoints, function (element) { return element.x === xVal; });
407
+ var found = (0, index_3.findCalloutPoints)(_this_1._calloutPoints, x);
415
408
  var hoverDp = undefined;
416
409
  if (_this_1.props.isCalloutForStack === false && (found === null || found === void 0 ? void 0 : found.values)) {
417
- var dp = (0, Utilities_1.find)(found.values, function (val) { return (val === null || val === void 0 ? void 0 : val.y) === yVal; });
410
+ var dp = (0, Utilities_1.find)(found.values, function (val) { return (val === null || val === void 0 ? void 0 : val.y) === y; });
418
411
  if (dp) {
419
412
  hoverDp = {
420
- x: xVal,
413
+ x: x,
421
414
  values: [dp],
422
415
  };
423
416
  }
@@ -435,7 +428,7 @@ var LineChartBase = /** @class */ (function (_super) {
435
428
  refSelected: "#".concat(circleId),
436
429
  hoverXValue: xAxisCalloutData ? xAxisCalloutData : '' + formattedData,
437
430
  YValueHover: found.values,
438
- YValue: yVal,
431
+ YValue: y,
439
432
  legendVal: legendVal,
440
433
  lineColor: lineColor,
441
434
  stackCalloutProps: found,
@@ -622,7 +615,7 @@ var LineChartBase = /** @class */ (function (_super) {
622
615
  _this_1._refArray = [];
623
616
  _this_1._points = _this_1._injectIndexPropertyInLineChartData(_this_1.props.data.lineChartData);
624
617
  _this_1._colorFillBars = [];
625
- _this_1._calloutPoints = (0, index_3.calloutData)(_this_1._points) || [];
618
+ _this_1._calloutPoints = (0, index_3.calloutData)(_this_1._points) || {};
626
619
  _this_1._circleId = (0, Utilities_1.getId)('circle');
627
620
  _this_1._lineId = (0, Utilities_1.getId)('lineID');
628
621
  _this_1._borderId = (0, Utilities_1.getId)('borderID');
@@ -658,7 +651,7 @@ var LineChartBase = /** @class */ (function (_super) {
658
651
  prevProps.width !== this.props.width ||
659
652
  prevProps.data !== this.props.data) {
660
653
  this._points = this._injectIndexPropertyInLineChartData(this.props.data.lineChartData);
661
- this._calloutPoints = (0, index_3.calloutData)(this._points) || [];
654
+ this._calloutPoints = (0, index_3.calloutData)(this._points) || {};
662
655
  }
663
656
  };
664
657
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -783,7 +776,7 @@ var LineChartBase = /** @class */ (function (_super) {
783
776
  // eslint-disable-next-line @typescript-eslint/no-deprecated
784
777
  LineChartBase.prototype._createLines = function (xElement, containerHeight) {
785
778
  var _this_1 = this;
786
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26;
779
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27;
787
780
  // eslint-disable-next-line @typescript-eslint/no-deprecated
788
781
  var lines = [];
789
782
  if (this.state.isSelectedLegend) {
@@ -827,12 +820,12 @@ var LineChartBase = /** @class */ (function (_super) {
827
820
  })
828
821
  : 0;
829
822
  if (this_1._points[i].data.length === 1) {
830
- var _27 = this_1._points[i].data[0], x1_1 = _27.x, y1 = _27.y, xAxisCalloutData_1 = _27.xAxisCalloutData, xAxisCalloutAccessibilityData_1 = _27.xAxisCalloutAccessibilityData;
823
+ var _28 = this_1._points[i].data[0], x1_1 = _28.x, y1 = _28.y, xAxisCalloutData_1 = _28.xAxisCalloutData, xAxisCalloutAccessibilityData_1 = _28.xAxisCalloutAccessibilityData;
831
824
  var xPoint = this_1._xAxisScale(x1_1);
832
825
  var yPoint = yScale(y1);
833
826
  if ((0, index_3.isPlottable)(xPoint, yPoint)) {
834
827
  var circleId_1 = "".concat(this_1._circleId, "_").concat(i);
835
- var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
828
+ var isLegendSelected_1 = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
836
829
  var currentMarkerSize = this_1._points[i].data[0].markerSize;
837
830
  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
831
  var text = this_1._points[i].data[0].text;
@@ -841,14 +834,14 @@ var LineChartBase = /** @class */ (function (_super) {
841
834
  ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize
842
835
  : activePoint === circleId_1
843
836
  ? 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) {
837
+ : 3.5, cx: xPoint, cy: yPoint, fill: activePoint === circleId_1 ? theme.semanticColors.bodyBackground : lineColor, opacity: isLegendSelected_1 ? 1 : 0.1, onMouseOver: this_1._handleHover.bind(this_1, x1_1, y1, verticaLineHeight, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseMove: this_1._handleHover.bind(this_1, x1_1, y1, verticaLineHeight, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseOut: this_1._handleMouseOut, strokeWidth: activePoint === circleId_1 ? DEFAULT_LINE_STROKE_SIZE : 0, stroke: activePoint === circleId_1 ? lineColor : '', role: "img", "aria-label": this_1._getAriaLabel(i, 0), "data-is-focusable": isLegendSelected_1, ref: function (e) {
845
838
  _this_1._refCallback(e, circleId_1);
846
839
  }, onFocus: function () {
847
840
  return _this_1._handleFocus(circleId_1, x1_1, xAxisCalloutData_1, circleId_1, xAxisCalloutAccessibilityData_1);
848
841
  }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[0].onDataPointClick))),
849
842
  !this_1._isScatterPolar && supportsTextMode && text && (React.createElement("text", { key: "".concat(circleId_1, "-label"), x: xPoint, y: yPoint +
850
843
  Math.max(currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 3.5, 4) +
851
- 12, className: classNames.markerLabel, opacity: isLegendSelected ? 1 : 0.1 }, text))));
844
+ 12, className: classNames.markerLabel, opacity: isLegendSelected_1 ? 1 : 0.1 }, text))));
852
845
  }
853
846
  }
854
847
  var gapIndex = 0;
@@ -866,7 +859,7 @@ var LineChartBase = /** @class */ (function (_super) {
866
859
  var lineId = "".concat(this_1._lineId, "_").concat(i);
867
860
  var borderId = "".concat(this_1._borderId, "_").concat(i);
868
861
  var strokeWidth = ((_f = this_1._points[i].lineOptions) === null || _f === void 0 ? void 0 : _f.strokeWidth) || this_1.props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
869
- var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
862
+ var isLegendSelected_2 = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
870
863
  var lineData = [];
871
864
  for (var k = 0; k < this_1._points[i].data.length; k++) {
872
865
  lineData.push([
@@ -879,7 +872,7 @@ var LineChartBase = /** @class */ (function (_super) {
879
872
  // Check if lines should be drawn based on mode
880
873
  var lineMode = (_g = this_1._points[i].lineOptions) === null || _g === void 0 ? void 0 : _g.mode;
881
874
  var shouldDrawLines = lineMode !== 'markers';
882
- if (shouldDrawLines && isLegendSelected) {
875
+ if (shouldDrawLines && isLegendSelected_2) {
883
876
  var lineBorderWidth = ((_h = this_1._points[i].lineOptions) === null || _h === void 0 ? void 0 : _h.lineBorderWidth)
884
877
  ? Number.parseFloat(this_1._points[i].lineOptions.lineBorderWidth.toString())
885
878
  : 0;
@@ -898,7 +891,7 @@ var LineChartBase = /** @class */ (function (_super) {
898
891
  var showMarkers = (lineMode === null || lineMode === void 0 ? void 0 : lineMode.includes('markers')) || !lineMode; // Show markers by default if no mode specified
899
892
  if (showMarkers) {
900
893
  for (var k = 0; k < this_1._points[i].data.length; k++) {
901
- var _28 = this_1._points[i].data[k], x = _28.x, y = _28.y;
894
+ var _29 = this_1._points[i].data[k], x = _29.x, y = _29.y;
902
895
  var xPoint = this_1._xAxisScale(x instanceof Date ? x.getTime() : x);
903
896
  var yPoint = yScale(y);
904
897
  if ((0, index_3.isPlottable)(xPoint, yPoint)) {
@@ -910,7 +903,7 @@ var LineChartBase = /** @class */ (function (_super) {
910
903
  ? 5.5
911
904
  : 3.5, cx: xPoint, cy: yPoint, fill: activePoint === this_1._circleId
912
905
  ? theme.semanticColors.bodyBackground
913
- : perPointColor || ((_u = this_1._points[i]) === null || _u === void 0 ? void 0 : _u.color) || lineColor, stroke: perPointColor || lineColor, strokeWidth: 1, opacity: isLegendSelected ? 1 : 0.1, onMouseMove: this_1._onMouseOverLargeDataset.bind(this_1, i, verticaLineHeight, yScale), onMouseOver: this_1._onMouseOverLargeDataset.bind(this_1, i, verticaLineHeight, yScale), onMouseOut: this_1._handleMouseOut }));
906
+ : perPointColor || ((_u = this_1._points[i]) === null || _u === void 0 ? void 0 : _u.color) || lineColor, stroke: perPointColor || lineColor, strokeWidth: 1, opacity: isLegendSelected_2 ? 1 : 0.1, onMouseMove: this_1._onMouseOverLargeDataset.bind(this_1, i, verticaLineHeight, yScale), onMouseOver: this_1._onMouseOverLargeDataset.bind(this_1, i, verticaLineHeight, yScale), onMouseOut: this_1._handleMouseOut }));
914
907
  }
915
908
  }
916
909
  }
@@ -923,14 +916,14 @@ var LineChartBase = /** @class */ (function (_super) {
923
916
  var lineId = "".concat(this_1._lineId, "_").concat(i, "_").concat(j);
924
917
  var borderId = "".concat(this_1._borderId, "_").concat(i, "_").concat(j);
925
918
  var circleId = "".concat(this_1._circleId, "_").concat(i, "_").concat(j);
926
- var _29 = this_1._points[i].data[j - 1], x1 = _29.x, y1 = _29.y, xAxisCalloutData = _29.xAxisCalloutData, xAxisCalloutAccessibilityData = _29.xAxisCalloutAccessibilityData;
927
- var _30 = this_1._points[i].data[j], x2 = _30.x, y2 = _30.y;
919
+ var _30 = this_1._points[i].data[j - 1], x1 = _30.x, y1 = _30.y, xAxisCalloutData = _30.xAxisCalloutData, xAxisCalloutAccessibilityData = _30.xAxisCalloutAccessibilityData;
920
+ var _31 = this_1._points[i].data[j], x2 = _31.x, y2 = _31.y;
928
921
  var xPoint1 = this_1._xAxisScale(x1);
929
922
  var yPoint1 = yScale(y1);
930
923
  var xPoint2 = this_1._xAxisScale(x2);
931
924
  var yPoint2 = yScale(y2);
932
925
  var strokeWidth = ((_v = this_1._points[i].lineOptions) === null || _v === void 0 ? void 0 : _v.strokeWidth) || this_1.props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
933
- var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
926
+ var isLegendSelected_3 = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
934
927
  var currentPointHidden = this_1._points[i].hideNonActiveDots && activePoint !== circleId;
935
928
  var supportsTextMode = (_x = (_w = this_1._points[i].lineOptions) === null || _w === void 0 ? void 0 : _w.mode) === null || _x === void 0 ? void 0 : _x.includes('text');
936
929
  var text = this_1._points[i].data[j - 1].text;
@@ -938,21 +931,21 @@ var LineChartBase = /** @class */ (function (_super) {
938
931
  if ((0, index_3.isPlottable)(xPoint1, yPoint1)) {
939
932
  var path = this_1._getPath(xPoint1, yPoint1, circleId, j, false, this_1._points[i].index);
940
933
  pointsForLine.push(((_z = (_y = this_1._points[i].lineOptions) === null || _y === void 0 ? void 0 : _y.mode) === null || _z === void 0 ? void 0 : _z.includes('markers')) || supportsTextMode ? (React.createElement(React.Fragment, null,
941
- 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 () {
934
+ React.createElement("circle", tslib_1.__assign({ id: circleId, key: circleId, r: currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, cx: xPoint1, cy: yPoint1, "data-is-focusable": isLegendSelected_3, onMouseOver: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, yScale, legendVal, lineColor), onMouseMove: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, yScale, legendVal, lineColor), onMouseOut: this_1._handleMouseOut, onFocus: function () {
942
935
  return _this_1._handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData);
943
- }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j - 1].onDataPointClick), { opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01, fill: ((_0 = this_1._points[i].data[j - 1]) === null || _0 === void 0 ? void 0 : _0.markerColor) || this_1._getPointFill(lineColor, circleId, j, false), stroke: ((_1 = this_1._points[i].data[j - 1]) === null || _1 === void 0 ? void 0 : _1.markerColor) || lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": (_2 = this_1._points[i].data[j - 1].text) !== null && _2 !== void 0 ? _2 : this_1._getAriaLabel(i, j - 1) })),
936
+ }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j - 1].onDataPointClick), { opacity: isLegendSelected_3 && !currentPointHidden ? 1 : 0.01, fill: ((_0 = this_1._points[i].data[j - 1]) === null || _0 === void 0 ? void 0 : _0.markerColor) || this_1._getPointFill(lineColor, circleId, j, false), stroke: ((_1 = this_1._points[i].data[j - 1]) === null || _1 === void 0 ? void 0 : _1.markerColor) || lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": (_2 = this_1._points[i].data[j - 1].text) !== null && _2 !== void 0 ? _2 : this_1._getAriaLabel(i, j - 1) })),
944
937
  !this_1._isScatterPolar && supportsTextMode && text && (React.createElement("text", { key: "".concat(circleId, "-label"), x: xPoint1, y: yPoint1 +
945
938
  Math.max(currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, 4) +
946
- 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 () {
939
+ 12, className: classNames.markerLabel, opacity: isLegendSelected_3 && !currentPointHidden ? 1 : 0.01 }, text)))) : (React.createElement("path", tslib_1.__assign({ id: circleId, key: circleId, d: path, "data-is-focusable": isLegendSelected_3, onMouseOver: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, yScale, legendVal, lineColor), onMouseMove: this_1._handleHover.bind(this_1, x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, yScale, legendVal, lineColor), onMouseOut: this_1._handleMouseOut, onFocus: function () {
947
940
  return _this_1._handleFocus(lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData);
948
- }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j - 1].onDataPointClick), { opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01, fill: ((_3 = this_1._points[i].data[j - 1]) === null || _3 === void 0 ? void 0 : _3.markerColor) || this_1._getPointFill(lineColor, circleId, j, false), stroke: ((_4 = this_1._points[i].data[j - 1]) === null || _4 === void 0 ? void 0 : _4.markerColor) || lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j - 1) }))));
941
+ }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j - 1].onDataPointClick), { opacity: isLegendSelected_3 && !currentPointHidden ? 1 : 0.01, fill: ((_3 = this_1._points[i].data[j - 1]) === null || _3 === void 0 ? void 0 : _3.markerColor) || this_1._getPointFill(lineColor, circleId, j, false), stroke: ((_4 = this_1._points[i].data[j - 1]) === null || _4 === void 0 ? void 0 : _4.markerColor) || lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j - 1) }))));
949
942
  }
950
943
  if (j + 1 === this_1._points[i].data.length) {
951
944
  // If this is last point of the line segment.
952
945
  var lastCircleId_1 = "".concat(circleId).concat(j, "L");
953
946
  var hiddenHoverCircleId = "".concat(circleId).concat(j, "D");
954
947
  var lastPointHidden = this_1._points[i].hideNonActiveDots && activePoint !== lastCircleId_1;
955
- var _31 = this_1._points[i].data[j], lastCirlceXCallout_1 = _31.xAxisCalloutData, lastCirlceXCalloutAccessibilityData_1 = _31.xAxisCalloutAccessibilityData;
948
+ var _32 = this_1._points[i].data[j], lastCirlceXCallout_1 = _32.xAxisCalloutData, lastCirlceXCalloutAccessibilityData_1 = _32.xAxisCalloutAccessibilityData;
956
949
  currentMarkerSize = this_1._points[i].data[j].markerSize;
957
950
  var lastSupportsTextMode = (_6 = (_5 = this_1._points[i].lineOptions) === null || _5 === void 0 ? void 0 : _5.mode) === null || _6 === void 0 ? void 0 : _6.includes('text');
958
951
  var lastText = this_1._points[i].data[j].text;
@@ -960,21 +953,21 @@ var LineChartBase = /** @class */ (function (_super) {
960
953
  var path = this_1._getPath(xPoint2, yPoint2, lastCircleId_1, j, true, this_1._points[i].index);
961
954
  pointsForLine.push(React.createElement(React.Fragment, { key: "".concat(lastCircleId_1, "_container") },
962
955
  ((_8 = (_7 = this_1._points[i].lineOptions) === null || _7 === void 0 ? void 0 : _7.mode) === null || _8 === void 0 ? void 0 : _8.includes('markers')) || lastSupportsTextMode ? (React.createElement(React.Fragment, null,
963
- 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 () {
956
+ React.createElement("circle", tslib_1.__assign({ id: lastCircleId_1, key: lastCircleId_1, r: currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, cx: xPoint2, cy: yPoint2, "data-is-focusable": isLegendSelected_3, onMouseOver: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseMove: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseOut: this_1._handleMouseOut, onFocus: function () {
964
957
  return _this_1._handleFocus(lineId, x2, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1);
965
- }, 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": (_9 = this_1._points[i].data[j].text) !== null && _9 !== void 0 ? _9 : this_1._getAriaLabel(i, j) })),
958
+ }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j].onDataPointClick), { opacity: isLegendSelected_3 && !lastPointHidden ? 1 : 0.01, fill: this_1._getPointFill(lineColor, lastCircleId_1, j, true), stroke: lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": (_9 = this_1._points[i].data[j].text) !== null && _9 !== void 0 ? _9 : this_1._getAriaLabel(i, j) })),
966
959
  !this_1._isScatterPolar && lastSupportsTextMode && lastText && (React.createElement("text", { key: "".concat(lastCircleId_1, "-label"), x: xPoint2, y: yPoint2 +
967
960
  Math.max(currentMarkerSize ? (currentMarkerSize * extraMaxPixels) / maxMarkerSize : 4, 4) +
968
- 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 () {
961
+ 12, className: classNames.markerLabel, opacity: isLegendSelected_3 && !currentPointHidden ? 1 : 0.01 }, text)))) : (React.createElement("path", tslib_1.__assign({ id: lastCircleId_1, key: lastCircleId_1, d: path, "data-is-focusable": isLegendSelected_3, onMouseOver: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseMove: this_1._handleHover.bind(this_1, x2, y2, verticaLineHeight, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1, yScale, legendVal, lineColor), onMouseOut: this_1._handleMouseOut, onFocus: function () {
969
962
  return _this_1._handleFocus(lineId, x2, lastCirlceXCallout_1, lastCircleId_1, lastCirlceXCalloutAccessibilityData_1);
970
- }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j].onDataPointClick), { opacity: isLegendSelected && !lastPointHidden ? 1 : 0.01, fill: ((_10 = this_1._points[i].data[j]) === null || _10 === void 0 ? void 0 : _10.markerColor) || this_1._getPointFill(lineColor, lastCircleId_1, j, true), stroke: ((_11 = this_1._points[i].data[j]) === null || _11 === void 0 ? void 0 : _11.markerColor) || lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j) }))),
963
+ }, onBlur: this_1._handleMouseOut }, this_1._getClickHandler(this_1._points[i].data[j].onDataPointClick), { opacity: isLegendSelected_3 && !lastPointHidden ? 1 : 0.01, fill: ((_10 = this_1._points[i].data[j]) === null || _10 === void 0 ? void 0 : _10.markerColor) || this_1._getPointFill(lineColor, lastCircleId_1, j, true), stroke: ((_11 = this_1._points[i].data[j]) === null || _11 === void 0 ? void 0 : _11.markerColor) || lineColor, strokeWidth: strokeWidth, role: "img", "aria-label": this_1._getAriaLabel(i, j) }))),
971
964
  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 })));
972
965
  }
973
966
  }
974
967
  if ((0, index_3.isPlottable)(xPoint1, yPoint1) &&
975
968
  (0, index_3.isPlottable)(xPoint2, yPoint2) &&
976
969
  (!this_1._hasMarkersMode || ((_13 = (_12 = this_1._points[i].lineOptions) === null || _12 === void 0 ? void 0 : _12.mode) === null || _13 === void 0 ? void 0 : _13.includes('lines')))) {
977
- if (isLegendSelected) {
970
+ if (isLegendSelected_3) {
978
971
  // don't draw line if it is in a gap
979
972
  if (!isInGap) {
980
973
  var lineBorderWidth = ((_14 = this_1._points[i].lineOptions) === null || _14 === void 0 ? void 0 : _14.lineBorderWidth)
@@ -999,12 +992,29 @@ var LineChartBase = /** @class */ (function (_super) {
999
992
  _loop_2(j);
1000
993
  }
1001
994
  }
995
+ // Add filled area for scatterpolar charts
996
+ var fillMode = (_26 = this_1._points[i].lineOptions) === null || _26 === void 0 ? void 0 : _26.fill;
997
+ var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
998
+ if (fillMode === 'toself' && this_1._points[i].data.length >= 3 && isLegendSelected && this_1._isScatterPolar) {
999
+ var getScaledXValue_1 = function (dataPoint) {
1000
+ return _this_1._xAxisScale(dataPoint.x instanceof Date ? dataPoint.x : dataPoint.x);
1001
+ };
1002
+ var fillPathGenerator = (0, d3_shape_1.line)()
1003
+ .x(function (dataPoint) { return getScaledXValue_1(dataPoint); })
1004
+ .y(function (dataPoint) { return yScale(dataPoint.y); })
1005
+ .curve((0, index_3.getCurveFactory)(lineCurve))
1006
+ .defined(function (dataPoint) { return (0, index_3.isPlottable)(getScaledXValue_1(dataPoint), yScale(dataPoint.y)); });
1007
+ var fillPath = fillPathGenerator(this_1._points[i].data);
1008
+ if (fillPath) {
1009
+ linesForLine.push(React.createElement("path", { key: "scatterpolar_fill_".concat(i), d: "".concat(fillPath, "Z"), fill: lineColor, fillOpacity: 0.5, stroke: lineColor, strokeWidth: 2, strokeOpacity: 0.8, pointerEvents: "none" }));
1010
+ }
1011
+ }
1002
1012
  if (this_1._isScatterPolar) {
1003
1013
  pointsForLine.push.apply(pointsForLine, (0, scatterpolar_utils_1.renderScatterPolarCategoryLabels)({
1004
1014
  xAxisScale: this_1._xAxisScale,
1005
1015
  yAxisScale: yScale,
1006
1016
  className: classNames.markerLabel || '',
1007
- lineOptions: (_26 = this_1._points[i]) === null || _26 === void 0 ? void 0 : _26.lineOptions,
1017
+ lineOptions: (_27 = this_1._points[i]) === null || _27 === void 0 ? void 0 : _27.lineOptions,
1008
1018
  }));
1009
1019
  }
1010
1020
  lines.push(React.createElement("g", { key: "line_".concat(i), role: "region", "aria-label": "".concat(legendVal, ", line ").concat(i + 1, " of ").concat(this_1._points.length, " with ").concat(this_1._points[i].data.length, " data points.") },