victory-pie 36.8.1 → 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,16 +11,22 @@
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
 
20
20
  "use strict";
21
21
  __webpack_require__.r(__webpack_exports__);
22
22
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23
- /* harmony export */ "getBaseProps": () => (/* binding */ getBaseProps)
23
+ /* harmony export */ "getAverage": () => (/* binding */ getAverage),
24
+ /* harmony export */ "getBaseProps": () => (/* binding */ getBaseProps),
25
+ /* harmony export */ "getLabelIndicatorPropsForLineSegment": () => (/* binding */ getLabelIndicatorPropsForLineSegment),
26
+ /* harmony export */ "getXOffset": () => (/* binding */ getXOffset),
27
+ /* harmony export */ "getXOffsetMultiplayerByAngle": () => (/* binding */ getXOffsetMultiplayerByAngle),
28
+ /* harmony export */ "getYOffset": () => (/* binding */ getYOffset),
29
+ /* harmony export */ "getYOffsetMultiplayerByAngle": () => (/* binding */ getYOffsetMultiplayerByAngle)
24
30
  /* harmony export */ });
25
31
  /* harmony import */ var lodash_isNil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/isNil */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isNil.js");
26
32
  /* harmony import */ var lodash_isNil__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isNil__WEBPACK_IMPORTED_MODULE_0__);
@@ -89,7 +95,7 @@ var getSlices = function (props, data) {
89
95
  var getCalculatedValues = function (props) {
90
96
  var colorScale = props.colorScale;
91
97
  var styleObject = victory_core__WEBPACK_IMPORTED_MODULE_6__.getDefaultStyles(props, "pie");
92
- var style = victory_core__WEBPACK_IMPORTED_MODULE_6__.getStyles(props.style, styleObject, "auto", "100%");
98
+ var style = victory_core__WEBPACK_IMPORTED_MODULE_6__.getStyles(props.style, styleObject);
93
99
  var colors = Array.isArray(colorScale) ? colorScale : victory_core__WEBPACK_IMPORTED_MODULE_7__.getColorScale(colorScale);
94
100
  var padding = victory_core__WEBPACK_IMPORTED_MODULE_6__.getPadding(props);
95
101
  var defaultRadius = getRadius(props, padding);
@@ -130,10 +136,13 @@ var getLabelText = function (props, datum, index) {
130
136
  return checkForValidText(text);
131
137
  };
132
138
 
133
- var getLabelArc = function (radius, labelRadius, style) {
139
+ var getLabelArc = function (labelRadius) {
140
+ return victory_vendor_d3_shape__WEBPACK_IMPORTED_MODULE_5__.arc().outerRadius(labelRadius).innerRadius(labelRadius);
141
+ };
142
+
143
+ var getCalculatedLabelRadius = function (radius, labelRadius, style) {
134
144
  var padding = style && style.padding || 0;
135
- var arcRadius = labelRadius || radius + padding;
136
- return victory_vendor_d3_shape__WEBPACK_IMPORTED_MODULE_5__.arc().outerRadius(arcRadius).innerRadius(arcRadius);
145
+ return labelRadius || radius + padding;
137
146
  };
138
147
 
139
148
  var getLabelPosition = function (arc, slice, position) {
@@ -238,7 +247,8 @@ var getLabelProps = function (text, dataProps, calculatedValues) {
238
247
  labelRadius: labelRadius,
239
248
  text: text
240
249
  }, dataProps));
241
- var labelArc = getLabelArc(defaultRadius, labelRadius, evaluatedStyle);
250
+ var calculatedLabelRadius = getCalculatedLabelRadius(defaultRadius, labelRadius, evaluatedStyle);
251
+ var labelArc = getLabelArc(calculatedLabelRadius);
242
252
  var position = getLabelPosition(labelArc, slice, labelPosition);
243
253
  var baseAngle = getBaseLabelAngle(slice, labelPosition, labelStyle);
244
254
  var labelAngle = getLabelAngle(baseAngle, labelPlacement);
@@ -259,7 +269,8 @@ var getLabelProps = function (text, dataProps, calculatedValues) {
259
269
  y: Math.round(position[1]) + origin.y,
260
270
  textAnchor: textAnchor,
261
271
  verticalAnchor: verticalAnchor,
262
- angle: labelAngle
272
+ angle: labelAngle,
273
+ calculatedLabelRadius: calculatedLabelRadius
263
274
  };
264
275
 
265
276
  if (!victory_core__WEBPACK_IMPORTED_MODULE_6__.isTooltip(labelComponent)) {
@@ -270,8 +281,57 @@ var getLabelProps = function (text, dataProps, calculatedValues) {
270
281
  return lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default()({}, labelProps, victory_core__WEBPACK_IMPORTED_MODULE_6__.omit(tooltipTheme, ["style"]));
271
282
  };
272
283
 
273
- var getBaseProps = function (props, fallbackProps) {
274
- props = victory_core__WEBPACK_IMPORTED_MODULE_6__.modifyProps(props, fallbackProps, "pie");
284
+ var getXOffsetMultiplayerByAngle = function (angle) {
285
+ return Math.cos(angle - victory_core__WEBPACK_IMPORTED_MODULE_6__.degreesToRadians(90));
286
+ };
287
+ var getYOffsetMultiplayerByAngle = function (angle) {
288
+ return Math.sin(angle - victory_core__WEBPACK_IMPORTED_MODULE_6__.degreesToRadians(90));
289
+ };
290
+ var getXOffset = function (offset, angle) {
291
+ return offset * getXOffsetMultiplayerByAngle(angle);
292
+ };
293
+ var getYOffset = function (offset, angle) {
294
+ return offset * getYOffsetMultiplayerByAngle(angle);
295
+ };
296
+ var getAverage = function (array) {
297
+ return array.reduce(function (acc, cur) {
298
+ return acc + cur;
299
+ }, 0) / array.length;
300
+ };
301
+ var getLabelIndicatorPropsForLineSegment = function (props, calculatedValues, labelProps) {
302
+ var innerRadius = props.innerRadius,
303
+ radius = props.radius,
304
+ _props$slice = props.slice,
305
+ startAngle = _props$slice.startAngle,
306
+ endAngle = _props$slice.endAngle,
307
+ labelIndicatorInnerOffset = props.labelIndicatorInnerOffset,
308
+ labelIndicatorOuterOffset = props.labelIndicatorOuterOffset,
309
+ index = props.index;
310
+ var height = calculatedValues.height,
311
+ width = calculatedValues.width;
312
+ var calculatedLabelRadius = labelProps.calculatedLabelRadius; // calculation
313
+
314
+ var middleRadius = getAverage([innerRadius, radius]);
315
+ var midAngle = getAverage([endAngle, startAngle]);
316
+ var centerX = width / 2;
317
+ var centerY = height / 2;
318
+ var innerOffset = middleRadius + labelIndicatorInnerOffset;
319
+ var outerOffset = calculatedLabelRadius - labelIndicatorOuterOffset;
320
+ var x1 = centerX + getXOffset(innerOffset, midAngle);
321
+ var y1 = centerY + getYOffset(innerOffset, midAngle);
322
+ var x2 = centerX + getXOffset(outerOffset, midAngle);
323
+ var y2 = centerY + getYOffset(outerOffset, midAngle);
324
+ var labelIndicatorProps = {
325
+ x1: x1,
326
+ y1: y1,
327
+ x2: x2,
328
+ y2: y2,
329
+ index: index
330
+ };
331
+ return lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default()({}, labelIndicatorProps);
332
+ };
333
+ var getBaseProps = function (initialProps, fallbackProps) {
334
+ var props = victory_core__WEBPACK_IMPORTED_MODULE_6__.modifyProps(initialProps, fallbackProps, "pie");
275
335
  var calculatedValues = getCalculatedValues(props);
276
336
  var slices = calculatedValues.slices,
277
337
  style = calculatedValues.style,
@@ -288,7 +348,8 @@ var getBaseProps = function (props, fallbackProps) {
288
348
  innerRadius = calculatedValues.innerRadius,
289
349
  cornerRadius = calculatedValues.cornerRadius,
290
350
  padAngle = calculatedValues.padAngle,
291
- disableInlineStyles = calculatedValues.disableInlineStyles;
351
+ disableInlineStyles = calculatedValues.disableInlineStyles,
352
+ labelIndicator = calculatedValues.labelIndicator;
292
353
  var radius = props.radius || defaultRadius;
293
354
  var initialChildProps = {
294
355
  parent: {
@@ -329,6 +390,14 @@ var getBaseProps = function (props, fallbackProps) {
329
390
  if (text !== undefined && text !== null || labels && (events || sharedEvents)) {
330
391
  var evaluatedText = victory_core__WEBPACK_IMPORTED_MODULE_6__.evaluateProp(text, dataProps);
331
392
  childProps[eventKey].labels = getLabelProps(evaluatedText, lodash_assign__WEBPACK_IMPORTED_MODULE_4___default()({}, props, dataProps), calculatedValues);
393
+
394
+ if (labelIndicator) {
395
+ var labelProps = childProps[eventKey].labels;
396
+
397
+ if (labelProps.calculatedLabelRadius > radius) {
398
+ childProps[eventKey].labelIndicators = getLabelIndicatorPropsForLineSegment(lodash_assign__WEBPACK_IMPORTED_MODULE_4___default()({}, props, dataProps), calculatedValues, labelProps);
399
+ }
400
+ }
332
401
  }
333
402
 
334
403
  return childProps;
@@ -337,16 +406,16 @@ var getBaseProps = function (props, fallbackProps) {
337
406
 
338
407
  /***/ }),
339
408
 
340
- /***/ "./slice.js":
341
- /*!******************!*\
342
- !*** ./slice.js ***!
343
- \******************/
409
+ /***/ "./slice.tsx":
410
+ /*!*******************!*\
411
+ !*** ./slice.tsx ***!
412
+ \*******************/
344
413
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
345
414
 
346
415
  "use strict";
347
416
  __webpack_require__.r(__webpack_exports__);
348
417
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
349
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
418
+ /* harmony export */ "Slice": () => (/* binding */ Slice)
350
419
  /* harmony export */ });
351
420
  /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/assign */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/assign.js");
352
421
  /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_0__);
@@ -448,9 +517,8 @@ var defaultProps = {
448
517
  role: "presentation",
449
518
  shapeRendering: "auto"
450
519
  };
451
-
452
- var Slice = function (props) {
453
- props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), props));
520
+ var Slice = function (initialProps) {
521
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
454
522
  var defaultTransform = props.origin ? "translate(".concat(props.origin.x, ", ").concat(props.origin.y, ")") : undefined;
455
523
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().cloneElement(props.pathComponent, _objectSpread(_objectSpread({}, props.events), {}, {
456
524
  "aria-label": props.ariaLabel,
@@ -464,7 +532,6 @@ var Slice = function (props) {
464
532
  tabIndex: props.tabIndex
465
533
  }));
466
534
  };
467
-
468
535
  Slice.propTypes = _objectSpread(_objectSpread({}, victory_core__WEBPACK_IMPORTED_MODULE_7__.CommonProps.primitiveProps), {}, {
469
536
  cornerRadius: prop_types__WEBPACK_IMPORTED_MODULE_8___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_8___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_8___default().func)]),
470
537
  datum: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().object),
@@ -477,35 +544,48 @@ Slice.propTypes = _objectSpread(_objectSpread({}, victory_core__WEBPACK_IMPORTED
477
544
  sliceEndAngle: prop_types__WEBPACK_IMPORTED_MODULE_8___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_8___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_8___default().func)]),
478
545
  sliceStartAngle: prop_types__WEBPACK_IMPORTED_MODULE_8___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_8___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_8___default().func)])
