victory-core 36.8.2 → 36.8.4

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 (98) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/victory-core.js +181 -159
  3. package/dist/victory-core.min.js +1 -1
  4. package/es/types/callbacks.d.ts +4 -4
  5. package/es/victory-animation/util.d.ts +3 -3
  6. package/es/victory-animation/util.js +5 -3
  7. package/es/victory-animation/victory-animation.js +2 -2
  8. package/es/victory-label/victory-label.d.ts +1 -1
  9. package/es/victory-label/victory-label.js +7 -11
  10. package/es/victory-primitives/arc.d.ts +1 -1
  11. package/es/victory-primitives/arc.js +2 -2
  12. package/es/victory-primitives/background.d.ts +1 -1
  13. package/es/victory-primitives/background.js +2 -2
  14. package/es/victory-primitives/border.d.ts +1 -1
  15. package/es/victory-primitives/border.js +2 -2
  16. package/es/victory-primitives/line-segment.d.ts +1 -1
  17. package/es/victory-primitives/line-segment.js +2 -2
  18. package/es/victory-primitives/point.d.ts +1 -1
  19. package/es/victory-primitives/point.js +2 -2
  20. package/es/victory-primitives/whisker.d.ts +1 -1
  21. package/es/victory-primitives/whisker.js +16 -17
  22. package/es/victory-util/add-events.js +7 -6
  23. package/es/victory-util/axis.js +2 -2
  24. package/es/victory-util/common-props.d.ts +1 -0
  25. package/es/victory-util/data.js +14 -9
  26. package/es/victory-util/domain.js +15 -15
  27. package/es/victory-util/events.d.ts +3 -3
  28. package/es/victory-util/events.js +17 -20
  29. package/es/victory-util/helpers.js +5 -5
  30. package/es/victory-util/immutable.js +4 -2
  31. package/es/victory-util/label-helpers.d.ts +1 -1
  32. package/es/victory-util/label-helpers.js +11 -12
  33. package/es/victory-util/selection.js +1 -2
  34. package/es/victory-util/timer.js +1 -2
  35. package/es/victory-util/transitions.js +37 -26
  36. package/es/victory-util/user-props.d.ts +6 -0
  37. package/es/victory-util/user-props.js +12 -1
  38. package/es/victory-util/wrapper.js +14 -14
  39. package/lib/types/callbacks.d.ts +4 -4
  40. package/lib/victory-animation/util.d.ts +3 -3
  41. package/lib/victory-animation/util.js +5 -3
  42. package/lib/victory-animation/victory-animation.js +2 -2
  43. package/lib/victory-label/victory-label.d.ts +1 -1
  44. package/lib/victory-label/victory-label.js +7 -11
  45. package/lib/victory-primitives/arc.d.ts +1 -1
  46. package/lib/victory-primitives/arc.js +2 -2
  47. package/lib/victory-primitives/background.d.ts +1 -1
  48. package/lib/victory-primitives/background.js +2 -2
  49. package/lib/victory-primitives/border.d.ts +1 -1
  50. package/lib/victory-primitives/border.js +2 -2
  51. package/lib/victory-primitives/line-segment.d.ts +1 -1
  52. package/lib/victory-primitives/line-segment.js +2 -2
  53. package/lib/victory-primitives/point.d.ts +1 -1
  54. package/lib/victory-primitives/point.js +2 -2
  55. package/lib/victory-primitives/whisker.d.ts +1 -1
  56. package/lib/victory-primitives/whisker.js +16 -17
  57. package/lib/victory-util/add-events.js +7 -6
  58. package/lib/victory-util/axis.js +2 -2
  59. package/lib/victory-util/common-props.d.ts +1 -0
  60. package/lib/victory-util/data.js +14 -9
  61. package/lib/victory-util/domain.js +15 -15
  62. package/lib/victory-util/events.d.ts +3 -3
  63. package/lib/victory-util/events.js +17 -20
  64. package/lib/victory-util/helpers.js +5 -5
  65. package/lib/victory-util/immutable.js +4 -2
  66. package/lib/victory-util/label-helpers.d.ts +1 -1
  67. package/lib/victory-util/label-helpers.js +11 -11
  68. package/lib/victory-util/selection.js +1 -2
  69. package/lib/victory-util/timer.js +1 -2
  70. package/lib/victory-util/transitions.js +32 -26
  71. package/lib/victory-util/user-props.d.ts +6 -0
  72. package/lib/victory-util/user-props.js +13 -0
  73. package/lib/victory-util/wrapper.js +16 -14
  74. package/package.json +2 -2
  75. package/src/types/callbacks.ts +8 -5
  76. package/src/victory-animation/util.ts +5 -3
  77. package/src/victory-animation/victory-animation.tsx +3 -2
  78. package/src/victory-label/victory-label.tsx +18 -17
  79. package/src/victory-primitives/arc.tsx +2 -2
  80. package/src/victory-primitives/background.tsx +2 -2
  81. package/src/victory-primitives/border.tsx +2 -2
  82. package/src/victory-primitives/line-segment.tsx +2 -2
  83. package/src/victory-primitives/point.tsx +2 -2
  84. package/src/victory-primitives/whisker.tsx +5 -5
  85. package/src/victory-util/add-events.tsx +10 -9
  86. package/src/victory-util/axis.tsx +6 -2
  87. package/src/victory-util/common-props.tsx +1 -0
  88. package/src/victory-util/data.ts +12 -8
  89. package/src/victory-util/domain.ts +15 -15
  90. package/src/victory-util/events.ts +23 -31
  91. package/src/victory-util/helpers.ts +5 -5
  92. package/src/victory-util/immutable.ts +3 -2
  93. package/src/victory-util/label-helpers.ts +6 -10
  94. package/src/victory-util/selection.ts +3 -2
  95. package/src/victory-util/timer.ts +1 -2
  96. package/src/victory-util/transitions.ts +31 -22
  97. package/src/victory-util/user-props.ts +14 -0
  98. package/src/victory-util/wrapper.tsx +17 -22
