victory-group 35.11.2 → 36.1.0

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.
@@ -53,20 +53,20 @@ var fallbackProps = {
53
53
  function getCalculatedProps(props, childComponents) {
54
54
  var role = "group";
55
55
  props = victory_core__WEBPACK_IMPORTED_MODULE_2__.modifyProps(props, fallbackProps, role);
56
- var style = victory_core__WEBPACK_IMPORTED_MODULE_3__.default.getStyle(props.theme, props.style, role);
56
+ var style = victory_core__WEBPACK_IMPORTED_MODULE_3__.getStyle(props.theme, props.style, role);
57
57
  var _props = props,
58
58
  offset = _props.offset,
59
59
  colorScale = _props.colorScale,
60
60
  color = _props.color,
61
61
  polar = _props.polar,
62
62
  horizontal = _props.horizontal;
63
- var categories = props.categories || victory_core__WEBPACK_IMPORTED_MODULE_3__.default.getCategories(props, childComponents);
64
- var datasets = props.datasets || victory_core__WEBPACK_IMPORTED_MODULE_3__.default.getDataFromChildren(props);
63
+ var categories = props.categories || victory_core__WEBPACK_IMPORTED_MODULE_3__.getCategories(props, childComponents);
64
+ var datasets = props.datasets || victory_core__WEBPACK_IMPORTED_MODULE_3__.getDataFromChildren(props);
65
65
  var domain = {
66
- x: victory_core__WEBPACK_IMPORTED_MODULE_3__.default.getDomain(lodash_assign__WEBPACK_IMPORTED_MODULE_0___default()({}, props, {
66
+ x: victory_core__WEBPACK_IMPORTED_MODULE_3__.getDomain(lodash_assign__WEBPACK_IMPORTED_MODULE_0___default()({}, props, {
67
67
  categories: categories
68
68
  }), "x", childComponents),
69
- y: victory_core__WEBPACK_IMPORTED_MODULE_3__.default.getDomain(lodash_assign__WEBPACK_IMPORTED_MODULE_0___default()({}, props, {
69
+ y: victory_core__WEBPACK_IMPORTED_MODULE_3__.getDomain(lodash_assign__WEBPACK_IMPORTED_MODULE_0___default()({}, props, {
70
70
  categories: categories
71
71
  }), "y", childComponents)
72
72
  };
@@ -75,8 +75,8 @@ function getCalculatedProps(props, childComponents) {
75
75
  y: victory_core__WEBPACK_IMPORTED_MODULE_2__.getRange(props, "y")
76
76
  };
77
77
  var baseScale = {
78
- x: victory_core__WEBPACK_IMPORTED_MODULE_4__.getScaleFromProps(props, "x") || victory_core__WEBPACK_IMPORTED_MODULE_3__.default.getScale(props, "x"),
79
- y: victory_core__WEBPACK_IMPORTED_MODULE_4__.getScaleFromProps(props, "y") || victory_core__WEBPACK_IMPORTED_MODULE_3__.default.getScale(props, "y")
78
+ x: victory_core__WEBPACK_IMPORTED_MODULE_4__.getScaleFromProps(props, "x") || victory_core__WEBPACK_IMPORTED_MODULE_3__.getScale(props, "x"),
79
+ y: victory_core__WEBPACK_IMPORTED_MODULE_4__.getScaleFromProps(props, "y") || victory_core__WEBPACK_IMPORTED_MODULE_3__.getScale(props, "y")
80
80
  };
81
81
  var scale = {
82
82
  x: baseScale.x.domain(domain.x).range(props.horizontal ? range.y : range.x),
@@ -211,7 +211,7 @@ function getChildren(props, childComponents, calculatedProps) {
211
211
  return childComponents.map(function (child, index) {
212
212
  var role = child.type && child.type.role;
213
213
  var xOffset = polar ? getPolarX0(props, calculatedProps, index, role) : getX0(props, calculatedProps, index, role);
214
- var style = role === "voronoi" || role === "tooltip" || role === "label" ? child.props.style : victory_core__WEBPACK_IMPORTED_MODULE_3__.default.getChildStyle(child, index, calculatedProps);
214
+ var style = role === "voronoi" || role === "tooltip" || role === "label" ? child.props.style : victory_core__WEBPACK_IMPORTED_MODULE_3__.getChildStyle(child, index, calculatedProps);
215
215
  var labels = props.labels ? getLabels(props, datasets, index) : child.props.labels;
216
216
  var name = child.props.name || "".concat(parentName, "-").concat(role, "-").concat(index);
217
217
  return react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(child, lodash_assign__WEBPACK_IMPORTED_MODULE_0___default()({
@@ -238,7 +238,7 @@ function getChildren(props, childComponents, calculatedProps) {
238
238
  "use strict";
239
239
  __webpack_require__.r(__webpack_exports__);
240
240
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
241
- /* harmony export */ "default": () => (/* binding */ VictoryGroup)
241
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
242
242
  /* harmony export */ });
243
243
  /* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/isEmpty */ "../../../node_modules/lodash/isEmpty.js");
244
244
  /* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0__);
@@ -250,13 +250,14 @@ __webpack_require__.r(__webpack_exports__);
250
250
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
251
251
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "react");
252
252
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
253
- /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/wrapper.js");
254
- /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
255
- /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/common-props.js");
256
- /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
257
- /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-theme/victory-theme.js");
258
- /* harmony import */ var victory_shared_events__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! victory-shared-events */ "../../victory-shared-events/es/victory-shared-events.js");
259
- /* harmony import */ var _helper_methods__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helper-methods */ "./helper-methods.js");
253
+ /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/hooks.js");
254
+ /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
255
+ /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/wrapper.js");
256
+ /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/common-props.js");
257
+ /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
258
+ /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-theme/victory-theme.js");
259
+ /* harmony import */ var victory_shared_events__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! victory-shared-events */ "../../victory-shared-events/es/victory-shared-events.js");
260
+ /* harmony import */ var _helper_methods__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helper-methods */ "./helper-methods.js");
260
261
  /* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-fast-compare */ "../../../node_modules/react-fast-compare/index.js");
261
262
  /* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_5__);
262
263
 
@@ -267,18 +268,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
267
268
 
268
269
  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; }
269
270
 
270
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
271
-
272
- 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); } }
273
-
274
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
275
-
276
- function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
277
-
278
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
279
-
280
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
281
-
282
271
 
283
272
 
284
273
 
@@ -292,76 +281,46 @@ var fallbackProps = {
292
281
  offset: 0
293
282
  };
294
283
 
295
- var VictoryGroup =
296
- /*#__PURE__*/
297
- function (_React$Component) {
298
- _inherits(VictoryGroup, _React$Component);
299
-
300
- function VictoryGroup(props) {
301
- var _this;
302
-
303
- _classCallCheck(this, VictoryGroup);
304
-
305
- _this = _possibleConstructorReturn(this, (VictoryGroup.__proto__ || Object.getPrototypeOf(VictoryGroup)).call(this, props));
306
-
307
- if (props.animate) {
308
- _this.state = {
309
- nodesShouldLoad: false,
310
- nodesDoneLoad: false,
311
- animating: true
312
- };
313
- _this.setAnimationState = victory_core__WEBPACK_IMPORTED_MODULE_6__.default.setAnimationState.bind(_assertThisInitialized(_this));
314
- }
315
-
316
- return _this;
317
- }
318
-
319
- _createClass(VictoryGroup, [{
320
- key: "shouldComponentUpdate",
321
- value: function shouldComponentUpdate(nextProps) {
322
- if (this.props.animate) {
323
- if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_5___default()(this.props, nextProps)) {
324
- this.setAnimationState(this.props, nextProps);
325
- return false;
326
- }
327
- }
328
-
329
- return true;
330
- }
331
- }, {
332
- key: "getNewChildren",
333
- value: function getNewChildren(props, childComponents, calculatedProps) {
334
- var children = (0,_helper_methods__WEBPACK_IMPORTED_MODULE_7__.getChildren)(props, childComponents, calculatedProps);
335
- var getAnimationProps = victory_core__WEBPACK_IMPORTED_MODULE_6__.default.getAnimationProps.bind(this);
336
- return children.map(function (child, index) {
337
- var childProps = lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({
338
- animate: getAnimationProps(props, child, index)
339
- }, child.props);
340
-
341
- return react__WEBPACK_IMPORTED_MODULE_4___default().cloneElement(child, childProps);
342
- });
343
- }
344
- }, {
345
- key: "renderContainer",
346
- value: function renderContainer(containerComponent, props) {
347
- var containerProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, containerComponent.props, props);
348
-
349
- return react__WEBPACK_IMPORTED_MODULE_4___default().cloneElement(containerComponent, containerProps);
350
- }
351
- }, {
352
- key: "getContainerProps",
353
- value: function getContainerProps(props, calculatedProps) {
354
- var width = props.width,
355
- height = props.height,
356
- standalone = props.standalone,
357
- theme = props.theme,
358
- polar = props.polar,
359
- horizontal = props.horizontal,
360
- name = props.name;
361
- var domain = calculatedProps.domain,
362
- scale = calculatedProps.scale,
363
- style = calculatedProps.style,
364
- origin = calculatedProps.origin;
284
+ var VictoryGroup = function (initialProps) {
285
+ // eslint-disable-next-line no-use-before-define
286
+ var role = VictoryGroupMemo.role;
287
+
288
+ var _useAnimationState = (0,victory_core__WEBPACK_IMPORTED_MODULE_6__.useAnimationState)(),
289
+ getAnimationProps = _useAnimationState.getAnimationProps,
290
+ setAnimationState = _useAnimationState.setAnimationState,
291
+ getProps = _useAnimationState.getProps;
292
+
293
+ var props = getProps(initialProps);
294
+ var modifiedProps = victory_core__WEBPACK_IMPORTED_MODULE_7__.modifyProps(props, fallbackProps, role);
295
+ var eventKey = modifiedProps.eventKey,
296
+ containerComponent = modifiedProps.containerComponent,
297
+ standalone = modifiedProps.standalone,
298
+ groupComponent = modifiedProps.groupComponent,
299
+ externalEventMutations = modifiedProps.externalEventMutations,
300
+ width = modifiedProps.width,
301
+ height = modifiedProps.height,
302
+ theme = modifiedProps.theme,
303
+ polar = modifiedProps.polar,
304
+ horizontal = modifiedProps.horizontal,
305
+ name = modifiedProps.name;
306
+ var childComponents = react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(modifiedProps.children);
307
+ var calculatedProps = (0,_helper_methods__WEBPACK_IMPORTED_MODULE_8__.getCalculatedProps)(modifiedProps, childComponents);
308
+ var domain = calculatedProps.domain,
309
+ scale = calculatedProps.scale,
310
+ style = calculatedProps.style,
311
+ origin = calculatedProps.origin;
312
+ var newChildren = react__WEBPACK_IMPORTED_MODULE_4___default().useMemo(function () {
313
+ var children = (0,_helper_methods__WEBPACK_IMPORTED_MODULE_8__.getChildren)(props, childComponents, calculatedProps);
314
+ return children.map(function (child, index) {
315
+ var childProps = lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({
316
+ animate: getAnimationProps(props, child, index, "victory-group")
317
+ }, child.props);
318
+
319
+ return react__WEBPACK_IMPORTED_MODULE_4___default().cloneElement(child, childProps);
320
+ });
321
+ }, [props, childComponents, calculatedProps, getAnimationProps]);
322
+ var containerProps = react__WEBPACK_IMPORTED_MODULE_4___default().useMemo(function () {
323
+ if (standalone) {
365
324
  return {
366
325
  domain: domain,
367
326
  scale: scale,
@@ -376,90 +335,66 @@ function (_React$Component) {
376
335
  name: name
377
336
  };
378
337
  }
379
- }, {
380
- key: "render",
381
- value: function render() {
382
- var role = this.constructor.role;
383
- var props = this.state && this.state.nodesWillExit ? this.state.oldProps || this.props : this.props;
384
- var modifiedProps = victory_core__WEBPACK_IMPORTED_MODULE_8__.modifyProps(props, fallbackProps, role);
385
- var eventKey = modifiedProps.eventKey,
386
- containerComponent = modifiedProps.containerComponent,
387
- standalone = modifiedProps.standalone,
388
- groupComponent = modifiedProps.groupComponent,
389
- externalEventMutations = modifiedProps.externalEventMutations;
390
- var childComponents = react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(modifiedProps.children);
391
- var calculatedProps = (0,_helper_methods__WEBPACK_IMPORTED_MODULE_7__.getCalculatedProps)(modifiedProps, childComponents);
392
- var newChildren = this.getNewChildren(modifiedProps, childComponents, calculatedProps);
393
- var containerProps = standalone ? this.getContainerProps(modifiedProps, calculatedProps) : {};
394
- var container = standalone ? this.renderContainer(containerComponent, containerProps) : groupComponent;
395
- var events = victory_core__WEBPACK_IMPORTED_MODULE_6__.default.getAllEvents(props);
396
-
397
- if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(events)) {
398
- return react__WEBPACK_IMPORTED_MODULE_4___default().createElement(victory_shared_events__WEBPACK_IMPORTED_MODULE_9__.default, {
399
- container: container,
400
- eventKey: eventKey,
401
- events: events,
402
- externalEventMutations: externalEventMutations
403
- }, newChildren);
404
- }
405
338
 
406
- return react__WEBPACK_IMPORTED_MODULE_4___default().cloneElement(container, container.props, newChildren);
339
+ return {};
340
+ }, [standalone, domain, scale, width, height, theme, style, horizontal, polar, origin, name]);
341
+ var container = react__WEBPACK_IMPORTED_MODULE_4___default().useMemo(function () {
342
+ if (standalone) {
343
+ var defaultContainerProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, containerComponent.props, containerProps);
344
+
345
+ return react__WEBPACK_IMPORTED_MODULE_4___default().cloneElement(containerComponent, defaultContainerProps);
407
346
  }
408
- }]);
409
347
 
410
- return VictoryGroup;
411
- }((react__WEBPACK_IMPORTED_MODULE_4___default().Component));
348
+ return groupComponent;
349
+ }, [groupComponent, standalone, containerComponent, containerProps]);
350
+ var events = react__WEBPACK_IMPORTED_MODULE_4___default().useMemo(function () {
351
+ return victory_core__WEBPACK_IMPORTED_MODULE_9__.getAllEvents(props);
352
+ }, [props]);
353
+ var previousProps = (0,victory_core__WEBPACK_IMPORTED_MODULE_6__.usePreviousProps)(initialProps);
354
+ react__WEBPACK_IMPORTED_MODULE_4___default().useEffect(function () {
355
+ // This is called before dismount to keep state in sync
356
+ return function () {
357
+ if (initialProps.animate) {
358
+ setAnimationState(previousProps, props);
359
+ }
360
+ };
361
+ }, [setAnimationState, previousProps, initialProps, props]);
412
362
 
413
- Object.defineProperty(VictoryGroup, "displayName", {
414
- configurable: true,
415
- enumerable: true,
416
- writable: true,
417
- value: "VictoryGroup"
418
- });
419
- Object.defineProperty(VictoryGroup, "role", {
420
- configurable: true,
421
- enumerable: true,
422
- writable: true,
423
- value: "group"
424
- });
425
- Object.defineProperty(VictoryGroup, "propTypes", {
426
- configurable: true,
427
- enumerable: true,
428
- writable: true,
429
- value: _objectSpread({}, victory_core__WEBPACK_IMPORTED_MODULE_10__.baseProps, victory_core__WEBPACK_IMPORTED_MODULE_10__.dataProps, {
430
- children: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_3___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_3___default().node)), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node)]),
431
- color: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_3___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func)]),
432
- 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"])]),
433
- horizontal: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
434
- offset: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number)
435
- })
436
- });
437
- Object.defineProperty(VictoryGroup, "defaultProps", {
438
- configurable: true,
439
- enumerable: true,
440
- writable: true,
441
- value: {
442
- containerComponent: react__WEBPACK_IMPORTED_MODULE_4___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_11__.default, null),
443
- groupComponent: react__WEBPACK_IMPORTED_MODULE_4___default().createElement("g", null),
444
- samples: 50,
445
- sortOrder: "ascending",
446
- standalone: true,
447
- theme: victory_core__WEBPACK_IMPORTED_MODULE_12__.default.grayscale
363
+ if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(events)) {
364
+ return react__WEBPACK_IMPORTED_MODULE_4___default().createElement(victory_shared_events__WEBPACK_IMPORTED_MODULE_10__.default, {
365
+ container: container,
366
+ eventKey: eventKey,
367
+ events: events,
368
+ externalEventMutations: externalEventMutations
369
+ }, newChildren);
448
370
  }
371
+
372
+ return react__WEBPACK_IMPORTED_MODULE_4___default().cloneElement(container, container.props, newChildren);
373
+ };
374
+
375
+ VictoryGroup.propTypes = _objectSpread({}, victory_core__WEBPACK_IMPORTED_MODULE_11__.baseProps, victory_core__WEBPACK_IMPORTED_MODULE_11__.dataProps, {
376
+ children: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_3___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_3___default().node)), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node)]),
377
+ color: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_3___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func)]),
378
+ 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"])]),
379
+ horizontal: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
380
+ offset: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number)
449
381
  });