479
546
  });
480
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Slice);
481
547
 
482
548
  /***/ }),
483
549
 
484
- /***/ "./victory-pie.js":
485
- /*!************************!*\
486
- !*** ./victory-pie.js ***!
487
- \************************/
550
+ /***/ "./victory-pie.tsx":
551
+ /*!*************************!*\
552
+ !*** ./victory-pie.tsx ***!
553
+ \*************************/
488
554
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
489
555
 
490
556
  "use strict";
491
557
  __webpack_require__.r(__webpack_exports__);
492
558
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
493
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
559
+ /* harmony export */ "VictoryPie": () => (/* binding */ VictoryPie)
494
560
  /* harmony export */ });
495
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
496
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
497
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js");
498
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
499
- /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
500
- /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/user-props.js");
501
- /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/prop-types.js");
561
+ /* harmony import */ var lodash_isNil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/isNil */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isNil.js");
562
+ /* harmony import */ var lodash_isNil__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isNil__WEBPACK_IMPORTED_MODULE_0__);
563
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
564
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
565
+ /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-primitives/line-segment.js");
566
+ /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
567
+ /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/user-props.js");
502
568
  /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-label/victory-label.js");
503
569
  /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
504
570
  /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-theme/victory-theme.js");
505
571
  /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/data.js");
506
572
  /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/add-events.js");
507
- /* harmony import */ var _slice__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./slice */ "./slice.js");
508
- /* harmony import */ var _helper_methods__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helper-methods */ "./helper-methods.js");
573
+ /* harmony import */ var _helper_methods__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helper-methods */ "./helper-methods.ts");
574
+ /* harmony import */ var _slice__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./slice */ "./slice.tsx");
575
+
576
+
577
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
578
+
579
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
580
+
581
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
582
+
583
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
584
+
585
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
586
+
587
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
588
+
509
589
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
510
590
 
511
591
  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); } }
@@ -526,8 +606,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
526
606
 
527
607
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
528
608
 
529
- /* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2] }]*/
530
-
531
609
 
532
610
 
533
611
 
@@ -542,50 +620,122 @@ var fallbackProps = {
542
620
  width: 400,
543
621
  startAngle: 0,
544
622
  colorScale: ["#ffffff", "#f0f0f0", "#d9d9d9", "#bdbdbd", "#969696", "#737373", "#525252", "#252525", "#000000"],
545
- labelPosition: "centroid"
623
+ labelPosition: "centroid",
624
+ labelIndicatorInnerOffset: 15,
625
+ labelIndicatorOuterOffset: 5
546
626
  };
547
627
 