@@ -224,12 +224,12 @@ var interpolateFunction = function (a, b) {
224
224
  * differs in that it uses our custom interpolators when interpolating the value of each property in
225
225
  * an object. This allows the correct interpolation of nested objects, including styles
226
226
  *
227
- * @param {any} a - Start value.
228
- * @param {any} b - End value.
227
+ * @param {any} startValue - Start value.
228
+ * @param {any} endValue - End value.
229
229
  * @returns {Function} An interpolation function.
230
230
  */
231
231
 
232
- var interpolateObject = function (a, b) {
232
+ var interpolateObject = function (startValue, endValue) {
233
233
  var interpolateTypes = function (x, y) {
234
234
  if (x === y || !isInterpolatable(x) || !isInterpolatable(y)) {
235
235
  return interpolateImmediate(x, y);
@@ -254,6 +254,8 @@ var interpolateObject = function (a, b) {
254
254
 
255
255
  var i = {};
256
256
  var c = {};
257
+ var a = startValue;
258
+ var b = endValue;
257
259
  var k;
258
260
 
259
261
  if (a === null || typeof a !== "object") {
@@ -421,8 +423,8 @@ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
421
423
  step can generate imprecise values, sometimes greater than 1
422
424
  if this happens set the state to 1 and return, cancelling the timer
423
425
  */
424
- duration = duration !== undefined ? duration : _this.props.duration;
425
- var step = duration ? elapsed / duration : 1;
426
+ var animationDuration = duration !== undefined ? duration : _this.props.duration;
427
+ var step = animationDuration ? elapsed / animationDuration : 1;
426
428
 
427
429
  if (step >= 1) {
428
430
  _this.setState({
@@ -1348,8 +1350,7 @@ var getStyles = function (style, props) {
1348
1350
  }
1349
1351
 
1350
1352
  var getSingleStyle = function (s) {
1351
- s = s ? lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, s, defaultStyles) : defaultStyles;
1352
- var baseStyles = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(s, props);
1353
+ var baseStyles = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(s ? lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, s, defaultStyles) : defaultStyles, props);
1353
1354
  return lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, baseStyles, {
1354
1355
  fontSize: getFontSize(baseStyles)
1355
1356
  });
@@ -1553,22 +1554,19 @@ var getInlineXOffset = function (calculatedProps, textElements, index) {
1553
1554
  switch (textAnchor) {
1554
1555
  case "start":
1555
1556
  return widths.reduce(function (memo, width, i) {
1556
- memo = i < index ? memo + width : memo;
1557
- return memo;
1557
+ return i < index ? memo + width : memo;
1558
1558
  }, 0);
1559
1559
 
1560
1560
  case "end":
1561
1561
  return widths.reduce(function (memo, width, i) {
1562
- memo = i > index ? memo - width : memo;
1563
- return memo;
1562
+ return i > index ? memo - width : memo;
1564
1563
  }, 0);
1565
1564
 
1566
1565
  default:
1567
1566
  // middle
1568
1567
  return widths.reduce(function (memo, width, i) {
1569
1568
  var offsetWidth = i < index ? width : 0;
1570
- memo = i === index ? memo + width / 2 : memo + offsetWidth;
1571
- return memo;
1569
+ return i === index ? memo + width / 2 : memo + offsetWidth;
1572
1570
  }, centerOffset);
1573
1571
  }
1574
1572
  };
@@ -1770,8 +1768,8 @@ var defaultProps = {
1770
1768
  // Magic number from d3.
1771
1769
  lineHeight: 1
1772
1770
  };
1773
- var VictoryLabel = function (props) {
1774
- props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), props));
1771
+ var VictoryLabel = function (initialProps) {
1772
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
1775
1773
 
1776
1774
  if (props.text === null || props.text === undefined) {
1777
1775
  return null;
@@ -1792,7 +1790,7 @@ var VictoryLabel = function (props) {
1792
1790
  fontSize: currentStyle.fontSize || defaultStyles.fontSize,
1793
1791
  capHeight: capHeightPx,
1794
1792
  text: line,
1795
- // @ts-expect-error TODO: This looks like a bug:
1793
+ // TODO: This looks like a bug:
1796
1794
  textSize: _victory_util_textsize__WEBPACK_IMPORTED_MODULE_12__.approximateTextSize(line, currentStyle),
1797
1795
  lineHeight: currentLineHeight,
1798
1796
  backgroundPadding: getSingleValue(backgroundPadding, i)
@@ -2232,8 +2230,8 @@ var defaultProps = {
2232
2230
  role: "presentation",
2233
2231
  shapeRendering: "auto"
2234
2232
  };
2235
- var Arc = function (props) {
2236
- props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), props));
2233
+ var Arc = function (initialProps) {
2234
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
2237
2235
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.pathComponent, _objectSpread(_objectSpread({}, props.events), {}, {
2238
2236
  "aria-label": props.ariaLabel,
2239
2237
  d: getArcPath(props),
@@ -2313,8 +2311,8 @@ var defaultProps = {
2313
2311
  role: "presentation",
2314
2312
  shapeRendering: "auto"
2315
2313
  };
2316
- var Background = function (props) {
2317
- props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), props));
2314
+ var Background = function (initialProps) {
2315
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
2318
2316
  return props.polar ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.circleComponent, _objectSpread(_objectSpread({}, props.events), {}, {
2319
2317
  style: props.style,
2320
2318
  role: props.role,
@@ -2413,8 +2411,8 @@ var defaultProps = {
2413
2411
  role: "presentation",
2414
2412
  shapeRendering: "auto"
2415
2413
  };
2416
- var Border = function (props) {
2417
- props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), props));
2414
+ var Border = function (initialProps) {
2415
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
2418
2416
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.rectComponent, _objectSpread(_objectSpread({}, props.events), {}, {
2419
2417
  "aria-label": props.ariaLabel,
2420
2418
  style: props.style,
@@ -2639,8 +2637,8 @@ var defaultProps = {
2639
2637
  role: "presentation",
2640
2638
  shapeRendering: "auto"
2641
2639
  };
2642
- var LineSegment = function (props) {
2643
- props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), props));
2640
+ var LineSegment = function (initialProps) {
2641
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
2644
2642
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.lineComponent, _objectSpread(_objectSpread({}, props.events), {}, {
2645
2643
  "aria-label": props.ariaLabel,
2646
2644
  style: props.style,
@@ -2868,8 +2866,8 @@ var defaultProps = {
2868
2866
  role: "presentation",
2869
2867
  shapeRendering: "auto"
2870
2868
  };
2871
- var Point = function (props) {
2872
- props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), props));
2869
+ var Point = function (initialProps) {
2870
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
2873
2871
  var userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_5__.getSafeUserProps(props);
2874
2872
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.pathComponent, _objectSpread(_objectSpread({}, props.events), {}, {
2875
2873
  "aria-label": props.ariaLabel,
@@ -3118,23 +3116,22 @@ var defaultProps = {
3118
3116
  role: "presentation",
3119
3117
  shapeRendering: "auto"
3120
3118
  };
3121
- var Whisker = function (props) {
3122
- props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), props));
3123
- var _props = props,
3124
- ariaLabel = _props.ariaLabel,
3125
- groupComponent = _props.groupComponent,
3126
- lineComponent = _props.lineComponent,
3127
- events = _props.events,
3128
- className = _props.className,
3129
- majorWhisker = _props.majorWhisker,
3130
- minorWhisker = _props.minorWhisker,
3131
- transform = _props.transform,
3132
- clipPath = _props.clipPath,
3133
- role = _props.role,
3134
- shapeRendering = _props.shapeRendering,
3135
- style = _props.style,
3136
- desc = _props.desc,
3137
- tabIndex = _props.tabIndex;
3119
+ var Whisker = function (initialProps) {
3120
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
3121
+ var ariaLabel = props.ariaLabel,
3122
+ groupComponent = props.groupComponent,
3123
+ lineComponent = props.lineComponent,
3124
+ events = props.events,
3125
+ className = props.className,
3126
+ majorWhisker = props.majorWhisker,
3127
+ minorWhisker = props.minorWhisker,
3128
+ transform = props.transform,
3129
+ clipPath = props.clipPath,
3130
+ role = props.role,
3131
+ shapeRendering = props.shapeRendering,
3132
+ style = props.style,
3133
+ desc = props.desc,
3134
+ tabIndex = props.tabIndex;
3138
3135
 
3139
3136
  var baseProps = _objectSpread(_objectSpread({}, events), {}, {
3140
3137
  style: style,
@@ -4301,8 +4298,7 @@ function addEvents(WrappedComponent) {
4301
4298
  value: function applyExternalMutations(props, externalMutations) {
4302
4299
  if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_5___default()(externalMutations)) {
4303
4300
  var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
4304
- memo = lodash_isFunction__WEBPACK_IMPORTED_MODULE_4___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
4305
- return memo;
4301
+ return lodash_isFunction__WEBPACK_IMPORTED_MODULE_4___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
4306
4302
  }, []);
4307
4303
  var compiledCallbacks = callbacks.length ? function () {
4308
4304
  callbacks.forEach(function (c) {
@@ -4357,8 +4353,8 @@ function addEvents(WrappedComponent) {
4357
4353
  }, {
4358
4354
  key: "getBaseProps",
4359
4355
  value: function getBaseProps(props, getSharedEventState) {
4360
- getSharedEventState = getSharedEventState || this.getSharedEventState.bind(this);
4361
- var sharedParentState = getSharedEventState("parent", "parent");
4356
+ var getSharedEventStateFunction = getSharedEventState || this.getSharedEventState.bind(this);
4357
+ var sharedParentState = getSharedEventStateFunction("parent", "parent");
4362
4358
  var parentState = this.getEventState("parent", "parent");
4363
4359
 
4364
4360
  var baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_7___default()({}, parentState, sharedParentState);
@@ -4457,13 +4453,15 @@ function addEvents(WrappedComponent) {
4457
4453
  var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_0___default()(this.dataKeys, "all");
4458
4454
 
4459
4455
  var labelComponents = dataKeys.reduce(function (memo, key) {
4456
+ var newMemo = memo;
4457
+
4460
4458
  var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
4461
4459
 
4462
4460
  if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
4463
- memo = memo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
4461
+ newMemo = newMemo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
4464
4462
  }
4465
4463
 
4466
- return memo;
4464
+ return newMemo;
4467
4465
  }, []);
4468
4466
  var dataProps = this.getComponentProps(dataComponent, "data", "all");
4469
4467
  var children = [/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
@@ -4609,11 +4607,11 @@ function getAxis(props) {
4609
4607
  */
4610
4608
 
4611
4609
  function findAxisComponents(childComponents, predicate) {
4612
- predicate = predicate || (lodash_identity__WEBPACK_IMPORTED_MODULE_9___default());
4610
+ var predicateFunction = predicate || (lodash_identity__WEBPACK_IMPORTED_MODULE_9___default());
4613
4611
 
4614
4612
  var findAxes = function (children) {
4615
4613
  return children.reduce(function (memo, child) {
4616
- if (child.type && child.type.role === "axis" && predicate(child)) {
4614
+ if (child.type && child.type.role === "axis" && predicateFunction(child)) {
4617
4615
  return memo.concat(child);
4618
4616
  } else if (child.props && child.props.children) {
4619
4617
  return memo.concat(findAxes(react__WEBPACK_IMPORTED_MODULE_12___default().Children.toArray(child.props.children)));
@@ -5357,12 +5355,14 @@ function sortData(dataset, sortKey) {
5357
5355
  } // Ensures previous VictoryLine api for sortKey prop stays consistent
5358
5356
 
5359
5357
 
5358
+ var formattedSortKey = sortKey;
5359
+
5360
5360
  if (sortKey === "x" || sortKey === "y") {
5361
- sortKey = "_".concat(sortKey);
5361
+ formattedSortKey = "_".concat(sortKey);
5362
5362
  }
5363
5363
 
5364
5364
  var order = sortOrder === "ascending" ? "asc" : "desc";
5365
- return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset, sortKey, order);
5365
+ return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset, formattedSortKey, order);
5366
5366
  } // This method will remove data points that break certain scales. (log scale only)
5367
5367
 
5368
5368
 
@@ -5553,7 +5553,10 @@ function formatData(dataset, props, expectedKeys) {
5553
5553
  return [];
5554
5554
  }
5555
5555
 
5556
- var defaultKeys = ["x", "y", "y0"];
5556
+ var defaultKeys = ["x", "y", "y0"]; // TODO: We shouldn’t mutate the expectedKeys param here,
5557
+ // but we need to figure out why changing it causes regressions in tests.
5558
+ // eslint-disable-next-line no-param-reassign
5559
+
5557
5560
  expectedKeys = Array.isArray(expectedKeys) ? expectedKeys : defaultKeys;
5558
5561
 
5559
5562
  var createAccessor = function (name) {
@@ -5578,13 +5581,13 @@ function formatData(dataset, props, expectedKeys) {
5578
5581
 
5579
5582
  var data = preformattedData ? dataset : dataset.reduce(function (dataArr, datum, index) {
5580
5583
  // eslint-disable-line complexity
5581
- datum = parseDatum(datum);
5584
+ var parsedDatum = parseDatum(datum);
5582
5585
  var fallbackValues = {
5583
5586
  x: index,
5584
- y: datum
5587
+ y: parsedDatum
5585
5588
  };
5586
5589
  var processedValues = expectedKeys.reduce(function (memo, type) {
5587
- var processedValue = accessor[type](datum);
5590
+ var processedValue = accessor[type](parsedDatum);
5588
5591
  var value = processedValue !== undefined ? processedValue : fallbackValues[type];
5589
5592
 
5590
5593
  if (value !== undefined) {
@@ -5599,7 +5602,7 @@ function formatData(dataset, props, expectedKeys) {
5599
5602
  return memo;
5600
5603
  }, {});
5601
5604
 
5602
- var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues, datum);
5605
+ var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues, parsedDatum);
5603
5606
 
5604
5607
  if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_4___default()(formattedDatum)) {
5605
5608
  dataArr.push(formattedDatum);
@@ -5710,8 +5713,8 @@ function getStringsFromData(props, axis) {
5710
5713
  }, []);
5711
5714
  var sortedData = sortData(data, props.sortKey, props.sortOrder);
5712
5715
  var dataStrings = sortedData.reduce(function (dataArr, datum) {
5713
- datum = parseDatum(datum);
5714
- dataArr.push(accessor(datum));
5716
+ var parsedDatum = parseDatum(datum);
5717
+ dataArr.push(accessor(parsedDatum));
5715
5718
  return dataArr;
5716
5719
  }, []).filter(function (datum) {
5717
5720
  return typeof datum === "string";
@@ -6077,18 +6080,18 @@ function padDomain(domain, props, axis) {
6077
6080
 
6078
6081
 
6079
6082
  function createDomainFunction(getDomainFromDataFunction, formatDomainFunction) {
6080
- getDomainFromDataFunction = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(getDomainFromDataFunction) ? getDomainFromDataFunction : getDomainFromData;
6081
- formatDomainFunction = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(formatDomainFunction) ? formatDomainFunction : formatDomain;
6083
+ var getDomainFromDataFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(getDomainFromDataFunction) ? getDomainFromDataFunction : getDomainFromData;
6084
+ var formatDomainFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(formatDomainFunction) ? formatDomainFunction : formatDomain;
6082
6085
  return function (props, axis) {
6083
6086
  var propsDomain = getDomainFromProps(props, axis);
6084
6087
 
6085
6088
  if (propsDomain) {
6086
- return formatDomainFunction(propsDomain, props, axis);
6089
+ return formatDomainFn(propsDomain, props, axis);
6087
6090
  }
6088
6091
 
6089
6092
  var categories = _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
6090
- var domain = categories ? getDomainFromCategories(props, axis, categories) : getDomainFromDataFunction(props, axis);
6091
- return domain ? formatDomainFunction(domain, props, axis) : undefined;
6093
+ var domain = categories ? getDomainFromCategories(props, axis, categories) : getDomainFromDataFn(props, axis);
6094
+ return domain ? formatDomainFn(domain, props, axis) : undefined;
6092
6095
  };
6093
6096
  }
6094
6097
  /**
@@ -6121,27 +6124,27 @@ function getDomain(props, axis) {
6121
6124
  */
6122
6125
 
6123
6126
  function getDomainFromCategories(props, axis, categories) {
6124
- categories = categories || _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
6127
+ var categoriesArray = categories || _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
6125
6128
  var polar = props.polar,
6126
6129
  _props$startAngle = props.startAngle,
6127
6130
  startAngle = _props$startAngle === void 0 ? 0 : _props$startAngle,
6128
6131
  _props$endAngle = props.endAngle,
6129
6132
  endAngle = _props$endAngle === void 0 ? 360 : _props$endAngle;
6130
6133
 
6131
- if (!categories) {
6134
+ if (!categoriesArray) {
6132
6135
  return undefined;
6133
6136
  }
6134
6137
 
6135
6138
  var minDomain = getMinFromProps(props, axis);
6136
6139
  var maxDomain = getMaxFromProps(props, axis);
6137
- var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(categories) ? _data__WEBPACK_IMPORTED_MODULE_10__.getStringsFromCategories(props, axis) : [];
6140
+ var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(categoriesArray) ? _data__WEBPACK_IMPORTED_MODULE_10__.getStringsFromCategories(props, axis) : [];
6138
6141
  var stringMap = stringArray.length === 0 ? null : stringArray.reduce(function (memo, string, index) {
6139
6142
  memo[string] = index + 1;
6140
6143
  return memo;
6141
6144
  }, {});
6142
- var categoryValues = stringMap ? categories.map(function (value) {
6145
+ var categoryValues = stringMap ? categoriesArray.map(function (value) {
6143
6146
  return stringMap[value];
6144
- }) : categories;
6147
+ }) : categoriesArray;
6145
6148
  var min = minDomain !== undefined ? minDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMinValue(categoryValues);
6146
6149
  var max = maxDomain !== undefined ? maxDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMaxValue(categoryValues);
6147
6150
  var categoryDomain = getDomainFromMinMax(min, max);
@@ -6156,7 +6159,7 @@ function getDomainFromCategories(props, axis, categories) {
6156
6159
  */
6157
6160
 
6158
6161
  function getDomainFromData(props, axis, dataset) {
6159
- dataset = dataset || _data__WEBPACK_IMPORTED_MODULE_10__.getData(props);
6162
+ var datasetArray = dataset || _data__WEBPACK_IMPORTED_MODULE_10__.getData(props);
6160
6163
  var polar = props.polar,
6161
6164
  _props$startAngle2 = props.startAngle,
6162
6165
  startAngle = _props$startAngle2 === void 0 ? 0 : _props$startAngle2,
@@ -6165,14 +6168,14 @@ function getDomainFromData(props, axis, dataset) {
6165
6168
  var minDomain = getMinFromProps(props, axis);
6166
6169
  var maxDomain = getMaxFromProps(props, axis);
6167
6170
 
6168
- if (dataset.length < 1) {
6171
+ if (datasetArray.length < 1) {
6169
6172
  return minDomain !== undefined && maxDomain !== undefined ? getDomainFromMinMax(minDomain, maxDomain) : undefined;
6170
6173
  }
6171
6174
 
6172
- var min = minDomain !== undefined ? minDomain : getExtremeFromData(dataset, axis, "min");
6173
- var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(dataset, axis, "max");
6175
+ var min = minDomain !== undefined ? minDomain : getExtremeFromData(datasetArray, axis, "min");
6176
+ var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(datasetArray, axis, "max");
6174
6177
  var domain = getDomainFromMinMax(min, max);
6175
- return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(dataset, axis)) : domain;
6178
+ return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(datasetArray, axis)) : domain;
6176
6179
  }
6177
6180
  /**
6178
6181
  * Returns a domain in the form of a two element array given a min and max value.
@@ -6485,14 +6488,14 @@ function getScopedEvents(events, namespace, childType, baseProps) {
6485
6488
  // eslint-disable-next-line no-invalid-this
6486
6489
 
6487
6490
 
6488
- baseProps = baseProps || this.baseProps; // returns the original base props or base state of a given target element
6491
+ var newBaseProps = baseProps || this.baseProps; // returns the original base props or base state of a given target element
6489
6492
 
6490
6493
  var getTargetProps = function (identifier, type) {
6491
6494
  var childName = identifier.childName,
6492
6495
  target = identifier.target,
6493
6496
  key = identifier.key; // eslint-disable-next-line no-invalid-this
6494
6497
 
6495
- var baseType = type === "props" ? baseProps : _this2.state || {};
6498
+ var baseType = type === "props" ? newBaseProps : _this2.state || {};
6496
6499
  var base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
6497
6500
  return key === "parent" ? base.parent : base[key] && base[key][target];
6498
6501
  }; // Returns the state object with the mutation caused by a given eventReturn
@@ -6509,9 +6512,9 @@ function getScopedEvents(events, namespace, childType, baseProps) {
6509
6512
  }
6510
6513
 
6511
6514
  if (eventReturn.eventKey === "all") {
6512
- return baseProps[childName] ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps[childName]), "parent") : lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps), "parent");
6515
+ return newBaseProps[childName] ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps[childName]), "parent") : lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps), "parent");
6513
6516
  } else if (eventReturn.eventKey === undefined && eventKey === "parent") {
6514
- return baseProps[childName] ? lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps[childName]) : lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps);
6517
+ return newBaseProps[childName] ? lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps[childName]) : lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps);
6515
6518
  }
6516
6519
 
6517
6520
  return eventReturn.eventKey !== undefined ? eventReturn.eventKey : eventKey;
@@ -6536,7 +6539,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
6536
6539
  key: key,
6537
6540
  target: target
6538
6541
  }, "state");
6539
- var mutatedProps = eventReturn.mutation(lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, mutationTargetProps, mutationTargetState), baseProps);
6542
+ var mutatedProps = eventReturn.mutation(lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, mutationTargetProps, mutationTargetState), newBaseProps);
6540
6543
  var childState = baseState[childName] || {};
6541
6544
 
6542
6545
  var filterState = function (state) {
@@ -6571,7 +6574,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
6571
6574
  }; // returns an entire mutated state for all children
6572
6575
 
6573
6576
 
6574
- var allChildNames = childNames === "all" ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps), "parent") : childNames;
6577
+ var allChildNames = childNames === "all" ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps), "parent") : childNames;
6575
6578
  return Array.isArray(allChildNames) ? allChildNames.reduce(function (memo, childName) {
6576
6579
  return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()(memo, getReturnByChild(childName));
6577
6580
  }, {}) : getReturnByChild(allChildNames);
@@ -6580,8 +6583,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
6580
6583
 
6581
6584
  var parseEventReturn = function (eventReturn, eventKey) {
6582
6585
  return Array.isArray(eventReturn) ? eventReturn.reduce(function (memo, props) {
6583
- memo = lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, memo, parseEvent(props, eventKey));
6584
- return memo;
6586
+ return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, memo, parseEvent(props, eventKey));
6585
6587
  }, {}) : parseEvent(eventReturn, eventKey);
6586
6588
  };
6587
6589
 
@@ -6667,9 +6669,10 @@ function getEventState(eventKey, namespace, childType) {
6667
6669
  */
6668
6670
  // eslint-disable-next-line max-params
6669
6671
 
6670
- function getExternalMutationsWithChildren(mutations, baseProps, baseState, childNames) {
6671
- baseProps = baseProps || {};
6672
- baseState = baseState || {};
6672
+ function getExternalMutationsWithChildren(mutations) {
6673
+ var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6674
+ var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
6675
+ var childNames = arguments.length > 3 ? arguments[3] : undefined;
6673
6676
  return childNames.reduce(function (memo, childName) {
6674
6677
  var childState = baseState[childName];
6675
6678
  var mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
@@ -6691,9 +6694,10 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
6691
6694
  */
6692
6695
  // eslint-disable-next-line max-params
6693
6696
 
6694
- function getExternalMutations(mutations, baseProps, baseState, childName) {
6695
- baseProps = baseProps || {};
6696
- baseState = baseState || {};
6697
+ function getExternalMutations(mutations) {
6698
+ var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6699
+ var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
6700
+ var childName = arguments.length > 3 ? arguments[3] : undefined;
6697
6701
 
6698
6702
  var eventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps);
6699
6703
 
@@ -6759,8 +6763,7 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
6759
6763
  return false;
6760
6764
  };
6761
6765
 
6762
- mutations = Array.isArray(mutations) ? mutations : [mutations];
6763
- var scopedMutations = mutations;
6766
+ var scopedMutations = Array.isArray(mutations) ? mutations : [mutations];
6764
6767
 
6765
6768
  if (identifier.childName) {
6766
6769
  scopedMutations = mutations.filter(function (m) {
@@ -6799,13 +6802,10 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
6799
6802
 
6800
6803
  function getComponentEvents(props, components) {
6801
6804
  var events = Array.isArray(components) && components.reduce(function (memo, componentName) {
6802
- var _memo;
6803
-
6804
6805
  var component = props[componentName];
6805
6806
  var defaultEvents = component && component.type && component.type.defaultEvents;
6806
6807
  var componentEvents = lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(defaultEvents) ? defaultEvents(component.props) : defaultEvents;
6807
- memo = Array.isArray(componentEvents) ? (_memo = memo).concat.apply(_memo, _toConsumableArray(componentEvents)) : memo;
6808
- return memo;
6808
+ return Array.isArray(componentEvents) ? memo.concat.apply(memo, _toConsumableArray(componentEvents)) : memo;
6809
6809
  }, []);
6810
6810
  return events && events.length ? events : undefined;
6811
6811
  }
@@ -7163,6 +7163,7 @@ function reduceChildren(children, iteratee) {
7163
7163
 
7164
7164
  var traverseChildren = function (childArray, names, parent) {
7165
7165
  return childArray.reduce(function (memo, child, index) {
7166
+ var newMemo = memo;
7166
7167
  var childRole = child.type && child.type.role;
7167
7168
  var childName = child.props.name || "".concat(childRole, "-").concat(names[index]);
7168
7169
 
@@ -7180,16 +7181,16 @@ function reduceChildren(children, iteratee) {
7180
7181
  });
7181
7182
 
7182
7183
  var nestedResults = traverseChildren(nestedChildren, _childNames, child);
7183
- memo = combine(memo, nestedResults);
7184
+ newMemo = combine(newMemo, nestedResults);
7184
7185
  } else {
7185
7186
  var result = iteratee(child, childName, parent);
7186
7187
 
7187
7188
  if (result) {
7188
- memo = combine(memo, result);
7189
+ newMemo = combine(newMemo, result);
7189
7190
  }
7190
7191
  }
7191
7192
 
7192
- return memo;
7193
+ return newMemo;
7193
7194
  }, initialMemo);
7194
7195
  };
7195
7196
 
@@ -7215,8 +7216,7 @@ function isHorizontal(props) {
7215
7216
  var childProps = child.props || {};
7216
7217
 
7217
7218
  if (memo || childProps.horizontal || !childProps.children) {
7218
- memo = memo || childProps.horizontal;
7219
- return memo;
7219
+ return memo || childProps.horizontal;
7220
7220
  }
7221
7221
 
7222
7222
  return traverseChildren(react__WEBPACK_IMPORTED_MODULE_6___default().Children.toArray(childProps.children));
@@ -7470,11 +7470,13 @@ function isMap(x) {
7470
7470
  }
7471
7471
  function shallowToJS(x, whitelist) {
7472
7472
  return isIterable(x) ? x.reduce(function (result, curr, key) {
7473
+ var newCurr = curr;
7474
+
7473
7475
  if (whitelist && whitelist[key]) {
7474
- curr = shallowToJS(curr);
7476
+ newCurr = shallowToJS(curr);
7475
7477
  }
7476
7478
 
7477
- result[key] = curr;
7479
+ result[key] = newCurr;
7478
7480
  return result;
7479
7481
  }, isList(x) ? [] : {}) : x;
7480
7482
  }
@@ -7611,12 +7613,10 @@ __webpack_require__.r(__webpack_exports__);
7611
7613
  /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "./victory-util/helpers.ts");
7612
7614
 
7613
7615
 
7614
- /* eslint-disable no-use-before-define */
7615
-
7616
7616
 
7617
7617
  // Private Functions
7618
- function getVerticalAnchor(props, datum) {
7619
- datum = datum || {};
7618
+ function getVerticalAnchor(props) {
7619
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7620
7620
  var sign = datum._y >= 0 ? 1 : -1;
7621
7621
  var labelStyle = props.style && props.style.labels || {};
7622
7622
 
@@ -7629,8 +7629,8 @@ function getVerticalAnchor(props, datum) {
7629
7629
  return "middle";
7630
7630
  }
7631
7631
 
7632
- function getTextAnchor(props, datum) {
7633
- datum = datum || {};
7632
+ function getTextAnchor(props) {
7633
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7634
7634
  var style = props.style,
7635
7635
  horizontal = props.horizontal;
7636
7636
  var sign = datum._y >= 0 ? 1 : -1;
@@ -7645,14 +7645,14 @@ function getTextAnchor(props, datum) {
7645
7645
  return sign >= 0 ? "start" : "end";
7646
7646
  }
7647
7647
 
7648
- function getAngle(props, datum) {
7649
- datum = datum || {};
7648
+ function getAngle(props) {
7649
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7650
7650
  var labelStyle = props.style && props.style.labels || {};
7651
7651
  return datum.angle === undefined ? labelStyle.angle : datum.angle;
7652
7652
  }
7653
7653
 
7654
- function getPadding(props, datum) {
7655
- datum = datum || {};
7654
+ function getPadding(props) {
7655
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7656
7656
  var horizontal = props.horizontal,
7657
7657
  style = props.style;
7658
7658
  var labelStyle = style.labels || {};
@@ -7731,8 +7731,9 @@ function getPolarOrientation(degrees) {
7731
7731
  } // Exported Functions
7732
7732
 
7733
7733
 
7734
- function getText(props, datum, index) {
7735
- datum = datum || {};
7734
+ function getText(props) {
7735
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7736
+ var index = arguments.length > 2 ? arguments[2] : undefined;
7736
7737
 
7737
7738
  if (datum.label !== undefined) {
7738
7739
  return datum.label;
@@ -8555,8 +8556,7 @@ function getSVGEventCoordinates(evt, svg) {
8555
8556
  }
8556
8557
 
8557
8558
  var location = isReactTouchEvent(evt) ? evt.changedTouches[0] : evt;
8558
- svg = svg || getParentSVG(location);
8559
- var matrix = getTransformationMatrix(svg);
8559
+ var matrix = getTransformationMatrix(svg || getParentSVG(location));
8560
8560
  return {
8561
8561
  x: transformTarget(location.clientX, matrix, "x"),
8562
8562
  y: transformTarget(location.clientY, matrix, "y")
@@ -9198,11 +9198,10 @@ var Timer = /*#__PURE__*/function () {
9198
9198
  }, {
9199
9199
  key: "subscribe",
9200
9200
  value: function subscribe(callback, duration) {
9201
- duration = this.shouldAnimate ? duration : 0;
9202
9201
  var subscriptionID = this.subscribers.push({
9203
9202
  startTime: (0,victory_vendor_d3_timer__WEBPACK_IMPORTED_MODULE_0__.now)(),
9204
9203
  callback: callback,
9205
- duration: duration
9204
+ duration: this.shouldAnimate ? duration : 0
9206
9205
  });
9207
9206
  this.activeSubscriptions++;
9208
9207
  this.start();
@@ -9389,36 +9388,38 @@ function getInitialChildProps(animate, data) {
9389
9388
 
9390
9389
 
9391
9390
  function getChildBeforeLoad(animate, child, data, cb) {
9392
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
9391
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
9393
9392
  onEnd: cb
9394
9393
  });
9395
9394
 
9396
- if (animate && animate.onLoad && !animate.onLoad.duration) {
9395
+ if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
9397
9396
  return {
9398
- animate: animate,
9397
+ animate: newAnimate,
9399
9398
  data: data
9400
9399
  };
9401
9400
  }
9402
9401
 
9403
- var before = animate.onLoad && animate.onLoad.before ? animate.onLoad.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default()); // If nodes need to exit, transform them with the provided onLoad.before function.
9402
+ var before = newAnimate.onLoad && newAnimate.onLoad.before ? newAnimate.onLoad.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default()); // If nodes need to exit, transform them with the provided onLoad.before function.
9404
9403
 
9405
- data = data.map(function (datum, idx) {
9404
+ var newData = data.map(function (datum, idx) {
9406
9405
  return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data));
9407
9406
  });
9408
9407
  return {
9409
- animate: animate,
9410
- data: data,
9408
+ animate: newAnimate,
9409
+ data: newData,
9411
9410
  clipWidth: 0
9412
9411
  };
9413
9412
  } // eslint-disable-next-line max-params
9414
9413
 
9415
9414
 
9416
9415
  function getChildOnLoad(animate, data, cb) {
9417
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
9416
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
9418
9417
  onEnd: cb
9419
9418
  });
9420
9419
 
9421
- if (animate && animate.onLoad && !animate.onLoad.duration) {
9420
+ var newData = data;
9421
+
9422
+ if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
9422
9423
  return {
9423
9424
  animate: animate,
9424
9425
  data: data
@@ -9427,12 +9428,12 @@ function getChildOnLoad(animate, data, cb) {
9427
9428
 
9428
9429
  var after = animate.onLoad && animate.onLoad.after ? animate.onLoad.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default()); // If nodes need to exit, transform them with the provided onLoad.after function.
9429
9430
 
9430
- data = data.map(function (datum, idx) {
9431
+ newData = data.map(function (datum, idx) {
9431
9432
  return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data));
9432
9433
  });
9433
9434
  return {
9434
- animate: animate,
9435
- data: data
9435
+ animate: newAnimate,
9436
+ data: newData
9436
9437
  };
9437
9438
  } // eslint-disable-next-line max-params, max-len
9438
9439
 
@@ -9441,7 +9442,10 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
9441
9442
  // Whether or not _this_ child has exiting nodes, we want the exit-
9442
9443
  // transition for all children to have the same duration, delay, etc.
9443
9444
  var onExit = animate && animate.onExit;
9444
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onExit);
9445
+
9446
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onExit);
9447
+
9448
+ var newData = data;
9445
9449
 
9446
9450
  if (exitingNodes) {
9447
9451
  // After the exit transition occurs, trigger the animations for
@@ -9449,39 +9453,42 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
9449
9453
  animate.onEnd = cb;
9450
9454
  var before = animate.onExit && animate.onExit.before ? animate.onExit.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default()); // If nodes need to exit, transform them with the provided onExit.before function.
9451
9455
 
9452
- data = data.map(function (datum, idx) {
9456
+ newData = data.map(function (datum, idx) {
9453
9457
  var key = (datum.key || idx).toString();
9454
9458
  return exitingNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
9455
9459
  });
9456
9460
  }
9457
9461
 
9458
9462
  return {
9459
- animate: animate,
9460
- data: data
9463
+ animate: newAnimate,
9464
+ data: newData
9461
9465
  };
9462
9466
  } // eslint-disable-next-line max-params,max-len
9463
9467
 
9464
9468
 
9465
9469
  function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
9470
+ var newAnimate = animate;
9471
+ var newData = data;
9472
+
9466
9473
  if (enteringNodes) {
9467
9474
  // Perform a normal animation here, except - when it finishes - trigger
9468
9475
  // the transition for entering nodes.
9469
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
9476
+ newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
9470
9477
  onEnd: cb
9471
9478
  });
9472
9479
  var before = animate.onEnter && animate.onEnter.before ? animate.onEnter.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default()); // We want the entering nodes to be included in the transition target
9473
9480
  // domain. However, we may not want these nodes to be displayed initially,
9474
9481
  // so perform the `onEnter.before` transformation on each node.
9475
9482
 
9476
- data = data.map(function (datum, idx) {
9483
+ newData = data.map(function (datum, idx) {
9477
9484
  var key = (datum.key || idx).toString();
9478
9485
  return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
9479
9486
  });
9480
9487
  }
9481
9488
 
9482
9489
  return {
9483
- animate: animate,
9484
- data: data
9490
+ animate: newAnimate,
9491
+ data: newData
9485
9492
  };
9486
9493
  } // eslint-disable-next-line max-params, max-len
9487
9494
 
@@ -9490,23 +9497,26 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
9490
9497
  // Whether or not _this_ child has entering nodes, we want the entering-
9491
9498
  // transition for all children to have the same duration, delay, etc.
9492
9499
  var onEnter = animate && animate.onEnter;
9493
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onEnter);
9500
+
9501
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onEnter);
9502
+
9503
+ var newData = data;
9494
9504
 
9495
9505
  if (enteringNodes) {
9496
9506
  // Old nodes have been transitioned to their new values, and the
9497
9507
  // domain should encompass the nodes that will now enter. So perform
9498
9508
  // the `onEnter.after` transformation on each node.
9499
- animate.onEnd = cb;
9500
- var after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default());
9501
- data = data.map(function (datum, idx) {
9509
+ newAnimate.onEnd = cb;
9510
+ var after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default());
9511
+ newData = data.map(function (datum, idx) {
9502
9512
  var key = getDatumKey(datum, idx);
9503
9513
  return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data)) : datum;
9504
9514
  });
9505
9515
  }
9506
9516
 
9507
9517
  return {
9508
- animate: animate,
9509
- data: data
9518
+ animate: newAnimate,
9519
+ data: newData
9510
9520
  };
9511
9521
  }
9512
9522
  /**
@@ -9672,6 +9682,7 @@ function getTransitionPropsFactory(props, state, setState) {
9672
9682
  "use strict";
9673
9683
  __webpack_require__.r(__webpack_exports__);
9674
9684
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9685
+ /* harmony export */ "assert": () => (/* binding */ assert),
9675
9686
  /* harmony export */ "getSafeUserProps": () => (/* binding */ getSafeUserProps),
9676
9687
  /* harmony export */ "withSafeUserProps": () => (/* binding */ withSafeUserProps)
9677
9688
  /* harmony export */ });
@@ -9752,6 +9763,18 @@ var testIfSafeProp = function (key) {
9752
9763
  if (doesPropStartWith(key) || isExactMatch(key)) return true;
9753
9764
  return false;
9754
9765
  };
9766
+ /**
9767
+ * Asserts that value is not null or undefined, throwing an error if it is.
9768
+ * @param value The value to assert
9769
+ * @param message The error message to throw
9770
+ */
9771
+
9772
+
9773
+ function assert(value, message) {
9774
+ if (value === undefined || value === null) {
9775
+ throw new Error(message);
9776
+ }
9777
+ }
9755
9778
  /**
9756
9779
  * getSafeUserProps - function that takes in a props object and removes any
9757
9780
  * key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
@@ -9761,7 +9784,6 @@ var testIfSafeProp = function (key) {
9761
9784
  * @returns {Object}: object containing remaining acceptable props
9762
9785
  */
9763
9786
 
9764
-
9765
9787
  var getSafeUserProps = function (props) {
9766
9788
  var propsToFilter = _objectSpread({}, props);
9767
9789
 
@@ -9964,12 +9986,13 @@ function getDataFromChildren(props, childComponents) {
9964
9986
  var childProps = lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, child.props, parentProps);
9965
9987
 
9966
9988
  var childData;
9989
+ var childElement = child;
9967
9990
 
9968
9991
  if (!_data__WEBPACK_IMPORTED_MODULE_12__.isDataComponent(child)) {
9969
9992
  return null;
9970
9993
  } else if (child.type && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(child.type.getData)) {
9971
- child = parent ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(child, parent.props) : child;
9972
- childData = child.type.getData(childProps);
9994
+ childElement = parent ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(child, parent.props) : child;
9995
+ childData = childElement.type.getData(childProps);
9973
9996
  } else {
9974
9997
  childData = _data__WEBPACK_IMPORTED_MODULE_12__.getData(childProps);
9975
9998
  }
@@ -10000,17 +10023,16 @@ function getData(props, childComponents) {
10000
10023
  return _data__WEBPACK_IMPORTED_MODULE_12__.getData(props);
10001
10024
  }
10002
10025
 
10003
- childComponents = childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
10004
- return getDataFromChildren(props, childComponents);
10026
+ return getDataFromChildren(props, childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children));
10005
10027
  }
10006
10028
  function getWidth(props, groupLength, seriesLength) {
10007
10029
  var datasets = props.datasets,
10008
10030
  horizontal = props.horizontal;
10009
10031
  var range = horizontal ? _helpers__WEBPACK_IMPORTED_MODULE_11__.getRange(props, "y") : _helpers__WEBPACK_IMPORTED_MODULE_11__.getRange(props, "x");
10010
10032
  var extent = Math.abs(range[1] - range[0]);
10011
- seriesLength = seriesLength !== undefined ? seriesLength : Array.isArray(datasets[0]) && datasets[0].length || 1;
10012
- groupLength = groupLength || datasets.length;
10013
- var bars = groupLength * seriesLength;
10033
+ var seriesLengthValue = seriesLength !== undefined ? seriesLength : Array.isArray(datasets[0]) && datasets[0].length || 1;
10034
+ var groupLengthValue = groupLength || datasets.length;
10035
+ var bars = groupLengthValue * seriesLengthValue;
10014
10036
  var barRatio = 0.5;
10015
10037
  return Math.round(barRatio * extent / bars);
10016
10038
  }
@@ -10102,9 +10124,9 @@ function getDomainFromChildren(props, axis, childComponents) {
10102
10124
  return [min, max];
10103
10125
  }
10104
10126
  function getDomain(props, axis, childComponents) {
10105
- childComponents = childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
10127
+ var children = childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
10106
10128
  var propsDomain = _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromProps(props, axis);
10107
- var domainPadding = getDefaultDomainPadding(props, axis, childComponents);
10129
+ var domainPadding = getDefaultDomainPadding(props, axis, children);
10108
10130
  var domain;
10109
10131
 
10110
10132
  if (propsDomain) {
@@ -10114,7 +10136,7 @@ function getDomain(props, axis, childComponents) {
10114
10136
  var maxDomain = _domain__WEBPACK_IMPORTED_MODULE_13__.getMaxFromProps(props, axis);
10115
10137
  var dataset = (props.data || props.y) && _data__WEBPACK_IMPORTED_MODULE_12__.getData(props);
10116
10138
  var dataDomain = dataset ? _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromData(props, axis, dataset) : [];
10117
- var childDomain = getDomainFromChildren(props, axis, childComponents);
10139
+ var childDomain = getDomainFromChildren(props, axis, children);
10118
10140
  var min = minDomain || _collection__WEBPACK_IMPORTED_MODULE_14__.getMinValue([].concat(_toConsumableArray(dataDomain), _toConsumableArray(childDomain)));
10119
10141
  var max = maxDomain || _collection__WEBPACK_IMPORTED_MODULE_14__.getMaxValue([].concat(_toConsumableArray(dataDomain), _toConsumableArray(childDomain)));
10120
10142
  domain = _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromMinMax(min, max);
@@ -10276,10 +10298,10 @@ function getCategoryAndAxisStringsFromChildren(props, axis, childComponents) {
10276
10298
  return lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()([].concat(_toConsumableArray(categoryStrings), _toConsumableArray(axisStrings))));
10277
10299
  }
10278
10300
  function getStringsFromChildren(props, childComponents) {
10279
- childComponents = childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
10280
- var xStrings = getCategoryAndAxisStringsFromChildren(props, "x", childComponents);
10281
- var yStrings = getCategoryAndAxisStringsFromChildren(props, "y", childComponents);
10282
- var dataStrings = getStringsFromData(childComponents);
10301
+ var children = childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
10302
+ var xStrings = getCategoryAndAxisStringsFromChildren(props, "x", children);
10303
+ var yStrings = getCategoryAndAxisStringsFromChildren(props, "y", children);
10304
+ var dataStrings = getStringsFromData(children);
10283
10305
  return {
10284
10306
  x: lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()([].concat(_toConsumableArray(xStrings), _toConsumableArray(dataStrings.x)))),
10285
10307
  y: lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()([].concat(_toConsumableArray(yStrings), _toConsumableArray(dataStrings.y))))