450
- Object.defineProperty(VictoryGroup, "expectedComponents", {
451
- configurable: true,
452
- enumerable: true,
453
- writable: true,
454
- value: ["groupComponent", "containerComponent", "labelComponent"]
455
- });
456
- Object.defineProperty(VictoryGroup, "getChildren", {
457
- configurable: true,
458
- enumerable: true,
459
- writable: true,
460
- value: _helper_methods__WEBPACK_IMPORTED_MODULE_7__.getChildren
461
- });
382
+ VictoryGroup.defaultProps = {
383
+ containerComponent: react__WEBPACK_IMPORTED_MODULE_4___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_12__.default, null),
384
+ groupComponent: react__WEBPACK_IMPORTED_MODULE_4___default().createElement("g", null),
385
+ samples: 50,
386
+ sortOrder: "ascending",
387
+ standalone: true,
388
+ theme: victory_core__WEBPACK_IMPORTED_MODULE_13__.default.grayscale
389
+ }; // We need to attatch the static properties to the memoized version, or else
390
+ // VictoryChart will not be able to get this component's role type
462
391
 
392
+ var VictoryGroupMemo = react__WEBPACK_IMPORTED_MODULE_4___default().memo(VictoryGroup, (react_fast_compare__WEBPACK_IMPORTED_MODULE_5___default()));
393
+ VictoryGroupMemo.displayName = "VictoryGroup";
394
+ VictoryGroupMemo.role = "group";
395
+ VictoryGroupMemo.expectedComponents = ["groupComponent", "containerComponent", "labelComponent"];
396
+ VictoryGroupMemo.getChildren = _helper_methods__WEBPACK_IMPORTED_MODULE_8__.getChildren;
397
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (VictoryGroupMemo);
463
398
 
464
399
  /***/ }),
465
400
 
@@ -13666,9 +13601,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
13666
13601
 
13667
13602
 
13668
13603
 