548
- var VictoryPie = /*#__PURE__*/function (_React$Component) {
549
- _inherits(VictoryPie, _React$Component);
628
+ var datumHasXandY = function (datum) {
629
+ return !lodash_isNil__WEBPACK_IMPORTED_MODULE_0___default()(datum._x) && !lodash_isNil__WEBPACK_IMPORTED_MODULE_0___default()(datum._y);
630
+ }; // eslint-disable-next-line @typescript-eslint/no-empty-interface
631
+
550
632
 
551
- var _super = _createSuper(VictoryPie);
633
+ var VictoryPieBase = /*#__PURE__*/function (_React$Component) {
634
+ _inherits(VictoryPieBase, _React$Component);
552
635
 
553
- function VictoryPie() {
554
- _classCallCheck(this, VictoryPie);
636
+ var _super = _createSuper(VictoryPieBase);
637
+
638
+ function VictoryPieBase() {
639
+ _classCallCheck(this, VictoryPieBase);
555
640
 
556
641
  return _super.apply(this, arguments);
557
642
  }
558
643
 
559
- _createClass(VictoryPie, [{
644
+ _createClass(VictoryPieBase, [{
560
645
  key: "shouldAnimate",
561
646
  value: // Overridden in victory-native
562
647
  function shouldAnimate() {
563
648
  return Boolean(this.props.animate);
564
649
  }
650
+ }, {
651
+ key: "renderComponents",
652
+ value: function renderComponents(props) {
653
+ var _this = this;
654
+
655
+ var shouldRenderDatum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datumHasXandY;
656
+ var dataComponent = props.dataComponent,
657
+ labelComponent = props.labelComponent,
658
+ groupComponent = props.groupComponent,
659
+ labelIndicator = props.labelIndicator,
660
+ labelPosition = props.labelPosition;
661
+
662
+ if (!groupComponent) {
663
+ throw new Error("VictoryPie expects a groupComponent prop");
664
+ }
665
+
666
+ var showIndicator = labelIndicator && labelPosition === "centroid";
667
+ var children = [];
668
+
669
+ if (dataComponent) {
670
+ var dataComponents = this.dataKeys.reduce(function (validDataComponents, _dataKey, index) {
671
+ var dataProps = _this.getComponentProps(dataComponent, "data", index);
672
+
673
+ if (shouldRenderDatum(dataProps.datum)) {
674
+ validDataComponents.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(dataComponent, dataProps));
675
+ }
676
+
677
+ return validDataComponents;
678
+ }, []);
679
+ children.push.apply(children, _toConsumableArray(dataComponents));
680
+ }
681
+
682
+ if (labelComponent) {
683
+ var labelComponents = this.dataKeys.map(function (_dataKey, index) {
684
+ var labelProps = _this.getComponentProps(labelComponent, "labels", index);
685
+
686
+ if (labelProps.text !== undefined && labelProps.text !== null) {
687
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(labelComponent, labelProps);
688
+ }
689
+
690
+ return undefined;
691
+ }).filter(function (comp) {
692
+ return comp !== undefined;
693
+ });
694
+ children.push.apply(children, _toConsumableArray(labelComponents));
695
+ }
696
+
697
+ if (showIndicator && labelIndicator) {
698
+ var labelIndicatorComponent = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_2__.LineSegment, null);
699
+
700
+ if (typeof labelIndicator === "object") {
701
+ // pass user provided react component
702
+ labelIndicatorComponent = labelIndicator;
703
+ }
704
+
705
+ var labelIndicatorComponents = this.dataKeys.map(function (_dataKey, index) {
706
+ var labelIndicatorProps = _this.getComponentProps(labelIndicatorComponent, "labelIndicators", index);
707
+
708
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(labelIndicatorComponent, labelIndicatorProps);
709
+ });
710
+ children.push.apply(children, _toConsumableArray(labelIndicatorComponents));
711
+ }
712
+
713
+ return this.renderContainer(groupComponent, children);
714
+ }
565
715
  }, {
566
716
  key: "render",
567
717
  value: function render() {
568
718
  var animationWhitelist = VictoryPie.animationWhitelist,
569
719
  role = VictoryPie.role;
570
- var props = victory_core__WEBPACK_IMPORTED_MODULE_1__.modifyProps(this.props, fallbackProps, role);
720
+ var props = victory_core__WEBPACK_IMPORTED_MODULE_3__.modifyProps(this.props, fallbackProps, role);
571
721
 
572
722
  if (this.shouldAnimate()) {
573
723
  return this.animateComponent(props, animationWhitelist);
574
724
  }
575
725
 
576
- var children = this.renderData(props);
726
+ var children = this.renderComponents(props);
577
727
  var component = props.standalone ? this.renderContainer(props.containerComponent, children) : children;
578
- return victory_core__WEBPACK_IMPORTED_MODULE_2__.withSafeUserProps(component, props);
728
+ return victory_core__WEBPACK_IMPORTED_MODULE_4__.withSafeUserProps(component, props);
579
729
  }
580
730
  }]);
581
731
 
582
- return VictoryPie;
583
- }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
732
+ return VictoryPieBase;
733
+ }((react__WEBPACK_IMPORTED_MODULE_1___default().Component));
584
734
 
585
- VictoryPie.animationWhitelist = ["data", "endAngle", "height", "innerRadius", "cornerRadius", "padAngle", "padding", "colorScale", "startAngle", "style", "width"];
586
- VictoryPie.displayName = "VictoryPie";
587
- VictoryPie.role = "pie";
588
- VictoryPie.defaultTransitions = {
735
+ VictoryPieBase.animationWhitelist = ["data", "endAngle", "height", "innerRadius", "cornerRadius", "padAngle", "padding", "colorScale", "startAngle", "style", "width"];
736
+ VictoryPieBase.displayName = "VictoryPie";
737
+ VictoryPieBase.role = "pie";
738
+ VictoryPieBase.defaultTransitions = {
589
739
  onExit: {
590
740
  duration: 500,
591
741
  before: function () {
@@ -611,68 +761,7 @@ VictoryPie.defaultTransitions = {
611
761
  }
612
762
  }
613
763
  };
614
- VictoryPie.propTypes = {
615
- animate: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().object)]),
616
- colorScale: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_3___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_3___default().string)), prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOf(["grayscale", "qualitative", "heatmap", "warm", "cool", "red", "green", "blue"])]),
617
- containerComponent: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().element),
618
- cornerRadius: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative, (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func)]),
619
- data: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().array),
620
- dataComponent: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().element),
621
- disableInlineStyes: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
622
- endAngle: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number),
623
- eventKey: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_3___default().func), victory_core__WEBPACK_IMPORTED_MODULE_4__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.integer, victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string)]),
624
- events: prop_types__WEBPACK_IMPORTED_MODULE_3___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_3___default().shape({
625
- target: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOf(["data", "labels", "parent"]),
626
- eventKey: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_3___default().array), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func), victory_core__WEBPACK_IMPORTED_MODULE_4__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.integer, victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string)]),
627
- eventHandlers: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().object)
628
- })),
629
- externalEventMutations: prop_types__WEBPACK_IMPORTED_MODULE_3___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_3___default().shape({
630
- callback: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),
631
- childName: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_3___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().array)]),
632
- eventKey: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_3___default().array), victory_core__WEBPACK_IMPORTED_MODULE_4__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.integer, victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string)]),
633
- mutation: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),
634
- target: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_3___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().array)])
635
- })),
636
- groupComponent: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().element),
637
- height: victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative,
638
- innerRadius: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative, (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func)]),
639
- labelComponent: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().element),
640
- labelPlacement: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_3___default().func), prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOf(["parallel", "perpendicular", "vertical"])]),
641
- labelPosition: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_3___default().func), prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOf(["startAngle", "centroid", "endAngle"])]),
642
- labelRadius: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative, (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func)]),
643
- labels: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_3___default().func), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().array)]),
644
- name: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
645
- origin: prop_types__WEBPACK_IMPORTED_MODULE_3___default().shape({
646
- x: victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative,
647
- y: victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative
648
- }),
649
- padAngle: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative, (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func)]),
650
- padding: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_3___default().number), prop_types__WEBPACK_IMPORTED_MODULE_3___default().shape({
651
- top: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number),
652
- bottom: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number),
653
- left: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number),
654
- right: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number)
655
- })]),
656
- radius: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative, (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func)]),
657
- sharedEvents: prop_types__WEBPACK_IMPORTED_MODULE_3___default().shape({
658
- events: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().array),
659
- getEventState: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func)
660
- }),
661
- sortKey: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_3___default().func), victory_core__WEBPACK_IMPORTED_MODULE_4__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.integer, victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string), prop_types__WEBPACK_IMPORTED_MODULE_3___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_3___default().string))]),
662
- sortOrder: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOf(["ascending", "descending"]),
663
- standalone: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
664
- startAngle: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number),
665
- style: prop_types__WEBPACK_IMPORTED_MODULE_3___default().shape({
666
- parent: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().object),
667
- data: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().object),
668
- labels: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().object)
669
- }),
670
- theme: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().object),
671
- width: victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative,
672
- x: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_3___default().func), victory_core__WEBPACK_IMPORTED_MODULE_4__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.integer, victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string), prop_types__WEBPACK_IMPORTED_MODULE_3___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_3___default().string))]),
673
- y: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_3___default().func), victory_core__WEBPACK_IMPORTED_MODULE_4__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_4__.integer, victory_core__WEBPACK_IMPORTED_MODULE_4__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string), prop_types__WEBPACK_IMPORTED_MODULE_3___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_3___default().string))])
674
- };
675
- VictoryPie.defaultProps = {
764
+ VictoryPieBase.defaultProps = {
676
765
  data: [{
677
766
  x: "A",
678
767
  y: 1
@@ -690,21 +779,21 @@ VictoryPie.defaultProps = {
690
779
  y: 2
691
780
  }],
692
781
  standalone: true,
693
- dataComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_slice__WEBPACK_IMPORTED_MODULE_5__["default"], null),
694
- labelComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_6__.VictoryLabel, null),
695
- containerComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_7__.VictoryContainer, null),
696
- groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null),
782
+ dataComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_slice__WEBPACK_IMPORTED_MODULE_5__.Slice, null),
783
+ labelComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_6__.VictoryLabel, null),
784
+ containerComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_7__.VictoryContainer, null),
785
+ groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null),
697
786
  sortOrder: "ascending",
