victory-histogram 36.8.2 → 36.8.3

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.
@@ -11,9 +11,9 @@
11
11
  return /******/ (() => { // webpackBootstrap
12
12
  /******/ var __webpack_modules__ = ({
13
13
 
14
- /***/ "./helper-methods.js":
14
+ /***/ "./helper-methods.ts":
15
15
  /*!***************************!*\
16
- !*** ./helper-methods.js ***!
16
+ !*** ./helper-methods.ts ***!
17
17
  \***************************/
18
18
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
19
19
 
@@ -92,9 +92,9 @@ var dataOrBinsContainDates = function (_ref) {
92
92
  bins = _ref.bins,
93
93
  x = _ref.x;
94
94
  var xAccessor = victory_core__WEBPACK_IMPORTED_MODULE_5__.createAccessor(x || "x");
95
- var dataIsDates = data.some(function (datum) {
95
+ var dataIsDates = (data === null || data === void 0 ? void 0 : data.some(function (datum) {
96
96
  return xAccessor(datum) instanceof Date;
97
- });
97
+ })) || false;
98
98
  var binsHasDates = Array.isArray(bins) && bins.some(function (bin) {
99
99
  return bin instanceof Date;
100
100
  });
@@ -154,19 +154,21 @@ var getFormattedData = cacheLastValue(function (_ref3) {
154
154
  dataOrBinsContainsDates: dataOrBinsContainsDates
155
155
  });
156
156
  var foo = binFunc(data);
157
- var binnedData = foo.filter(function (_ref4) {
157
+
158
+ var binnedData = _toConsumableArray(foo).filter(function (_ref4) {
158
159
  var x0 = _ref4.x0,
159
160
  x1 = _ref4.x1;
160
161
 
161
- if (dataOrBinsContainsDates) {
162
+ if (x0 instanceof Date && x1 instanceof Date) {
162
163
  return new Date(x0).getTime() !== new Date(x1).getTime();
163
164
  }
164
165
 
165
166
  return x0 !== x1;
166
167
  });
168
+
167
169
  var formattedData = binnedData.map(function (bin) {
168
- var x0 = dataOrBinsContainsDates ? new Date(bin.x0) : bin.x0;
169
- var x1 = dataOrBinsContainsDates ? new Date(bin.x1) : bin.x1;
170
+ var x0 = dataOrBinsContainsDates ? new Date(bin.x0) : bin.x0 || 0;
171
+ var x1 = dataOrBinsContainsDates ? new Date(bin.x1) : bin.x1 || 0;
170
172
  return {
171
173
  x0: x0,
172
174
  x1: x1,
@@ -181,7 +183,7 @@ var getData = function (props) {
181
183
  var bins = props.bins,
182
184
  data = props.data,
183
185
  x = props.x;
184
- var dataIsPreformatted = data.some(function (_ref5) {
186
+ var dataIsPreformatted = data === null || data === void 0 ? void 0 : data.some(function (_ref5) {
185
187
  var _y = _ref5._y;
186
188
  return !lodash_isNil__WEBPACK_IMPORTED_MODULE_0___default()(_y);
187
189
  });
@@ -196,6 +198,8 @@ var getData = function (props) {
196
198
  }));
197
199
  };
198
200
  var getDomain = function (props, axis) {
201
+ var _props$data;
202
+
199
203
  var data = getData(props);
200
204
 
201
205
  if (!data.length) {
@@ -215,7 +219,7 @@ var getDomain = function (props, axis) {
215
219
  }), "x");
216
220
  }
217
221
 
218
- return props.data.length ? victory_core__WEBPACK_IMPORTED_MODULE_7__.getDomainWithZero(_objectSpread(_objectSpread({}, props), {}, {
222
+ return (_props$data = props.data) !== null && _props$data !== void 0 && _props$data.length ? victory_core__WEBPACK_IMPORTED_MODULE_7__.getDomainWithZero(_objectSpread(_objectSpread({}, props), {}, {
219
223
  data: data
220
224
  }), "y") : [0, 1];
221
225
  };
@@ -245,28 +249,29 @@ var getCalculatedValues = function (props) {
245
249
  };
246
250
  };
247
251
 
248
- var getBaseProps = function (props, fallbackProps) {
249
- var modifiedProps = victory_core__WEBPACK_IMPORTED_MODULE_5__.modifyProps(props, fallbackProps, "histogram");
250
- props = lodash_assign__WEBPACK_IMPORTED_MODULE_1___default()({}, modifiedProps, getCalculatedValues(modifiedProps));
251
- var _props = props,
252
- binSpacing = _props.binSpacing,
253
- cornerRadius = _props.cornerRadius,
254
- data = _props.data,
255
- domain = _props.domain,
256
- events = _props.events,
257
- height = _props.height,
258
- horizontal = _props.horizontal,
259
- padding = _props.padding,
260
- scale = _props.scale,
261
- sharedEvents = _props.sharedEvents,
262
- standalone = _props.standalone,
263
- style = _props.style,
264
- theme = _props.theme,
265
- width = _props.width,
266
- labels = _props.labels,
267
- name = _props.name,
268
- getPath = _props.getPath,
269
- disableInlineStyles = _props.disableInlineStyles;
252
+ var getBaseProps = function (initialProps, fallbackProps) {
253
+ var modifiedProps = victory_core__WEBPACK_IMPORTED_MODULE_5__.modifyProps(initialProps, fallbackProps, "histogram");
254
+
255
+ var props = lodash_assign__WEBPACK_IMPORTED_MODULE_1___default()({}, modifiedProps, getCalculatedValues(modifiedProps));
256
+
257
+ var binSpacing = props.binSpacing,
258
+ cornerRadius = props.cornerRadius,
259
+ data = props.data,
260
+ domain = props.domain,
261
+ events = props.events,
262
+ height = props.height,
263
+ horizontal = props.horizontal,
264
+ padding = props.padding,
265
+ scale = props.scale,
266
+ sharedEvents = props.sharedEvents,
267
+ standalone = props.standalone,
268
+ style = props.style,
269
+ theme = props.theme,
270
+ width = props.width,
271
+ labels = props.labels,
272
+ name = props.name,
273
+ getPath = props.getPath,
274
+ disableInlineStyles = props.disableInlineStyles;
270
275
  var initialChildProps = {
271
276
  parent: {
272
277
  horizontal: horizontal,
@@ -341,38 +346,27 @@ var getBaseProps = function (props, fallbackProps) {
341
346
 
342
347
  /***/ }),
343
348
 
344
- /***/ "./victory-histogram.js":
345
- /*!******************************!*\
346
- !*** ./victory-histogram.js ***!
347
- \******************************/
349
+ /***/ "./victory-histogram.tsx":
350
+ /*!*******************************!*\
351
+ !*** ./victory-histogram.tsx ***!
352
+ \*******************************/
348
353
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
349
354
 
350
355
  "use strict";
351
356
  __webpack_require__.r(__webpack_exports__);
352
357
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
353
- /* harmony export */ "VictoryHistogram": () => (/* binding */ VictoryHistogram),
354
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
358
+ /* harmony export */ "VictoryHistogram": () => (/* binding */ VictoryHistogram)
355
359
  /* harmony export */ });
356
360
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
357
361
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
358
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js");
359
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__);
360
- /* harmony import */ var victory_bar__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! victory-bar */ "../../victory-bar/es/bar.js");
362
+ /* harmony import */ var victory_bar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-bar */ "../../victory-bar/es/bar.js");
361
363
  /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
362
364
  /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/user-props.js");
363
- /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/common-props.js");
364
- /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/prop-types.js");
365
- /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
366
- /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-label/victory-label.js");
367
- /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-theme/victory-theme.js");
368
- /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/add-events.js");
369
- /* harmony import */ var _helper_methods__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helper-methods */ "./helper-methods.js");
370
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
371
-
372
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
373
-
374
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
375
-
365
+ /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
366
+ /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-label/victory-label.js");
367
+ /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-theme/victory-theme.js");
368
+ /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/add-events.js");
369
+ /* harmony import */ var _helper_methods__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helper-methods */ "./helper-methods.ts");
376
370
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
377
371
 
378
372
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -397,25 +391,29 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
397
391
 
398
392
 
399
393
 
400
-
401
394
  var fallbackProps = {
402
395
  width: 450,
403
396
  height: 300,
404
397
  padding: 50
405
398
  };
406
- var defaultData = [];
407
- var VictoryHistogram = /*#__PURE__*/function (_React$Component) {
408
- _inherits(VictoryHistogram, _React$Component);
399
+ var defaultData = []; // eslint-disable-next-line @typescript-eslint/no-empty-interface
400
+
401
+ /**
402
+ * Draw SVG histogram charts with React. VictoryHistogram is a composable component, so it doesn't include axes
403
+ * Check out VictoryChart for complete histogram charts and more.
404
+ */
405
+ var VictoryHistogramBase = /*#__PURE__*/function (_React$Component) {
406
+ _inherits(VictoryHistogramBase, _React$Component);
409
407
 
410
- var _super = _createSuper(VictoryHistogram);
408
+ var _super = _createSuper(VictoryHistogramBase);
411
409
 
412
- function VictoryHistogram() {
413
- _classCallCheck(this, VictoryHistogram);
410
+ function VictoryHistogramBase() {
411
+ _classCallCheck(this, VictoryHistogramBase);
414
412
 
415
413
  return _super.apply(this, arguments);
416
414
  }
417
415
 
418
- _createClass(VictoryHistogram, [{
416
+ _createClass(VictoryHistogramBase, [{
419
417
  key: "shouldAnimate",
420
418
  value: // Overridden in native versions
421
419
  function shouldAnimate() {
@@ -424,8 +422,8 @@ var VictoryHistogram = /*#__PURE__*/function (_React$Component) {
424
422
  }, {
425
423
  key: "render",
426
424
  value: function render() {
427
- var animationWhitelist = VictoryHistogram.animationWhitelist,
428
- role = VictoryHistogram.role;
425
+ var animationWhitelist = VictoryHistogramBase.animationWhitelist,
426
+ role = VictoryHistogramBase.role;
429
427
  var props = victory_core__WEBPACK_IMPORTED_MODULE_1__.modifyProps(this.props, fallbackProps, role);
430
428
 
431
429
  if (this.shouldAnimate()) {
@@ -438,12 +436,13 @@ var VictoryHistogram = /*#__PURE__*/function (_React$Component) {
438
436
  }
439
437
  }]);
440
438
 
441
- return VictoryHistogram;
439
+ return VictoryHistogramBase;
442
440
  }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
443
- VictoryHistogram.animationWhitelist = ["data", "domain", "height", "padding", "style", "width"];
444
- VictoryHistogram.displayName = "VictoryHistogram";
445
- VictoryHistogram.role = "histogram";
446
- VictoryHistogram.defaultTransitions = {
441
+
442
+ VictoryHistogramBase.animationWhitelist = ["data", "domain", "height", "padding", "style", "width"];
443
+ VictoryHistogramBase.displayName = "VictoryHistogram";
444
+ VictoryHistogramBase.role = "histogram";
445
+ VictoryHistogramBase.defaultTransitions = {
447
446
  onLoad: {
448
447
  duration: 2000,
449
448
  before: function () {
@@ -488,43 +487,29 @@ VictoryHistogram.defaultTransitions = {
488
487
  }
489
488
  }
490
489
  };
491
- VictoryHistogram.getFormattedData = _helper_methods__WEBPACK_IMPORTED_MODULE_3__.getFormattedData;
492
- VictoryHistogram.propTypes = _objectSpread(_objectSpread(_objectSpread({}, victory_core__WEBPACK_IMPORTED_MODULE_4__.CommonProps.baseProps), victory_core__WEBPACK_IMPORTED_MODULE_4__.CommonProps.dataProps), {}, {
493
- binSpacing: victory_core__WEBPACK_IMPORTED_MODULE_5__.nonNegative,
494
- bins: prop_types__WEBPACK_IMPORTED_MODULE_6___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_6___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_6___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_6___default().number), prop_types__WEBPACK_IMPORTED_MODULE_6___default().instanceOf(Date)])), victory_core__WEBPACK_IMPORTED_MODULE_5__.nonNegative]),
495
- cornerRadius: prop_types__WEBPACK_IMPORTED_MODULE_6___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_6___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_6___default().func), prop_types__WEBPACK_IMPORTED_MODULE_6___default().shape({
496
- top: prop_types__WEBPACK_IMPORTED_MODULE_6___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_6___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_6___default().func)]),
497
- topLeft: prop_types__WEBPACK_IMPORTED_MODULE_6___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_6___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_6___default().func)]),
498
- topRight: prop_types__WEBPACK_IMPORTED_MODULE_6___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_6___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_6___default().func)]),
499
- bottom: prop_types__WEBPACK_IMPORTED_MODULE_6___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_6___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_6___default().func)]),
500
- bottomLeft: prop_types__WEBPACK_IMPORTED_MODULE_6___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_6___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_6___default().func)]),
501
- bottomRight: prop_types__WEBPACK_IMPORTED_MODULE_6___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_6___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_6___default().func)])
502
- })]),
503
- getPath: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().func),
504
- horizontal: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().bool)
505
- });
506
- VictoryHistogram.defaultProps = {
507
- containerComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_7__.VictoryContainer, null),
490
+ VictoryHistogramBase.getFormattedData = _helper_methods__WEBPACK_IMPORTED_MODULE_3__.getFormattedData;
491
+ VictoryHistogramBase.defaultProps = {
492
+ containerComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_4__.VictoryContainer, null),
508
493
  data: defaultData,