13669
- var VictoryContainer =
13670
- /*#__PURE__*/
13671
- function (_React$Component) {
13604
+ var VictoryContainer = /*#__PURE__*/function (_React$Component) {
13672
13605
  _inherits(VictoryContainer, _React$Component);
13673
13606
 
13674
13607
  function VictoryContainer(props) {
@@ -13985,9 +13918,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
13985
13918
 
13986
13919
 
13987
13920
 
13988
- var Portal =
13989
- /*#__PURE__*/
13990
- function (_React$Component) {
13921
+ var Portal = /*#__PURE__*/function (_React$Component) {
13991
13922
  _inherits(Portal, _React$Component);
13992
13923
 
13993
13924
  function Portal(props) {
@@ -17209,6 +17140,166 @@ function isHorizontal(props) {
17209
17140
 
17210
17141
  /***/ }),
17211
17142
 
17143
+ /***/ "../../victory-core/es/victory-util/hooks.js":
17144
+ /*!***************************************************!*\
17145
+ !*** ../../victory-core/es/victory-util/hooks.js ***!
17146
+ \***************************************************/
17147
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
17148
+
17149
+ "use strict";
17150
+ __webpack_require__.r(__webpack_exports__);
17151
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
17152
+ /* harmony export */ "usePreviousProps": () => (/* binding */ usePreviousProps),
17153
+ /* harmony export */ "useAnimationState": () => (/* binding */ useAnimationState)
17154
+ /* harmony export */ });
17155
+ /* harmony import */ var lodash_some__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/some */ "../../../node_modules/lodash/some.js");
17156
+ /* harmony import */ var lodash_some__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_some__WEBPACK_IMPORTED_MODULE_0__);
17157
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/lodash/defaults.js");
17158
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
17159
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
17160
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
17161
+ /* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
17162
+ /* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./transitions */ "../../victory-core/es/victory-util/transitions.js");
17163
+
17164
+
17165
+
17166
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
17167
+
17168
+ 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; }
17169
+
17170
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
17171
+
17172
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
17173
+
17174
+ function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
17175
+
17176
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17177
+
17178
+
17179
+
17180
+
17181
+ var usePreviousProps = function (props) {
17182
+ var ref = react__WEBPACK_IMPORTED_MODULE_2___default().useRef();
17183
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(function () {
17184
+ ref.current = props;
17185
+ });
17186
+ return ref.current || {};
17187
+ };
17188
+ var INITIAL_STATE = {
17189
+ nodesShouldLoad: false,
17190
+ nodesDoneLoad: false,
17191
+ animating: true
17192
+ };
17193
+ var useAnimationState = function () {
17194
+ var initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INITIAL_STATE;
17195
+
17196
+ var _React$useState = react__WEBPACK_IMPORTED_MODULE_2___default().useState(initialState),
17197
+ _React$useState2 = _slicedToArray(_React$useState, 2),
17198
+ state = _React$useState2[0],
17199
+ _setState = _React$useState2[1]; // This allows us to use a state object and maintain the same API as this.setState
17200
+
17201
+
17202
+ var setState = react__WEBPACK_IMPORTED_MODULE_2___default().useCallback(function (newState) {
17203
+ _setState(function (oldState) {
17204
+ return _objectSpread({}, oldState, newState);
17205
+ });
17206
+ }, [_setState]); // This is a copy of Wrapper.getAnimationProps
17207
+
17208
+ var getAnimationProps = react__WEBPACK_IMPORTED_MODULE_2___default().useCallback(function (props, child, index) {
17209
+ if (!props.animate) {
17210
+ return child.props.animate;
17211
+ }
17212
+
17213
+ var getFilteredState = function () {
17214
+ var childrenTransitions = state && state.childrenTransitions;
17215
+ childrenTransitions = _collection__WEBPACK_IMPORTED_MODULE_3__.isArrayOfArrays(childrenTransitions) ? childrenTransitions[index] : childrenTransitions;
17216
+ return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
17217
+ childrenTransitions: childrenTransitions
17218
+ }, state);
17219
+ };
17220
+
17221
+ var getTransitions = props.animate && props.animate.getTransitions;
17222
+ var filteredState = getFilteredState();
17223
+ var parentState = props.animate && props.animate.parentState || filteredState;
17224
+
17225
+ if (!getTransitions) {
17226
+ var getTransitionProps = _transitions__WEBPACK_IMPORTED_MODULE_4__.getTransitionPropsFactory(props, filteredState, function (newState) {
17227
+ return setState(newState);
17228
+ });
17229
+
17230
+ getTransitions = function (childComponent) {
17231
+ return getTransitionProps(childComponent, index);
17232
+ };
17233
+ }
17234
+
17235
+ return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
17236
+ getTransitions: getTransitions,
17237
+ parentState: parentState
17238
+ }, props.animate, child.props.animate);
17239
+ }, [state, setState]); // This is a copy of Wrapper.setAnimationState
17240
+
17241
+ var setAnimationState = react__WEBPACK_IMPORTED_MODULE_2___default().useCallback(function (props, nextProps) {
17242
+ if (!props.animate) {
17243
+ return;
17244
+ }
17245
+
17246
+ if (props.animate.parentState) {
17247
+ var nodesWillExit = props.animate.parentState.nodesWillExit;
17248
+ var oldProps = nodesWillExit ? props : null;
17249
+
17250
+ var newState = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
17251
+ oldProps: oldProps,
17252
+ nextProps: nextProps
17253
+ }, props.animate.parentState);
17254
+
17255
+ setState(newState);
17256
+ } else {
17257
+ var oldChildren = react__WEBPACK_IMPORTED_MODULE_2___default().Children.toArray(props.children);
17258
+ var nextChildren = react__WEBPACK_IMPORTED_MODULE_2___default().Children.toArray(nextProps.children);
17259
+
17260
+ var isContinuous = function (child) {
17261
+ var check = function (c) {
17262
+ return c.type && c.type.continuous;
17263
+ };
17264
+
17265
+ return Array.isArray(child) ? lodash_some__WEBPACK_IMPORTED_MODULE_0___default()(child, check) : check(child);
17266
+ };
17267
+
17268
+ var continuous = !props.polar && lodash_some__WEBPACK_IMPORTED_MODULE_0___default()(oldChildren, function (child) {
17269
+ return isContinuous(child) || child.props.children && isContinuous(child.props.children);
17270
+ });
17271
+
17272
+ var _Transitions$getIniti = _transitions__WEBPACK_IMPORTED_MODULE_4__.getInitialTransitionState(oldChildren, nextChildren),
17273
+ _nodesWillExit = _Transitions$getIniti.nodesWillExit,
17274
+ nodesWillEnter = _Transitions$getIniti.nodesWillEnter,
17275
+ childrenTransitions = _Transitions$getIniti.childrenTransitions,
17276
+ nodesShouldEnter = _Transitions$getIniti.nodesShouldEnter;
17277
+
17278
+ setState({
17279
+ nodesWillExit: _nodesWillExit,
17280
+ nodesWillEnter: nodesWillEnter,
17281
+ nodesShouldEnter: nodesShouldEnter,
17282
+ childrenTransitions: _collection__WEBPACK_IMPORTED_MODULE_3__.isArrayOfArrays(childrenTransitions) ? childrenTransitions[0] : childrenTransitions,
17283
+ oldProps: _nodesWillExit ? props : null,
17284
+ nextProps: nextProps,
17285
+ continuous: continuous
17286
+ });
17287
+ }
17288
+ }, [setState]);
17289
+ var getProps = react__WEBPACK_IMPORTED_MODULE_2___default().useCallback(function (initialProps) {
17290
+ return state && state.nodesWillExit ? state.oldProps || initialProps : initialProps;
17291
+ }, [state]);
17292
+ return {
17293
+ state: state,
17294
+ setState: setState,
17295
+ getAnimationProps: getAnimationProps,
17296
+ setAnimationState: setAnimationState,
17297
+ getProps: getProps
17298
+ };
17299
+ };
17300
+
17301
+ /***/ }),
17302
+
17212
17303
  /***/ "../../victory-core/es/victory-util/immutable.js":
17213
17304
  /*!*******************************************************!*\
17214
17305
  !*** ../../victory-core/es/victory-util/immutable.js ***!
@@ -17857,9 +17948,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
17857
17948
 
17858
17949
 
17859
17950
 
17860
- var Timer =
17861
- /*#__PURE__*/
17862
- function () {
17951
+ var Timer = /*#__PURE__*/function () {
17863
17952
  function Timer() {
17864
17953
  _classCallCheck(this, Timer);
17865
17954
 
@@ -18379,7 +18468,23 @@ function getTransitionPropsFactory(props, state, setState) {
18379
18468
  "use strict";
18380
18469
  __webpack_require__.r(__webpack_exports__);
18381
18470
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18382
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
18471
+ /* harmony export */ "addBinsToParentPropsIfHistogram": () => (/* binding */ addBinsToParentPropsIfHistogram),
18472
+ /* harmony export */ "getDataFromChildren": () => (/* binding */ getDataFromChildren),
18473
+ /* harmony export */ "getData": () => (/* binding */ getData),
18474
+ /* harmony export */ "getWidth": () => (/* binding */ getWidth),
18475
+ /* harmony export */ "getDefaultDomainPadding": () => (/* binding */ getDefaultDomainPadding),
18476
+ /* harmony export */ "getDomainFromChildren": () => (/* binding */ getDomainFromChildren),
18477
+ /* harmony export */ "getDomain": () => (/* binding */ getDomain),
18478
+ /* harmony export */ "getScale": () => (/* binding */ getScale),
18479
+ /* harmony export */ "getAllEvents": () => (/* binding */ getAllEvents),
18480
+ /* harmony export */ "getColor": () => (/* binding */ getColor),
18481
+ /* harmony export */ "getStyle": () => (/* binding */ getStyle),
18482
+ /* harmony export */ "getChildStyle": () => (/* binding */ getChildStyle),
18483
+ /* harmony export */ "getStringsFromCategories": () => (/* binding */ getStringsFromCategories),
18484
+ /* harmony export */ "getStringsFromData": () => (/* binding */ getStringsFromData),
18485
+ /* harmony export */ "getCategoryAndAxisStringsFromChildren": () => (/* binding */ getCategoryAndAxisStringsFromChildren),
18486
+ /* harmony export */ "getStringsFromChildren": () => (/* binding */ getStringsFromChildren),
18487
+ /* harmony export */ "getCategories": () => (/* binding */ getCategories)
18383
18488
  /* harmony export */ });
18384
18489
  /* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/isPlainObject */ "../../../node_modules/lodash/isPlainObject.js");
18385
18490
  /* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0__);
@@ -18389,33 +18494,27 @@ __webpack_require__.r(__webpack_exports__);
18389
18494
  /* harmony import */ var lodash_uniqBy__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqBy__WEBPACK_IMPORTED_MODULE_2__);
