victory-pie 36.8.2 → 36.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
  };
@@ -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);
@@ -10428,13 +10664,15 @@ function addEvents(WrappedComponent) {
10428
10664
  var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_0___default()(this.dataKeys, "all");
10429
10665
 
10430
10666
  var labelComponents = dataKeys.reduce(function (memo, key) {
10667
+ var newMemo = memo;
10668
+
10431
10669
  var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
10432
10670
 
10433
10671
  if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
10434
- 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));
10435
10673
  }
10436
10674
 
10437
- return memo;
10675
+ return newMemo;
10438
10676
  }, []);
10439
10677
  var dataProps = this.getComponentProps(dataComponent, "data", "all");
10440
10678
  var children = [/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
@@ -10833,12 +11071,14 @@ function sortData(dataset, sortKey) {
10833
11071
  } // Ensures previous VictoryLine api for sortKey prop stays consistent
10834
11072
 
10835
11073
 
11074
+ var formattedSortKey = sortKey;
11075
+
10836
11076
  if (sortKey === "x" || sortKey === "y") {
10837
- sortKey = "_".concat(sortKey);
11077
+ formattedSortKey = "_".concat(sortKey);
10838
11078
  }
10839
11079
 
10840
11080
  var order = sortOrder === "ascending" ? "asc" : "desc";
10841
- return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset, sortKey, order);
11081
+ return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset, formattedSortKey, order);
10842
11082
  } // This method will remove data points that break certain scales. (log scale only)
10843
11083
 
10844
11084
 
@@ -11029,7 +11269,10 @@ function formatData(dataset, props, expectedKeys) {
11029
11269
  return [];
11030
11270
  }
11031
11271
 
11032
- 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
+
11033
11276
  expectedKeys = Array.isArray(expectedKeys) ? expectedKeys : defaultKeys;
11034
11277
 
11035
11278
  var createAccessor = function (name) {
@@ -11054,13 +11297,13 @@ function formatData(dataset, props, expectedKeys) {
11054
11297
 
11055
11298
  var data = preformattedData ? dataset : dataset.reduce(function (dataArr, datum, index) {
11056
11299
  // eslint-disable-line complexity
11057
- datum = parseDatum(datum);
11300
+ var parsedDatum = parseDatum(datum);
11058
11301
  var fallbackValues = {
11059
11302
  x: index,
11060
- y: datum
11303
+ y: parsedDatum
11061
11304
  };
11062
11305
  var processedValues = expectedKeys.reduce(function (memo, type) {
11063
- var processedValue = accessor[type](datum);
11306
+ var processedValue = accessor[type](parsedDatum);
11064
11307
  var value = processedValue !== undefined ? processedValue : fallbackValues[type];
11065
11308
 
11066
11309
  if (value !== undefined) {
@@ -11075,7 +11318,7 @@ function formatData(dataset, props, expectedKeys) {
11075
11318
  return memo;
11076
11319
  }, {});
11077
11320
 
11078
- var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues, datum);
11321
+ var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues, parsedDatum);
11079
11322
 
11080
11323
  if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_4___default()(formattedDatum)) {
11081
11324
  dataArr.push(formattedDatum);
@@ -11186,8 +11429,8 @@ function getStringsFromData(props, axis) {
11186
11429
  }, []);
11187
11430
  var sortedData = sortData(data, props.sortKey, props.sortOrder);
11188
11431
  var dataStrings = sortedData.reduce(function (dataArr, datum) {
11189
- datum = parseDatum(datum);
11190
- dataArr.push(accessor(datum));
11432
+ var parsedDatum = parseDatum(datum);
11433
+ dataArr.push(accessor(parsedDatum));
11191
11434
  return dataArr;
11192
11435
  }, []).filter(function (datum) {
11193
11436
  return typeof datum === "string";
@@ -11384,14 +11627,14 @@ function getScopedEvents(events, namespace, childType, baseProps) {
11384
11627
  // eslint-disable-next-line no-invalid-this
11385
11628
 
11386
11629
 
11387
- 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
11388
11631
 
11389
11632
  var getTargetProps = function (identifier, type) {
11390
11633
  var childName = identifier.childName,
11391
11634
  target = identifier.target,
11392
11635
  key = identifier.key; // eslint-disable-next-line no-invalid-this
11393
11636
 
11394
- var baseType = type === "props" ? baseProps : _this2.state || {};
11637
+ var baseType = type === "props" ? newBaseProps : _this2.state || {};
11395
11638
  var base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
11396
11639
  return key === "parent" ? base.parent : base[key] && base[key][target];
11397
11640
  }; // Returns the state object with the mutation caused by a given eventReturn
@@ -11408,9 +11651,9 @@ function getScopedEvents(events, namespace, childType, baseProps) {
11408
11651
  }
11409
11652
 
11410
11653
  if (eventReturn.eventKey === "all") {
11411
- return baseProps[childName] ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps[childName]), "parent") : lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps), "parent");
11654
+ return newBaseProps[childName] ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps[childName]), "parent") : lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps), "parent");
11412
11655
  } else if (eventReturn.eventKey === undefined && eventKey === "parent") {
11413
- return baseProps[childName] ? lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps[childName]) : lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps);
11656
+ return newBaseProps[childName] ? lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps[childName]) : lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps);
11414
11657
  }