509
- dataComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_bar__WEBPACK_IMPORTED_MODULE_8__.Bar, null),
494
+ dataComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_bar__WEBPACK_IMPORTED_MODULE_5__.Bar, null),
510
495
  groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", {
511
496
  role: "presentation"
512
497
  }),
513
- labelComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_9__.VictoryLabel, null),
498
+ labelComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_6__.VictoryLabel, null),
514
499
  samples: 50,
515
500
  sortOrder: "ascending",
516
501
  standalone: true,
517
- theme: victory_core__WEBPACK_IMPORTED_MODULE_10__.VictoryTheme.grayscale
502
+ theme: victory_core__WEBPACK_IMPORTED_MODULE_7__.VictoryTheme.grayscale
518
503
  };
519
- VictoryHistogram.getDomain = _helper_methods__WEBPACK_IMPORTED_MODULE_3__.getDomain;
520
- VictoryHistogram.getData = _helper_methods__WEBPACK_IMPORTED_MODULE_3__.getData;
504
+ VictoryHistogramBase.getDomain = _helper_methods__WEBPACK_IMPORTED_MODULE_3__.getDomain;
505
+ VictoryHistogramBase.getData = _helper_methods__WEBPACK_IMPORTED_MODULE_3__.getData;
521
506
 
522
- VictoryHistogram.getBaseProps = function (props) {
507
+ VictoryHistogramBase.getBaseProps = function (props) {
523
508
  return (0,_helper_methods__WEBPACK_IMPORTED_MODULE_3__.getBaseProps)(props, fallbackProps);
524
509
  };
525
510
 
526
- VictoryHistogram.expectedComponents = ["dataComponent", "labelComponent", "groupComponent", "containerComponent"];
527
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,victory_core__WEBPACK_IMPORTED_MODULE_11__.addEvents)(VictoryHistogram));
511
+ VictoryHistogramBase.expectedComponents = ["dataComponent", "labelComponent", "groupComponent", "containerComponent"];
512
+ var VictoryHistogram = (0,victory_core__WEBPACK_IMPORTED_MODULE_8__.addEvents)(VictoryHistogramBase);
528
513
 
529
514
  /***/ }),
530
515
 
@@ -7341,14 +7326,13 @@ var defaultProps = {
7341
7326
  shapeRendering: "auto"
7342
7327
  }; // eslint-disable-next-line prefer-arrow-callback
7343
7328
 
