victory-box-plot 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.
@@ -213,13 +213,14 @@ var getLabelStyle = function (props, styleObject, namespace) {
213
213
  return lodash_defaults__WEBPACK_IMPORTED_MODULE_6___default()({}, tooltipTheme.style, baseStyle);
214
214
  };
215
215
 
216
- var getStyles = function (props, styleObject) {
216
+ var getStyles = function (props) {
217
+ var styleObject = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
218
+
217
219
  if (props.disableInlineStyles) {
218
220
  return {};
219
221
  }
220
222
 
221
223
  var style = props.style || {};
222
- styleObject = styleObject || {};
223
224
  var parentStyles = {
224
225
  height: "100%",
225
226
  width: "100%"
@@ -510,24 +511,25 @@ var isDatumOutOfBounds = function (datum, domain) {
510
511
  return yOutOfBounds || xOutOfBounds;
511
512
  };
512
513
 
513
- var getBaseProps = function (props, fallbackProps) {
514
- var modifiedProps = victory_core__WEBPACK_IMPORTED_MODULE_11__.modifyProps(props, fallbackProps, "boxplot");
515
- props = lodash_assign__WEBPACK_IMPORTED_MODULE_5___default()({}, modifiedProps, getCalculatedValues(modifiedProps));
516
- var _props = props,
517
- groupComponent = _props.groupComponent,
518
- width = _props.width,
519
- height = _props.height,
520
- padding = _props.padding,
521
- standalone = _props.standalone,
522
- theme = _props.theme,
523
- events = _props.events,
524
- sharedEvents = _props.sharedEvents,
525
- scale = _props.scale,
526
- horizontal = _props.horizontal,
527
- data = _props.data,
528
- style = _props.style,
529
- domain = _props.domain,
530
- name = _props.name;
514
+ var getBaseProps = function (initialProps, fallbackProps) {
515
+ var modifiedProps = victory_core__WEBPACK_IMPORTED_MODULE_11__.modifyProps(initialProps, fallbackProps, "boxplot");
516
+
517
+ var props = lodash_assign__WEBPACK_IMPORTED_MODULE_5___default()({}, modifiedProps, getCalculatedValues(modifiedProps));
518
+
519
+ var groupComponent = props.groupComponent,
520
+ width = props.width,
521
+ height = props.height,
522
+ padding = props.padding,
523
+ standalone = props.standalone,
524
+ theme = props.theme,
525
+ events = props.events,
526
+ sharedEvents = props.sharedEvents,
527
+ scale = props.scale,
528
+ horizontal = props.horizontal,
529
+ data = props.data,
530
+ style = props.style,
531
+ domain = props.domain,
532
+ name = props.name;
531
533
  var initialChildProps = {
532
534
  parent: {
533
535
  domain: domain,
@@ -7889,12 +7891,12 @@ var interpolateFunction = function (a, b) {
7889
7891
  * differs in that it uses our custom interpolators when interpolating the value of each property in
7890
7892
  * an object. This allows the correct interpolation of nested objects, including styles
7891
7893
  *
7892
- * @param {any} a - Start value.
7893
- * @param {any} b - End value.
7894
+ * @param {any} startValue - Start value.
7895
+ * @param {any} endValue - End value.
7894
7896
  * @returns {Function} An interpolation function.
7895
7897
  */
7896
7898
 
7897
- var interpolateObject = function (a, b) {
7899
+ var interpolateObject = function (startValue, endValue) {
7898
7900
  var interpolateTypes = function (x, y) {
7899
7901
  if (x === y || !isInterpolatable(x) || !isInterpolatable(y)) {
7900
7902
  return interpolateImmediate(x, y);
@@ -7919,6 +7921,8 @@ var interpolateObject = function (a, b) {
7919
7921
 
7920
7922
  var i = {};
7921
7923
  var c = {};
7924
+ var a = startValue;
7925
+ var b = endValue;
7922
7926
  var k;
7923
7927
 
7924
7928
  if (a === null || typeof a !== "object") {
@@ -8086,8 +8090,8 @@ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
8086
8090
  step can generate imprecise values, sometimes greater than 1
8087
8091
  if this happens set the state to 1 and return, cancelling the timer
8088
8092
  */
8089
- duration = duration !== undefined ? duration : _this.props.duration;
8090
- var step = duration ? elapsed / duration : 1;
8093
+ var animationDuration = duration !== undefined ? duration : _this.props.duration;
8094
+ var step = animationDuration ? elapsed / animationDuration : 1;
8091
8095
 
8092
8096
  if (step >= 1) {
8093
8097
  _this.setState({
@@ -8703,8 +8707,7 @@ var getStyles = function (style, props) {
8703
8707
  }
8704
8708
 
8705
8709
  var getSingleStyle = function (s) {
8706
- s = s ? lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, s, defaultStyles) : defaultStyles;
8707
- var baseStyles = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(s, props);
8710
+ var baseStyles = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(s ? lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, s, defaultStyles) : defaultStyles, props);
8708
8711
  return lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, baseStyles, {
8709
8712
  fontSize: getFontSize(baseStyles)
8710
8713
  });
@@ -8908,22 +8911,19 @@ var getInlineXOffset = function (calculatedProps, textElements, index) {
8908
8911
  switch (textAnchor) {
8909
8912
  case "start":
8910
8913
  return widths.reduce(function (memo, width, i) {
8911
- memo = i < index ? memo + width : memo;
8912
- return memo;
8914
+ return i < index ? memo + width : memo;
8913
8915
  }, 0);
8914
8916
 
8915
8917
  case "end":
8916
8918
  return widths.reduce(function (memo, width, i) {
8917
- memo = i > index ? memo - width : memo;
8918
- return memo;
8919
+ return i > index ? memo - width : memo;
8919
8920
  }, 0);
8920
8921
 
8921
8922
  default:
8922
8923
  // middle
8923
8924
  return widths.reduce(function (memo, width, i) {
8924
8925
  var offsetWidth = i < index ? width : 0;
8925
- memo = i === index ? memo + width / 2 : memo + offsetWidth;
8926
- return memo;
8926
+ return i === index ? memo + width / 2 : memo + offsetWidth;
8927
8927
  }, centerOffset);
8928
8928
  }
8929
8929
  };
@@ -9125,8 +9125,8 @@ var defaultProps = {
9125
9125
  // Magic number from d3.
9126
9126
  lineHeight: 1
9127
9127
  };
9128
- var VictoryLabel = function (props) {
9129
- props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), props));
9128
+ var VictoryLabel = function (initialProps) {
9129
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
9130
9130
 
9131
9131
  if (props.text === null || props.text === undefined) {
9132
9132
  return null;
@@ -9147,7 +9147,7 @@ var VictoryLabel = function (props) {
9147
9147
  fontSize: currentStyle.fontSize || defaultStyles.fontSize,
9148
9148
  capHeight: capHeightPx,
9149
9149
  text: line,
9150
- // @ts-expect-error TODO: This looks like a bug:
9150
+ // TODO: This looks like a bug:
9151
9151
  textSize: _victory_util_textsize__WEBPACK_IMPORTED_MODULE_12__.approximateTextSize(line, currentStyle),
9152
9152
  lineHeight: currentLineHeight,
9153
9153
  backgroundPadding: getSingleValue(backgroundPadding, i)
@@ -9561,8 +9561,8 @@ var defaultProps = {
9561
9561
  role: "presentation",
9562
9562
  shapeRendering: "auto"
9563
9563
  };
9564
- var Border = function (props) {
9565
- props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), props));
9564
+ var Border = function (initialProps) {
9565
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
9566
9566
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.rectComponent, _objectSpread(_objectSpread({}, props.events), {}, {
9567
9567
  "aria-label": props.ariaLabel,
9568
9568
  style: props.style,
@@ -9653,8 +9653,8 @@ var defaultProps = {
9653
9653
  role: "presentation",
9654
9654
  shapeRendering: "auto"
9655
9655
  };
9656
- var LineSegment = function (props) {
9657
- props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), props));
9656
+ var LineSegment = function (initialProps) {
9657
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
9658
9658
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.lineComponent, _objectSpread(_objectSpread({}, props.events), {}, {
9659
9659
  "aria-label": props.ariaLabel,
9660
9660
  style: props.style,
@@ -9961,23 +9961,22 @@ var defaultProps = {
9961
9961
  role: "presentation",
9962
9962
  shapeRendering: "auto"
9963
9963
  };
9964
- var Whisker = function (props) {
9965
- props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), props));
9966
- var _props = props,
9967
- ariaLabel = _props.ariaLabel,
9968
- groupComponent = _props.groupComponent,
9969
- lineComponent = _props.lineComponent,
9970
- events = _props.events,
9971
- className = _props.className,
9972
- majorWhisker = _props.majorWhisker,
9973
- minorWhisker = _props.minorWhisker,
9974
- transform = _props.transform,
9975
- clipPath = _props.clipPath,
9976
- role = _props.role,
9977
- shapeRendering = _props.shapeRendering,
9978
- style = _props.style,
9979
- desc = _props.desc,
9980
- tabIndex = _props.tabIndex;
9964
+ var Whisker = function (initialProps) {
9965
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
9966
+ var ariaLabel = props.ariaLabel,
9967
+ groupComponent = props.groupComponent,
9968
+ lineComponent = props.lineComponent,
9969
+ events = props.events,
9970
+ className = props.className,
9971
+ majorWhisker = props.majorWhisker,
9972
+ minorWhisker = props.minorWhisker,
9973
+ transform = props.transform,
9974
+ clipPath = props.clipPath,
9975
+ role = props.role,
9976
+ shapeRendering = props.shapeRendering,
9977
+ style = props.style,
9978
+ desc = props.desc,
9979
+ tabIndex = props.tabIndex;
9981
9980
 
9982
9981
  var baseProps = _objectSpread(_objectSpread({}, events), {}, {
9983
9982
  style: style,
@@ -11144,8 +11143,7 @@ function addEvents(WrappedComponent) {
11144
11143
  value: function applyExternalMutations(props, externalMutations) {
11145
11144
  if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_5___default()(externalMutations)) {
11146
11145
  var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
11147
- memo = lodash_isFunction__WEBPACK_IMPORTED_MODULE_4___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
11148
- return memo;
11146
+ return lodash_isFunction__WEBPACK_IMPORTED_MODULE_4___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
11149
11147
  }, []);
11150
11148
  var compiledCallbacks = callbacks.length ? function () {
11151
11149
  callbacks.forEach(function (c) {
@@ -11200,8 +11198,8 @@ function addEvents(WrappedComponent) {
11200
11198
  }, {
11201
11199
  key: "getBaseProps",
11202
11200
  value: function getBaseProps(props, getSharedEventState) {
11203
- getSharedEventState = getSharedEventState || this.getSharedEventState.bind(this);
11204
- var sharedParentState = getSharedEventState("parent", "parent");
11201
+ var getSharedEventStateFunction = getSharedEventState || this.getSharedEventState.bind(this);
11202
+ var sharedParentState = getSharedEventStateFunction("parent", "parent");
11205
11203
  var parentState = this.getEventState("parent", "parent");
11206
11204
 
11207
11205
  var baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_7___default()({}, parentState, sharedParentState);
@@ -11300,13 +11298,15 @@ function addEvents(WrappedComponent) {
11300
11298
  var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_0___default()(this.dataKeys, "all");
11301
11299
 
11302
11300
  var labelComponents = dataKeys.reduce(function (memo, key) {
11301
+ var newMemo = memo;
11302
+
11303
11303
  var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
11304
11304
 
11305
11305
  if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
11306
- memo = memo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
11306
+ newMemo = newMemo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
11307
11307
  }
11308
11308
 
11309
- return memo;
11309
+ return newMemo;
11310
11310
  }, []);
11311
11311
  var dataProps = this.getComponentProps(dataComponent, "data", "all");
11312
11312
  var children = [/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
@@ -11705,12 +11705,14 @@ function sortData(dataset, sortKey) {
11705
11705
  } // Ensures previous VictoryLine api for sortKey prop stays consistent
11706
11706
 
11707
11707
 
11708
+ var formattedSortKey = sortKey;
11709
+
11708
11710
  if (sortKey === "x" || sortKey === "y") {
11709
- sortKey = "_".concat(sortKey);
11711
+ formattedSortKey = "_".concat(sortKey);
11710
11712
  }
11711
11713
 
11712
11714
  var order = sortOrder === "ascending" ? "asc" : "desc";
11713
- return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset, sortKey, order);
11715
+ return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset, formattedSortKey, order);
11714
11716
  } // This method will remove data points that break certain scales. (log scale only)
11715
11717
 
11716
11718
 
@@ -11901,7 +11903,10 @@ function formatData(dataset, props, expectedKeys) {
11901
11903
  return [];
11902
11904
  }
11903
11905
 
11904
- var defaultKeys = ["x", "y", "y0"];
11906
+ var defaultKeys = ["x", "y", "y0"]; // TODO: We shouldn’t mutate the expectedKeys param here,
11907
+ // but we need to figure out why changing it causes regressions in tests.
11908
+ // eslint-disable-next-line no-param-reassign
11909
+
11905
11910
  expectedKeys = Array.isArray(expectedKeys) ? expectedKeys : defaultKeys;
11906
11911
 
11907
11912
  var createAccessor = function (name) {
@@ -11926,13 +11931,13 @@ function formatData(dataset, props, expectedKeys) {
11926
11931
 
11927
11932
  var data = preformattedData ? dataset : dataset.reduce(function (dataArr, datum, index) {
11928
11933
  // eslint-disable-line complexity
11929
- datum = parseDatum(datum);
11934
+ var parsedDatum = parseDatum(datum);
11930
11935
  var fallbackValues = {
11931
11936
  x: index,
11932
- y: datum
11937
+ y: parsedDatum
11933
11938
  };
11934
11939
  var processedValues = expectedKeys.reduce(function (memo, type) {
11935
- var processedValue = accessor[type](datum);
11940
+ var processedValue = accessor[type](parsedDatum);
11936
11941
  var value = processedValue !== undefined ? processedValue : fallbackValues[type];
11937
11942
 
11938
11943
  if (value !== undefined) {
@@ -11947,7 +11952,7 @@ function formatData(dataset, props, expectedKeys) {
11947
11952
  return memo;
11948
11953
  }, {});
11949
11954
 
11950
- var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues, datum);
11955
+ var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues, parsedDatum);
11951
11956
 
11952
11957
  if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_4___default()(formattedDatum)) {
11953
11958
  dataArr.push(formattedDatum);
@@ -12058,8 +12063,8 @@ function getStringsFromData(props, axis) {
12058
12063
  }, []);
12059
12064
  var sortedData = sortData(data, props.sortKey, props.sortOrder);
12060
12065
  var dataStrings = sortedData.reduce(function (dataArr, datum) {
12061
- datum = parseDatum(datum);
12062
- dataArr.push(accessor(datum));
12066
+ var parsedDatum = parseDatum(datum);
12067
+ dataArr.push(accessor(parsedDatum));
12063
12068
  return dataArr;
12064
12069
  }, []).filter(function (datum) {
12065
12070
  return typeof datum === "string";
@@ -12425,18 +12430,18 @@ function padDomain(domain, props, axis) {
12425
12430
 
12426
12431
 
12427
12432
  function createDomainFunction(getDomainFromDataFunction, formatDomainFunction) {
12428
- getDomainFromDataFunction = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(getDomainFromDataFunction) ? getDomainFromDataFunction : getDomainFromData;
12429
- formatDomainFunction = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(formatDomainFunction) ? formatDomainFunction : formatDomain;
12433
+ var getDomainFromDataFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(getDomainFromDataFunction) ? getDomainFromDataFunction : getDomainFromData;
12434
+ var formatDomainFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(formatDomainFunction) ? formatDomainFunction : formatDomain;
12430
12435
  return function (props, axis) {
12431
12436
  var propsDomain = getDomainFromProps(props, axis);
12432
12437
 
12433
12438
  if (propsDomain) {
12434
- return formatDomainFunction(propsDomain, props, axis);
12439
+ return formatDomainFn(propsDomain, props, axis);
12435
12440
  }
12436
12441
 
12437
12442
  var categories = _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
12438
- var domain = categories ? getDomainFromCategories(props, axis, categories) : getDomainFromDataFunction(props, axis);
12439
- return domain ? formatDomainFunction(domain, props, axis) : undefined;
12443
+ var domain = categories ? getDomainFromCategories(props, axis, categories) : getDomainFromDataFn(props, axis);
12444
+ return domain ? formatDomainFn(domain, props, axis) : undefined;
12440
12445
  };
12441
12446
  }
12442
12447
  /**
@@ -12469,27 +12474,27 @@ function getDomain(props, axis) {
12469
12474
  */
12470
12475
 
12471
12476
  function getDomainFromCategories(props, axis, categories) {
12472
- categories = categories || _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
12477
+ var categoriesArray = categories || _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
12473
12478
  var polar = props.polar,
12474
12479
  _props$startAngle = props.startAngle,
12475
12480
  startAngle = _props$startAngle === void 0 ? 0 : _props$startAngle,
12476
12481
  _props$endAngle = props.endAngle,
12477
12482
  endAngle = _props$endAngle === void 0 ? 360 : _props$endAngle;
12478
12483
 
12479
- if (!categories) {
12484
+ if (!categoriesArray) {
12480
12485
  return undefined;
12481
12486
  }
12482
12487
 
12483
12488
  var minDomain = getMinFromProps(props, axis);
12484
12489
  var maxDomain = getMaxFromProps(props, axis);
12485
- var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(categories) ? _data__WEBPACK_IMPORTED_MODULE_10__.getStringsFromCategories(props, axis) : [];
12490
+ var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(categoriesArray) ? _data__WEBPACK_IMPORTED_MODULE_10__.getStringsFromCategories(props, axis) : [];
12486
12491
  var stringMap = stringArray.length === 0 ? null : stringArray.reduce(function (memo, string, index) {
12487
12492
  memo[string] = index + 1;
12488
12493
  return memo;
12489
12494
  }, {});
12490
- var categoryValues = stringMap ? categories.map(function (value) {
12495
+ var categoryValues = stringMap ? categoriesArray.map(function (value) {
12491
12496
  return stringMap[value];
12492
- }) : categories;
12497
+ }) : categoriesArray;
12493
12498
  var min = minDomain !== undefined ? minDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMinValue(categoryValues);
12494
12499
  var max = maxDomain !== undefined ? maxDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMaxValue(categoryValues);
12495
12500
  var categoryDomain = getDomainFromMinMax(min, max);
@@ -12504,7 +12509,7 @@ function getDomainFromCategories(props, axis, categories) {
12504
12509
  */
12505
12510
 
12506
12511
  function getDomainFromData(props, axis, dataset) {
12507
- dataset = dataset || _data__WEBPACK_IMPORTED_MODULE_10__.getData(props);
12512
+ var datasetArray = dataset || _data__WEBPACK_IMPORTED_MODULE_10__.getData(props);
12508
12513
  var polar = props.polar,
12509
12514
  _props$startAngle2 = props.startAngle,
12510
12515
  startAngle = _props$startAngle2 === void 0 ? 0 : _props$startAngle2,
@@ -12513,14 +12518,14 @@ function getDomainFromData(props, axis, dataset) {
12513
12518
  var minDomain = getMinFromProps(props, axis);
12514
12519
  var maxDomain = getMaxFromProps(props, axis);
12515
12520
 
12516
- if (dataset.length < 1) {
12521
+ if (datasetArray.length < 1) {
12517
12522
  return minDomain !== undefined && maxDomain !== undefined ? getDomainFromMinMax(minDomain, maxDomain) : undefined;
12518
12523
  }
12519
12524
 
12520
- var min = minDomain !== undefined ? minDomain : getExtremeFromData(dataset, axis, "min");
12521
- var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(dataset, axis, "max");
12525
+ var min = minDomain !== undefined ? minDomain : getExtremeFromData(datasetArray, axis, "min");
12526
+ var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(datasetArray, axis, "max");
12522
12527
  var domain = getDomainFromMinMax(min, max);
12523
- return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(dataset, axis)) : domain;
12528
+ return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(datasetArray, axis)) : domain;
12524
12529
  }
12525
12530
  /**
12526
12531
  * Returns a domain in the form of a two element array given a min and max value.
@@ -12833,14 +12838,14 @@ function getScopedEvents(events, namespace, childType, baseProps) {
12833
12838
  // eslint-disable-next-line no-invalid-this
12834
12839
 
12835
12840
 
12836
- baseProps = baseProps || this.baseProps; // returns the original base props or base state of a given target element
12841
+ var newBaseProps = baseProps || this.baseProps; // returns the original base props or base state of a given target element
12837
12842
 
12838
12843
  var getTargetProps = function (identifier, type) {
12839
12844
  var childName = identifier.childName,
12840
12845
  target = identifier.target,
12841
12846
  key = identifier.key; // eslint-disable-next-line no-invalid-this
12842
12847
 
12843
- var baseType = type === "props" ? baseProps : _this2.state || {};
12848
+ var baseType = type === "props" ? newBaseProps : _this2.state || {};
12844
12849
  var base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
12845
12850
  return key === "parent" ? base.parent : base[key] && base[key][target];
12846
12851
  }; // Returns the state object with the mutation caused by a given eventReturn
@@ -12857,9 +12862,9 @@ function getScopedEvents(events, namespace, childType, baseProps) {
12857
12862
  }
12858
12863
 
12859
12864
  if (eventReturn.eventKey === "all") {
12860
- 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");
12865
+ 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");
12861
12866
  } else if (eventReturn.eventKey === undefined && eventKey === "parent") {
12862
- return baseProps[childName] ? lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps[childName]) : lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps);
12867
+ return newBaseProps[childName] ? lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps[childName]) : lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps);
12863
12868
  }
12864
12869
 
12865
12870
  return eventReturn.eventKey !== undefined ? eventReturn.eventKey : eventKey;
@@ -12884,7 +12889,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
12884
12889
  key: key,
12885
12890
  target: target
12886
12891
  }, "state");
12887
- var mutatedProps = eventReturn.mutation(lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, mutationTargetProps, mutationTargetState), baseProps);
12892
+ var mutatedProps = eventReturn.mutation(lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, mutationTargetProps, mutationTargetState), newBaseProps);
12888
12893
  var childState = baseState[childName] || {};
12889
12894
 
12890
12895
  var filterState = function (state) {
@@ -12919,7 +12924,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
12919
12924
  }; // returns an entire mutated state for all children
12920
12925
 
12921
12926
 
12922
- var allChildNames = childNames === "all" ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps), "parent") : childNames;
12927
+ var allChildNames = childNames === "all" ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps), "parent") : childNames;
12923
12928
  return Array.isArray(allChildNames) ? allChildNames.reduce(function (memo, childName) {
12924
12929
  return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()(memo, getReturnByChild(childName));
12925
12930
  }, {}) : getReturnByChild(allChildNames);
@@ -12928,8 +12933,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
12928
12933
 
12929
12934
  var parseEventReturn = function (eventReturn, eventKey) {
12930
12935
  return Array.isArray(eventReturn) ? eventReturn.reduce(function (memo, props) {
12931
- memo = lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, memo, parseEvent(props, eventKey));
12932
- return memo;
12936
+ return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, memo, parseEvent(props, eventKey));
12933
12937
  }, {}) : parseEvent(eventReturn, eventKey);
12934
12938
  };
12935
12939
 
@@ -13015,9 +13019,10 @@ function getEventState(eventKey, namespace, childType) {
13015
13019
  */
13016
13020
  // eslint-disable-next-line max-params
13017
13021
 
13018
- function getExternalMutationsWithChildren(mutations, baseProps, baseState, childNames) {
13019
- baseProps = baseProps || {};
13020
- baseState = baseState || {};
13022
+ function getExternalMutationsWithChildren(mutations) {
13023
+ var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13024
+ var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
13025
+ var childNames = arguments.length > 3 ? arguments[3] : undefined;
13021
13026
  return childNames.reduce(function (memo, childName) {
13022
13027
  var childState = baseState[childName];
13023
13028
  var mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
@@ -13039,9 +13044,10 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
13039
13044
  */
13040
13045
  // eslint-disable-next-line max-params
13041
13046
 
13042
- function getExternalMutations(mutations, baseProps, baseState, childName) {
13043
- baseProps = baseProps || {};
13044
- baseState = baseState || {};
13047
+ function getExternalMutations(mutations) {
13048
+ var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13049
+ var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
13050
+ var childName = arguments.length > 3 ? arguments[3] : undefined;
13045
13051
 
13046
13052
  var eventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps);
13047
13053
 
@@ -13107,8 +13113,7 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
13107
13113
  return false;
13108
13114
  };
13109
13115
 
13110
- mutations = Array.isArray(mutations) ? mutations : [mutations];
13111
- var scopedMutations = mutations;
13116
+ var scopedMutations = Array.isArray(mutations) ? mutations : [mutations];
13112
13117
 
13113
13118
  if (identifier.childName) {
13114
13119
  scopedMutations = mutations.filter(function (m) {
@@ -13147,13 +13152,10 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
13147
13152
 
13148
13153
  function getComponentEvents(props, components) {
13149
13154
  var events = Array.isArray(components) && components.reduce(function (memo, componentName) {
13150
- var _memo;
13151
-
13152
13155
  var component = props[componentName];
13153
13156
  var defaultEvents = component && component.type && component.type.defaultEvents;
13154
13157
  var componentEvents = lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(defaultEvents) ? defaultEvents(component.props) : defaultEvents;
13155
- memo = Array.isArray(componentEvents) ? (_memo = memo).concat.apply(_memo, _toConsumableArray(componentEvents)) : memo;
13156
- return memo;
13158
+ return Array.isArray(componentEvents) ? memo.concat.apply(memo, _toConsumableArray(componentEvents)) : memo;
13157
13159
  }, []);
13158
13160
  return events && events.length ? events : undefined;
13159
13161
  }
@@ -13511,6 +13513,7 @@ function reduceChildren(children, iteratee) {
13511
13513
 
13512
13514
  var traverseChildren = function (childArray, names, parent) {
13513
13515
  return childArray.reduce(function (memo, child, index) {
13516
+ var newMemo = memo;
13514
13517
  var childRole = child.type && child.type.role;
13515
13518
  var childName = child.props.name || "".concat(childRole, "-").concat(names[index]);
13516
13519
 
@@ -13528,16 +13531,16 @@ function reduceChildren(children, iteratee) {
13528
13531
  });
13529
13532
 
13530
13533
  var nestedResults = traverseChildren(nestedChildren, _childNames, child);
13531
- memo = combine(memo, nestedResults);
13534
+ newMemo = combine(newMemo, nestedResults);
13532
13535
  } else {
13533
13536
  var result = iteratee(child, childName, parent);
13534
13537
 
13535
13538
  if (result) {
13536
- memo = combine(memo, result);
13539
+ newMemo = combine(newMemo, result);
13537
13540
  }
13538
13541
  }
13539
13542
 
13540
- return memo;
13543
+ return newMemo;
13541
13544
  }, initialMemo);
13542
13545
  };
13543
13546
 
@@ -13563,8 +13566,7 @@ function isHorizontal(props) {
13563
13566
  var childProps = child.props || {};
13564
13567
 
13565
13568
  if (memo || childProps.horizontal || !childProps.children) {
13566
- memo = memo || childProps.horizontal;
13567
- return memo;
13569
+ return memo || childProps.horizontal;
13568
13570
  }
13569
13571
 
13570
13572
  return traverseChildren(react__WEBPACK_IMPORTED_MODULE_6___default().Children.toArray(childProps.children));
@@ -13617,11 +13619,13 @@ function isMap(x) {
13617
13619
  }
13618
13620
  function shallowToJS(x, whitelist) {
13619
13621
  return isIterable(x) ? x.reduce(function (result, curr, key) {
13622
+ var newCurr = curr;
13623
+
13620
13624
  if (whitelist && whitelist[key]) {
13621
- curr = shallowToJS(curr);
13625
+ newCurr = shallowToJS(curr);
13622
13626
  }
13623
13627
 
13624
- result[key] = curr;
13628
+ result[key] = newCurr;
13625
13629
  return result;
13626
13630
  }, isList(x) ? [] : {}) : x;
13627
13631
  }
@@ -13649,12 +13653,10 @@ __webpack_require__.r(__webpack_exports__);
13649
13653
  /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
13650
13654
 
13651
13655
 
13652
- /* eslint-disable no-use-before-define */
13653
-
13654
13656
 
13655
13657
  // Private Functions
13656
- function getVerticalAnchor(props, datum) {
13657
- datum = datum || {};
13658
+ function getVerticalAnchor(props) {
13659
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13658
13660
  var sign = datum._y >= 0 ? 1 : -1;
13659
13661
  var labelStyle = props.style && props.style.labels || {};
13660
13662
 
@@ -13667,8 +13669,8 @@ function getVerticalAnchor(props, datum) {
13667
13669
  return "middle";
13668
13670
  }
13669
13671
 
13670
- function getTextAnchor(props, datum) {
13671
- datum = datum || {};
13672
+ function getTextAnchor(props) {
13673
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13672
13674
  var style = props.style,
13673
13675
  horizontal = props.horizontal;
13674
13676
  var sign = datum._y >= 0 ? 1 : -1;
@@ -13683,14 +13685,14 @@ function getTextAnchor(props, datum) {
13683
13685
  return sign >= 0 ? "start" : "end";
13684
13686
  }
13685
13687
 
13686
- function getAngle(props, datum) {
13687
- datum = datum || {};
13688
+ function getAngle(props) {
13689
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13688
13690
  var labelStyle = props.style && props.style.labels || {};
13689
13691
  return datum.angle === undefined ? labelStyle.angle : datum.angle;
13690
13692
  }
13691
13693
 
13692
- function getPadding(props, datum) {
13693
- datum = datum || {};
13694
+ function getPadding(props) {
13695
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13694
13696
  var horizontal = props.horizontal,
13695
13697
  style = props.style;
13696
13698
  var labelStyle = style.labels || {};
@@ -13769,8 +13771,9 @@ function getPolarOrientation(degrees) {
13769
13771
  } // Exported Functions
13770
13772
 
13771
13773
 
13772
- function getText(props, datum, index) {
13773
- datum = datum || {};
13774
+ function getText(props) {
13775
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13776
+ var index = arguments.length > 2 ? arguments[2] : undefined;
13774
13777
 
13775
13778
  if (datum.label !== undefined) {
13776
13779
  return datum.label;
@@ -14930,11 +14933,10 @@ var Timer = /*#__PURE__*/function () {
14930
14933
  }, {
14931
14934
  key: "subscribe",
14932
14935
  value: function subscribe(callback, duration) {
14933
- duration = this.shouldAnimate ? duration : 0;
14934
14936
  var subscriptionID = this.subscribers.push({
14935
14937
  startTime: (0,victory_vendor_d3_timer__WEBPACK_IMPORTED_MODULE_0__.now)(),
14936
14938
  callback: callback,
14937
- duration: duration
14939
+ duration: this.shouldAnimate ? duration : 0
14938
14940
  });
14939
14941
  this.activeSubscriptions++;
14940
14942
  this.start();
@@ -15121,36 +15123,38 @@ function getInitialChildProps(animate, data) {
15121
15123
 
15122
15124
 
15123
15125
  function getChildBeforeLoad(animate, child, data, cb) {
15124
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
15126
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
15125
15127
  onEnd: cb
15126
15128
  });
15127
15129
 
15128
- if (animate && animate.onLoad && !animate.onLoad.duration) {
15130
+ if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
15129
15131
  return {
15130
- animate: animate,
15132
+ animate: newAnimate,
15131
15133
  data: data
15132
15134
  };
15133
15135
  }
15134
15136
 
15135
- 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.
15137
+ 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.
15136
15138
 
15137
- data = data.map(function (datum, idx) {
15139
+ var newData = data.map(function (datum, idx) {
15138
15140
  return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data));
15139
15141
  });
15140
15142
  return {
15141
- animate: animate,
15142
- data: data,
15143
+ animate: newAnimate,
15144
+ data: newData,
15143
15145
  clipWidth: 0
15144
15146
  };
15145
15147
  } // eslint-disable-next-line max-params
15146
15148
 
15147
15149
 
15148
15150
  function getChildOnLoad(animate, data, cb) {
15149
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
15151
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
15150
15152
  onEnd: cb
15151
15153
  });
15152
15154
 
15153
- if (animate && animate.onLoad && !animate.onLoad.duration) {
15155
+ var newData = data;
15156
+
15157
+ if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
15154
15158
  return {
15155
15159
  animate: animate,
15156
15160
  data: data
@@ -15159,12 +15163,12 @@ function getChildOnLoad(animate, data, cb) {
15159
15163
 
15160
15164
  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.
15161
15165
 
15162
- data = data.map(function (datum, idx) {
15166
+ newData = data.map(function (datum, idx) {
15163
15167
  return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data));
15164
15168
  });
15165
15169
  return {
15166
- animate: animate,
15167
- data: data
15170
+ animate: newAnimate,
15171
+ data: newData
15168
15172
  };
15169
15173
  } // eslint-disable-next-line max-params, max-len
15170
15174
 
@@ -15173,7 +15177,10 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
15173
15177
  // Whether or not _this_ child has exiting nodes, we want the exit-
15174
15178
  // transition for all children to have the same duration, delay, etc.
15175
15179
  var onExit = animate && animate.onExit;
15176
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onExit);
15180
+
15181
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onExit);
15182
+
15183
+ var newData = data;
15177
15184
 
15178
15185
  if (exitingNodes) {
15179
15186
  // After the exit transition occurs, trigger the animations for
@@ -15181,39 +15188,42 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
15181
15188
  animate.onEnd = cb;
15182
15189
  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.
15183
15190
 
15184
- data = data.map(function (datum, idx) {
15191
+ newData = data.map(function (datum, idx) {
15185
15192
  var key = (datum.key || idx).toString();
15186
15193
  return exitingNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
15187
15194
  });
15188
15195
  }
15189
15196
 
15190
15197
  return {
15191
- animate: animate,
15192
- data: data
15198
+ animate: newAnimate,
15199
+ data: newData
15193
15200
  };
15194
15201
  } // eslint-disable-next-line max-params,max-len
15195
15202
 
15196
15203
 
15197
15204
  function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
15205
+ var newAnimate = animate;
15206
+ var newData = data;
15207
+
15198
15208
  if (enteringNodes) {
15199
15209
  // Perform a normal animation here, except - when it finishes - trigger
15200
15210
  // the transition for entering nodes.
15201
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
15211
+ newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
15202
15212
  onEnd: cb
15203
15213
  });
15204
15214
  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
15205
15215
  // domain. However, we may not want these nodes to be displayed initially,
15206
15216
  // so perform the `onEnter.before` transformation on each node.
15207
15217
 
15208
- data = data.map(function (datum, idx) {
15218
+ newData = data.map(function (datum, idx) {
15209
15219
  var key = (datum.key || idx).toString();
15210
15220
  return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
15211
15221
  });
15212
15222
  }
15213
15223
 
15214
15224
  return {
15215
- animate: animate,
15216
- data: data
15225
+ animate: newAnimate,
15226
+ data: newData
15217
15227
  };
15218
15228
  } // eslint-disable-next-line max-params, max-len
15219
15229
 
@@ -15222,23 +15232,26 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
15222
15232
  // Whether or not _this_ child has entering nodes, we want the entering-
15223
15233
  // transition for all children to have the same duration, delay, etc.
15224
15234
  var onEnter = animate && animate.onEnter;
15225
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onEnter);
15235
+
15236
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onEnter);
15237
+
15238
+ var newData = data;
15226
15239
 
15227
15240
  if (enteringNodes) {
15228
15241
  // Old nodes have been transitioned to their new values, and the
15229
15242
  // domain should encompass the nodes that will now enter. So perform
15230
15243
  // the `onEnter.after` transformation on each node.
15231
- animate.onEnd = cb;
15232
- var after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default());
15233
- data = data.map(function (datum, idx) {
15244
+ newAnimate.onEnd = cb;
15245
+ var after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default());
15246
+ newData = data.map(function (datum, idx) {
15234
15247
  var key = getDatumKey(datum, idx);
15235
15248
  return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data)) : datum;
15236
15249
  });
15237
15250
  }
15238
15251
 
15239
15252
  return {
15240
- animate: animate,
15241
- data: data
15253
+ animate: newAnimate,
15254
+ data: newData
15242
15255
  };
15243
15256
  }
15244
15257
  /**
@@ -15404,6 +15417,7 @@ function getTransitionPropsFactory(props, state, setState) {
15404
15417
  "use strict";
15405
15418
  __webpack_require__.r(__webpack_exports__);
15406
15419
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15420
+ /* harmony export */ "assert": () => (/* binding */ assert),
15407
15421
  /* harmony export */ "getSafeUserProps": () => (/* binding */ getSafeUserProps),
15408
15422
  /* harmony export */ "withSafeUserProps": () => (/* binding */ withSafeUserProps)
15409
15423
  /* harmony export */ });
@@ -15484,6 +15498,18 @@ var testIfSafeProp = function (key) {
15484
15498
  if (doesPropStartWith(key) || isExactMatch(key)) return true;
15485
15499
  return false;
15486
15500
  };
15501
+ /**
15502
+ * Asserts that value is not null or undefined, throwing an error if it is.
15503
+ * @param value The value to assert
15504
+ * @param message The error message to throw
15505
+ */
15506
+
15507
+
15508
+ function assert(value, message) {
15509
+ if (value === undefined || value === null) {
15510
+ throw new Error(message);
15511
+ }
15512
+ }
15487
15513
  /**
15488
15514
  * getSafeUserProps - function that takes in a props object and removes any
15489
15515
  * key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
@@ -15493,7 +15519,6 @@ var testIfSafeProp = function (key) {
15493
15519
  * @returns {Object}: object containing remaining acceptable props
15494
15520
  */
15495
15521
 
15496
-
15497
15522
  var getSafeUserProps = function (props) {
15498
15523
  var propsToFilter = _objectSpread({}, props);
15499
15524