11415
11658
 
11416
11659
  return eventReturn.eventKey !== undefined ? eventReturn.eventKey : eventKey;
@@ -11435,7 +11678,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
11435
11678
  key: key,
11436
11679
  target: target
11437
11680
  }, "state");
11438
- var mutatedProps = eventReturn.mutation(lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, mutationTargetProps, mutationTargetState), baseProps);
11681
+ var mutatedProps = eventReturn.mutation(lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, mutationTargetProps, mutationTargetState), newBaseProps);
11439
11682
  var childState = baseState[childName] || {};
11440
11683
 
11441
11684
  var filterState = function (state) {
@@ -11470,7 +11713,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
11470
11713
  }; // returns an entire mutated state for all children
11471
11714
 
11472
11715
 
11473
- var allChildNames = childNames === "all" ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps), "parent") : childNames;
11716
+ var allChildNames = childNames === "all" ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps), "parent") : childNames;
11474
11717
  return Array.isArray(allChildNames) ? allChildNames.reduce(function (memo, childName) {
11475
11718
  return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()(memo, getReturnByChild(childName));
11476
11719
  }, {}) : getReturnByChild(allChildNames);
@@ -11479,8 +11722,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
11479
11722
 
11480
11723
  var parseEventReturn = function (eventReturn, eventKey) {
11481
11724
  return Array.isArray(eventReturn) ? eventReturn.reduce(function (memo, props) {
11482
- memo = lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, memo, parseEvent(props, eventKey));
11483
- return memo;
11725
+ return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, memo, parseEvent(props, eventKey));
11484
11726
  }, {}) : parseEvent(eventReturn, eventKey);
11485
11727
  };
11486
11728
 