698
787
  theme: victory_core__WEBPACK_IMPORTED_MODULE_8__.VictoryTheme.grayscale
699
788
  };
700
789
 
701
- VictoryPie.getBaseProps = function (props) {
790
+ VictoryPieBase.getBaseProps = function (props) {
702
791
  return (0,_helper_methods__WEBPACK_IMPORTED_MODULE_9__.getBaseProps)(props, fallbackProps);
703
792
  };
704
793
 
705
- VictoryPie.getData = victory_core__WEBPACK_IMPORTED_MODULE_10__.getData;
706
- VictoryPie.expectedComponents = ["dataComponent", "labelComponent", "groupComponent", "containerComponent"];
707
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,victory_core__WEBPACK_IMPORTED_MODULE_11__.addEvents)(VictoryPie));
794
+ VictoryPieBase.getData = victory_core__WEBPACK_IMPORTED_MODULE_10__.getData;
795
+ VictoryPieBase.expectedComponents = ["dataComponent", "labelComponent", "groupComponent", "containerComponent", "labelIndicatorComponent"];
796
+ var VictoryPie = (0,victory_core__WEBPACK_IMPORTED_MODULE_11__.addEvents)(VictoryPieBase);
708
797
 
709
798
  /***/ }),
710
799
 
@@ -7322,12 +7411,12 @@ var interpolateFunction = function (a, b) {
7322
7411
  * differs in that it uses our custom interpolators when interpolating the value of each property in
7323
7412
  * an object. This allows the correct interpolation of nested objects, including styles
7324
7413
  *
7325
- * @param {any} a - Start value.
7326
- * @param {any} b - End value.
7414
+ * @param {any} startValue - Start value.
7415
+ * @param {any} endValue - End value.
7327
7416
  * @returns {Function} An interpolation function.
7328
7417
  */
7329
7418
 
7330
- var interpolateObject = function (a, b) {
7419
+ var interpolateObject = function (startValue, endValue) {
7331
7420
  var interpolateTypes = function (x, y) {
7332
7421
  if (x === y || !isInterpolatable(x) || !isInterpolatable(y)) {
7333
7422
  return interpolateImmediate(x, y);
@@ -7352,6 +7441,8 @@ var interpolateObject = function (a, b) {
7352
7441
 
7353
7442
  var i = {};
7354
7443
  var c = {};
7444
+ var a = startValue;
7445
+ var b = endValue;
7355
7446
  var k;
7356
7447
 
7357
7448
  if (a === null || typeof a !== "object") {
@@ -7519,8 +7610,8 @@ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
7519
7610
  step can generate imprecise values, sometimes greater than 1
7520
7611
  if this happens set the state to 1 and return, cancelling the timer
7521
7612
  */
7522
- duration = duration !== undefined ? duration : _this.props.duration;
7523
- var step = duration ? elapsed / duration : 1;
7613
+ var animationDuration = duration !== undefined ? duration : _this.props.duration;
7614
+ var step = animationDuration ? elapsed / animationDuration : 1;
7524
7615
 
7525
7616
  if (step >= 1) {
7526
7617
  _this.setState({
@@ -8136,8 +8227,7 @@ var getStyles = function (style, props) {
8136
8227
  }
8137
8228
 
8138
8229
  var getSingleStyle = function (s) {
8139
- s = s ? lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, s, defaultStyles) : defaultStyles;
8140
- var baseStyles = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(s, props);
8230
+ var baseStyles = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(s ? lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, s, defaultStyles) : defaultStyles, props);
8141
8231
  return lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, baseStyles, {
8142
8232
  fontSize: getFontSize(baseStyles)
8143
8233
  });
@@ -8341,22 +8431,19 @@ var getInlineXOffset = function (calculatedProps, textElements, index) {
8341
8431
  switch (textAnchor) {
8342
8432
  case "start":
8343
8433
  return widths.reduce(function (memo, width, i) {
8344
- memo = i < index ? memo + width : memo;
8345
- return memo;
8434
+ return i < index ? memo + width : memo;
8346
8435
  }, 0);
8347
8436
 
8348
8437
  case "end":
8349
8438
  return widths.reduce(function (memo, width, i) {
8350
- memo = i > index ? memo - width : memo;
8351
- return memo;
8439
+ return i > index ? memo - width : memo;
8352
8440
  }, 0);
8353
8441
 
8354
8442
  default:
8355
8443
  // middle
8356
8444
  return widths.reduce(function (memo, width, i) {
8357
8445
  var offsetWidth = i < index ? width : 0;
8358
- memo = i === index ? memo + width / 2 : memo + offsetWidth;
8359
- return memo;
8446
+ return i === index ? memo + width / 2 : memo + offsetWidth;
8360
8447
  }, centerOffset);
8361
8448
  }
8362
8449
  };
@@ -8488,7 +8575,7 @@ var getCalculatedProps = function (props) {
8488
8575
  verticalAnchor: verticalAnchor,
8489
8576
  dx: dx,
8490
8577
  dy: dy,
8491
- originalDy: props.dy,
8578
+ originalDy: _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateProp(props.dy, props),
8492
8579
  transform: transform,
8493
8580
  x: x,
8494
8581
  y: y
@@ -8558,8 +8645,8 @@ var defaultProps = {
8558
8645
  // Magic number from d3.
8559
8646
  lineHeight: 1
8560
8647
  };
8561
- var VictoryLabel = function (props) {
8562
- props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), props));
8648
+ var VictoryLabel = function (initialProps) {
8649
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
8563
8650
 
8564
8651
  if (props.text === null || props.text === undefined) {
8565
8652
  return null;
@@ -8580,7 +8667,7 @@ var VictoryLabel = function (props) {
8580
8667
  fontSize: currentStyle.fontSize || defaultStyles.fontSize,
8581
8668
  capHeight: capHeightPx,
8582
8669
  text: line,
8583
- // @ts-expect-error TODO: This looks like a bug:
8670
+ // TODO: This looks like a bug:
8584
8671
  textSize: _victory_util_textsize__WEBPACK_IMPORTED_MODULE_12__.approximateTextSize(line, currentStyle),
8585
8672
  lineHeight: currentLineHeight,
8586
8673
  backgroundPadding: getSingleValue(backgroundPadding, i)
@@ -8930,6 +9017,156 @@ VictoryPortal.contextType = _portal_context__WEBPACK_IMPORTED_MODULE_5__.PortalC
8930
9017
 
8931
9018
  /***/ }),
8932
9019
 
9020
+ /***/ "../../victory-core/es/victory-primitives/line-segment.js":
9021
+ /*!****************************************************************!*\
9022
+ !*** ../../victory-core/es/victory-primitives/line-segment.js ***!
9023
+ \****************************************************************/
9024
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9025
+
9026
+ "use strict";
9027
+ __webpack_require__.r(__webpack_exports__);
9028
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9029
+ /* harmony export */ "LineSegment": () => (/* binding */ LineSegment)
9030
+ /* harmony export */ });
9031
+ /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/assign */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/assign.js");
9032
+ /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_0__);
9033
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
9034
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
9035
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js");
9036
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__);
9037
+ /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
9038
+ /* harmony import */ var _victory_util_common_props__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/common-props */ "../../victory-core/es/victory-util/common-props.js");
9039
+ /* harmony import */ var _line__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./line */ "../../victory-core/es/victory-primitives/line.js");
9040
+
9041
+
9042
+ 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; }
9043
+
9044
+ 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; }
9045
+
9046
+ 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; }
9047
+
9048
+
9049
+
9050
+
9051
+
9052
+
9053
+
9054
+ var evaluateProps = function (props) {
9055
+ /**
9056
+ * Potential evaluated props are:
9057
+ * `ariaLabel`
9058
+ * `desc`
9059
+ * `id`
9060
+ * `style`
9061
+ * `tabIndex`
9062
+ */
9063
+ var ariaLabel = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.ariaLabel, props);
9064
+ var desc = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.desc, props);
9065
+ var id = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.id, props);
9066
+ var style = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateStyle(lodash_assign__WEBPACK_IMPORTED_MODULE_0___default()({
9067
+ stroke: "black"
9068
+ }, props.style), props);
9069
+ var tabIndex = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.tabIndex, props);
9070
+ return lodash_assign__WEBPACK_IMPORTED_MODULE_0___default()({}, props, {
9071
+ ariaLabel: ariaLabel,
9072
+ desc: desc,
9073
+ id: id,
9074
+ style: style,
9075
+ tabIndex: tabIndex
9076
+ });
9077
+ };
9078
+
9079
+ var defaultProps = {
9080
+ lineComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_line__WEBPACK_IMPORTED_MODULE_3__.Line, null),
9081
+ role: "presentation",
9082
+ shapeRendering: "auto"
9083
+ };
9084
+ var LineSegment = function (initialProps) {
9085
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
9086
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.lineComponent, _objectSpread(_objectSpread({}, props.events), {}, {
9087
+ "aria-label": props.ariaLabel,
9088
+ style: props.style,
9089
+ desc: props.desc,
9090
+ tabIndex: props.tabIndex,
9091
+ className: props.className,
9092
+ role: props.role,
9093
+ shapeRendering: props.shapeRendering,
9094
+ x1: props.x1,
9095
+ x2: props.x2,
9096
+ y1: props.y1,
9097
+ y2: props.y2,
9098
+ transform: props.transform,
9099
+ clipPath: props.clipPath
9100
+ }));
9101
+ };
9102
+ LineSegment.propTypes = _objectSpread(_objectSpread({}, _victory_util_common_props__WEBPACK_IMPORTED_MODULE_4__.CommonProps.primitiveProps), {}, {
9103
+ datum: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().any),
9104
+ lineComponent: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().element),
9105
+ x1: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().number),
9106
+ x2: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().number),
9107
+ y1: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().number),
9108
+ y2: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().number)
9109
+ });
9110
+
9111
+ /***/ }),
9112
+
9113
+ /***/ "../../victory-core/es/victory-primitives/line.js":
9114
+ /*!********************************************************!*\
9115
+ !*** ../../victory-core/es/victory-primitives/line.js ***!
9116
+ \********************************************************/
9117
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9118
+
9119
+ "use strict";
9120
+ __webpack_require__.r(__webpack_exports__);
9121
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9122
+ /* harmony export */ "Line": () => (/* binding */ Line)
9123
+ /* harmony export */ });
9124
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
9125
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
9126
+ /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
9127
+ var _excluded = ["desc", "id", "tabIndex", "origin"];
9128
+
9129
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
9130
+
9131
+ 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; }
9132
+
9133
+ 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; }
9134
+
9135
+ 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; }
9136
+
9137
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9138
+
9139
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
9140
+
9141
+
9142
+
9143
+ var Line = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) {
9144
+ var _evaluateProp;
9145
+
9146
+ /* eslint-disable-next-line @typescript-eslint/no-unused-vars --
9147
+ * origin conflicts with the SVG element's origin attribute
9148
+ */
9149
+ var desc = props.desc,
9150
+ id = props.id,
9151
+ tabIndex = props.tabIndex,
9152
+ origin = props.origin,
9153
+ rest = _objectWithoutProperties(props, _excluded);
9154
+
9155
+ var svgProps = _objectSpread({
9156
+ vectorEffect: "non-scaling-stroke",
9157
+ id: (_evaluateProp = (0,_victory_util_helpers__WEBPACK_IMPORTED_MODULE_1__.evaluateProp)(id, props)) === null || _evaluateProp === void 0 ? void 0 : _evaluateProp.toString(),
9158
+ tabIndex: (0,_victory_util_helpers__WEBPACK_IMPORTED_MODULE_1__.evaluateProp)(tabIndex, props)
9159
+ }, rest);
9160
+
9161
+ return desc ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("line", _extends({}, svgProps, {
9162
+ ref: ref
9163
+ }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("desc", null, desc)) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("line", _extends({}, svgProps, {
9164
+ ref: ref
9165
+ }));
9166
+ });
9167
+
9168
+ /***/ }),
9169
+
8933
9170
  /***/ "../../victory-core/es/victory-primitives/path.js":