18390
18495
  /* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash/groupBy */ "../../../node_modules/lodash/groupBy.js");
18391
18496
  /* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_groupBy__WEBPACK_IMPORTED_MODULE_3__);
18392
- /* harmony import */ var lodash_some__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash/some */ "../../../node_modules/lodash/some.js");
18393
- /* harmony import */ var lodash_some__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash_some__WEBPACK_IMPORTED_MODULE_4__);
18394
- /* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash/uniq */ "../../../node_modules/lodash/uniq.js");
18395
- /* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_5__);
18396
- /* harmony import */ var lodash_isFunction__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash/isFunction */ "../../../node_modules/lodash/isFunction.js");
18397
- /* harmony import */ var lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_isFunction__WEBPACK_IMPORTED_MODULE_6__);
18398
- /* harmony import */ var lodash_flatten__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash/flatten */ "../../../node_modules/lodash/flatten.js");
18399
- /* harmony import */ var lodash_flatten__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash_flatten__WEBPACK_IMPORTED_MODULE_7__);
18400
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/lodash/defaults.js");
18401
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_8__);
18402
- /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash/assign */ "../../../node_modules/lodash/assign.js");
18403
- /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_9__);
18404
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react */ "react");
18405
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_10__);
18406
- /* harmony import */ var _axis__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./axis */ "../../victory-core/es/victory-util/axis.js");
18407
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./style */ "../../victory-core/es/victory-util/style.js");
18408
- /* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./transitions */ "../../victory-core/es/victory-util/transitions.js");
18409
- /* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./data */ "../../victory-core/es/victory-util/data.js");
18410
- /* harmony import */ var _domain__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./domain */ "../../victory-core/es/victory-util/domain.js");
18411
- /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./events */ "../../victory-core/es/victory-util/events.js");
18412
- /* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
18413
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
18414
- /* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
18415
- /* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./log */ "../../victory-core/es/victory-util/log.js");
18416
-
18417
-
18418
-
18497
+ /* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash/uniq */ "../../../node_modules/lodash/uniq.js");
18498
+ /* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_4__);
18499
+ /* harmony import */ var lodash_isFunction__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash/isFunction */ "../../../node_modules/lodash/isFunction.js");
18500
+ /* harmony import */ var lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash_isFunction__WEBPACK_IMPORTED_MODULE_5__);
18501
+ /* harmony import */ var lodash_flatten__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash/flatten */ "../../../node_modules/lodash/flatten.js");
18502
+ /* harmony import */ var lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_flatten__WEBPACK_IMPORTED_MODULE_6__);
18503
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/lodash/defaults.js");
18504
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_7__);
18505
+ /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash/assign */ "../../../node_modules/lodash/assign.js");
18506
+ /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_8__);
18507
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react */ "react");
18508
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_9__);
18509
+ /* harmony import */ var _axis__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./axis */ "../../victory-core/es/victory-util/axis.js");
18510
+ /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./style */ "../../victory-core/es/victory-util/style.js");
18511
+ /* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./data */ "../../victory-core/es/victory-util/data.js");
18512
+ /* harmony import */ var _domain__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./domain */ "../../victory-core/es/victory-util/domain.js");
18513
+ /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./events */ "../../victory-core/es/victory-util/events.js");
18514
+ /* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
18515
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
18516
+ /* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
18517
+ /* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./log */ "../../victory-core/es/victory-util/log.js");
18419
18518
 
18420
18519
 
18421
18520
 
@@ -18424,9 +18523,7 @@ __webpack_require__.r(__webpack_exports__);
18424
18523
 
18425
18524
 
18426
18525
 
18427
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
18428
18526
 
18429
- 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; }
18430
18527
 
18431
18528
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
18432
18529
 
@@ -18436,7 +18533,9 @@ function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.
18436
18533
 
18437
18534
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
18438
18535
 
18536
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
18439
18537
 
18538
+ 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; }
18440
18539
 
18441
18540
 
18442
18541
 
@@ -18447,500 +18546,418 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr
18447
18546
 
18448
18547
 
18449
18548
 