7344
- var Bar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function Bar(props, ref) {
7345
- props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), props));
7346
- var _props = props,
7347
- polar = _props.polar,
7348
- origin = _props.origin,
7349
- style = _props.style,
7350
- barWidth = _props.barWidth,
7351
- cornerRadius = _props.cornerRadius;
7329
+ var Bar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function Bar(initialProps, ref) {
7330
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
7331
+ var polar = props.polar,
7332
+ origin = props.origin,
7333
+ style = props.style,
7334
+ barWidth = props.barWidth,
7335
+ cornerRadius = props.cornerRadius;
7352
7336
  var path = polar ? (0,_path_helper_methods__WEBPACK_IMPORTED_MODULE_5__.getPolarBarPath)(props, cornerRadius) : (0,_path_helper_methods__WEBPACK_IMPORTED_MODULE_5__.getBarPath)(props, barWidth, cornerRadius);
7353
7337
  var defaultTransform = polar && origin ? "translate(".concat(origin.x, ", ").concat(origin.y, ")") : undefined;
7354
7338
 
@@ -7576,32 +7560,33 @@ var getCalculatedValues = function (props) {
7576
7560
  };
7577
7561
  };
7578
7562
 
7579
- var getBaseProps = function (props, fallbackProps) {
7580
- var modifiedProps = victory_core__WEBPACK_IMPORTED_MODULE_4__.modifyProps(props, fallbackProps, "bar");
7581
- props = lodash_assign__WEBPACK_IMPORTED_MODULE_1___default()({}, modifiedProps, getCalculatedValues(modifiedProps));
7582
- var _props = props,
7583
- alignment = _props.alignment,
7584
- barRatio = _props.barRatio,
7585
- cornerRadius = _props.cornerRadius,
7586
- data = _props.data,
7587
- disableInlineStyles = _props.disableInlineStyles,
7588
- domain = _props.domain,
7589
- events = _props.events,
7590
- height = _props.height,
7591
- horizontal = _props.horizontal,
7592
- origin = _props.origin,
7593
- padding = _props.padding,
7594
- polar = _props.polar,
7595
- scale = _props.scale,
7596
- sharedEvents = _props.sharedEvents,
7597
- standalone = _props.standalone,
7598
- style = _props.style,
7599
- theme = _props.theme,
7600
- width = _props.width,
7601
- labels = _props.labels,
7602
- name = _props.name,
7603
- barWidth = _props.barWidth,
7604
- getPath = _props.getPath;
7563
+ var getBaseProps = function (initialProps, fallbackProps) {
7564
+ var modifiedProps = victory_core__WEBPACK_IMPORTED_MODULE_4__.modifyProps(initialProps, fallbackProps, "bar");
7565
+
7566
+ var props = lodash_assign__WEBPACK_IMPORTED_MODULE_1___default()({}, modifiedProps, getCalculatedValues(modifiedProps));
7567
+
7568
+ var alignment = props.alignment,
7569
+ barRatio = props.barRatio,
7570
+ cornerRadius = props.cornerRadius,
7571
+ data = props.data,
7572
+ disableInlineStyles = props.disableInlineStyles,
7573
+ domain = props.domain,
7574
+ events = props.events,
7575
+ height = props.height,
7576
+ horizontal = props.horizontal,
7577
+ origin = props.origin,
7578
+ padding = props.padding,
7579
+ polar = props.polar,
7580
+ scale = props.scale,
7581
+ sharedEvents = props.sharedEvents,
7582
+ standalone = props.standalone,
7583
+ style = props.style,
7584
+ theme = props.theme,
7585
+ width = props.width,
7586
+ labels = props.labels,
7587
+ name = props.name,
7588
+ barWidth = props.barWidth,
7589
+ getPath = props.getPath;
7605
7590
  var initialChildProps = {
7606
7591
  parent: {
7607
7592
  horizontal: horizontal,
@@ -7753,9 +7738,11 @@ var transformAngle = function (angle) {
7753
7738
  var getCustomBarPath = function (props, width) {
7754
7739
  var getPath = props.getPath;
7755
7740
 
7756
- var propsWithCalculatedValues = _objectSpread(_objectSpread({}, props), getPosition(props, width));
7741
+ if (typeof getPath === "function") {
7742
+ var propsWithCalculatedValues = _objectSpread(_objectSpread({}, props), getPosition(props, width));
7757
7743
 
7758
- return getPath(propsWithCalculatedValues);
7744
+ return getPath(propsWithCalculatedValues);
7745
+ }
7759
7746
  };
7760
7747
 
7761
7748
  var getStartAngle = function (props, index) {
@@ -7800,8 +7787,7 @@ var mapPointsToPath = function (coords, cornerRadius, direction) {
7800
7787
  var bottomRightPath = "".concat(cornerRadius.bottomRight, " ").concat(cornerRadius.bottomRight, " ").concat(direction);
7801
7788
  var commands = ["M", "A ".concat(bottomLeftPath, ","), "L", "A ".concat(topLeftPath, ","), "L", "A ".concat(topRightPath, ","), "L", "A ".concat(bottomRightPath, ",")];
7802
7789
  var path = commands.reduce(function (acc, command, i) {
7803
- acc += "".concat(command, " ").concat(coords[i].x, ", ").concat(coords[i].y, " \n");
7804
- return acc;
7790
+ return "".concat(acc).concat(command, " ").concat(coords[i].x, ", ").concat(coords[i].y, " \n");
7805
7791
  }, "");
7806
7792
  return "".concat(path, " z");
7807
7793
  };
@@ -8024,8 +8010,8 @@ var getVerticalPolarBarPath = function (props, cornerRadius) {
8024
8010
  start = alignment === "start" ? currentAngle : currentAngle - size;
8025
8011
  end = alignment === "end" ? currentAngle : currentAngle + size;
8026
8012
  } else {
8027
- start = getStartAngle(props, index);
8028
- end = getEndAngle(props, index);
8013
+ start = getStartAngle(props, Number(index));
8014
+ end = getEndAngle(props, Number(index));
8029
8015
  }
8030
8016
 
8031
8017
  var getPath = function (edge) {
@@ -8153,8 +8139,7 @@ var getVerticalPolarBarPath = function (props, cornerRadius) {
8153
8139
  var bottomPath = getBottomPath();
8154
8140
  var moves = [].concat(_toConsumableArray(topPath), _toConsumableArray(bottomPath));
8155
8141
  var path = moves.reduce(function (memo, move) {
8156
- memo += "".concat(move.command, " ").concat(move.coords.join());
8157
- return memo;
8142
+ return "".concat(memo).concat(move.command, " ").concat(move.coords.join());
8158
8143
  }, "");
8159
8144
  return "".concat(path, " z");
8160
8145
  };
@@ -8295,12 +8280,12 @@ var interpolateFunction = function (a, b) {
8295
8280
  * differs in that it uses our custom interpolators when interpolating the value of each property in
8296
8281
  * an object. This allows the correct interpolation of nested objects, including styles
8297
8282
  *
8298
- * @param {any} a - Start value.
8299
- * @param {any} b - End value.
8283
+ * @param {any} startValue - Start value.
8284
+ * @param {any} endValue - End value.
8300
8285
  * @returns {Function} An interpolation function.
8301
8286
  */
8302
8287
 
8303
- var interpolateObject = function (a, b) {
8288
+ var interpolateObject = function (startValue, endValue) {
8304
8289
  var interpolateTypes = function (x, y) {
8305
8290
  if (x === y || !isInterpolatable(x) || !isInterpolatable(y)) {
8306
8291
  return interpolateImmediate(x, y);
@@ -8325,6 +8310,8 @@ var interpolateObject = function (a, b) {
8325
8310
 
8326
8311
  var i = {};
8327
8312
  var c = {};
8313
+ var a = startValue;
8314
+ var b = endValue;
8328
8315
  var k;
8329
8316
 
8330
8317
  if (a === null || typeof a !== "object") {
@@ -8492,8 +8479,8 @@ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
8492
8479
  step can generate imprecise values, sometimes greater than 1
8493
8480
  if this happens set the state to 1 and return, cancelling the timer
8494
8481
  */
8495
- duration = duration !== undefined ? duration : _this.props.duration;
8496
- var step = duration ? elapsed / duration : 1;
8482
+ var animationDuration = duration !== undefined ? duration : _this.props.duration;
8483
+ var step = animationDuration ? elapsed / animationDuration : 1;
8497
8484
 
8498
8485
  if (step >= 1) {
8499
8486
  _this.setState({
@@ -9109,8 +9096,7 @@ var getStyles = function (style, props) {
9109
9096
  }
9110
9097
 
9111
9098
  var getSingleStyle = function (s) {
9112
- s = s ? lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, s, defaultStyles) : defaultStyles;
9113
- var baseStyles = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(s, props);
9099
+ var baseStyles = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(s ? lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, s, defaultStyles) : defaultStyles, props);
9114
9100
  return lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, baseStyles, {
9115
9101
  fontSize: getFontSize(baseStyles)
9116
9102
  });
@@ -9314,22 +9300,19 @@ var getInlineXOffset = function (calculatedProps, textElements, index) {
9314
9300
  switch (textAnchor) {
9315
9301
  case "start":
9316
9302
  return widths.reduce(function (memo, width, i) {
9317
- memo = i < index ? memo + width : memo;
9318
- return memo;
9303
+ return i < index ? memo + width : memo;
9319
9304
  }, 0);
9320
9305
 
9321
9306
  case "end":
9322
9307
  return widths.reduce(function (memo, width, i) {
9323
- memo = i > index ? memo - width : memo;
9324
- return memo;
9308
+ return i > index ? memo - width : memo;
9325
9309
  }, 0);
9326
9310
 
9327
9311
  default:
9328
9312
  // middle
9329
9313
  return widths.reduce(function (memo, width, i) {
9330
9314
  var offsetWidth = i < index ? width : 0;
9331
- memo = i === index ? memo + width / 2 : memo + offsetWidth;
9332
- return memo;
9315
+ return i === index ? memo + width / 2 : memo + offsetWidth;
9333
9316
  }, centerOffset);
9334
9317
  }
9335
9318
  };
@@ -9531,8 +9514,8 @@ var defaultProps = {
9531
9514
  // Magic number from d3.
9532
9515
  lineHeight: 1
9533
9516
  };
9534
- var VictoryLabel = function (props) {
9535
- props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), props));
9517
+ var VictoryLabel = function (initialProps) {
9518
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
9536
9519
 
9537
9520
  if (props.text === null || props.text === undefined) {
9538
9521
  return null;
@@ -9553,7 +9536,7 @@ var VictoryLabel = function (props) {
9553
9536
  fontSize: currentStyle.fontSize || defaultStyles.fontSize,
9554
9537
  capHeight: capHeightPx,
9555
9538
  text: line,
9556
- // @ts-expect-error TODO: This looks like a bug:
9539
+ // TODO: This looks like a bug:
9557
9540
  textSize: _victory_util_textsize__WEBPACK_IMPORTED_MODULE_12__.approximateTextSize(line, currentStyle),
9558
9541
  lineHeight: currentLineHeight,
9559
9542
  backgroundPadding: getSingleValue(backgroundPadding, i)
@@ -11245,8 +11228,7 @@ function addEvents(WrappedComponent) {
11245
11228
  value: function applyExternalMutations(props, externalMutations) {
11246
11229
  if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_5___default()(externalMutations)) {
11247
11230
  var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
11248
- memo = lodash_isFunction__WEBPACK_IMPORTED_MODULE_4___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
11249
- return memo;
11231
+ return lodash_isFunction__WEBPACK_IMPORTED_MODULE_4___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
11250
11232
  }, []);
11251
11233
  var compiledCallbacks = callbacks.length ? function () {
11252
11234
  callbacks.forEach(function (c) {
@@ -11301,8 +11283,8 @@ function addEvents(WrappedComponent) {
11301
11283
  }, {
11302
11284
  key: "getBaseProps",
11303
11285
  value: function getBaseProps(props, getSharedEventState) {
11304
- getSharedEventState = getSharedEventState || this.getSharedEventState.bind(this);
11305
- var sharedParentState = getSharedEventState("parent", "parent");
11286
+ var getSharedEventStateFunction = getSharedEventState || this.getSharedEventState.bind(this);
11287
+ var sharedParentState = getSharedEventStateFunction("parent", "parent");
11306
11288
  var parentState = this.getEventState("parent", "parent");
11307
11289
 
11308
11290
  var baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_7___default()({}, parentState, sharedParentState);
@@ -11401,13 +11383,15 @@ function addEvents(WrappedComponent) {
11401
11383
  var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_0___default()(this.dataKeys, "all");
11402
11384
 
11403
11385
  var labelComponents = dataKeys.reduce(function (memo, key) {
11386
+ var newMemo = memo;
11387
+
11404
11388
  var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
11405
11389
 
11406
11390
  if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
11407
- memo = memo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
11391
+ newMemo = newMemo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
11408
11392
  }
11409
11393
 
11410
- return memo;
11394
+ return newMemo;
11411
11395
  }, []);
11412
11396
  var dataProps = this.getComponentProps(dataComponent, "data", "all");
11413
11397
  var children = [/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
@@ -11536,155 +11520,6 @@ function getMinValue(arr) {
11536
11520
 
11537
11521
  /***/ }),
11538
11522
 
11539
- /***/ "../../victory-core/es/victory-util/common-props.js":
11540
- /*!**********************************************************!*\
11541
- !*** ../../victory-core/es/victory-util/common-props.js ***!
11542
- \**********************************************************/
11543
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
11544
-
11545
- "use strict";
11546
- __webpack_require__.r(__webpack_exports__);
11547
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11548
- /* harmony export */ "CommonProps": () => (/* binding */ CommonProps)
11549
- /* harmony export */ });
11550
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js");
11551
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);
11552
- /* harmony import */ var _prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./prop-types */ "../../victory-core/es/victory-util/prop-types.js");
11553
-
11554
-
11555
- var dataProps = {
11556
- // @ts-expect-error TODO: synchronize the type with this PropTypes
11557
- categories: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)), prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
11558
- x: prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)),
11559
- y: prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().string))
11560
- })]),
11561
- // @ts-expect-error TODO: synchronize the type with this PropTypes
11562
- data: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().array), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)]),
11563
- dataComponent: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().element),
11564
- disableInlineStyles: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
11565
- labelComponent: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().element),
11566
- labels: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().func), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array)]),
11567
- samples: _prop_types__WEBPACK_IMPORTED_MODULE_1__.nonNegative,
11568
- sortKey: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().func), _prop_types__WEBPACK_IMPORTED_MODULE_1__.allOfType([_prop_types__WEBPACK_IMPORTED_MODULE_1__.integer, _prop_types__WEBPACK_IMPORTED_MODULE_1__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().string.isRequired))]),
11569
- sortOrder: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(["ascending", "descending"]),
11570
- style: prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
11571
- parent: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
11572
- data: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
11573
- labels: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)
11574
- }),
11575
- x: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().func), _prop_types__WEBPACK_IMPORTED_MODULE_1__.allOfType([_prop_types__WEBPACK_IMPORTED_MODULE_1__.integer, _prop_types__WEBPACK_IMPORTED_MODULE_1__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().string.isRequired))]),
11576
- y: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().func), _prop_types__WEBPACK_IMPORTED_MODULE_1__.allOfType([_prop_types__WEBPACK_IMPORTED_MODULE_1__.integer, _prop_types__WEBPACK_IMPORTED_MODULE_1__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().string.isRequired))]),
11577
- y0: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().func), _prop_types__WEBPACK_IMPORTED_MODULE_1__.allOfType([_prop_types__WEBPACK_IMPORTED_MODULE_1__.integer, _prop_types__WEBPACK_IMPORTED_MODULE_1__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().string.isRequired))])
11578
- };
11579
- var baseProps = {
11580
- animate: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)]),
11581
- containerComponent: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().element),
11582
- domain: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([_prop_types__WEBPACK_IMPORTED_MODULE_1__.domain, prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
11583
- x: _prop_types__WEBPACK_IMPORTED_MODULE_1__.domain,
11584
- y: _prop_types__WEBPACK_IMPORTED_MODULE_1__.domain
11585
- })]),
11586
- // @ts-expect-error TODO: synchronize the type with this PropTypes
11587
- maxDomain: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().number), prop_types__WEBPACK_IMPORTED_MODULE_0___default().instanceOf(Date), prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
11588
- x: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().number), prop_types__WEBPACK_IMPORTED_MODULE_0___default().instanceOf(Date)]),
11589
- y: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().number), prop_types__WEBPACK_IMPORTED_MODULE_0___default().instanceOf(Date)])
11590
- })]),
11591
- // @ts-expect-error TODO: synchronize the type with this PropTypes
11592
- minDomain: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().number), prop_types__WEBPACK_IMPORTED_MODULE_0___default().instanceOf(Date), prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
11593
- x: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().number), prop_types__WEBPACK_IMPORTED_MODULE_0___default().instanceOf(Date)]),
11594
- y: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().number), prop_types__WEBPACK_IMPORTED_MODULE_0___default().instanceOf(Date)])
11595
- })]),
11596
- // @ts-expect-error TODO: synchronize the type with this PropTypes
11597
- domainPadding: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
11598
- x: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().number), prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().number))]),
11599
- y: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().number), prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().number))])
11600
- }), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number), prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().number))]),
11601
- eventKey: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().func), _prop_types__WEBPACK_IMPORTED_MODULE_1__.allOfType([_prop_types__WEBPACK_IMPORTED_MODULE_1__.integer, _prop_types__WEBPACK_IMPORTED_MODULE_1__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)]),
11602
- events: prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
11603
- target: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(["data", "labels", "parent"]),
11604
- eventKey: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().array), _prop_types__WEBPACK_IMPORTED_MODULE_1__.allOfType([_prop_types__WEBPACK_IMPORTED_MODULE_1__.integer, _prop_types__WEBPACK_IMPORTED_MODULE_1__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)]),
11605
- eventHandlers: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)
11606
- })),
11607
- // @ts-expect-error TODO: synchronize the type with this PropTypes
11608
- externalEventMutations: prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
11609
- callback: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
11610
- childName: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array)]),
11611
- eventKey: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().array), _prop_types__WEBPACK_IMPORTED_MODULE_1__.allOfType([_prop_types__WEBPACK_IMPORTED_MODULE_1__.integer, _prop_types__WEBPACK_IMPORTED_MODULE_1__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)]),
11612
- mutation: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
11613
- target: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array)])
11614
- })),
11615
- groupComponent: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().element),
11616
- height: _prop_types__WEBPACK_IMPORTED_MODULE_1__.nonNegative,
11617
- name: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
11618
- // @ts-expect-error TODO: synchronize the type with this PropTypes
11619
- origin: prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
11620
- x: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
11621
- y: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)
11622
- }),
11623
- // @ts-expect-error TODO: synchronize the type with this PropTypes
11624
- padding: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().number), prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
11625
- top: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
11626
- bottom: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
11627
- left: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
11628
- right: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)
11629
- })]),
11630
- polar: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
11631
- range: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([_prop_types__WEBPACK_IMPORTED_MODULE_1__.domain, prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
11632
- x: _prop_types__WEBPACK_IMPORTED_MODULE_1__.domain.isRequired,
11633
- y: _prop_types__WEBPACK_IMPORTED_MODULE_1__.domain.isRequired
11634
- })]),
11635
- scale: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([_prop_types__WEBPACK_IMPORTED_MODULE_1__.scale, prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
11636
- x: _prop_types__WEBPACK_IMPORTED_MODULE_1__.scale.isRequired,
11637
- y: _prop_types__WEBPACK_IMPORTED_MODULE_1__.scale.isRequired
11638
- })]),
11639
- // @ts-expect-error TODO: synchronize the type with this PropTypes
11640
- sharedEvents: prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
11641
- events: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array),
11642
- getEventState: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)
11643
- }),
11644
- // @ts-expect-error TODO: synchronize the type with this PropTypes
11645
- singleQuadrantDomainPadding: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool), prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
11646
- x: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)]),
11647
- y: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)])
11648
- })]),
11649
- standalone: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
11650
- theme: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
11651
- width: _prop_types__WEBPACK_IMPORTED_MODULE_1__.nonNegative
11652
- };
11653
- var primitiveProps = {
11654
- active: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
11655
- ariaLabel: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)]),
11656
- className: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
11657
- clipPath: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
11658
- data: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().array), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)]),
11659
- desc: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)]),
11660
- disableInlineStyles: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
11661
- events: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
11662
- id: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)]),
11663
- index: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)]),
11664
- // @ts-expect-error TODO: synchronize the type with this PropTypes
11665
- origin: prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
11666
- x: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
11667
- y: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)
11668
- }),
11669
- polar: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
11670
- role: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
11671
- scale: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([_prop_types__WEBPACK_IMPORTED_MODULE_1__.scale, prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
11672
- x: _prop_types__WEBPACK_IMPORTED_MODULE_1__.scale,
11673
- y: _prop_types__WEBPACK_IMPORTED_MODULE_1__.scale
11674
- })]),
11675
- shapeRendering: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
11676
- style: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
11677
- tabIndex: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)]),
11678
- transform: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)
11679
- };
11680
- var CommonProps = {
11681
- dataProps: dataProps,
11682
- baseProps: baseProps,
11683
- primitiveProps: primitiveProps
11684
- };
11685
-
11686
- /***/ }),
11687
-
11688
11523
  /***/ "../../victory-core/es/victory-util/data.js":