@@ -11566,9 +11808,10 @@ function getEventState(eventKey, namespace, childType) {
11566
11808
  */
11567
11809
  // eslint-disable-next-line max-params
11568
11810
 
11569
- function getExternalMutationsWithChildren(mutations, baseProps, baseState, childNames) {
11570
- baseProps = baseProps || {};
11571
- 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;
11572
11815
  return childNames.reduce(function (memo, childName) {
11573
11816
  var childState = baseState[childName];
11574
11817
  var mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
@@ -11590,9 +11833,10 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
11590
11833
  */
11591
11834
  // eslint-disable-next-line max-params
11592
11835
 
11593
- function getExternalMutations(mutations, baseProps, baseState, childName) {
11594
- baseProps = baseProps || {};
11595
- 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;
11596
11840
 
11597
11841
  var eventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps);
11598
11842
 
@@ -11658,8 +11902,7 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
11658
11902
  return false;
11659
11903
  };
11660
11904
 
11661
- mutations = Array.isArray(mutations) ? mutations : [mutations];
11662
- var scopedMutations = mutations;
11905
+ var scopedMutations = Array.isArray(mutations) ? mutations : [mutations];
11663
11906
 
11664
11907
  if (identifier.childName) {
11665
11908
  scopedMutations = mutations.filter(function (m) {
@@ -11698,13 +11941,10 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
11698
11941
 
11699
11942
  function getComponentEvents(props, components) {
11700
11943
  var events = Array.isArray(components) && components.reduce(function (memo, componentName) {
11701
- var _memo;
11702
-
11703
11944
  var component = props[componentName];
11704
11945
  var defaultEvents = component && component.type && component.type.defaultEvents;
11705
11946
  var componentEvents = lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(defaultEvents) ? defaultEvents(component.props) : defaultEvents;
11706
- memo = Array.isArray(componentEvents) ? (_memo = memo).concat.apply(_memo, _toConsumableArray(componentEvents)) : memo;
11707
- return memo;
11947
+ return Array.isArray(componentEvents) ? memo.concat.apply(memo, _toConsumableArray(componentEvents)) : memo;
11708
11948
  }, []);
11709
11949
  return events && events.length ? events : undefined;
11710
11950
  }
@@ -12062,6 +12302,7 @@ function reduceChildren(children, iteratee) {
12062
12302
 
12063
12303
  var traverseChildren = function (childArray, names, parent) {
12064
12304
  return childArray.reduce(function (memo, child, index) {
12305
+ var newMemo = memo;
12065
12306
  var childRole = child.type && child.type.role;
12066
12307
  var childName = child.props.name || "".concat(childRole, "-").concat(names[index]);
12067
12308
 
@@ -12079,16 +12320,16 @@ function reduceChildren(children, iteratee) {
12079
12320
  });
12080
12321
 
12081
12322
  var nestedResults = traverseChildren(nestedChildren, _childNames, child);
12082
- memo = combine(memo, nestedResults);
12323
+ newMemo = combine(newMemo, nestedResults);
12083
12324
  } else {
12084
12325
  var result = iteratee(child, childName, parent);
12085
12326
 
12086
12327
  if (result) {
12087
- memo = combine(memo, result);
12328
+ newMemo = combine(newMemo, result);
12088
12329
  }
12089
12330
  }
12090
12331
 
12091
- return memo;
12332
+ return newMemo;
12092
12333
  }, initialMemo);
12093
12334
  };
12094
12335
 
@@ -12114,8 +12355,7 @@ function isHorizontal(props) {
12114
12355
  var childProps = child.props || {};
12115
12356
 
12116
12357
  if (memo || childProps.horizontal || !childProps.children) {
12117
- memo = memo || childProps.horizontal;
12118
- return memo;
12358
+ return memo || childProps.horizontal;
12119
12359
  }
12120
12360
 
12121
12361
  return traverseChildren(react__WEBPACK_IMPORTED_MODULE_6___default().Children.toArray(childProps.children));
@@ -12168,11 +12408,13 @@ function isMap(x) {
12168
12408
  }
12169
12409
  function shallowToJS(x, whitelist) {
12170
12410
  return isIterable(x) ? x.reduce(function (result, curr, key) {
12411
+ var newCurr = curr;
12412
+
12171
12413
  if (whitelist && whitelist[key]) {
12172
- curr = shallowToJS(curr);
12414
+ newCurr = shallowToJS(curr);
12173
12415
  }
12174
12416
 
12175
- result[key] = curr;
12417
+ result[key] = newCurr;
12176
12418
  return result;
12177
12419
  }, isList(x) ? [] : {}) : x;
12178
12420
  }
@@ -12200,12 +12442,10 @@ __webpack_require__.r(__webpack_exports__);
12200
12442
  /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
12201
12443
 
12202
12444
 
12203
- /* eslint-disable no-use-before-define */
12204
-
12205
12445
 
12206
12446
  // Private Functions
12207
- function getVerticalAnchor(props, datum) {
12208
- datum = datum || {};
12447
+ function getVerticalAnchor(props) {
12448
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12209
12449
  var sign = datum._y >= 0 ? 1 : -1;
12210
12450
  var labelStyle = props.style && props.style.labels || {};
12211
12451
 
@@ -12218,8 +12458,8 @@ function getVerticalAnchor(props, datum) {
12218
12458
  return "middle";
12219
12459
  }
12220
12460
 
12221
- function getTextAnchor(props, datum) {
12222
- datum = datum || {};
12461
+ function getTextAnchor(props) {
12462
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12223
12463
  var style = props.style,
12224
12464
  horizontal = props.horizontal;
12225
12465
  var sign = datum._y >= 0 ? 1 : -1;
@@ -12234,14 +12474,14 @@ function getTextAnchor(props, datum) {
12234
12474
  return sign >= 0 ? "start" : "end";
12235
12475
  }
12236
12476
 
12237
- function getAngle(props, datum) {
12238
- datum = datum || {};
12477
+ function getAngle(props) {
12478
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12239
12479
  var labelStyle = props.style && props.style.labels || {};
12240
12480
  return datum.angle === undefined ? labelStyle.angle : datum.angle;
12241
12481
  }
12242
12482
 
12243
- function getPadding(props, datum) {
12244
- datum = datum || {};
12483
+ function getPadding(props) {
12484
+ var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12245
12485
  var horizontal = props.horizontal,
12246
12486
  style = props.style;
12247
12487
  var labelStyle = style.labels || {};
@@ -12320,8 +12560,9 @@ function getPolarOrientation(degrees) {
12320
12560
  } // Exported Functions
12321
12561
 
12322
12562
 
12323
- function getText(props, datum, index) {
12324
- 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;
12325
12566
 
12326
12567
  if (datum.label !== undefined) {
12327
12568
  return datum.label;
@@ -13481,11 +13722,10 @@ var Timer = /*#__PURE__*/function () {
13481
13722
  }, {
13482
13723
  key: "subscribe",
13483
13724
  value: function subscribe(callback, duration) {
13484
- duration = this.shouldAnimate ? duration : 0;
13485
13725
  var subscriptionID = this.subscribers.push({
13486
13726
  startTime: (0,victory_vendor_d3_timer__WEBPACK_IMPORTED_MODULE_0__.now)(),
13487
13727
  callback: callback,
13488
- duration: duration
13728
+ duration: this.shouldAnimate ? duration : 0
13489
13729
  });
13490
13730
  this.activeSubscriptions++;
13491
13731
  this.start();
@@ -13672,36 +13912,38 @@ function getInitialChildProps(animate, data) {
13672
13912
 
13673
13913
 
13674
13914
  function getChildBeforeLoad(animate, child, data, cb) {
13675
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
13915
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
13676
13916
  onEnd: cb
13677
13917
  });
13678
13918
 
13679
- if (animate && animate.onLoad && !animate.onLoad.duration) {
13919
+ if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
13680
13920
  return {
13681
- animate: animate,
13921
+ animate: newAnimate,
13682
13922
  data: data
13683
13923
  };
13684
13924
  }
13685
13925
 
13686
- 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.
13687
13927
 
13688
- data = data.map(function (datum, idx) {
13928
+ var newData = data.map(function (datum, idx) {
13689
13929
  return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data));
13690
13930
  });
13691
13931
  return {
13692
- animate: animate,
13693
- data: data,
13932
+ animate: newAnimate,
13933
+ data: newData,
13694
13934
  clipWidth: 0
13695
13935
  };
13696
13936
  } // eslint-disable-next-line max-params
13697
13937
 
13698
13938
 
13699
13939
  function getChildOnLoad(animate, data, cb) {
13700
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
13940
+ var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
13701
13941
  onEnd: cb
13702
13942
  });
13703
13943
 
13704
- if (animate && animate.onLoad && !animate.onLoad.duration) {
13944
+ var newData = data;
13945
+
13946
+ if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
13705
13947
  return {
13706
13948
  animate: animate,
13707
13949
  data: data
@@ -13710,12 +13952,12 @@ function getChildOnLoad(animate, data, cb) {
13710
13952
 
13711
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.
13712
13954
 
13713
- data = data.map(function (datum, idx) {
13955
+ newData = data.map(function (datum, idx) {
13714
13956
  return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data));
13715
13957
  });
13716
13958
  return {
13717
- animate: animate,
13718
- data: data
13959
+ animate: newAnimate,
13960
+ data: newData
13719
13961
  };
13720
13962
  } // eslint-disable-next-line max-params, max-len
13721
13963
 
@@ -13724,7 +13966,10 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
13724
13966
  // Whether or not _this_ child has exiting nodes, we want the exit-
13725
13967
  // transition for all children to have the same duration, delay, etc.
13726
13968
  var onExit = animate && animate.onExit;
13727
- 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;
13728
13973
 
13729
13974
  if (exitingNodes) {
13730
13975
  // After the exit transition occurs, trigger the animations for
@@ -13732,39 +13977,42 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
13732
13977
  animate.onEnd = cb;
13733
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.
13734
13979
 
13735
- data = data.map(function (datum, idx) {
13980
+ newData = data.map(function (datum, idx) {
13736
13981
  var key = (datum.key || idx).toString();
13737
13982
  return exitingNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
13738
13983
  });
13739
13984
  }
13740
13985
 
13741
13986
  return {
13742
- animate: animate,
13743
- data: data
13987
+ animate: newAnimate,
13988
+ data: newData
13744
13989
  };
13745
13990
  } // eslint-disable-next-line max-params,max-len
13746
13991
 
13747
13992
 
13748
13993
  function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
13994
+ var newAnimate = animate;
13995
+ var newData = data;
13996
+
13749
13997
  if (enteringNodes) {
13750
13998
  // Perform a normal animation here, except - when it finishes - trigger
13751
13999
  // the transition for entering nodes.
13752
- animate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
14000
+ newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
13753
14001
  onEnd: cb
13754
14002
  });
13755
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
13756
14004
  // domain. However, we may not want these nodes to be displayed initially,
13757
14005
  // so perform the `onEnter.before` transformation on each node.
13758
14006
 
13759
- data = data.map(function (datum, idx) {
14007
+ newData = data.map(function (datum, idx) {
13760
14008
  var key = (datum.key || idx).toString();
13761
14009
  return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
13762
14010
  });
13763
14011
  }
13764
14012
 
13765
14013
  return {
13766
- animate: animate,
13767
- data: data
14014
+ animate: newAnimate,
14015
+ data: newData
13768
14016
  };
13769
14017
  } // eslint-disable-next-line max-params, max-len
13770
14018
 
@@ -13773,23 +14021,26 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
13773
14021
  // Whether or not _this_ child has entering nodes, we want the entering-
13774
14022
  // transition for all children to have the same duration, delay, etc.
13775
14023
  var onEnter = animate && animate.onEnter;
13776
- 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;
13777
14028
 
13778
14029
  if (enteringNodes) {
13779
14030
  // Old nodes have been transitioned to their new values, and the
13780
14031
  // domain should encompass the nodes that will now enter. So perform
13781
14032
  // the `onEnter.after` transformation on each node.
13782
- animate.onEnd = cb;
13783
- var after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default());
13784
- 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) {
13785
14036
  var key = getDatumKey(datum, idx);
13786
14037
  return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data)) : datum;
13787
14038
  });
13788
14039
  }
13789
14040
 
13790
14041
  return {
13791
- animate: animate,
13792
- data: data
14042
+ animate: newAnimate,
14043
+ data: newData
13793
14044
  };
13794
14045
  }
13795
14046
  /**
@@ -13955,6 +14206,7 @@ function getTransitionPropsFactory(props, state, setState) {
13955
14206
  "use strict";
13956
14207
  __webpack_require__.r(__webpack_exports__);
13957
14208
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14209
+ /* harmony export */ "assert": () => (/* binding */ assert),
13958
14210
  /* harmony export */ "getSafeUserProps": () => (/* binding */ getSafeUserProps),
13959
14211
  /* harmony export */ "withSafeUserProps": () => (/* binding */ withSafeUserProps)
13960
14212
  /* harmony export */ });
@@ -14035,6 +14287,18 @@ var testIfSafeProp = function (key) {
14035
14287
  if (doesPropStartWith(key) || isExactMatch(key)) return true;
14036
14288
  return false;
14037
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
+ }
14038
14302
  /**
14039
14303
  * getSafeUserProps - function that takes in a props object and removes any
14040
14304
  * key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
@@ -14044,7 +14308,6 @@ var testIfSafeProp = function (key) {
14044
14308
  * @returns {Object}: object containing remaining acceptable props
14045
14309
  */
14046
14310
 
14047
-
14048
14311
  var getSafeUserProps = function (props) {
14049
14312
  var propsToFilter = _objectSpread({}, props);
14050
14313
 
@@ -24785,15 +25048,15 @@ var __webpack_exports__ = {};
24785
25048
  (() => {
24786
25049
  "use strict";
24787
25050
  /*!******************!*\
24788
- !*** ./index.js ***!
25051
+ !*** ./index.ts ***!
24789
25052
  \******************/
24790
25053
  __webpack_require__.r(__webpack_exports__);
24791
25054
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24792
- /* harmony export */ "Slice": () => (/* reexport safe */ _slice__WEBPACK_IMPORTED_MODULE_1__["default"]),
24793
- /* 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)
24794
25057
  /* harmony export */ });
24795
- /* harmony import */ var _victory_pie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./victory-pie */ "./victory-pie.js");
24796
- /* 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");
24797
25060
 
24798
25061
 
24799
25062
  })();