18450
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
18451
- getData: function (props, childComponents) {
18452
- if (props.data) {
18453
- return _data__WEBPACK_IMPORTED_MODULE_11__.getData(props);
18454
- }
18455
-
18456
- childComponents = childComponents || react__WEBPACK_IMPORTED_MODULE_10___default().Children.toArray(props.children);
18457
- return this.getDataFromChildren(childComponents);
18458
- },
18459
- getDefaultDomainPadding: function (props, axis, childComponents) {
18460
- if (props.polar || axis !== "x") {
18461
- return undefined;
18462
- }
18463
-
18464
- var groupComponent = childComponents.filter(function (child) {
18465
- return child.type && child.type.role && child.type.role === "group";
18466
- });
18467
18549
 
18468
- if (groupComponent.length < 1) {
18469
- return undefined;
18470
- }
18550
+ function addBinsToParentPropsIfHistogram(_ref) {
18551
+ var children = _ref.children,
18552
+ props = _ref.props,
18553
+ childComponents = _ref.childComponents,
18554
+ parentProps = _ref.parentProps;
18555
+ var someChildrenAreHistograms = children.some(function (child) {
18556
+ return child.type && child.type.role === "histogram";
18557
+ });
18558
+ var allChildrenAreHistograms = someChildrenAreHistograms && children.length && children.every(function (child) {
18559
+ return child.type && child.type.role === "histogram";
18560
+ });
18471
18561
 
18472
- var _groupComponent$0$pro = groupComponent[0].props,
18473
- offset = _groupComponent$0$pro.offset,
18474
- children = _groupComponent$0$pro.children;
18562
+ if (someChildrenAreHistograms && !allChildrenAreHistograms) {
18563
+ _log__WEBPACK_IMPORTED_MODULE_10__.warn("VictoryHistogram only supports being stacked with other VictoryHistogram components. Check to make sure that you are only passing VictoryHistogram components to VictoryStack");
18564
+ } // if we are stacking histograms, we need to generate explicit bins
18565
+ // or else each histogram may end up having different bins
18475
18566
 
18476
- if (!offset) {
18477
- return undefined;
18478
- }
18479
18567
 
18480
- var firstChild = Array.isArray(children) && children[0];
18568
+ if (!allChildrenAreHistograms) {
18569
+ return parentProps;
18570
+ }
18481
18571
 
18482
- if (!firstChild) {
18483
- return undefined;
18484
- }
18572
+ var childBins = props.bins || childComponents[0].props.bins; // if we have explicit bins then we don't need to calculate them
18485
18573
 
18486
- var barWidth = firstChild.props.barWidth;
18487
- var dataLength = firstChild.props.data && firstChild.props.data.length || 1;
18574
+ if (!Array.isArray(childBins)) {
18575
+ var combinedData = children.reduce(function (memo, child) {
18576
+ var xAccessor = _helpers__WEBPACK_IMPORTED_MODULE_11__.createAccessor(child.props.x || "x");
18577
+ return memo.concat(child.props.data.map(function (datum) {
18578
+ return {
18579
+ x: xAccessor(datum)
18580
+ };
18581
+ }));
18582
+ }, []); // use the same function to generate bins as VictoryHistogram but with
18583
+ // the combined data from above, then get explicit bins from that
18488
18584
 
18489
- if (firstChild && firstChild.type.role === "stack") {
18490
- var nestedChild = firstChild.props.children && firstChild.props.children[0];
18585
+ var getFormattedHistogramData = children[0].type.getFormattedData;
18586
+ childBins = getFormattedHistogramData({
18587
+ data: combinedData,
18588
+ bins: childBins
18589
+ }).reduce(function (memo, _ref2, index) {
18590
+ var x0 = _ref2.x0,
18591
+ x1 = _ref2.x1;
18592
+ return index === 0 ? memo.concat([x0, x1]) : memo.concat(x1);
18593
+ }, []);
18594
+ }
18491
18595
 
18492
- if (!nestedChild) {
18493
- return undefined;
18494
- }
18596
+ return _objectSpread({}, parentProps, {
18597
+ bins: childBins
18598
+ });
18599
+ }
18600
+ function getDataFromChildren(props, childComponents) {
18601
+ var polar = props.polar,
18602
+ startAngle = props.startAngle,
18603
+ endAngle = props.endAngle,
18604
+ categories = props.categories,
18605
+ minDomain = props.minDomain,
18606
+ maxDomain = props.maxDomain;
18607
+ var parentProps = {
18608
+ polar: polar,
18609
+ startAngle: startAngle,
18610
+ endAngle: endAngle,
18611
+ categories: categories,
18612
+ minDomain: minDomain,
18613
+ maxDomain: maxDomain
18614
+ };
18615
+ var stack = 0;
18616
+ var children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
18617
+ parentProps = addBinsToParentPropsIfHistogram({
18618
+ children: children,
18619
+ props: props,
18620
+ childComponents: childComponents,
18621
+ parentProps: parentProps
18622
+ });
18495
18623
 
18496
- barWidth = nestedChild.props.barWidth;
18497
- dataLength = firstChild.props.children.length;
18498
- }
18624
+ var iteratee = function (child, childName, parent) {
18625
+ var childProps = lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, child.props, parentProps);
18499
18626
 
18500
- var width = barWidth || this.getWidth(props, children.length, dataLength);
18501
- return {
18502
- x: width * children.length / 2 + (offset - width * ((children.length - 1) / 2))
18503
- };
18504
- },
18505
- getDomain: function (props, axis, childComponents) {
18506
- childComponents = childComponents || react__WEBPACK_IMPORTED_MODULE_10___default().Children.toArray(props.children);
18507
- var propsDomain = _domain__WEBPACK_IMPORTED_MODULE_12__.getDomainFromProps(props, axis);
18508
- var domainPadding = this.getDefaultDomainPadding(props, axis, childComponents);
18509
- var domain;
18627
+ var childData;
18510
18628
 
18511
- if (propsDomain) {
18512
- domain = propsDomain;
18629
+ if (!_data__WEBPACK_IMPORTED_MODULE_12__.isDataComponent(child)) {
18630
+ return null;
18631
+ } else if (child.type && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(child.type.getData)) {
18632
+ child = parent ? react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(child, parent.props) : child;
18633
+ childData = child.type.getData(childProps);
18513
18634
  } else {
18514
- var minDomain = _domain__WEBPACK_IMPORTED_MODULE_12__.getMinFromProps(props, axis);
18515
- var maxDomain = _domain__WEBPACK_IMPORTED_MODULE_12__.getMaxFromProps(props, axis);
18516
- var dataset = (props.data || props.y) && _data__WEBPACK_IMPORTED_MODULE_11__.getData(props);
18517
- var dataDomain = dataset ? _domain__WEBPACK_IMPORTED_MODULE_12__.getDomainFromData(props, axis, dataset) : [];
18518
- var childDomain = this.getDomainFromChildren(props, axis, childComponents);
18519
- var min = minDomain || _collection__WEBPACK_IMPORTED_MODULE_13__.getMinValue(_toConsumableArray(dataDomain).concat(_toConsumableArray(childDomain)));
18520
- var max = maxDomain || _collection__WEBPACK_IMPORTED_MODULE_13__.getMaxValue(_toConsumableArray(dataDomain).concat(_toConsumableArray(childDomain)));
18521
- domain = _domain__WEBPACK_IMPORTED_MODULE_12__.getDomainFromMinMax(min, max);
18522
- }
18523
-
18524
- return _domain__WEBPACK_IMPORTED_MODULE_12__.formatDomain(domain, lodash_assign__WEBPACK_IMPORTED_MODULE_9___default()({
18525
- domainPadding: domainPadding
18526
- }, props), axis);
18527
- },
18528
- getScale: function (props, axis, childComponents) {
18529
- if (props.data) {
18530
- return _scale__WEBPACK_IMPORTED_MODULE_14__.getBaseScale(props, axis);
18635
+ childData = _data__WEBPACK_IMPORTED_MODULE_12__.getData(childProps);
18531
18636
  }
18532
18637
 
18533
- var children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_10___default().Children.toArray(props.children);
18534
-
18535
- var iteratee = function (child) {
18536
- var sharedProps = lodash_assign__WEBPACK_IMPORTED_MODULE_9___default()({}, child.props, {
18537
- horizontal: props.horizontal
18538
- });
18539
-
18540
- return _scale__WEBPACK_IMPORTED_MODULE_14__.getScaleType(sharedProps, axis);
18541
- };
18638
+ stack += 1;
18639
+ return childData.map(function (datum, index) {
18640
+ return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({
18641
+ _stack: stack,
18642
+ _group: index
18643
+ }, datum);
18644
+ });
18645
+ };
18542
18646
 
18543
- var childScale = lodash_uniq__WEBPACK_IMPORTED_MODULE_5___default()(_helpers__WEBPACK_IMPORTED_MODULE_15__.reduceChildren(children, iteratee, props)); // default to linear scale if more than one uniq scale type is given by children
18647
+ var stacked = children.filter(function (c) {
18648
+ return c.type && c.type.role === "stack";
18649
+ }).length;
18544
18650
 
18651
+ var combine = function (memo, val) {
18652
+ return memo.concat(lodash_uniqBy__WEBPACK_IMPORTED_MODULE_2___default()(val, "_group"));
18653
+ };
18545
18654
 
18546
- return childScale.length > 1 ? _scale__WEBPACK_IMPORTED_MODULE_14__.getScaleFromName("linear") : _scale__WEBPACK_IMPORTED_MODULE_14__.getScaleFromName(childScale[0]);
18547
- },
18548
- setAnimationState: function (props, nextProps) {
18549
- if (!props.animate) {
18550
- return;
18551
- }
18655
+ var datasets = _helpers__WEBPACK_IMPORTED_MODULE_11__.reduceChildren(children, iteratee, props, [], combine);
18656
+ var group = stacked ? "_group" : "_stack";
18657
+ return lodash_values__WEBPACK_IMPORTED_MODULE_1___default()(lodash_groupBy__WEBPACK_IMPORTED_MODULE_3___default()(datasets, group));
18658
+ }
18659
+ function getData(props, childComponents) {
18660
+ if (props.data) {
18661
+ return _data__WEBPACK_IMPORTED_MODULE_12__.getData(props);
18662
+ }
18552
18663
 
18553
- if (props.animate.parentState) {
18554
- var nodesWillExit = props.animate.parentState.nodesWillExit;
18555
- var oldProps = nodesWillExit ? props : null;
18556
- this.setState(lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({
18557
- oldProps: oldProps,
18558
- nextProps: nextProps
18559
- }, props.animate.parentState));
18560
- } else {
18561
- var oldChildren = react__WEBPACK_IMPORTED_MODULE_10___default().Children.toArray(props.children);
18562
- var nextChildren = react__WEBPACK_IMPORTED_MODULE_10___default().Children.toArray(nextProps.children);
18664
+ childComponents = childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
18665
+ return getDataFromChildren(childComponents);
18666
+ }
18667
+ function getWidth(props, groupLength, seriesLength) {
18668
+ var datasets = props.datasets,
18669
+ horizontal = props.horizontal;
18670
+ var range = horizontal ? _helpers__WEBPACK_IMPORTED_MODULE_11__.getRange(props, "y") : _helpers__WEBPACK_IMPORTED_MODULE_11__.getRange(props, "x");
18671
+ var extent = Math.abs(range[1] - range[0]);
18672
+ seriesLength = seriesLength !== undefined ? seriesLength : Array.isArray(datasets[0]) && datasets[0].length || 1;
18673
+ groupLength = groupLength || datasets.length;
18674
+ var bars = groupLength * seriesLength;
18675
+ var barRatio = 0.5;
18676
+ return Math.round(barRatio * extent / bars);
18677
+ }
18678
+ function getDefaultDomainPadding(props, axis, childComponents) {
18679
+ if (props.polar || axis !== "x") {
18680
+ return undefined;
18681
+ }
18563
18682
 
18564
- var isContinuous = function (child) {
18565
- var check = function (c) {
18566
- return c.type && c.type.continuous;
18567
- };
18683
+ var groupComponent = childComponents.filter(function (child) {
18684
+ return child.type && child.type.role && child.type.role === "group";
18685
+ });
18568
18686
 
18569
- return Array.isArray(child) ? lodash_some__WEBPACK_IMPORTED_MODULE_4___default()(child, check) : check(child);
18570
- };
18687
+ if (groupComponent.length < 1) {
18688
+ return undefined;
18689
+ }
18571
18690
 
18572
- var continuous = !props.polar && lodash_some__WEBPACK_IMPORTED_MODULE_4___default()(oldChildren, function (child) {
18573
- return isContinuous(child) || child.props.children && isContinuous(child.props.children);
18574
- });
18691
+ var _groupComponent$0$pro = groupComponent[0].props,
18692
+ offset = _groupComponent$0$pro.offset,
18693
+ children = _groupComponent$0$pro.children;
18575
18694
 
18576
- var _Transitions$getIniti = _transitions__WEBPACK_IMPORTED_MODULE_16__.getInitialTransitionState(oldChildren, nextChildren),
18577
- _nodesWillExit = _Transitions$getIniti.nodesWillExit,
18578
- nodesWillEnter = _Transitions$getIniti.nodesWillEnter,
18579
- childrenTransitions = _Transitions$getIniti.childrenTransitions,
18580
- nodesShouldEnter = _Transitions$getIniti.nodesShouldEnter;
18695
+ if (!offset) {
18696
+ return undefined;
18697
+ }
18581
18698
 
18582
- this.setState({
18583
- nodesWillExit: _nodesWillExit,
18584
- nodesWillEnter: nodesWillEnter,
18585
- nodesShouldEnter: nodesShouldEnter,
18586
- childrenTransitions: _collection__WEBPACK_IMPORTED_MODULE_13__.isArrayOfArrays(childrenTransitions) ? childrenTransitions[0] : childrenTransitions,
18587
- oldProps: _nodesWillExit ? props : null,
18588
- nextProps: nextProps,
18589
- continuous: continuous
18590
- });
18591
- }
18592
- },
18593
- getAllEvents: function (props) {
18594
- var components = ["groupComponent", "containerComponent", "labelComponent"];
18595
- this.componentEvents = _events__WEBPACK_IMPORTED_MODULE_17__.getComponentEvents(props, components);
18596
- var events = props.events;
18699
+ var firstChild = Array.isArray(children) && children[0];
18597
18700
 
18598
- if (Array.isArray(this.componentEvents)) {
18599
- var _componentEvents;
18701
+ if (!firstChild) {
18702
+ return undefined;
18703
+ }
18600
18704
 
18601
- events = Array.isArray(props.events) ? (_componentEvents = this.componentEvents).concat.apply(_componentEvents, _toConsumableArray(props.events)) : this.componentEvents;
18602
- }
18705
+ var barWidth = firstChild.props.barWidth;
18706
+ var dataLength = firstChild.props.data && firstChild.props.data.length || 1;
18603
18707
 
18604
- return events || [];
18605
- },
18606
- getAnimationProps: function (props, child, index) {
18607
- var _this = this;
18708
+ if (firstChild && firstChild.type.role === "stack") {
18709
+ var nestedChild = firstChild.props.children && firstChild.props.children[0];
18608
18710
 
18609
- if (!props.animate) {
18610
- return child.props.animate;
18711
+ if (!nestedChild) {
18712
+ return undefined;
18611
18713
  }
18612
18714
 
18613
- var getFilteredState = function () {
18614
- var childrenTransitions = _this.state && _this.state.childrenTransitions;
18615
- childrenTransitions = _collection__WEBPACK_IMPORTED_MODULE_13__.isArrayOfArrays(childrenTransitions) ? childrenTransitions[index] : childrenTransitions;
18616
- return lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({
18617
- childrenTransitions: childrenTransitions
18618
- }, _this.state);
18619
- };
18715
+ barWidth = nestedChild.props.barWidth;
18716
+ dataLength = firstChild.props.children.length;
18717
+ }
18620
18718
 
18621
- var getTransitions = props.animate && props.animate.getTransitions;
18622
- var state = getFilteredState();
18623
- var parentState = props.animate && props.animate.parentState || state;
18719
+ var width = barWidth || getWidth(props, children.length, dataLength);
18720
+ return {
18721
+ x: width * children.length / 2 + (offset - width * ((children.length - 1) / 2))
18722
+ };
18723
+ }
18724
+ function getDomainFromChildren(props, axis, childComponents) {
18725
+ // eslint-disable-line max-statements, complexity, max-len
18726
+ var children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
18727
+ var parentData = props.data ? _data__WEBPACK_IMPORTED_MODULE_12__.getData(props, axis) : undefined;
18728
+ var polar = props.polar,
18729
+ startAngle = props.startAngle,
18730
+ endAngle = props.endAngle,
18731
+ categories = props.categories,
18732
+ minDomain = props.minDomain,
18733
+ maxDomain = props.maxDomain,
18734
+ horizontal = props.horizontal;
18735
+ var baseParentProps = {
18736
+ horizontal: horizontal,
18737
+ polar: polar,
18738
+ startAngle: startAngle,
18739
+ endAngle: endAngle,
18740
+ minDomain: minDomain,
18741
+ maxDomain: maxDomain,
18742
+ categories: categories
18743
+ };
18744
+ var parentProps = parentData ? lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()(baseParentProps, {
18745
+ data: parentData
18746
+ }) : baseParentProps;
18624
18747
 
18625
- if (!getTransitions) {
18626
- var getTransitionProps = _transitions__WEBPACK_IMPORTED_MODULE_16__.getTransitionPropsFactory(props, state, function (newState) {
18627
- return _this.setState(newState);
18628
- });
18748
+ var iteratee = function (child) {
18749
+ var sharedProps = lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, child.props, parentProps);
18629
18750
 
18630
- getTransitions = function (childComponent) {
18631
- return getTransitionProps(childComponent, index);
18632
- };
18751
+ if (!_domain__WEBPACK_IMPORTED_MODULE_13__.isDomainComponent(child)) {
18752
+ return null;
18753
+ } else if (child.type && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(child.type.getDomain)) {
18754
+ return child.props && child.type.getDomain(sharedProps, axis);
18755
+ } else {
18756
+ return _domain__WEBPACK_IMPORTED_MODULE_13__.getDomain(sharedProps, axis);
18633
18757
  }
18758
+ };
18634
18759
 
18635
- return lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({
18636
- getTransitions: getTransitions,
18637
- parentState: parentState
18638
- }, props.animate, child.props.animate);
18639
- },
18640
- getDomainFromChildren: function (props, axis, childComponents) {
18641
- // eslint-disable-line max-statements, complexity, max-len
18642
- var children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_10___default().Children.toArray(props.children);
18643
- var parentData = props.data ? _data__WEBPACK_IMPORTED_MODULE_11__.getData(props, axis) : undefined;
18644
- var polar = props.polar,
18645
- startAngle = props.startAngle,
18646
- endAngle = props.endAngle,
18647
- categories = props.categories,
18648
- minDomain = props.minDomain,
18649
- maxDomain = props.maxDomain,
18650
- horizontal = props.horizontal;
18651
- var baseParentProps = {
18652
- horizontal: horizontal,
18653
- polar: polar,
18654
- startAngle: startAngle,
18655
- endAngle: endAngle,
18656
- minDomain: minDomain,
18657
- maxDomain: maxDomain,
18658
- categories: categories
18659
- };
18660
- var parentProps = parentData ? lodash_assign__WEBPACK_IMPORTED_MODULE_9___default()(baseParentProps, {
18661
- data: parentData
18662
- }) : baseParentProps;
18663
-
18664
- var iteratee = function (child) {
18665
- var sharedProps = lodash_assign__WEBPACK_IMPORTED_MODULE_9___default()({}, child.props, parentProps);
18666
-
18667
- if (!_domain__WEBPACK_IMPORTED_MODULE_12__.isDomainComponent(child)) {
18668
- return null;
18669
- } else if (child.type && lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(child.type.getDomain)) {
18670
- return child.props && child.type.getDomain(sharedProps, axis);
18671
- } else {
18672
- return _domain__WEBPACK_IMPORTED_MODULE_12__.getDomain(sharedProps, axis);
18673
- }
18674
- };
18675
-
18676
- var childDomains = _helpers__WEBPACK_IMPORTED_MODULE_15__.reduceChildren(children, iteratee, props);
18677
- var min = childDomains.length === 0 ? 0 : _collection__WEBPACK_IMPORTED_MODULE_13__.getMinValue(childDomains);
18678
- var max = childDomains.length === 0 ? 1 : _collection__WEBPACK_IMPORTED_MODULE_13__.getMaxValue(childDomains);
18679
- return [min, max];
18680
- },
18681
- addBinsToParentPropsIfHistogram: function (_ref) {
18682
- var children = _ref.children,
18683
- props = _ref.props,
18684
- childComponents = _ref.childComponents,
18685
- parentProps = _ref.parentProps;
18686
- var someChildrenAreHistograms = children.some(function (child) {
18687
- return child.type && child.type.role === "histogram";
18688
- });
18689
- var allChildrenAreHistograms = someChildrenAreHistograms && children.length && children.every(function (child) {
18690
- return child.type && child.type.role === "histogram";
18691
- });
18692
-
18693
- if (someChildrenAreHistograms && !allChildrenAreHistograms) {
18694
- _log__WEBPACK_IMPORTED_MODULE_18__.warn("VictoryHistogram only supports being stacked with other VictoryHistogram components. Check to make sure that you are only passing VictoryHistogram components to VictoryStack");
18695
- } // if we are stacking histograms, we need to generate explicit bins
18696
- // or else each histogram may end up having different bins
18697
-
18760
+ var childDomains = _helpers__WEBPACK_IMPORTED_MODULE_11__.reduceChildren(children, iteratee, props);
18761
+ var min = childDomains.length === 0 ? 0 : _collection__WEBPACK_IMPORTED_MODULE_14__.getMinValue(childDomains);
18762
+ var max = childDomains.length === 0 ? 1 : _collection__WEBPACK_IMPORTED_MODULE_14__.getMaxValue(childDomains);
18763
+ return [min, max];
18764
+ }
18765
+ function getDomain(props, axis, childComponents) {
18766
+ childComponents = childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
18767
+ var propsDomain = _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromProps(props, axis);
18768
+ var domainPadding = getDefaultDomainPadding(props, axis, childComponents);
18769
+ var domain;
18698
18770
 
18699
- if (!allChildrenAreHistograms) {
18700
- return parentProps;
18701
- }
18771
+ if (propsDomain) {
18772
+ domain = propsDomain;
18773
+ } else {
18774
+ var minDomain = _domain__WEBPACK_IMPORTED_MODULE_13__.getMinFromProps(props, axis);
18775
+ var maxDomain = _domain__WEBPACK_IMPORTED_MODULE_13__.getMaxFromProps(props, axis);
18776
+ var dataset = (props.data || props.y) && _data__WEBPACK_IMPORTED_MODULE_12__.getData(props);
18777
+ var dataDomain = dataset ? _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromData(props, axis, dataset) : [];
18778
+ var childDomain = getDomainFromChildren(props, axis, childComponents);
18779
+ var min = minDomain || _collection__WEBPACK_IMPORTED_MODULE_14__.getMinValue(_toConsumableArray(dataDomain).concat(_toConsumableArray(childDomain)));
18780
+ var max = maxDomain || _collection__WEBPACK_IMPORTED_MODULE_14__.getMaxValue(_toConsumableArray(dataDomain).concat(_toConsumableArray(childDomain)));
18781
+ domain = _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromMinMax(min, max);
18782
+ }
18702
18783
 
18703
- var childBins = props.bins || childComponents[0].props.bins; // if we have explicit bins then we don't need to calculate them
18784
+ return _domain__WEBPACK_IMPORTED_MODULE_13__.formatDomain(domain, lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({
18785
+ domainPadding: domainPadding
18786
+ }, props), axis);
18787
+ }
18788
+ function getScale(props, axis, childComponents) {
18789
+ if (props.data) {
18790
+ return _scale__WEBPACK_IMPORTED_MODULE_15__.getBaseScale(props, axis);
18791
+ }
18704
18792
 
18705
- if (!Array.isArray(childBins)) {
18706
- var combinedData = children.reduce(function (memo, child) {
18707
- var xAccessor = _helpers__WEBPACK_IMPORTED_MODULE_15__.createAccessor(child.props.x || "x");
18708
- return memo.concat(child.props.data.map(function (datum) {
18709
- return {
18710
- x: xAccessor(datum)
18711
- };
18712
- }));
18713
- }, []); // use the same function to generate bins as VictoryHistogram but with
18714
- // the combined data from above, then get explicit bins from that
18715
-
18716
- var getFormattedHistogramData = children[0].type.getFormattedData;
18717
- childBins = getFormattedHistogramData({
18718
- data: combinedData,
18719
- bins: childBins
18720
- }).reduce(function (memo, _ref2, index) {
18721
- var x0 = _ref2.x0,
18722
- x1 = _ref2.x1;
18723
- return index === 0 ? memo.concat([x0, x1]) : memo.concat(x1);
18724
- }, []);
18725
- }
18793
+ var children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
18726
18794
 
18727
- return _objectSpread({}, parentProps, {
18728
- bins: childBins
18729
- });
18730
- },
18731
- getDataFromChildren: function (props, childComponents) {
18732
- var polar = props.polar,
18733
- startAngle = props.startAngle,
18734
- endAngle = props.endAngle,
18735
- categories = props.categories,
18736
- minDomain = props.minDomain,
18737
- maxDomain = props.maxDomain;
18738
- var parentProps = {
18739
- polar: polar,
18740
- startAngle: startAngle,
18741
- endAngle: endAngle,
18742
- categories: categories,
18743
- minDomain: minDomain,
18744
- maxDomain: maxDomain
18745
- };
18746
- var stack = 0;
18747
- var children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_10___default().Children.toArray(props.children);
18748
- parentProps = this.addBinsToParentPropsIfHistogram({
18749
- children: children,
18750
- props: props,
18751
- childComponents: childComponents,
18752
- parentProps: parentProps
18795
+ var iteratee = function (child) {
18796
+ var sharedProps = lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, child.props, {
18797
+ horizontal: props.horizontal
18753
18798
  });
18754
18799
 
18755
- var iteratee = function (child, childName, parent) {
18756
- var childProps = lodash_assign__WEBPACK_IMPORTED_MODULE_9___default()({}, child.props, parentProps);
18757
-
18758
- var childData;
18759
-
18760
- if (!_data__WEBPACK_IMPORTED_MODULE_11__.isDataComponent(child)) {
18761
- return null;
18762
- } else if (child.type && lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(child.type.getData)) {
18763
- child = parent ? react__WEBPACK_IMPORTED_MODULE_10___default().cloneElement(child, parent.props) : child;
18764
- childData = child.type.getData(childProps);
18765
- } else {
18766
- childData = _data__WEBPACK_IMPORTED_MODULE_11__.getData(childProps);
18767
- }
18768
-
18769
- stack += 1;
18770
- return childData.map(function (datum, index) {
18771
- return lodash_assign__WEBPACK_IMPORTED_MODULE_9___default()({
18772
- _stack: stack,
18773
- _group: index
18774
- }, datum);
18775
- });
18776
- };
18800
+ return _scale__WEBPACK_IMPORTED_MODULE_15__.getScaleType(sharedProps, axis);
18801
+ };
18777
18802
 
18778
- var stacked = children.filter(function (c) {
18779
- return c.type && c.type.role === "stack";
18780
- }).length;
18803
+ var childScale = lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(_helpers__WEBPACK_IMPORTED_MODULE_11__.reduceChildren(children, iteratee, props)); // default to linear scale if more than one uniq scale type is given by children
18781
18804
 
18782
- var combine = function (memo, val) {
18783
- return memo.concat(lodash_uniqBy__WEBPACK_IMPORTED_MODULE_2___default()(val, "_group"));
18784
- };
18785
18805
 
18786
- var datasets = _helpers__WEBPACK_IMPORTED_MODULE_15__.reduceChildren(children, iteratee, props, [], combine);
18787
- var group = stacked ? "_group" : "_stack";
18788
- return lodash_values__WEBPACK_IMPORTED_MODULE_1___default()(lodash_groupBy__WEBPACK_IMPORTED_MODULE_3___default()(datasets, group));
18789
- },
18790
- getColor: function (calculatedProps, child, index) {
18791
- // check for styles first
18792
- var style = calculatedProps.style;
18793
- var colorScale = calculatedProps.colorScale,
18794
- color = calculatedProps.color;
18795
-
18796
- if (style && style.data && style.data.fill) {
18797
- return style.data.fill;
18798
- }
18806
+ return childScale.length > 1 ? _scale__WEBPACK_IMPORTED_MODULE_15__.getScaleFromName("linear") : _scale__WEBPACK_IMPORTED_MODULE_15__.getScaleFromName(childScale[0]);
18807
+ }
18808
+ function getAllEvents(props) {
18809
+ var components = ["groupComponent", "containerComponent", "labelComponent"];
18810
+ var componentEvents = _events__WEBPACK_IMPORTED_MODULE_16__.getComponentEvents(props, components);
18811
+ var events = props.events;
18799
18812
 
18800
- colorScale = child.props && child.props.colorScale ? child.props.colorScale : colorScale;
18801
- color = child.props && child.props.color ? child.props.color : color;
18813
+ if (Array.isArray(componentEvents)) {
18814
+ events = Array.isArray(props.events) ? componentEvents.concat.apply(componentEvents, _toConsumableArray(props.events)) : componentEvents;
18815
+ }
18802
18816
 
18803
- if (!colorScale && !color) {
18804
- return undefined;
18805
- }
18817
+ return events || [];
18818
+ }
18819
+ function getColor(calculatedProps, child, index) {
18820
+ // check for styles first
18821
+ var style = calculatedProps.style;
18822
+ var colorScale = calculatedProps.colorScale,
18823
+ color = calculatedProps.color;
18806
18824
 
18807
- var colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_19__.getColorScale(colorScale);
18808
- return color || colors[index % colors.length];
18809
- },
18810
- getWidth: function (props, groupLength, seriesLength) {
18811
- var datasets = props.datasets,
18812
- horizontal = props.horizontal;
18813
- var range = horizontal ? _helpers__WEBPACK_IMPORTED_MODULE_15__.getRange(props, "y") : _helpers__WEBPACK_IMPORTED_MODULE_15__.getRange(props, "x");
18814
- var extent = Math.abs(range[1] - range[0]);
18815
- seriesLength = seriesLength !== undefined ? seriesLength : Array.isArray(datasets[0]) && datasets[0].length || 1;
18816
- groupLength = groupLength || datasets.length;
18817
- var bars = groupLength * seriesLength;
18818
- var barRatio = 0.5;
18819
- return Math.round(barRatio * extent / bars);
18820
- },
18821
- getStyle: function (theme, style, role) {
18822
- var defaultStyle = theme && theme[role] && theme[role].style ? theme[role].style : {};
18823
- return _helpers__WEBPACK_IMPORTED_MODULE_15__.getStyles(style, defaultStyle);
18824
- },
18825
- getChildStyle: function (child, index, calculatedProps) {
18826
- var style = calculatedProps.style,
18827
- role = calculatedProps.role;
18828
- var childStyle = child.props.style || {};
18825
+ if (style && style.data && style.data.fill) {
18826
+ return style.data.fill;
18827
+ }
18829
18828
 
18830
- if (Array.isArray(childStyle)) {
18831
- return childStyle;
18832
- }
18829
+ colorScale = child.props && child.props.colorScale ? child.props.colorScale : colorScale;
18830
+ color = child.props && child.props.color ? child.props.color : color;
18833
18831
 
18834
- var childRole = child.type && child.type.role;
18835
- var defaultFill = childRole === "stack" ? undefined : this.getColor(calculatedProps, child, index);
18836
- var defaultColor = childRole === "line" ? {
18837
- fill: "none",
18838
- stroke: defaultFill
18839
- } : {
18840
- fill: defaultFill
18841
- };
18842
- var dataWidth = role === "stack" ? {} : {
18843
- width: this.getWidth(calculatedProps)
18844
- };
18832
+ if (!colorScale && !color) {
18833
+ return undefined;
18834
+ }
18845
18835
 
18846
- var dataStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, childStyle.data, lodash_assign__WEBPACK_IMPORTED_MODULE_9___default()({}, dataWidth, style.data, defaultColor));
18836
+ var colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_17__.getColorScale(colorScale);
18837
+ return color || colors[index % colors.length];
18838
+ }
18839
+ function getStyle(theme, style, role) {
18840
+ var defaultStyle = theme && theme[role] && theme[role].style ? theme[role].style : {};
18841
+ return _helpers__WEBPACK_IMPORTED_MODULE_11__.getStyles(style, defaultStyle);
18842
+ }
18843
+ function getChildStyle(child, index, calculatedProps) {
18844
+ var style = calculatedProps.style,
18845
+ role = calculatedProps.role;
18846
+ var childStyle = child.props.style || {};
18847
18847
 
18848
- var labelsStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, childStyle.labels, style.labels);
18848
+ if (Array.isArray(childStyle)) {
18849
+ return childStyle;
18850
+ }
18849
18851
 
18850
- return {
18851
- parent: style.parent,
18852
- data: dataStyle,
18853
- labels: labelsStyle
18854
- };
18855
- },
18856
- getStringsFromCategories: function (childComponents, axis) {
18857
- var iteratee = function (child) {
18858
- var childProps = child.props || {};
18852
+ var childRole = child.type && child.type.role;
18853
+ var defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index);
18854
+ var defaultColor = childRole === "line" ? {
18855
+ fill: "none",
18856
+ stroke: defaultFill
18857
+ } : {
18858
+ fill: defaultFill
18859
+ };
18860
+ var dataWidth = role === "stack" ? {} : {
18861
+ width: getWidth(calculatedProps)
18862
+ };
18859
18863
 
18860
- if (!_domain__WEBPACK_IMPORTED_MODULE_12__.isDomainComponent(child) || !childProps.categories) {
18861
- return null;
18862
- } else {
18863
- var categories = childProps.categories && !Array.isArray(childProps.categories) ? childProps.categories[axis] : childProps.props.categories;
18864
- var categoryStrings = categories && categories.filter(function (val) {
18865
- return typeof val === "string";
18866
- });
18867
- return categoryStrings ? _collection__WEBPACK_IMPORTED_MODULE_13__.removeUndefined(categoryStrings) : [];
18868
- }
18869
- };
18864
+ var dataStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_7___default()({}, childStyle.data, lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, dataWidth, style.data, defaultColor));
18870
18865
 