11689
11524
  /*!**************************************************!*\
11690
11525
  !*** ../../victory-core/es/victory-util/data.js ***!
@@ -11806,12 +11641,14 @@ function sortData(dataset, sortKey) {
11806
11641
  } // Ensures previous VictoryLine api for sortKey prop stays consistent
11807
11642
 
11808
11643
 
11644
+ var formattedSortKey = sortKey;
11645
+
11809
11646
  if (sortKey === "x" || sortKey === "y") {
11810
- sortKey = "_".concat(sortKey);
11647
+ formattedSortKey = "_".concat(sortKey);
11811
11648
  }
11812
11649
 
11813
11650
  var order = sortOrder === "ascending" ? "asc" : "desc";
11814
- return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset, sortKey, order);
11651
+ return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset, formattedSortKey, order);
11815
11652
  } // This method will remove data points that break certain scales. (log scale only)
11816
11653
 
11817
11654
 
@@ -12002,7 +11839,10 @@ function formatData(dataset, props, expectedKeys) {
12002
11839
  return [];
12003
11840
  }
12004
11841
 
12005
- var defaultKeys = ["x", "y", "y0"];
11842
+ var defaultKeys = ["x", "y", "y0"]; // TODO: We shouldn’t mutate the expectedKeys param here,
11843
+ // but we need to figure out why changing it causes regressions in tests.
11844
+ // eslint-disable-next-line no-param-reassign
11845
+
12006
11846
  expectedKeys = Array.isArray(expectedKeys) ? expectedKeys : defaultKeys;
12007
11847
 
12008
11848
  var createAccessor = function (name) {
@@ -12027,13 +11867,13 @@ function formatData(dataset, props, expectedKeys) {
12027
11867
 
12028
11868
  var data = preformattedData ? dataset : dataset.reduce(function (dataArr, datum, index) {
12029
11869
  // eslint-disable-line complexity
12030
- datum = parseDatum(datum);
11870
+ var parsedDatum = parseDatum(datum);
12031
11871
  var fallbackValues = {
12032
11872
  x: index,
12033
- y: datum
11873
+ y: parsedDatum
12034
11874
  };
12035
11875
  var processedValues = expectedKeys.reduce(function (memo, type) {
12036
- var processedValue = accessor[type](datum);
11876
+ var processedValue = accessor[type](parsedDatum);
12037
11877
  var value = processedValue !== undefined ? processedValue : fallbackValues[type];
12038
11878
 
12039
11879
  if (value !== undefined) {
@@ -12048,7 +11888,7 @@ function formatData(dataset, props, expectedKeys) {
12048
11888
  return memo;
12049
11889
  }, {});
12050
11890
 
12051
- var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues, datum);
11891
+ var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues, parsedDatum);
12052
11892
 
12053
11893
  if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_4___default()(formattedDatum)) {
12054
11894
  dataArr.push(formattedDatum);
@@ -12159,8 +11999,8 @@ function getStringsFromData(props, axis) {
12159
11999
  }, []);
12160
12000
  var sortedData = sortData(data, props.sortKey, props.sortOrder);
12161
12001
  var dataStrings = sortedData.reduce(function (dataArr, datum) {
12162
- datum = parseDatum(datum);
12163
- dataArr.push(accessor(datum));
12002
+ var parsedDatum = parseDatum(datum);
12003
+ dataArr.push(accessor(parsedDatum));
12164
12004
  return dataArr;
12165
12005
  }, []).filter(function (datum) {
12166
12006
  return typeof datum === "string";
@@ -12404,18 +12244,18 @@ function padDomain(domain, props, axis) {
12404
12244
 
12405
12245
 
12406
12246
  function createDomainFunction(getDomainFromDataFunction, formatDomainFunction) {
12407
- getDomainFromDataFunction = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(getDomainFromDataFunction) ? getDomainFromDataFunction : getDomainFromData;
12408
- formatDomainFunction = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(formatDomainFunction) ? formatDomainFunction : formatDomain;
12247
+ var getDomainFromDataFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(getDomainFromDataFunction) ? getDomainFromDataFunction : getDomainFromData;
12248
+ var formatDomainFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(formatDomainFunction) ? formatDomainFunction : formatDomain;
12409
12249
  return function (props, axis) {
12410
12250
  var propsDomain = getDomainFromProps(props, axis);
12411
12251
 
12412
12252
  if (propsDomain) {
12413
- return formatDomainFunction(propsDomain, props, axis);
12253
+ return formatDomainFn(propsDomain, props, axis);
12414
12254
  }
12415
12255
 
12416
12256
  var categories = _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
12417
- var domain = categories ? getDomainFromCategories(props, axis, categories) : getDomainFromDataFunction(props, axis);
12418
- return domain ? formatDomainFunction(domain, props, axis) : undefined;
12257
+ var domain = categories ? getDomainFromCategories(props, axis, categories) : getDomainFromDataFn(props, axis);
12258
+ return domain ? formatDomainFn(domain, props, axis) : undefined;
12419
12259
  };
12420
12260
  }
12421
12261
  /**
@@ -12448,27 +12288,27 @@ function getDomain(props, axis) {
12448
12288
  */