8934
9171
  /*!********************************************************!*\
8935
9172
  !*** ../../victory-core/es/victory-primitives/path.js ***!
@@ -10272,8 +10509,7 @@ function addEvents(WrappedComponent) {
10272
10509
  value: function applyExternalMutations(props, externalMutations) {
10273
10510
  if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_5___default()(externalMutations)) {
10274
10511
  var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
10275
- memo = lodash_isFunction__WEBPACK_IMPORTED_MODULE_4___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
10276
- return memo;
10512
+ return lodash_isFunction__WEBPACK_IMPORTED_MODULE_4___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
10277
10513
  }, []);
10278
10514
  var compiledCallbacks = callbacks.length ? function () {
10279
10515
  callbacks.forEach(function (c) {
@@ -10328,8 +10564,8 @@ function addEvents(WrappedComponent) {
10328
10564
  }, {
10329
10565
  key: "getBaseProps",
10330
10566
  value: function getBaseProps(props, getSharedEventState) {
10331
- getSharedEventState = getSharedEventState || this.getSharedEventState.bind(this);
10332
- var sharedParentState = getSharedEventState("parent", "parent");
10567
+ var getSharedEventStateFunction = getSharedEventState || this.getSharedEventState.bind(this);
10568
+ var sharedParentState = getSharedEventStateFunction("parent", "parent");
10333
10569
  var parentState = this.getEventState("parent", "parent");
10334
10570
 
10335
10571
  var baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_7___default()({}, parentState, sharedParentState);
@@ -10364,13 +10600,15 @@ function addEvents(WrappedComponent) {
10364
10600
  return undefined;
10365
10601
  }
10366
10602
 
10603
+ var currentProps = component && typeof component === "object" && "props" in component ? component.props : undefined;
10604
+
10367
10605
  if (this.hasEvents) {
10368
10606
  var baseEvents = this.getEvents(this.props, type, key);
10369
10607
 
10370
10608
  var componentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_7___default()({
10371
10609
  index: index,
10372
10610
  key: id
10373
- }, this.getEventState(key, type), this.getSharedEventState(key, type), component.props, baseProps, {
10611
+ }, this.getEventState(key, type), this.getSharedEventState(key, type), currentProps, baseProps, {
10374
10612
  id: id
10375
10613
  });
10376
10614
 
@@ -10384,7 +10622,7 @@ function addEvents(WrappedComponent) {
10384
10622
  return lodash_defaults__WEBPACK_IMPORTED_MODULE_7___default()({
10385
10623
  index: index,
10386
10624
  key: id
10387
- }, component.props, baseProps, {
10625
+ }, currentProps, baseProps, {
10388
10626
  id: id
10389
10627
  });
10390
10628
  }
@@ -10426,13 +10664,15 @@ function addEvents(WrappedComponent) {
10426
10664
  var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_0___default()(this.dataKeys, "all");
10427
10665
 
10428
10666
  var labelComponents = dataKeys.reduce(function (memo, key) {
10667
+ var newMemo = memo;
10668
+
10429
10669
  var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
10430
10670
 
10431
10671
  if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
10432
- memo = memo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
10672
+ newMemo = newMemo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
10433
10673
  }
10434
10674
 
10435
- return memo;
10675
+ return newMemo;
10436
10676
  }, []);
10437
10677
  var dataProps = this.getComponentProps(dataComponent, "data", "all");
10438
10678
  var children = [/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
@@ -10831,12 +11071,14 @@ function sortData(dataset, sortKey) {
10831
11071
  } // Ensures previous VictoryLine api for sortKey prop stays consistent
10832
11072
 
10833
11073
 
11074
+ var formattedSortKey = sortKey;
11075
+
10834
11076
  if (sortKey === "x" || sortKey === "y") {
10835
- sortKey = "_".concat(sortKey);
11077
+ formattedSortKey = "_".concat(sortKey);
10836
11078
  }
10837
11079
 
10838
11080
  var order = sortOrder === "ascending" ? "asc" : "desc";
10839
- return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset, sortKey, order);
11081
+ return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset, formattedSortKey, order);
10840
11082
  } // This method will remove data points that break certain scales. (log scale only)
10841
11083
 
10842
11084
 
@@ -11027,7 +11269,10 @@ function formatData(dataset, props, expectedKeys) {
11027
11269
  return [];
11028
11270
  }
11029
11271
 
11030
- var defaultKeys = ["x", "y", "y0"];
11272
+ var defaultKeys = ["x", "y", "y0"]; // TODO: We shouldn’t mutate the expectedKeys param here,
11273
+ // but we need to figure out why changing it causes regressions in tests.
11274
+ // eslint-disable-next-line no-param-reassign
11275
+
11031
11276
  expectedKeys = Array.isArray(expectedKeys) ? expectedKeys : defaultKeys;
11032
11277
 
11033
11278
  var createAccessor = function (name) {
@@ -11052,13 +11297,13 @@ function formatData(dataset, props, expectedKeys) {
11052
11297
 
11053
11298
  var data = preformattedData ? dataset : dataset.reduce(function (dataArr, datum, index) {
11054
11299
  // eslint-disable-line complexity
11055
- datum = parseDatum(datum);
11300
+ var parsedDatum = parseDatum(datum);
11056
11301
  var fallbackValues = {
11057
11302
  x: index,
11058
- y: datum
11303
+ y: parsedDatum
11059
11304
  };
11060
11305
  var processedValues = expectedKeys.reduce(function (memo, type) {
11061
- var processedValue = accessor[type](datum);
11306
+ var processedValue = accessor[type](parsedDatum);
11062
11307
  var value = processedValue !== undefined ? processedValue : fallbackValues[type];
11063
11308
 
11064
11309
  if (value !== undefined) {
@@ -11073,7 +11318,7 @@ function formatData(dataset, props, expectedKeys) {
11073
11318
  return memo;
11074
11319
  }, {});
11075
11320
 
11076
- var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues, datum);
11321
+ var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues, parsedDatum);
11077
11322
 
11078
11323
  if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_4___default()(formattedDatum)) {
11079
11324
  dataArr.push(formattedDatum);
@@ -11184,8 +11429,8 @@ function getStringsFromData(props, axis) {
11184
11429
  }, []);
11185
11430
  var sortedData = sortData(data, props.sortKey, props.sortOrder);
11186
11431
  var dataStrings = sortedData.reduce(function (dataArr, datum) {
11187
- datum = parseDatum(datum);
11188
- dataArr.push(accessor(datum));
11432
+ var parsedDatum = parseDatum(datum);
11433
+ dataArr.push(accessor(parsedDatum));
11189
11434
  return dataArr;
11190
11435
  }, []).filter(function (datum) {
11191
11436
  return typeof datum === "string";
@@ -11382,14 +11627,14 @@ function getScopedEvents(events, namespace, childType, baseProps) {
11382
11627
  // eslint-disable-next-line no-invalid-this
11383
11628
 
11384
11629
 
11385
- baseProps = baseProps || this.baseProps; // returns the original base props or base state of a given target element
11630
+ var newBaseProps = baseProps || this.baseProps; // returns the original base props or base state of a given target element
11386
11631
 
11387
11632
  var getTargetProps = function (identifier, type) {
11388
11633
  var childName = identifier.childName,
11389
11634
  target = identifier.target,
11390
11635
  key = identifier.key; // eslint-disable-next-line no-invalid-this
11391
11636
 
11392
- var baseType = type === "props" ? baseProps : _this2.state || {};
11637
+ var baseType = type === "props" ? newBaseProps : _this2.state || {};
11393
11638
  var base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
11394
11639
  return key === "parent" ? base.parent : base[key] && base[key][target];
11395
11640
  }; // Returns the state object with the mutation caused by a given eventReturn
@@ -11477,8 +11722,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
11477
11722
 
11478
11723
  var parseEventReturn = function (eventReturn, eventKey) {
11479
11724
  return Array.isArray(eventReturn) ? eventReturn.reduce(function (memo, props) {
11480
- memo = lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, memo, parseEvent(props, eventKey));
11481
- return memo;
11725
+ return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, memo, parseEvent(props, eventKey));
11482
11726
  }, {}) : parseEvent(eventReturn, eventKey);
11483
11727
  };
11484
11728
 
@@ -11564,9 +11808,10 @@ function getEventState(eventKey, namespace, childType) {
11564
11808
  */