18871
- return _helpers__WEBPACK_IMPORTED_MODULE_15__.reduceChildren(childComponents.slice(0), iteratee);
18872
- },
18873
- getStringsFromData: function (childComponents) {
18874
- var iteratee = function (child) {
18875
- var childProps = child.props || {};
18876
- var data;
18866
+ var labelsStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_7___default()({}, childStyle.labels, style.labels);
18877
18867
 
18878
- if (!_data__WEBPACK_IMPORTED_MODULE_11__.isDataComponent(child)) {
18879
- return null;
18880
- } else if (child.type && lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(child.type.getData)) {
18881
- data = child.type.getData(childProps);
18882
- } else {
18883
- data = _data__WEBPACK_IMPORTED_MODULE_11__.getData(childProps);
18884
- }
18868
+ return {
18869
+ parent: style.parent,
18870
+ data: dataStyle,
18871
+ labels: labelsStyle
18872
+ };
18873
+ }
18874
+ function getStringsFromCategories(childComponents, axis) {
18875
+ var iteratee = function (child) {
18876
+ var childProps = child.props || {};
18885
18877
 
18886
- return data.map(function (d) {
18887
- return {
18888
- x: d.xName,
18889
- y: d.yName
18890
- };
18878
+ if (!_domain__WEBPACK_IMPORTED_MODULE_13__.isDomainComponent(child) || !childProps.categories) {
18879
+ return null;
18880
+ } else {
18881
+ var categories = childProps.categories && !Array.isArray(childProps.categories) ? childProps.categories[axis] : childProps.props.categories;
18882
+ var categoryStrings = categories && categories.filter(function (val) {
18883
+ return typeof val === "string";
18891
18884
  });
18892
- };
18885
+ return categoryStrings ? _collection__WEBPACK_IMPORTED_MODULE_14__.removeUndefined(categoryStrings) : [];
18886
+ }
18887
+ };
18893
18888
 
18894
- var initialMemo = {
18895
- x: [],
18896
- y: []
18897
- };
18889
+ return _helpers__WEBPACK_IMPORTED_MODULE_11__.reduceChildren(childComponents.slice(0), iteratee);
18890
+ }
18891
+ function getStringsFromData(childComponents) {
18892
+ var iteratee = function (child) {
18893
+ var childProps = child.props || {};
18894
+ var data;
18898
18895
 
18899
- var combine = function (memo, datum) {
18900
- var x = Array.isArray(datum) ? datum.map(function (d) {
18901
- return d.x;
18902
- }).filter(Boolean) : datum.x;
18903
- var y = Array.isArray(datum) ? datum.map(function (d) {
18904
- return d.y;
18905
- }).filter(Boolean) : datum.y;
18896
+ if (!_data__WEBPACK_IMPORTED_MODULE_12__.isDataComponent(child)) {
18897
+ return null;
18898
+ } else if (child.type && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(child.type.getData)) {
18899
+ data = child.type.getData(childProps);
18900
+ } else {
18901
+ data = _data__WEBPACK_IMPORTED_MODULE_12__.getData(childProps);
18902
+ }
18903
+
18904
+ return data.map(function (d) {
18906
18905
  return {
18907
- x: x !== undefined ? memo.x.concat(x) : memo.x,
18908
- y: y !== undefined ? memo.y.concat(y) : memo.y
18906
+ x: d.xName,
18907
+ y: d.yName
18909
18908
  };
18910
- };
18909
+ });
18910
+ };
18911
18911
 
18912
- return _helpers__WEBPACK_IMPORTED_MODULE_15__.reduceChildren(childComponents.slice(0), iteratee, {}, initialMemo, combine);
18913
- },
18914
- getCategoryAndAxisStringsFromChildren: function (props, axis, childComponents) {
18915
- var categories = lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(props.categories) ? props.categories[axis] : props.categories;
18916
- var axisComponent = _axis__WEBPACK_IMPORTED_MODULE_20__.getAxisComponent(childComponents, axis);
18917
- var axisStrings = axisComponent ? _data__WEBPACK_IMPORTED_MODULE_11__.getStringsFromAxes(axisComponent.props, axis) : [];
18918
- var categoryStrings = categories || this.getStringsFromCategories(childComponents, axis);
18919
- return lodash_uniq__WEBPACK_IMPORTED_MODULE_5___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_7___default()(_toConsumableArray(categoryStrings).concat(_toConsumableArray(axisStrings))));
18920
- },
18921
- getStringsFromChildren: function (props, childComponents) {
18922
- childComponents = childComponents || react__WEBPACK_IMPORTED_MODULE_10___default().Children.toArray(props.children);
18923
- var xStrings = this.getCategoryAndAxisStringsFromChildren(props, "x", childComponents);
18924
- var yStrings = this.getCategoryAndAxisStringsFromChildren(props, "y", childComponents);
18925
- var dataStrings = this.getStringsFromData(childComponents);
18926
- return {
18927
- x: lodash_uniq__WEBPACK_IMPORTED_MODULE_5___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_7___default()(_toConsumableArray(xStrings).concat(_toConsumableArray(dataStrings.x)))),
18928
- y: lodash_uniq__WEBPACK_IMPORTED_MODULE_5___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_7___default()(_toConsumableArray(yStrings).concat(_toConsumableArray(dataStrings.y))))
18929
- };
18930
- },
18931
- getCategories: function (props, childComponents, allStrings) {
18932
- var xPropCategories = props.categories && !Array.isArray(props.categories) ? props.categories.x : props.categories;
18933
- var yPropCategories = props.categories && !Array.isArray(props.categories) ? props.categories.y : props.categories;
18934
- var fallbackRequired = !xPropCategories || !yPropCategories;
18935
- var fallbackProps = fallbackRequired ? allStrings || this.getStringsFromChildren(props, childComponents) : {};
18936
- var xCategories = xPropCategories || fallbackProps.x;
18937
- var yCategories = yPropCategories || fallbackProps.y;
18912
+ var initialMemo = {
18913
+ x: [],
18914
+ y: []
18915
+ };
18916
+
18917
+ var combine = function (memo, datum) {
18918
+ var x = Array.isArray(datum) ? datum.map(function (d) {
18919
+ return d.x;
18920
+ }).filter(Boolean) : datum.x;
18921
+ var y = Array.isArray(datum) ? datum.map(function (d) {
18922
+ return d.y;
18923
+ }).filter(Boolean) : datum.y;
18938
18924
  return {
18939
- x: xCategories.length > 0 ? xCategories : undefined,
18940
- y: yCategories.length > 0 ? yCategories : undefined
18925
+ x: x !== undefined ? memo.x.concat(x) : memo.x,
18926
+ y: y !== undefined ? memo.y.concat(y) : memo.y
18941
18927
  };
18942
- }
18943
- });
18928
+ };
18929
+
18930
+ return _helpers__WEBPACK_IMPORTED_MODULE_11__.reduceChildren(childComponents.slice(0), iteratee, {}, initialMemo, combine);
18931
+ }
18932
+ function getCategoryAndAxisStringsFromChildren(props, axis, childComponents) {
18933
+ var categories = lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(props.categories) ? props.categories[axis] : props.categories;
18934
+ var axisComponent = _axis__WEBPACK_IMPORTED_MODULE_18__.getAxisComponent(childComponents, axis);
18935
+ var axisStrings = axisComponent ? _data__WEBPACK_IMPORTED_MODULE_12__.getStringsFromAxes(axisComponent.props, axis) : [];
18936
+ var categoryStrings = categories || getStringsFromCategories(childComponents, axis);
18937
+ return lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()(_toConsumableArray(categoryStrings).concat(_toConsumableArray(axisStrings))));
18938
+ }
18939
+ function getStringsFromChildren(props, childComponents) {
18940
+ childComponents = childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
18941
+ var xStrings = getCategoryAndAxisStringsFromChildren(props, "x", childComponents);
18942
+ var yStrings = getCategoryAndAxisStringsFromChildren(props, "y", childComponents);
18943
+ var dataStrings = getStringsFromData(childComponents);
18944
+ return {
18945
+ x: lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()(_toConsumableArray(xStrings).concat(_toConsumableArray(dataStrings.x)))),
18946
+ y: lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()(_toConsumableArray(yStrings).concat(_toConsumableArray(dataStrings.y))))
18947
+ };
18948
+ }
18949
+ function getCategories(props, childComponents, allStrings) {
18950
+ var xPropCategories = props.categories && !Array.isArray(props.categories) ? props.categories.x : props.categories;
18951
+ var yPropCategories = props.categories && !Array.isArray(props.categories) ? props.categories.y : props.categories;
18952
+ var fallbackRequired = !xPropCategories || !yPropCategories;
18953
+ var fallbackProps = fallbackRequired ? allStrings || getStringsFromChildren(props, childComponents) : {};
18954
+ var xCategories = xPropCategories || fallbackProps.x;
18955
+ var yCategories = yPropCategories || fallbackProps.y;
18956
+ return {
18957
+ x: xCategories.length > 0 ? xCategories : undefined,
18958
+ y: yCategories.length > 0 ? yCategories : undefined
18959
+ };
18960
+ }
18944
18961
 
18945
18962
  /***/ }),
18946
18963
 
@@ -19023,9 +19040,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
19023
19040
 
19024
19041
 
19025
19042
 
19026
- var VictorySharedEvents =
19027
- /*#__PURE__*/
19028
- function (_React$Component) {
19043
+ var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
19029
19044
  _inherits(VictorySharedEvents, _React$Component);
19030
19045
 
19031
19046
  function VictorySharedEvents(props) {