12449
12289
 
12450
12290
  function getDomainFromCategories(props, axis, categories) {
12451
- categories = categories || _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
12291
+ var categoriesArray = categories || _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
12452
12292
  var polar = props.polar,
12453
12293
  _props$startAngle = props.startAngle,
12454
12294
  startAngle = _props$startAngle === void 0 ? 0 : _props$startAngle,
12455
12295
  _props$endAngle = props.endAngle,
12456
12296
  endAngle = _props$endAngle === void 0 ? 360 : _props$endAngle;
12457
12297
 
12458
- if (!categories) {
12298
+ if (!categoriesArray) {
12459
12299
  return undefined;
12460
12300
  }
12461
12301
 
12462
12302
  var minDomain = getMinFromProps(props, axis);
12463
12303
  var maxDomain = getMaxFromProps(props, axis);
12464
- var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(categories) ? _data__WEBPACK_IMPORTED_MODULE_10__.getStringsFromCategories(props, axis) : [];
12304
+ var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(categoriesArray) ? _data__WEBPACK_IMPORTED_MODULE_10__.getStringsFromCategories(props, axis) : [];
12465
12305
  var stringMap = stringArray.length === 0 ? null : stringArray.reduce(function (memo, string, index) {
12466
12306
  memo[string] = index + 1;
12467
12307
  return memo;
12468
12308
  }, {});
12469
- var categoryValues = stringMap ? categories.map(function (value) {
12309
+ var categoryValues = stringMap ? categoriesArray.map(function (value) {
12470
12310
  return stringMap[value];
12471
- }) : categories;
12311
+ }) : categoriesArray;
12472
12312
  var min = minDomain !== undefined ? minDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMinValue(categoryValues);
12473
12313
  var max = maxDomain !== undefined ? maxDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMaxValue(categoryValues);
12474
12314
  var categoryDomain = getDomainFromMinMax(min, max);
@@ -12483,7 +12323,7 @@ function getDomainFromCategories(props, axis, categories) {
12483
12323
  */
12484
12324
 
12485
12325
  function getDomainFromData(props, axis, dataset) {
12486
- dataset = dataset || _data__WEBPACK_IMPORTED_MODULE_10__.getData(props);
12326
+ var datasetArray = dataset || _data__WEBPACK_IMPORTED_MODULE_10__.getData(props);
12487
12327
  var polar = props.polar,
12488
12328
  _props$startAngle2 = props.startAngle,
12489
12329
  startAngle = _props$startAngle2 === void 0 ? 0 : _props$startAngle2,
@@ -12492,14 +12332,14 @@ function getDomainFromData(props, axis, dataset) {
12492
12332
  var minDomain = getMinFromProps(props, axis);
12493
12333
  var maxDomain = getMaxFromProps(props, axis);
12494
12334
 
12495
- if (dataset.length < 1) {
12335
+ if (datasetArray.length < 1) {
12496
12336
  return minDomain !== undefined && maxDomain !== undefined ? getDomainFromMinMax(minDomain, maxDomain) : undefined;
12497
12337
  }
12498
12338
 
12499
- var min = minDomain !== undefined ? minDomain : getExtremeFromData(dataset, axis, "min");
12500
- var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(dataset, axis, "max");
12339
+ var min = minDomain !== undefined ? minDomain : getExtremeFromData(datasetArray, axis, "min");
12340
+ var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(datasetArray, axis, "max");
12501
12341
  var domain = getDomainFromMinMax(min, max);
12502
- return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(dataset, axis)) : domain;
12342
+ return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(datasetArray, axis)) : domain;
12503
12343
  }
12504
12344
  /**
12505
12345
  * Returns a domain in the form of a two element array given a min and max value.
@@ -12812,14 +12652,14 @@ function getScopedEvents(events, namespace, childType, baseProps) {
12812
12652
  // eslint-disable-next-line no-invalid-this
12813
12653
 
12814
12654
 
12815
- baseProps = baseProps || this.baseProps; // returns the original base props or base state of a given target element
12655
+ var newBaseProps = baseProps || this.baseProps; // returns the original base props or base state of a given target element
12816
12656
 
12817
12657
  var getTargetProps = function (identifier, type) {
12818
12658
  var childName = identifier.childName,
12819
12659
  target = identifier.target,
12820
12660
  key = identifier.key; // eslint-disable-next-line no-invalid-this
12821
12661
 
12822
- var baseType = type === "props" ? baseProps : _this2.state || {};
12662
+ var baseType = type === "props" ? newBaseProps : _this2.state || {};
12823
12663
  var base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
12824
12664
  return key === "parent" ? base.parent : base[key] && base[key][target];
12825
12665
  }; // Returns the state object with the mutation caused by a given eventReturn
@@ -12907,8 +12747,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
12907
12747
 
12908
12748
  var parseEventReturn = function (eventReturn, eventKey) {
12909
12749
  return Array.isArray(eventReturn) ? eventReturn.reduce(function (memo, props) {
12910
- memo = lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, memo, parseEvent(props, eventKey));
12911
- return memo;
12750
+ return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, memo, parseEvent(props, eventKey));
12912
12751
  }, {}) : parseEvent(eventReturn, eventKey);
12913
12752
  };
12914
12753
 
@@ -12994,9 +12833,10 @@ function getEventState(eventKey, namespace, childType) {
12994
12833
  */
12995
12834
  // eslint-disable-next-line max-params
12996
12835
 
12997
- function getExternalMutationsWithChildren(mutations, baseProps, baseState, childNames) {
12998
- baseProps = baseProps || {};
12999
- baseState = baseState || {};
12836
+ function getExternalMutationsWithChildren(mutations) {
12837
+ var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12838
+ var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
12839
+ var childNames = arguments.length > 3 ? arguments[3] : undefined;
13000
12840
  return childNames.reduce(function (memo, childName) {
13001
12841
  var childState = baseState[childName];
13002
12842
  var mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
@@ -13018,9 +12858,10 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
13018
12858
  */
13019
12859
  // eslint-disable-next-line max-params
13020
12860
 
13021
- function getExternalMutations(mutations, baseProps, baseState, childName) {
13022
- baseProps = baseProps || {};
13023
- baseState = baseState || {};
12861
+ function getExternalMutations(mutations) {
12862
+ var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12863
+ var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
12864
+ var childName = arguments.length > 3 ? arguments[3] : undefined;
13024
12865
 
13025
12866
  var eventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps);
13026
12867
 
@@ -13086,8 +12927,7 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
13086
12927
  return false;
13087
12928
  };
13088
12929
 
13089
- mutations = Array.isArray(mutations) ? mutations : [mutations];
13090
- var scopedMutations = mutations;
12930
+ var scopedMutations = Array.isArray(mutations) ? mutations : [mutations];
13091
12931
 
13092
12932
  if (identifier.childName) {
13093
12933
  scopedMutations = mutations.filter(function (m) {
@@ -13126,13 +12966,10 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
13126
12966
 
13127
12967
  function getComponentEvents(props, components) {
13128
12968
  var events = Array.isArray(components) && components.reduce(function (memo, componentName) {
13129
- var _memo;
13130
-
13131
12969
  var component = props[componentName];
13132
12970
  var defaultEvents = component && component.type && component.type.defaultEvents;
13133
12971
  var componentEvents = lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(defaultEvents) ? defaultEvents(component.props) : defaultEvents;
13134
- memo = Array.isArray(componentEvents) ? (_memo = memo).concat.apply(_memo, _toConsumableArray(componentEvents)) : memo;
13135
- return memo;
12972
+ return Array.isArray(componentEvents) ? memo.concat.apply(memo, _toConsumableArray(componentEvents)) : memo;
13136
12973
  }, []);
13137
12974
  return events && events.length ? events : undefined;
13138
12975
  }
@@ -13490,6 +13327,7 @@ function reduceChildren(children, iteratee) {
13490
13327
 
13491
13328
  var traverseChildren = function (childArray, names, parent) {
13492
13329
  return childArray.reduce(function (memo, child, index) {
13330
+ var newMemo = memo;
13493
13331
  var childRole = child.type && child.type.role;
13494
13332
  var childName = child.props.name || "".concat(childRole, "-").concat(names[index]);
13495
13333
 
@@ -13507,16 +13345,16 @@ function reduceChildren(children, iteratee) {
13507
13345
  });
13508
13346
 
13509
13347
  var nestedResults = traverseChildren(nestedChildren, _childNames, child);
13510
- memo = combine(memo, nestedResults);
13348
+ newMemo = combine(newMemo, nestedResults);
13511
13349
  } else {
13512
13350
  var result = iteratee(child, childName, parent);
13513
13351
 
13514
13352
  if (result) {
13515
- memo = combine(memo, result);
13353
+ newMemo = combine(newMemo, result);
13516
13354
  }
13517
13355
  }
13518
13356
 
13519
- return memo;
13357
+ return newMemo;
13520
13358
  }, initialMemo);
13521
13359
  };
13522
13360
 
@@ -13542,8 +13380,7 @@ function isHorizontal(props) {
13542
13380
  var childProps = child.props || {};
13543
13381
 
13544
13382
  if (memo || childProps.horizontal || !childProps.children) {
13545
- memo = memo || childProps.horizontal;
13546
- return memo;
13383
+ return memo || childProps.horizontal;
13547
13384
  }
13548
13385
 
13549
13386
  return traverseChildren(react__WEBPACK_IMPORTED_MODULE_6___default().Children.toArray(childProps.children));
@@ -13596,11 +13433,13 @@ function isMap(x) {
13596
13433
  }
13597
13434
  function shallowToJS(x, whitelist) {
13598
13435
  return isIterable(x) ? x.reduce(function (result, curr, key) {
13436
+ var newCurr = curr;
13437
+
13599
13438
  if (whitelist && whitelist[key]) {
13600
- curr = shallowToJS(curr);
13439
+ newCurr = shallowToJS(curr);
13601
13440
  }
13602
13441
 
13603
- result[key] = curr;
13442
+ result[key] = newCurr;
13604
13443
  return result;
13605
13444
  }, isList(x) ? [] : {}) : x;
13606
13445
  }
@@ -13628,12 +13467,10 @@ __webpack_require__.r(__webpack_exports__);
13628
13467
  /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
13629
13468
 
13630
13469
 
13631
- /* eslint-disable no-use-before-define */
13632
-
13633
13470
 
13634
13471
  // Private Functions
13635
- function getVerticalAnchor(props, datum) {
13636
- datum = datum || {};
13472
+ function getVerticalAnchor(props) {
13473
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13637
13474
  var sign = datum._y >= 0 ? 1 : -1;
13638
13475
  var labelStyle = props.style && props.style.labels || {};
13639
13476
 
@@ -13646,8 +13483,8 @@ function getVerticalAnchor(props, datum) {
13646
13483
  return "middle";
13647
13484
  }
13648
13485
 
13649
- function getTextAnchor(props, datum) {
13650
- datum = datum || {};
13486
+ function getTextAnchor(props) {
13487
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13651
13488
  var style = props.style,
13652
13489
  horizontal = props.horizontal;
13653
13490
  var sign = datum._y >= 0 ? 1 : -1;
@@ -13662,14 +13499,14 @@ function getTextAnchor(props, datum) {
13662
13499
  return sign >= 0 ? "start" : "end";
13663
13500
  }
13664
13501
 
13665
- function getAngle(props, datum) {
13666
- datum = datum || {};
13502
+ function getAngle(props) {
13503
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13667
13504
  var labelStyle = props.style && props.style.labels || {};
13668
13505
  return datum.angle === undefined ? labelStyle.angle : datum.angle;
13669
13506
  }
13670
13507
 
13671
- function getPadding(props, datum) {
13672
- datum = datum || {};
13508
+ function getPadding(props) {
13509
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13673
13510
  var horizontal = props.horizontal,
13674
13511
  style = props.style;
13675
13512
  var labelStyle = style.labels || {};
@@ -13748,8 +13585,9 @@ function getPolarOrientation(degrees) {
13748
13585
  } // Exported Functions
13749
13586
 
13750
13587
 
13751
- function getText(props, datum, index) {
13752
- datum = datum || {};
13588
+ function getText(props) {
13589
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13590
+ var index = arguments.length > 2 ? arguments[2] : undefined;
13753
13591
 
13754
13592
  if (datum.label !== undefined) {
13755
13593
  return datum.label;
@@ -14909,11 +14747,10 @@ var Timer = /*#__PURE__*/function () {
14909
14747
  }, {
14910
14748
  key: "subscribe",
14911
14749
  value: function subscribe(callback, duration) {
14912
- duration = this.shouldAnimate ? duration : 0;
14913
14750
  var subscriptionID = this.subscribers.push({
14914
14751
  startTime: (0,victory_vendor_d3_timer__WEBPACK_IMPORTED_MODULE_0__.now)(),
14915
14752
  callback: callback,
14916
- duration: duration
14753
+ duration: this.shouldAnimate ? duration : 0
14917
14754
  });
14918
14755
  this.activeSubscriptions++;
14919
14756
  this.start();
@@ -15100,36 +14937,38 @@ function getInitialChildProps(animate, data) {
15100
14937
 
15101
14938
 
15102
14939
  function getChildBeforeLoad(animate, child, data, cb) {
15103
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
14940
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
15104
14941
  onEnd: cb
15105
14942
  });
15106
14943
 
15107
- if (animate && animate.onLoad && !animate.onLoad.duration) {
14944
+ if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
15108
14945
  return {
15109
- animate: animate,
14946
+ animate: newAnimate,
15110
14947
  data: data
15111
14948
  };
15112
14949
  }
15113
14950
 
15114
- 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.
14951
+ 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.
15115
14952
 
15116
- data = data.map(function (datum, idx) {
14953
+ var newData = data.map(function (datum, idx) {
15117
14954
  return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data));
15118
14955
  });
15119
14956
  return {
15120
- animate: animate,
15121
- data: data,
14957
+ animate: newAnimate,
14958
+ data: newData,
15122
14959
  clipWidth: 0
15123
14960
  };
15124
14961
  } // eslint-disable-next-line max-params
15125
14962
 
15126
14963
 
15127
14964
  function getChildOnLoad(animate, data, cb) {
15128
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
14965
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
15129
14966
  onEnd: cb
15130
14967
  });
15131
14968
 
15132
- if (animate && animate.onLoad && !animate.onLoad.duration) {
14969
+ var newData = data;
14970
+
14971
+ if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
15133
14972
  return {
15134
14973
  animate: animate,
15135
14974
  data: data
@@ -15138,12 +14977,12 @@ function getChildOnLoad(animate, data, cb) {
15138
14977
 
15139
14978
  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.
15140
14979
 
15141
- data = data.map(function (datum, idx) {
14980
+ newData = data.map(function (datum, idx) {
15142
14981
  return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data));
15143
14982
  });
15144
14983
  return {
15145
- animate: animate,
15146
- data: data
14984
+ animate: newAnimate,
14985
+ data: newData
15147
14986
  };
15148
14987
  } // eslint-disable-next-line max-params, max-len
15149
14988
 
@@ -15152,7 +14991,10 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
15152
14991
  // Whether or not _this_ child has exiting nodes, we want the exit-
15153
14992
  // transition for all children to have the same duration, delay, etc.
15154
14993
  var onExit = animate && animate.onExit;
15155
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onExit);
14994
+
14995
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onExit);
14996
+
14997
+ var newData = data;
15156
14998
 
15157
14999
  if (exitingNodes) {
15158
15000
  // After the exit transition occurs, trigger the animations for
@@ -15160,39 +15002,42 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
15160
15002
  animate.onEnd = cb;
15161
15003
  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.
15162
15004
 
15163
- data = data.map(function (datum, idx) {
15005
+ newData = data.map(function (datum, idx) {
15164
15006
  var key = (datum.key || idx).toString();
15165
15007
  return exitingNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
15166
15008
  });
15167
15009
  }
15168
15010
 
15169
15011
  return {
15170
- animate: animate,
15171
- data: data
15012
+ animate: newAnimate,
15013
+ data: newData
15172
15014
  };
15173
15015
  } // eslint-disable-next-line max-params,max-len
15174
15016
 
15175
15017
 
15176
15018
  function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
15019
+ var newAnimate = animate;
15020
+ var newData = data;
15021
+
15177
15022
  if (enteringNodes) {
15178
15023
  // Perform a normal animation here, except - when it finishes - trigger
15179
15024
  // the transition for entering nodes.
15180
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
15025
+ newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
15181
15026
  onEnd: cb
15182
15027
  });
15183
15028
  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
15184
15029
  // domain. However, we may not want these nodes to be displayed initially,
15185
15030
  // so perform the `onEnter.before` transformation on each node.
15186
15031
 
15187
- data = data.map(function (datum, idx) {
15032
+ newData = data.map(function (datum, idx) {
15188
15033
  var key = (datum.key || idx).toString();
15189
15034
  return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
15190
15035
  });
15191
15036
  }
15192
15037
 
15193
15038
  return {
15194
- animate: animate,
15195
- data: data
15039
+ animate: newAnimate,
15040
+ data: newData
15196
15041
  };
15197
15042
  } // eslint-disable-next-line max-params, max-len
15198
15043
 
@@ -15201,23 +15046,26 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
15201
15046
  // Whether or not _this_ child has entering nodes, we want the entering-
15202
15047
  // transition for all children to have the same duration, delay, etc.
15203
15048
  var onEnter = animate && animate.onEnter;
15204
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onEnter);
15049
+
15050
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onEnter);
15051
+
15052
+ var newData = data;
15205
15053
 
15206
15054
  if (enteringNodes) {
15207
15055
  // Old nodes have been transitioned to their new values, and the
15208
15056
  // domain should encompass the nodes that will now enter. So perform
15209
15057
  // the `onEnter.after` transformation on each node.
15210
- animate.onEnd = cb;
15211
- var after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default());
15212
- data = data.map(function (datum, idx) {
15058
+ newAnimate.onEnd = cb;
15059
+ var after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default());
15060
+ newData = data.map(function (datum, idx) {
15213
15061
  var key = getDatumKey(datum, idx);
15214
15062
  return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data)) : datum;
15215
15063
  });
15216
15064
  }
15217
15065
 
15218
15066
  return {
15219
- animate: animate,
15220
- data: data
15067
+ animate: newAnimate,
15068
+ data: newData
15221
15069
  };
15222
15070
  }
15223
15071
  /**
@@ -15383,6 +15231,7 @@ function getTransitionPropsFactory(props, state, setState) {
15383
15231
  "use strict";
15384
15232
  __webpack_require__.r(__webpack_exports__);
15385
15233
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15234
+ /* harmony export */ "assert": () => (/* binding */ assert),
15386
15235
  /* harmony export */ "getSafeUserProps": () => (/* binding */ getSafeUserProps),
15387
15236
  /* harmony export */ "withSafeUserProps": () => (/* binding */ withSafeUserProps)
15388
15237
  /* harmony export */ });
@@ -15463,6 +15312,18 @@ var testIfSafeProp = function (key) {
15463
15312
  if (doesPropStartWith(key) || isExactMatch(key)) return true;
15464
15313
  return false;
15465
15314
  };
15315
+ /**
15316
+ * Asserts that value is not null or undefined, throwing an error if it is.
15317
+ * @param value The value to assert
15318
+ * @param message The error message to throw
15319
+ */
15320
+
15321
+
15322
+ function assert(value, message) {
15323
+ if (value === undefined || value === null) {
15324
+ throw new Error(message);
15325
+ }
15326
+ }
15466
15327
  /**
15467
15328
  * getSafeUserProps - function that takes in a props object and removes any
15468
15329
  * key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
@@ -15472,7 +15333,6 @@ var testIfSafeProp = function (key) {
15472
15333
  * @returns {Object}: object containing remaining acceptable props
15473
15334
  */
15474
15335
 
15475
-
15476
15336
  var getSafeUserProps = function (props) {
15477
15337
  var propsToFilter = _objectSpread({}, props);
15478
15338
 
@@ -28107,13 +27967,13 @@ var __webpack_exports__ = {};
28107
27967
  (() => {
28108
27968
  "use strict";
28109
27969
  /*!******************!*\
28110
- !*** ./index.js ***!
27970
+ !*** ./index.ts ***!
28111
27971
  \******************/
28112
27972
  __webpack_require__.r(__webpack_exports__);
28113
27973
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
28114
- /* harmony export */ "VictoryHistogram": () => (/* reexport safe */ _victory_histogram__WEBPACK_IMPORTED_MODULE_0__["default"])
27974
+ /* harmony export */ "VictoryHistogram": () => (/* reexport safe */ _victory_histogram__WEBPACK_IMPORTED_MODULE_0__.VictoryHistogram)
28115
27975
  /* harmony export */ });
28116
- /* harmony import */ var _victory_histogram__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./victory-histogram */ "./victory-histogram.js");
27976
+ /* harmony import */ var _victory_histogram__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./victory-histogram */ "./victory-histogram.tsx");
28117
27977
 
28118
27978
  })();
28119
27979