11565
11809
  // eslint-disable-next-line max-params
11566
11810
 
11567
- function getExternalMutationsWithChildren(mutations, baseProps, baseState, childNames) {
11568
- baseProps = baseProps || {};
11569
- baseState = baseState || {};
11811
+ function getExternalMutationsWithChildren(mutations) {
11812
+ var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
11813
+ var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
11814
+ var childNames = arguments.length > 3 ? arguments[3] : undefined;
11570
11815
  return childNames.reduce(function (memo, childName) {
11571
11816
  var childState = baseState[childName];
11572
11817
  var mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
@@ -11588,9 +11833,10 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
11588
11833
  */
11589
11834
  // eslint-disable-next-line max-params
11590
11835
 
11591
- function getExternalMutations(mutations, baseProps, baseState, childName) {
11592
- baseProps = baseProps || {};
11593
- baseState = baseState || {};
11836
+ function getExternalMutations(mutations) {
11837
+ var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
11838
+ var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
11839
+ var childName = arguments.length > 3 ? arguments[3] : undefined;
11594
11840
 
11595
11841
  var eventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps);
11596
11842
 
@@ -11656,8 +11902,7 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
11656
11902
  return false;
11657
11903
  };
11658
11904
 
11659
- mutations = Array.isArray(mutations) ? mutations : [mutations];
11660
- var scopedMutations = mutations;
11905
+ var scopedMutations = Array.isArray(mutations) ? mutations : [mutations];
11661
11906
 
11662
11907
  if (identifier.childName) {
11663
11908
  scopedMutations = mutations.filter(function (m) {
@@ -11696,13 +11941,10 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
11696
11941
 
11697
11942
  function getComponentEvents(props, components) {
11698
11943
  var events = Array.isArray(components) && components.reduce(function (memo, componentName) {
11699
- var _memo;
11700
-
11701
11944
  var component = props[componentName];
11702
11945
  var defaultEvents = component && component.type && component.type.defaultEvents;
11703
11946
  var componentEvents = lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(defaultEvents) ? defaultEvents(component.props) : defaultEvents;
11704
- memo = Array.isArray(componentEvents) ? (_memo = memo).concat.apply(_memo, _toConsumableArray(componentEvents)) : memo;
11705
- return memo;
11947
+ return Array.isArray(componentEvents) ? memo.concat.apply(memo, _toConsumableArray(componentEvents)) : memo;
11706
11948
  }, []);
11707
11949
  return events && events.length ? events : undefined;
11708
11950
  }
@@ -12060,6 +12302,7 @@ function reduceChildren(children, iteratee) {
12060
12302
 
12061
12303
  var traverseChildren = function (childArray, names, parent) {
12062
12304
  return childArray.reduce(function (memo, child, index) {
12305
+ var newMemo = memo;
12063
12306
  var childRole = child.type && child.type.role;
12064
12307
  var childName = child.props.name || "".concat(childRole, "-").concat(names[index]);
12065
12308
 
@@ -12077,16 +12320,16 @@ function reduceChildren(children, iteratee) {
12077
12320
  });
12078
12321
 
12079
12322
  var nestedResults = traverseChildren(nestedChildren, _childNames, child);
12080
- memo = combine(memo, nestedResults);
12323
+ newMemo = combine(newMemo, nestedResults);
12081
12324
  } else {
12082
12325
  var result = iteratee(child, childName, parent);
12083
12326
 
12084
12327
  if (result) {
12085
- memo = combine(memo, result);
12328
+ newMemo = combine(newMemo, result);
12086
12329
  }
12087
12330
  }
12088
12331
 
12089
- return memo;
12332
+ return newMemo;
12090
12333
  }, initialMemo);
12091
12334
  };
12092
12335
 
@@ -12112,8 +12355,7 @@ function isHorizontal(props) {
12112
12355
  var childProps = child.props || {};
12113
12356
 
12114
12357
  if (memo || childProps.horizontal || !childProps.children) {
12115
- memo = memo || childProps.horizontal;
12116
- return memo;
12358
+ return memo || childProps.horizontal;
12117
12359
  }
12118
12360
 
12119
12361
  return traverseChildren(react__WEBPACK_IMPORTED_MODULE_6___default().Children.toArray(childProps.children));
@@ -12166,11 +12408,13 @@ function isMap(x) {
12166
12408
  }
12167
12409
  function shallowToJS(x, whitelist) {
12168
12410
  return isIterable(x) ? x.reduce(function (result, curr, key) {
12411
+ var newCurr = curr;
12412
+
12169
12413
  if (whitelist && whitelist[key]) {
12170
- curr = shallowToJS(curr);
12414
+ newCurr = shallowToJS(curr);
12171
12415
  }
12172
12416
 
12173
- result[key] = curr;
12417
+ result[key] = newCurr;
12174
12418
  return result;
12175
12419
  }, isList(x) ? [] : {}) : x;
12176
12420
  }
@@ -12198,12 +12442,10 @@ __webpack_require__.r(__webpack_exports__);
12198
12442
  /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
12199
12443
 
12200
12444
 
12201
- /* eslint-disable no-use-before-define */
12202
-
12203
12445
 
12204
12446
  // Private Functions
12205
- function getVerticalAnchor(props, datum) {
12206
- datum = datum || {};
12447
+ function getVerticalAnchor(props) {
12448
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12207
12449
  var sign = datum._y >= 0 ? 1 : -1;
12208
12450
  var labelStyle = props.style && props.style.labels || {};
12209
12451
 
@@ -12216,8 +12458,8 @@ function getVerticalAnchor(props, datum) {
12216
12458
  return "middle";
12217
12459
  }
12218
12460
 
12219
- function getTextAnchor(props, datum) {
12220
- datum = datum || {};
12461
+ function getTextAnchor(props) {
12462
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12221
12463
  var style = props.style,
12222
12464
  horizontal = props.horizontal;
12223
12465
  var sign = datum._y >= 0 ? 1 : -1;
@@ -12232,14 +12474,14 @@ function getTextAnchor(props, datum) {
12232
12474
  return sign >= 0 ? "start" : "end";
12233
12475
  }
12234
12476
 
12235
- function getAngle(props, datum) {
12236
- datum = datum || {};
12477
+ function getAngle(props) {
12478
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12237
12479
  var labelStyle = props.style && props.style.labels || {};
12238
12480
  return datum.angle === undefined ? labelStyle.angle : datum.angle;
12239
12481
  }
12240
12482
 
12241
- function getPadding(props, datum) {
12242
- datum = datum || {};
12483
+ function getPadding(props) {
12484
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12243
12485
  var horizontal = props.horizontal,
12244
12486
  style = props.style;
12245
12487
  var labelStyle = style.labels || {};
@@ -12318,8 +12560,9 @@ function getPolarOrientation(degrees) {
12318
12560
  } // Exported Functions
12319
12561
 
12320
12562
 
12321
- function getText(props, datum, index) {
12322
- datum = datum || {};
12563
+ function getText(props) {
12564
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12565
+ var index = arguments.length > 2 ? arguments[2] : undefined;
12323
12566
 
12324
12567
  if (datum.label !== undefined) {
12325
12568
  return datum.label;
@@ -13479,11 +13722,10 @@ var Timer = /*#__PURE__*/function () {
13479
13722
  }, {
13480
13723
  key: "subscribe",
13481
13724
  value: function subscribe(callback, duration) {
13482
- duration = this.shouldAnimate ? duration : 0;
13483
13725
  var subscriptionID = this.subscribers.push({
13484
13726
  startTime: (0,victory_vendor_d3_timer__WEBPACK_IMPORTED_MODULE_0__.now)(),
13485
13727
  callback: callback,
13486
- duration: duration
13728
+ duration: this.shouldAnimate ? duration : 0
13487
13729
  });
13488
13730
  this.activeSubscriptions++;
13489
13731
  this.start();
@@ -13670,36 +13912,38 @@ function getInitialChildProps(animate, data) {
13670
13912
 
13671
13913
 
13672
13914
  function getChildBeforeLoad(animate, child, data, cb) {
13673
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
13915
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
13674
13916
  onEnd: cb
13675
13917
  });
13676
13918
 
13677
- if (animate && animate.onLoad && !animate.onLoad.duration) {
13919
+ if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
13678
13920
  return {
13679
- animate: animate,
13921
+ animate: newAnimate,
13680
13922
  data: data
13681
13923
  };
13682
13924
  }
13683
13925
 
13684
- 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.
13926
+ 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.
13685
13927
 
13686
- data = data.map(function (datum, idx) {
13928
+ var newData = data.map(function (datum, idx) {
13687
13929
  return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data));
13688
13930
  });
13689
13931
  return {
13690
- animate: animate,
13691
- data: data,
13932
+ animate: newAnimate,
13933
+ data: newData,
13692
13934
  clipWidth: 0
13693
13935
  };
13694
13936
  } // eslint-disable-next-line max-params
13695
13937
 
13696
13938
 
13697
13939
  function getChildOnLoad(animate, data, cb) {
13698
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
13940
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
13699
13941
  onEnd: cb
13700
13942
  });
13701
13943
 
13702
- if (animate && animate.onLoad && !animate.onLoad.duration) {
13944
+ var newData = data;
13945
+
13946
+ if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
13703
13947
  return {
13704
13948
  animate: animate,
13705
13949
  data: data
@@ -13708,12 +13952,12 @@ function getChildOnLoad(animate, data, cb) {
13708
13952
 
13709
13953
  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.
13710
13954
 
13711
- data = data.map(function (datum, idx) {
13955
+ newData = data.map(function (datum, idx) {
13712
13956
  return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data));
13713
13957
  });
13714
13958
  return {
13715
- animate: animate,
13716
- data: data
13959
+ animate: newAnimate,
13960
+ data: newData
13717
13961
  };
13718
13962
  } // eslint-disable-next-line max-params, max-len
13719
13963
 
@@ -13722,7 +13966,10 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
13722
13966
  // Whether or not _this_ child has exiting nodes, we want the exit-
13723
13967
  // transition for all children to have the same duration, delay, etc.
13724
13968
  var onExit = animate && animate.onExit;
13725
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onExit);
13969
+
13970
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onExit);
13971
+
13972
+ var newData = data;
13726
13973
 
13727
13974
  if (exitingNodes) {
13728
13975
  // After the exit transition occurs, trigger the animations for
@@ -13730,39 +13977,42 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
13730
13977
  animate.onEnd = cb;
13731
13978
  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.
13732
13979
 
13733
- data = data.map(function (datum, idx) {
13980
+ newData = data.map(function (datum, idx) {
13734
13981
  var key = (datum.key || idx).toString();
13735
13982
  return exitingNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
13736
13983
  });
13737
13984
  }
13738
13985
 
13739
13986
  return {
13740
- animate: animate,
13741
- data: data
13987
+ animate: newAnimate,
13988
+ data: newData
13742
13989
  };
13743
13990
  } // eslint-disable-next-line max-params,max-len
13744
13991
 
13745
13992
 
13746
13993
  function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
13994
+ var newAnimate = animate;
13995
+ var newData = data;
13996
+
13747
13997
  if (enteringNodes) {
13748
13998
  // Perform a normal animation here, except - when it finishes - trigger
13749
13999
  // the transition for entering nodes.
13750
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
14000
+ newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
13751
14001
  onEnd: cb
13752
14002
  });
13753
14003
  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
13754
14004
  // domain. However, we may not want these nodes to be displayed initially,
13755
14005
  // so perform the `onEnter.before` transformation on each node.
13756
14006
 
13757
- data = data.map(function (datum, idx) {
14007
+ newData = data.map(function (datum, idx) {
13758
14008
  var key = (datum.key || idx).toString();
13759
14009
  return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
13760
14010
  });
13761
14011
  }
13762
14012
 
13763
14013
  return {
13764
- animate: animate,
13765
- data: data
14014
+ animate: newAnimate,
14015
+ data: newData
13766
14016
  };
13767
14017
  } // eslint-disable-next-line max-params, max-len
13768
14018
 
@@ -13771,23 +14021,26 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
13771
14021
  // Whether or not _this_ child has entering nodes, we want the entering-
13772
14022
  // transition for all children to have the same duration, delay, etc.
13773
14023
  var onEnter = animate && animate.onEnter;
13774
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onEnter);
14024
+
14025
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onEnter);
14026
+
14027
+ var newData = data;
13775
14028
 
13776
14029
  if (enteringNodes) {
13777
14030
  // Old nodes have been transitioned to their new values, and the
13778
14031
  // domain should encompass the nodes that will now enter. So perform
13779
14032
  // the `onEnter.after` transformation on each node.
13780
- animate.onEnd = cb;
13781
- var after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default());
13782
- data = data.map(function (datum, idx) {
14033
+ newAnimate.onEnd = cb;
14034
+ var after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default());
14035
+ newData = data.map(function (datum, idx) {
13783
14036
  var key = getDatumKey(datum, idx);
13784
14037
  return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data)) : datum;
13785
14038
  });
13786
14039
  }
13787
14040
 
13788
14041
  return {
13789
- animate: animate,
13790
- data: data
14042
+ animate: newAnimate,
14043
+ data: newData
13791
14044
  };
13792
14045
  }
13793
14046
  /**
@@ -13953,6 +14206,7 @@ function getTransitionPropsFactory(props, state, setState) {
13953
14206
  "use strict";
13954
14207
  __webpack_require__.r(__webpack_exports__);
13955
14208
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14209
+ /* harmony export */ "assert": () => (/* binding */ assert),
13956
14210
  /* harmony export */ "getSafeUserProps": () => (/* binding */ getSafeUserProps),
13957
14211
  /* harmony export */ "withSafeUserProps": () => (/* binding */ withSafeUserProps)
13958
14212
  /* harmony export */ });
@@ -14033,6 +14287,18 @@ var testIfSafeProp = function (key) {
14033
14287
  if (doesPropStartWith(key) || isExactMatch(key)) return true;
14034
14288
  return false;
14035
14289
  };
14290
+ /**
14291
+ * Asserts that value is not null or undefined, throwing an error if it is.
14292
+ * @param value The value to assert
14293
+ * @param message The error message to throw
14294
+ */
14295
+
14296
+
14297
+ function assert(value, message) {
14298
+ if (value === undefined || value === null) {
14299
+ throw new Error(message);
14300
+ }
14301
+ }
14036
14302
  /**
14037
14303
  * getSafeUserProps - function that takes in a props object and removes any
14038
14304
  * key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
@@ -14042,7 +14308,6 @@ var testIfSafeProp = function (key) {
14042
14308
  * @returns {Object}: object containing remaining acceptable props
14043
14309
  */
14044
14310
 
14045
-
14046
14311
  var getSafeUserProps = function (props) {
14047
14312
  var propsToFilter = _objectSpread({}, props);
14048
14313
 
@@ -24783,15 +25048,15 @@ var __webpack_exports__ = {};
24783
25048
  (() => {
24784
25049
  "use strict";
24785
25050
  /*!******************!*\
24786
- !*** ./index.js ***!
25051
+ !*** ./index.ts ***!
24787
25052
  \******************/
24788
25053
  __webpack_require__.r(__webpack_exports__);
24789
25054
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24790
- /* harmony export */ "Slice": () => (/* reexport safe */ _slice__WEBPACK_IMPORTED_MODULE_1__["default"]),
24791
- /* harmony export */ "VictoryPie": () => (/* reexport safe */ _victory_pie__WEBPACK_IMPORTED_MODULE_0__["default"])
25055
+ /* harmony export */ "Slice": () => (/* reexport safe */ _slice__WEBPACK_IMPORTED_MODULE_1__.Slice),
25056
+ /* harmony export */ "VictoryPie": () => (/* reexport safe */ _victory_pie__WEBPACK_IMPORTED_MODULE_0__.VictoryPie)
24792
25057
  /* harmony export */ });
24793
- /* harmony import */ var _victory_pie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./victory-pie */ "./victory-pie.js");
24794
- /* harmony import */ var _slice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./slice */ "./slice.js");
25058
+ /* harmony import */ var _victory_pie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./victory-pie */ "./victory-pie.tsx");
25059
+ /* harmony import */ var _slice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./slice */ "./slice.tsx");
24795
25060
 
24796
25061
 
24797
25062
  })();