victory-scatter 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.
package/LICENSE.txt ADDED
@@ -0,0 +1,30 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-2020 Formidable Labs.
4
+
5
+ Copyright (c) 2016-2020 Alexey Svetliakov <https://github.com/asvetliakov>,
6
+ snerks <https://github.com/snerks>, Krzysztof Cebula <https://github.com
7
+ Havret>, Vitaliy Polyanskiy <https://github.com/alreadyExisted>, James Lismore
8
+ <https://github.com/jlismore>, Stack Builders <https://github.com
9
+ stackbuilders>, Esteban Ibarra <https://github.com/ibarrae>, Dominic Lee
10
+ <https://github.com/dominictwlee>, Dave Vedder <https://github.com
11
+ veddermatic>, Alec Flett <https://github.com/alecf> and potentially other
12
+ DefinitelyTyped contributors.
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+
29
+ The above copyright notice and this permission notice shall be included in all
30
+ copies or substantial portions of the Software.
@@ -260,9 +260,7 @@ var fallbackProps = {
260
260
  symbol: "circle"
261
261
  };
262
262
 
263
- var VictoryScatter =
264
- /*#__PURE__*/
265
- function (_React$Component) {
263
+ var VictoryScatter = /*#__PURE__*/function (_React$Component) {
266
264
  _inherits(VictoryScatter, _React$Component);
267
265
 
268
266
  function VictoryScatter() {
@@ -13755,9 +13753,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
13755
13753
 
13756
13754
 
13757
13755
 
13758
- var VictoryAnimation =
13759
- /*#__PURE__*/
13760
- function (_React$Component) {
13756
+ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
13761
13757
  _inherits(VictoryAnimation, _React$Component);
13762
13758
 
13763
13759
  function VictoryAnimation(props, context) {
@@ -14041,9 +14037,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
14041
14037
 
14042
14038
 
14043
14039
 
14044
- var VictoryContainer =
14045
- /*#__PURE__*/
14046
- function (_React$Component) {
14040
+ var VictoryContainer = /*#__PURE__*/function (_React$Component) {
14047
14041
  _inherits(VictoryContainer, _React$Component);
14048
14042
 
14049
14043
  function VictoryContainer(props) {
@@ -14401,7 +14395,7 @@ var getSingleValue = function (prop) {
14401
14395
  return Array.isArray(prop) ? prop[index] || prop[0] : prop;
14402
14396
  };
14403
14397
 
14404
- var useMultiLineBackgrounds = function (props) {
14398
+ var shouldUseMultilineBackgrounds = function (props) {
14405
14399
  var backgroundStyle = props.backgroundStyle,
14406
14400
  backgroundPadding = props.backgroundPadding;
14407
14401
  return Array.isArray(backgroundStyle) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(backgroundStyle) || Array.isArray(backgroundPadding) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(backgroundPadding);
@@ -14693,7 +14687,7 @@ var getChildBackgrounds = function (calculatedProps, tspanValues) {
14693
14687
  };
14694
14688
 
14695
14689
  var getBackgroundElement = function (calculatedProps, tspanValues) {
14696
- return useMultiLineBackgrounds(calculatedProps) ? getChildBackgrounds(calculatedProps, tspanValues) : getFullBackground(calculatedProps, tspanValues);
14690
+ return shouldUseMultilineBackgrounds(calculatedProps) ? getChildBackgrounds(calculatedProps, tspanValues) : getFullBackground(calculatedProps, tspanValues);
14697
14691
  };
14698
14692
 
14699
14693
  var calculateSpanDy = function (tspanValues, i, calculatedProps) {
@@ -14704,7 +14698,7 @@ var calculateSpanDy = function (tspanValues, i, calculatedProps) {
14704
14698
  var previousCaps = previous.fontSize - previous.capHeight;
14705
14699
  var currentCaps = current.fontSize - current.capHeight;
14706
14700
  var textHeight = previousHeight - previous.fontSize / 2 + current.fontSize / 2 - previousHeight / 2 + currentHeight / 2 - currentCaps / 2 + previousCaps / 2;
14707
- return useMultiLineBackgrounds(calculatedProps) ? textHeight + current.backgroundPadding.top + previous.backgroundPadding.bottom : textHeight;
14701
+ return shouldUseMultilineBackgrounds(calculatedProps) ? textHeight + current.backgroundPadding.top + previous.backgroundPadding.bottom : textHeight;
14708
14702
  };
14709
14703
 
14710
14704
  var getTSpanDy = function (tspanValues, calculatedProps, i) {
@@ -14989,9 +14983,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
14989
14983
 
14990
14984
 
14991
14985
 
14992
- var Portal =
14993
- /*#__PURE__*/
14994
- function (_React$Component) {
14986
+ var Portal = /*#__PURE__*/function (_React$Component) {
14995
14987
  _inherits(Portal, _React$Component);
14996
14988
 
14997
14989
  function Portal(props) {
@@ -15110,9 +15102,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
15110
15102
 
15111
15103
 
15112
15104
 
15113
- var VictoryPortal =
15114
- /*#__PURE__*/
15115
- function (_React$Component) {
15105
+ var VictoryPortal = /*#__PURE__*/function (_React$Component) {
15116
15106
  _inherits(VictoryPortal, _React$Component);
15117
15107
 
15118
15108
  function VictoryPortal() {
@@ -15220,95 +15210,6 @@ Object.defineProperty(VictoryPortal, "contextType", {
15220
15210
  });
15221
15211
 
15222
15212
 
15223
- /***/ }),
15224
-
15225
- /***/ "../../victory-core/es/victory-primitives/path-helpers.js":
15226
- /*!****************************************************************!*\
15227
- !*** ../../victory-core/es/victory-primitives/path-helpers.js ***!
15228
- \****************************************************************/
15229
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
15230
-
15231
- "use strict";
15232
- __webpack_require__.r(__webpack_exports__);
15233
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15234
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
15235
- /* harmony export */ });
15236
- /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/range */ "../../../node_modules/lodash/range.js");
15237
- /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_range__WEBPACK_IMPORTED_MODULE_0__);
15238
-
15239
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
15240
- circle: function (x, y, size) {
15241
- return "M ".concat(x, ", ").concat(y, "\n m ").concat(-size, ", 0\n a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(size * 2, ",0\n a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(-size * 2, ",0");
15242
- },
15243
- square: function (x, y, size) {
15244
- var baseSize = 0.87 * size; // eslint-disable-line no-magic-numbers
15245
-
15246
- var x0 = x - baseSize;
15247
- var y1 = y + baseSize;
15248
- var distance = x + baseSize - x0;
15249
- return "M ".concat(x0, ", ").concat(y1, "\n h").concat(distance, "\n v-").concat(distance, "\n h-").concat(distance, "\n z");
15250
- },
15251
- diamond: function (x, y, size) {
15252
- var baseSize = 0.87 * size; // eslint-disable-line no-magic-numbers
15253
-
15254
- var length = Math.sqrt(2 * (baseSize * baseSize));
15255
- return "M ".concat(x, ", ").concat(y + length, "\n l ").concat(length, ", -").concat(length, "\n l -").concat(length, ", -").concat(length, "\n l -").concat(length, ", ").concat(length, "\n l ").concat(length, ", ").concat(length, "\n z");
15256
- },
15257
- triangleDown: function (x, y, size) {
15258
- var height = size / 2 * Math.sqrt(3);
15259
- var x0 = x - size;
15260
- var x1 = x + size;
15261
- var y0 = y - size;
15262
- var y1 = y + height;
15263
- return "M ".concat(x0, ", ").concat(y0, "\n L ").concat(x1, ", ").concat(y0, "\n L ").concat(x, ", ").concat(y1, "\n z");
15264
- },
15265
- triangleUp: function (x, y, size) {
15266
- var height = size / 2 * Math.sqrt(3);
15267
- var x0 = x - size;
15268
- var x1 = x + size;
15269
- var y0 = y - height;
15270
- var y1 = y + size;
15271
- return "M ".concat(x0, ", ").concat(y1, "\n L ").concat(x1, ", ").concat(y1, "\n L ").concat(x, ", ").concat(y0, "\n z");
15272
- },
15273
- plus: function (x, y, size) {
15274
- var baseSize = 1.1 * size; // eslint-disable-line no-magic-numbers
15275
-
15276
- var distance = baseSize / 1.5; // eslint-disable-line no-magic-numbers
15277
-
15278
- return "\n M ".concat(x - distance / 2, ", ").concat(y + baseSize, "\n v-").concat(distance, "\n h-").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h-").concat(distance, "\n v").concat(distance, "\n z");
15279
- },
15280
- cross: function (x, y, size) {
15281
- var baseSize = 0.8 * size; // eslint-disable-line no-magic-numbers
15282
-
15283
- var distance = baseSize / 1.5; // eslint-disable-line no-magic-numbers
15284
-
15285
- return "\n M ".concat(x - distance / 2, ", ").concat(y + baseSize + distance, "\n v-").concat(distance * 2, "\n h-").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h-").concat(distance, "\n v").concat(distance * 2, "\n z");
15286
- },
15287
- minus: function (x, y, size) {
15288
- var baseSize = 1.1 * size; // eslint-disable-line no-magic-numbers
15289
-
15290
- var lineHeight = baseSize - baseSize * 0.3; // eslint-disable-line no-magic-numbers
15291
-
15292
- var x0 = x - baseSize;
15293
- var y1 = y + lineHeight / 2;
15294
- var distance = x + baseSize - x0;
15295
- return "M ".concat(x0, ", ").concat(y1, "\n h").concat(distance, "\n v-").concat(lineHeight, "\n h-").concat(distance, "\n z");
15296
- },
15297
- star: function (x, y, size) {
15298
- var baseSize = 1.35 * size; // eslint-disable-line no-magic-numbers
15299
-
15300
- var angle = Math.PI / 5; // eslint-disable-line no-magic-numbers
15301
- // eslint-disable-next-line no-magic-numbers
15302
-
15303
- var starCoords = lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(10).map(function (index) {
15304
- var length = index % 2 === 0 ? baseSize : baseSize / 2;
15305
- return "".concat(length * Math.sin(angle * (index + 1)) + x, ",\n ").concat(length * Math.cos(angle * (index + 1)) + y);
15306
- });
15307
-
15308
- return "M ".concat(starCoords.join("L"), " z");
15309
- }
15310
- });
15311
-
15312
15213
  /***/ }),
15313
15214
 
15314
15215
  /***/ "../../victory-core/es/victory-primitives/path.js":
@@ -15358,7 +15259,7 @@ __webpack_require__.r(__webpack_exports__);
15358
15259
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../../../node_modules/prop-types/index.js");
15359
15260
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
15360
15261
  /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
15361
- /* harmony import */ var _path_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./path-helpers */ "../../victory-core/es/victory-primitives/path-helpers.js");
15262
+ /* harmony import */ var _victory_util_point_path_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/point-path-helpers */ "../../victory-core/es/victory-util/point-path-helpers.js");
15362
15263
  /* harmony import */ var _victory_util_common_props__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/common-props */ "../../victory-core/es/victory-util/common-props.js");
15363
15264
  /* harmony import */ var _path__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./path */ "../../victory-core/es/victory-primitives/path.js");
15364
15265
 
@@ -15385,15 +15286,15 @@ var getPath = function (props) {
15385
15286
  }
15386
15287
 
15387
15288
  var pathFunctions = {
15388
- circle: _path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.circle,
15389
- square: _path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.square,
15390
- diamond: _path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.diamond,
15391
- triangleDown: _path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.triangleDown,
15392
- triangleUp: _path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.triangleUp,
15393
- plus: _path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.plus,
15394
- minus: _path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.minus,
15395
- star: _path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.star,
15396
- cross: _path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.cross
15289
+ circle: _victory_util_point_path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.circle,
15290
+ square: _victory_util_point_path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.square,
15291
+ diamond: _victory_util_point_path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.diamond,
15292
+ triangleDown: _victory_util_point_path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.triangleDown,
15293
+ triangleUp: _victory_util_point_path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.triangleUp,
15294
+ plus: _victory_util_point_path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.plus,
15295
+ minus: _victory_util_point_path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.minus,
15296
+ star: _victory_util_point_path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.star,
15297
+ cross: _victory_util_point_path_helpers__WEBPACK_IMPORTED_MODULE_3__.default.cross
15397
15298
  };
15398
15299
  var symbolFunction = typeof pathFunctions[symbol] === "function" ? pathFunctions[symbol] : pathFunctions.circle;
15399
15300
  return symbolFunction(x, y, size);
@@ -16215,9 +16116,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
16215
16116
 
16216
16117
 
16217
16118
 
16218
- var VictoryTransition =
16219
- /*#__PURE__*/
16220
- function (_React$Component) {
16119
+ var VictoryTransition = /*#__PURE__*/function (_React$Component) {
16221
16120
  _inherits(VictoryTransition, _React$Component);
16222
16121
 
16223
16122
  function VictoryTransition(props, context) {
@@ -16518,365 +16417,362 @@ var defaultComponents = [{
16518
16417
  name: "labels"
16519
16418
  }];
16520
16419
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function (WrappedComponent, options) {
16521
- return (
16522
- /*#__PURE__*/
16523
- function (_WrappedComponent) {
16524
- _inherits(addEvents, _WrappedComponent);
16420
+ return /*#__PURE__*/function (_WrappedComponent) {
16421
+ _inherits(addEvents, _WrappedComponent);
16525
16422
 
16526
- function addEvents(props) {
16527
- var _this;
16423
+ function addEvents(props) {
16424
+ var _this;
16528
16425
 
16529
- _classCallCheck(this, addEvents);
16426
+ _classCallCheck(this, addEvents);
16530
16427
 
16531
- _this = _possibleConstructorReturn(this, (addEvents.__proto__ || Object.getPrototypeOf(addEvents)).call(this, props));
16532
- var getScopedEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getScopedEvents.bind(_assertThisInitialized(_this));
16533
- var boundGetEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getEvents.bind(_assertThisInitialized(_this));
16534
- _this.state = {};
16428
+ _this = _possibleConstructorReturn(this, (addEvents.__proto__ || Object.getPrototypeOf(addEvents)).call(this, props));
16429
+ var getScopedEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getScopedEvents.bind(_assertThisInitialized(_this));
16430
+ var boundGetEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getEvents.bind(_assertThisInitialized(_this));
16431
+ _this.state = {};
16535
16432
 
16536
- _this.getEvents = function (p, target, eventKey) {
16537
- return boundGetEvents(p, target, eventKey, getScopedEvents);
16538
- };
16433
+ _this.getEvents = function (p, target, eventKey) {
16434
+ return boundGetEvents(p, target, eventKey, getScopedEvents);
16435
+ };
16539
16436
 
16540
- _this.getEventState = _events__WEBPACK_IMPORTED_MODULE_11__.getEventState.bind(_assertThisInitialized(_this));
16437
+ _this.getEventState = _events__WEBPACK_IMPORTED_MODULE_11__.getEventState.bind(_assertThisInitialized(_this));
16541
16438
 
16542
- var calculatedValues = _this.getCalculatedValues(props);
16439
+ var calculatedValues = _this.getCalculatedValues(props);
16543
16440
 
16544
- _this.cacheValues(calculatedValues);
16441
+ _this.cacheValues(calculatedValues);
16545
16442
 
16546
- _this.externalMutations = _this.getExternalMutations(props);
16547
- _this.calculatedState = _this.getStateChanges(props);
16548
- _this.globalEvents = {};
16549
- _this.prevGlobalEventKeys = [];
16550
- _this.boundGlobalEvents = {};
16551
- return _this;
16552
- }
16553
-
16554
- _createClass(addEvents, [{
16555
- key: "shouldComponentUpdate",
16556
- value: function shouldComponentUpdate(nextProps) {
16557
- var externalMutations = this.getExternalMutations(nextProps);
16558
- var animating = this.props.animating || this.props.animate;
16559
- var newMutation = !react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(externalMutations, this.externalMutations);
16560
-
16561
- if (animating || newMutation) {
16562
- this.cacheValues(this.getCalculatedValues(nextProps));
16563
- this.externalMutations = externalMutations;
16564
- this.applyExternalMutations(nextProps, externalMutations);
16565
- return true;
16566
- }
16567
-
16568
- var calculatedState = this.getStateChanges(nextProps);
16443
+ _this.externalMutations = _this.getExternalMutations(props);
16444
+ _this.calculatedState = _this.getStateChanges(props);
16445
+ _this.globalEvents = {};
16446
+ _this.prevGlobalEventKeys = [];
16447
+ _this.boundGlobalEvents = {};
16448
+ return _this;
16449
+ }
16569
16450
 
16570
- if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(this.calculatedState, calculatedState)) {
16571
- this.cacheValues(this.getCalculatedValues(nextProps));
16572
- return true;
16573
- }
16451
+ _createClass(addEvents, [{
16452
+ key: "shouldComponentUpdate",
16453
+ value: function shouldComponentUpdate(nextProps) {
16454
+ var externalMutations = this.getExternalMutations(nextProps);
16455
+ var animating = this.props.animating || this.props.animate;
16456
+ var newMutation = !react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(externalMutations, this.externalMutations);
16457
+
16458
+ if (animating || newMutation) {
16459
+ this.cacheValues(this.getCalculatedValues(nextProps));
16460
+ this.externalMutations = externalMutations;
16461
+ this.applyExternalMutations(nextProps, externalMutations);
16462
+ return true;
16463
+ }
16574
16464
 
16575
- if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(this.props, nextProps)) {
16576
- this.cacheValues(this.getCalculatedValues(nextProps));
16577
- return true;
16578
- }
16465
+ var calculatedState = this.getStateChanges(nextProps);
16579
16466
 
16580
- return false;
16467
+ if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(this.calculatedState, calculatedState)) {
16468
+ this.cacheValues(this.getCalculatedValues(nextProps));
16469
+ return true;
16581
16470
  }
16582
- }, {
16583
- key: "componentDidMount",
16584
- value: function componentDidMount() {
16585
- var _this2 = this;
16586
16471
 
16587
- var globalEventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(this.globalEvents);
16588
-
16589
- globalEventKeys.forEach(function (key) {
16590
- return _this2.addGlobalListener(key);
16591
- });
16592
- this.prevGlobalEventKeys = globalEventKeys;
16472
+ if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(this.props, nextProps)) {
16473
+ this.cacheValues(this.getCalculatedValues(nextProps));
16474
+ return true;
16593
16475
  }
16594
- }, {
16595
- key: "componentDidUpdate",
16596
- value: function componentDidUpdate(prevProps) {
16597
- var _this3 = this;
16598
16476
 
16599
- var calculatedState = this.getStateChanges(prevProps);
16600
- this.calculatedState = calculatedState;
16477
+ return false;
16478
+ }
16479
+ }, {
16480
+ key: "componentDidMount",
16481
+ value: function componentDidMount() {
16482
+ var _this2 = this;
16601
16483
 
16602
- var globalEventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(this.globalEvents);
16484
+ var globalEventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(this.globalEvents);
16603
16485
 
16604
- var removedGlobalEventKeys = lodash_difference__WEBPACK_IMPORTED_MODULE_0___default()(this.prevGlobalEventKeys, globalEventKeys);
16486
+ globalEventKeys.forEach(function (key) {
16487
+ return _this2.addGlobalListener(key);
16488
+ });
16489
+ this.prevGlobalEventKeys = globalEventKeys;
16490
+ }
16491
+ }, {
16492
+ key: "componentDidUpdate",
16493
+ value: function componentDidUpdate(prevProps) {
16494
+ var _this3 = this;
16605
16495
 
16606
- removedGlobalEventKeys.forEach(function (key) {
16607
- return _this3.removeGlobalListener(key);
16608
- });
16496
+ var calculatedState = this.getStateChanges(prevProps);
16497
+ this.calculatedState = calculatedState;
16609
16498
 
16610
- var addedGlobalEventKeys = lodash_difference__WEBPACK_IMPORTED_MODULE_0___default()(globalEventKeys, this.prevGlobalEventKeys);
16499
+ var globalEventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(this.globalEvents);
16611
16500
 
16612
- addedGlobalEventKeys.forEach(function (key) {
16613
- return _this3.addGlobalListener(key);
16614
- });
16615
- this.prevGlobalEventKeys = globalEventKeys;
16616
- }
16617
- }, {
16618
- key: "componentWillUnmount",
16619
- value: function componentWillUnmount() {
16620
- var _this4 = this;
16501
+ var removedGlobalEventKeys = lodash_difference__WEBPACK_IMPORTED_MODULE_0___default()(this.prevGlobalEventKeys, globalEventKeys);
16621
16502
 
16622
- this.prevGlobalEventKeys.forEach(function (key) {
16623
- return _this4.removeGlobalListener(key);
16624
- });
16625
- }
16626
- }, {
16627
- key: "addGlobalListener",
16628
- value: function addGlobalListener(key) {
16629
- var _this5 = this;
16630
-
16631
- var boundListener = function (event) {
16632
- var listener = _this5.globalEvents[key];
16633
- return listener && listener(_events__WEBPACK_IMPORTED_MODULE_11__.emulateReactEvent(event));
16634
- };
16503
+ removedGlobalEventKeys.forEach(function (key) {
16504
+ return _this3.removeGlobalListener(key);
16505
+ });
16635
16506
 
16636
- this.boundGlobalEvents[key] = boundListener;
16637
- window.addEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), boundListener);
16638
- }
16639
- }, {
16640
- key: "removeGlobalListener",
16641
- value: function removeGlobalListener(key) {
16642
- window.removeEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), this.boundGlobalEvents[key]);
16643
- } // compile all state changes from own and parent state. Order doesn't matter, as any state
16644
- // state change should trigger a re-render
16645
-
16646
- }, {
16647
- key: "getStateChanges",
16648
- value: function getStateChanges(props) {
16649
- var _this6 = this;
16650
-
16651
- if (!this.hasEvents) {
16652
- return {};
16653
- }
16507
+ var addedGlobalEventKeys = lodash_difference__WEBPACK_IMPORTED_MODULE_0___default()(globalEventKeys, this.prevGlobalEventKeys);
16654
16508
 
16655
- var getState = function (key, type) {
16656
- var result = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, _this6.getEventState(key, type), _this6.getSharedEventState(key, type));
16509
+ addedGlobalEventKeys.forEach(function (key) {
16510
+ return _this3.addGlobalListener(key);
16511
+ });
16512
+ this.prevGlobalEventKeys = globalEventKeys;
16513
+ }
16514
+ }, {
16515
+ key: "componentWillUnmount",
16516
+ value: function componentWillUnmount() {
16517
+ var _this4 = this;
16657
16518
 
16658
- return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(result) ? undefined : result;
16659
- };
16519
+ this.prevGlobalEventKeys.forEach(function (key) {
16520
+ return _this4.removeGlobalListener(key);
16521
+ });
16522
+ }
16523
+ }, {
16524
+ key: "addGlobalListener",
16525
+ value: function addGlobalListener(key) {
16526
+ var _this5 = this;
16527
+
16528
+ var boundListener = function (event) {
16529
+ var listener = _this5.globalEvents[key];
16530
+ return listener && listener(_events__WEBPACK_IMPORTED_MODULE_11__.emulateReactEvent(event));
16531
+ };
16660
16532
 
16661
- options = options || {};
16662
- var components = options.components || defaultComponents;
16663
- var stateChanges = components.map(function (component) {
16664
- if (!props.standalone && component.name === "parent") {
16665
- // don't check for changes on parent props for non-standalone components
16666
- return undefined;
16667
- } else {
16668
- return component.index !== undefined ? getState(component.index, component.name) : _this6.dataKeys.map(function (key) {
16669
- return getState(key, component.name);
16670
- }).filter(Boolean);
16671
- }
16672
- }).filter(Boolean);
16673
- return stateChanges;
16674
- }
16675
- }, {
16676
- key: "applyExternalMutations",
16677
- value: function applyExternalMutations(props, externalMutations) {
16678
- if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalMutations)) {
16679
- var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
16680
- memo = lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
16681
- return memo;
16682
- }, []);
16683
- var compiledCallbacks = callbacks.length ? function () {
16684
- callbacks.forEach(function (c) {
16685
- return c();
16686
- });
16687
- } : undefined;
16688
- this.setState(externalMutations, compiledCallbacks);
16689
- }
16533
+ this.boundGlobalEvents[key] = boundListener;
16534
+ window.addEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), boundListener);
16535
+ }
16536
+ }, {
16537
+ key: "removeGlobalListener",
16538
+ value: function removeGlobalListener(key) {
16539
+ window.removeEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), this.boundGlobalEvents[key]);
16540
+ } // compile all state changes from own and parent state. Order doesn't matter, as any state
16541
+ // state change should trigger a re-render
16542
+
16543
+ }, {
16544
+ key: "getStateChanges",
16545
+ value: function getStateChanges(props) {
16546
+ var _this6 = this;
16547
+
16548
+ if (!this.hasEvents) {
16549
+ return {};
16690
16550
  }
16691
- }, {
16692
- key: "getCalculatedValues",
16693
- value: function getCalculatedValues(props) {
16694
- var sharedEvents = props.sharedEvents;
16695
- var components = WrappedComponent.expectedComponents;
16696
- var componentEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getComponentEvents(props, components);
16697
- var getSharedEventState = sharedEvents && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(sharedEvents.getEventState) ? sharedEvents.getEventState : function () {
16698
- return undefined;
16699
- };
16700
- var baseProps = this.getBaseProps(props, getSharedEventState);
16701
16551
 
16702
- var dataKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(baseProps).filter(function (key) {
16703
- return key !== "parent";
16704
- });
16552
+ var getState = function (key, type) {
16553
+ var result = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, _this6.getEventState(key, type), _this6.getSharedEventState(key, type));
16705
16554
 
16706
- var hasEvents = props.events || props.sharedEvents || componentEvents;
16707
- var events = this.getAllEvents(props);
16708
- return {
16709
- componentEvents: componentEvents,
16710
- getSharedEventState: getSharedEventState,
16711
- baseProps: baseProps,
16712
- dataKeys: dataKeys,
16713
- hasEvents: hasEvents,
16714
- events: events
16715
- };
16716
- }
16717
- }, {
16718
- key: "getExternalMutations",
16719
- value: function getExternalMutations(props) {
16720
- var sharedEvents = props.sharedEvents,
16721
- externalEventMutations = props.externalEventMutations;
16722
- return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalEventMutations) || sharedEvents ? undefined : _events__WEBPACK_IMPORTED_MODULE_11__.getExternalMutations(externalEventMutations, this.baseProps, this.state);
16723
- }
16724
- }, {
16725
- key: "cacheValues",
16726
- value: function cacheValues(obj) {
16727
- var _this7 = this;
16555
+ return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(result) ? undefined : result;
16556
+ };
16728
16557
 
16729
- lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(obj).forEach(function (key) {
16730
- _this7[key] = obj[key];
16731
- });
16558
+ options = options || {};
16559
+ var components = options.components || defaultComponents;
16560
+ var stateChanges = components.map(function (component) {
16561
+ if (!props.standalone && component.name === "parent") {
16562
+ // don't check for changes on parent props for non-standalone components
16563
+ return undefined;
16564
+ } else {
16565
+ return component.index !== undefined ? getState(component.index, component.name) : _this6.dataKeys.map(function (key) {
16566
+ return getState(key, component.name);
16567
+ }).filter(Boolean);
16568
+ }
16569
+ }).filter(Boolean);
16570
+ return stateChanges;
16571
+ }
16572
+ }, {
16573
+ key: "applyExternalMutations",
16574
+ value: function applyExternalMutations(props, externalMutations) {
16575
+ if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalMutations)) {
16576
+ var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
16577
+ memo = lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
16578
+ return memo;
16579
+ }, []);
16580
+ var compiledCallbacks = callbacks.length ? function () {
16581
+ callbacks.forEach(function (c) {
16582
+ return c();
16583
+ });
16584
+ } : undefined;
16585
+ this.setState(externalMutations, compiledCallbacks);
16732
16586
  }
16733
- }, {
16734
- key: "getBaseProps",
16735
- value: function getBaseProps(props, getSharedEventState) {
16736
- getSharedEventState = getSharedEventState || this.getSharedEventState;
16737
- var sharedParentState = getSharedEventState("parent", "parent");
16738
- var parentState = this.getEventState("parent", "parent");
16587
+ }
16588
+ }, {
16589
+ key: "getCalculatedValues",
16590
+ value: function getCalculatedValues(props) {
16591
+ var sharedEvents = props.sharedEvents;
16592
+ var components = WrappedComponent.expectedComponents;
16593
+ var componentEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getComponentEvents(props, components);
16594
+ var getSharedEventState = sharedEvents && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(sharedEvents.getEventState) ? sharedEvents.getEventState : function () {
16595
+ return undefined;
16596
+ };
16597
+ var baseProps = this.getBaseProps(props, getSharedEventState);
16739
16598
 
16740
- var baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, parentState, sharedParentState);
16599
+ var dataKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(baseProps).filter(function (key) {
16600
+ return key !== "parent";
16601
+ });
16741
16602
 
16742
- var parentPropsList = baseParentProps.parentControlledProps;
16743
- var parentProps = parentPropsList ? lodash_pick__WEBPACK_IMPORTED_MODULE_4___default()(baseParentProps, parentPropsList) : {};
16603
+ var hasEvents = props.events || props.sharedEvents || componentEvents;
16604
+ var events = this.getAllEvents(props);
16605
+ return {
16606
+ componentEvents: componentEvents,
16607
+ getSharedEventState: getSharedEventState,
16608
+ baseProps: baseProps,
16609
+ dataKeys: dataKeys,
16610
+ hasEvents: hasEvents,
16611
+ events: events
16612
+ };
16613
+ }
16614
+ }, {
16615
+ key: "getExternalMutations",
16616
+ value: function getExternalMutations(props) {
16617
+ var sharedEvents = props.sharedEvents,
16618
+ externalEventMutations = props.externalEventMutations;
16619
+ return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalEventMutations) || sharedEvents ? undefined : _events__WEBPACK_IMPORTED_MODULE_11__.getExternalMutations(externalEventMutations, this.baseProps, this.state);
16620
+ }
16621
+ }, {
16622
+ key: "cacheValues",
16623
+ value: function cacheValues(obj) {
16624
+ var _this7 = this;
16744
16625
 
16745
- var modifiedProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, parentProps, props);
16626
+ lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(obj).forEach(function (key) {
16627
+ _this7[key] = obj[key];
16628
+ });
16629
+ }
16630
+ }, {
16631
+ key: "getBaseProps",
16632
+ value: function getBaseProps(props, getSharedEventState) {
16633
+ getSharedEventState = getSharedEventState || this.getSharedEventState;
16634
+ var sharedParentState = getSharedEventState("parent", "parent");
16635
+ var parentState = this.getEventState("parent", "parent");
16746
16636
 
16747
- return lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(WrappedComponent.getBaseProps) ? WrappedComponent.getBaseProps(modifiedProps) : {};
16748
- }
16749
- }, {
16750
- key: "getAllEvents",
16751
- value: function getAllEvents(props) {
16752
- if (Array.isArray(this.componentEvents)) {
16753
- var _componentEvents;
16637
+ var baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, parentState, sharedParentState);
16754
16638
 
16755
- return Array.isArray(props.events) ? (_componentEvents = this.componentEvents).concat.apply(_componentEvents, _toConsumableArray(props.events)) : this.componentEvents;
16756
- }
16639
+ var parentPropsList = baseParentProps.parentControlledProps;
16640
+ var parentProps = parentPropsList ? lodash_pick__WEBPACK_IMPORTED_MODULE_4___default()(baseParentProps, parentPropsList) : {};
16757
16641
 
16758
- return props.events;
16759
- }
16760
- }, {
16761
- key: "getComponentProps",
16762
- value: function getComponentProps(component, type, index) {
16763
- var name = this.props.name || WrappedComponent.role;
16764
- var key = this.dataKeys && this.dataKeys[index] || index;
16765
- var id = "".concat(name, "-").concat(type, "-").concat(key);
16766
- var baseProps = this.baseProps[key] && this.baseProps[key][type] || this.baseProps[key];
16767
-
16768
- if (!baseProps && !this.hasEvents) {
16769
- return undefined;
16770
- }
16642
+ var modifiedProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, parentProps, props);
16771
16643
 
16772
- if (this.hasEvents) {
16773
- var baseEvents = this.getEvents(this.props, type, key);
16644
+ return lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(WrappedComponent.getBaseProps) ? WrappedComponent.getBaseProps(modifiedProps) : {};
16645
+ }
16646
+ }, {
16647
+ key: "getAllEvents",
16648
+ value: function getAllEvents(props) {
16649
+ if (Array.isArray(this.componentEvents)) {
16650
+ var _componentEvents;
16774
16651
 
16775
- var componentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({
16776
- index: index,
16777
- key: id
16778
- }, this.getEventState(key, type), this.getSharedEventState(key, type), component.props, baseProps, {
16779
- id: id
16780
- });
16652
+ return Array.isArray(props.events) ? (_componentEvents = this.componentEvents).concat.apply(_componentEvents, _toConsumableArray(props.events)) : this.componentEvents;
16653
+ }
16781
16654
 
16782
- var events = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, _events__WEBPACK_IMPORTED_MODULE_11__.getPartialEvents(baseEvents, key, componentProps), componentProps.events);
16655
+ return props.events;
16656
+ }
16657
+ }, {
16658
+ key: "getComponentProps",
16659
+ value: function getComponentProps(component, type, index) {
16660
+ var name = this.props.name || WrappedComponent.role;
16661
+ var key = this.dataKeys && this.dataKeys[index] || index;
16662
+ var id = "".concat(name, "-").concat(type, "-").concat(key);
16663
+ var baseProps = this.baseProps[key] && this.baseProps[key][type] || this.baseProps[key];
16664
+
16665
+ if (!baseProps && !this.hasEvents) {
16666
+ return undefined;
16667
+ }
16783
16668
 
16784
- return lodash_assign__WEBPACK_IMPORTED_MODULE_7___default()({}, componentProps, {
16785
- events: events
16786
- });
16787
- }
16669
+ if (this.hasEvents) {
16670
+ var baseEvents = this.getEvents(this.props, type, key);
16788
16671
 
16789
- return lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({
16672
+ var componentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({
16790
16673
  index: index,
16791
16674
  key: id
16792
- }, component.props, baseProps, {
16675
+ }, this.getEventState(key, type), this.getSharedEventState(key, type), component.props, baseProps, {
16793
16676
  id: id
16794
16677
  });
16795
- }
16796
- }, {
16797
- key: "renderContainer",
16798
- value: function renderContainer(component, children) {
16799
- var isContainer = component.type && component.type.role === "container";
16800
- var parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {};
16801
-
16802
- if (parentProps.events) {
16803
- this.globalEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEvents(parentProps.events);
16804
- parentProps.events = _events__WEBPACK_IMPORTED_MODULE_11__.omitGlobalEvents(parentProps.events);
16805
- }
16806
16678
 
16807
- return react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(component, parentProps, children);
16679
+ var events = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, _events__WEBPACK_IMPORTED_MODULE_11__.getPartialEvents(baseEvents, key, componentProps), componentProps.events);
16680
+
16681
+ return lodash_assign__WEBPACK_IMPORTED_MODULE_7___default()({}, componentProps, {
16682
+ events: events
16683
+ });
16808
16684
  }
16809
- }, {
16810
- key: "animateComponent",
16811
- value: function animateComponent(props, defaultAnimationWhitelist) {
16812
- var animationWhitelist = props.animate && props.animate.animationWhitelist ? props.animate.animationWhitelist : defaultAnimationWhitelist;
16813
- return react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_victory_transition_victory_transition__WEBPACK_IMPORTED_MODULE_12__.default, {
16814
- animate: props.animate,
16815
- animationWhitelist: animationWhitelist
16816
- }, react__WEBPACK_IMPORTED_MODULE_9___default().createElement(this.constructor, props));
16817
- } // Used by `VictoryLine` and `VictoryArea`
16818
-
16819
- }, {
16820
- key: "renderContinuousData",
16821
- value: function renderContinuousData(props) {
16822
- var _this8 = this;
16823
-
16824
- var dataComponent = props.dataComponent,
16825
- labelComponent = props.labelComponent,
16826
- groupComponent = props.groupComponent;
16827
-
16828
- var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_3___default()(this.dataKeys, "all");
16829
-
16830
- var labelComponents = dataKeys.reduce(function (memo, key) {
16831
- var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
16832
-
16833
- if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
16834
- memo = memo.concat(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
16835
- }
16836
16685
 
16837
- return memo;
16838
- }, []);
16839
- var dataProps = this.getComponentProps(dataComponent, "data", "all");
16840
- var children = [react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
16841
- return this.renderContainer(groupComponent, children);
16686
+ return lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({
16687
+ index: index,
16688
+ key: id
16689
+ }, component.props, baseProps, {
16690
+ id: id
16691
+ });
16692
+ }
16693
+ }, {
16694
+ key: "renderContainer",
16695
+ value: function renderContainer(component, children) {
16696
+ var isContainer = component.type && component.type.role === "container";
16697
+ var parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {};
16698
+
16699
+ if (parentProps.events) {
16700
+ this.globalEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEvents(parentProps.events);
16701
+ parentProps.events = _events__WEBPACK_IMPORTED_MODULE_11__.omitGlobalEvents(parentProps.events);
16842
16702
  }
16843
- }, {
16844
- key: "renderData",
16845
- value: function renderData(props) {
16846
- var _this9 = this;
16847
-
16848
- var shouldRenderDatum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datumHasXandY;
16849
- var dataComponent = props.dataComponent,
16850
- labelComponent = props.labelComponent,
16851
- groupComponent = props.groupComponent;
16852
- var dataComponents = this.dataKeys.reduce(function (validDataComponents, _dataKey, index) {
16853
- var dataProps = _this9.getComponentProps(dataComponent, "data", index);
16854
-
16855
- if (shouldRenderDatum(dataProps.datum)) {
16856
- validDataComponents.push(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps));
16857
- }
16858
16703
 
16859
- return validDataComponents;
16860
- }, []);
16861
- var labelComponents = this.dataKeys.map(function (_dataKey, index) {
16862
- var labelProps = _this9.getComponentProps(labelComponent, "labels", index);
16704
+ return react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(component, parentProps, children);
16705
+ }
16706
+ }, {
16707
+ key: "animateComponent",
16708
+ value: function animateComponent(props, defaultAnimationWhitelist) {
16709
+ var animationWhitelist = props.animate && props.animate.animationWhitelist ? props.animate.animationWhitelist : defaultAnimationWhitelist;
16710
+ return react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_victory_transition_victory_transition__WEBPACK_IMPORTED_MODULE_12__.default, {
16711
+ animate: props.animate,
16712
+ animationWhitelist: animationWhitelist
16713
+ }, react__WEBPACK_IMPORTED_MODULE_9___default().createElement(this.constructor, props));
16714
+ } // Used by `VictoryLine` and `VictoryArea`
16715
+
16716
+ }, {
16717
+ key: "renderContinuousData",
16718
+ value: function renderContinuousData(props) {
16719
+ var _this8 = this;
16720
+
16721
+ var dataComponent = props.dataComponent,
16722
+ labelComponent = props.labelComponent,
16723
+ groupComponent = props.groupComponent;
16724
+
16725
+ var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_3___default()(this.dataKeys, "all");
16726
+
16727
+ var labelComponents = dataKeys.reduce(function (memo, key) {
16728
+ var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
16729
+
16730
+ if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
16731
+ memo = memo.concat(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
16732
+ }
16863
16733
 
16864
- if (labelProps.text !== undefined && labelProps.text !== null) {
16865
- return react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps);
16866
- }
16734
+ return memo;
16735
+ }, []);
16736
+ var dataProps = this.getComponentProps(dataComponent, "data", "all");
16737
+ var children = [react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
16738
+ return this.renderContainer(groupComponent, children);
16739
+ }
16740
+ }, {
16741
+ key: "renderData",
16742
+ value: function renderData(props) {
16743
+ var _this9 = this;
16744
+
16745
+ var shouldRenderDatum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datumHasXandY;
16746
+ var dataComponent = props.dataComponent,
16747
+ labelComponent = props.labelComponent,
16748
+ groupComponent = props.groupComponent;
16749
+ var dataComponents = this.dataKeys.reduce(function (validDataComponents, _dataKey, index) {
16750
+ var dataProps = _this9.getComponentProps(dataComponent, "data", index);
16751
+
16752
+ if (shouldRenderDatum(dataProps.datum)) {
16753
+ validDataComponents.push(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps));
16754
+ }
16867
16755
 
16868
- return undefined;
16869
- }).filter(Boolean);
16756
+ return validDataComponents;
16757
+ }, []);
16758
+ var labelComponents = this.dataKeys.map(function (_dataKey, index) {
16759
+ var labelProps = _this9.getComponentProps(labelComponent, "labels", index);
16870
16760
 
16871
- var children = _toConsumableArray(dataComponents).concat(_toConsumableArray(labelComponents));
16761
+ if (labelProps.text !== undefined && labelProps.text !== null) {
16762
+ return react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps);
16763
+ }
16872
16764
 
16873
- return this.renderContainer(groupComponent, children);
16874
- }
16875
- }]);
16765
+ return undefined;
16766
+ }).filter(Boolean);
16876
16767
 
16877
- return addEvents;
16878
- }(WrappedComponent)
16879
- );
16768
+ var children = _toConsumableArray(dataComponents).concat(_toConsumableArray(labelComponents));
16769
+
16770
+ return this.renderContainer(groupComponent, children);
16771
+ }
16772
+ }]);
16773
+
16774
+ return addEvents;
16775
+ }(WrappedComponent);
16880
16776
  });
16881
16777
 
16882
16778
  /***/ }),
@@ -19410,6 +19306,95 @@ function warn(message) {
19410
19306
 
19411
19307
  /***/ }),
19412
19308
 
19309
+ /***/ "../../victory-core/es/victory-util/point-path-helpers.js":
19310
+ /*!****************************************************************!*\
19311
+ !*** ../../victory-core/es/victory-util/point-path-helpers.js ***!
19312
+ \****************************************************************/
19313
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
19314
+
19315
+ "use strict";
19316
+ __webpack_require__.r(__webpack_exports__);
19317
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19318
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
19319
+ /* harmony export */ });
19320
+ /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/range */ "../../../node_modules/lodash/range.js");
19321
+ /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_range__WEBPACK_IMPORTED_MODULE_0__);
19322
+
19323
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
19324
+ circle: function (x, y, size) {
19325
+ return "M ".concat(x, ", ").concat(y, "\n m ").concat(-size, ", 0\n a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(size * 2, ",0\n a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(-size * 2, ",0");
19326
+ },
19327
+ square: function (x, y, size) {
19328
+ var baseSize = 0.87 * size; // eslint-disable-line no-magic-numbers
19329
+
19330
+ var x0 = x - baseSize;
19331
+ var y1 = y + baseSize;
19332
+ var distance = x + baseSize - x0;
19333
+ return "M ".concat(x0, ", ").concat(y1, "\n h").concat(distance, "\n v-").concat(distance, "\n h-").concat(distance, "\n z");
19334
+ },
19335
+ diamond: function (x, y, size) {
19336
+ var baseSize = 0.87 * size; // eslint-disable-line no-magic-numbers
19337
+
19338
+ var length = Math.sqrt(2 * (baseSize * baseSize));
19339
+ return "M ".concat(x, ", ").concat(y + length, "\n l ").concat(length, ", -").concat(length, "\n l -").concat(length, ", -").concat(length, "\n l -").concat(length, ", ").concat(length, "\n l ").concat(length, ", ").concat(length, "\n z");
19340
+ },
19341
+ triangleDown: function (x, y, size) {
19342
+ var height = size / 2 * Math.sqrt(3);
19343
+ var x0 = x - size;
19344
+ var x1 = x + size;
19345
+ var y0 = y - size;
19346
+ var y1 = y + height;
19347
+ return "M ".concat(x0, ", ").concat(y0, "\n L ").concat(x1, ", ").concat(y0, "\n L ").concat(x, ", ").concat(y1, "\n z");
19348
+ },
19349
+ triangleUp: function (x, y, size) {
19350
+ var height = size / 2 * Math.sqrt(3);
19351
+ var x0 = x - size;
19352
+ var x1 = x + size;
19353
+ var y0 = y - height;
19354
+ var y1 = y + size;
19355
+ return "M ".concat(x0, ", ").concat(y1, "\n L ").concat(x1, ", ").concat(y1, "\n L ").concat(x, ", ").concat(y0, "\n z");
19356
+ },
19357
+ plus: function (x, y, size) {
19358
+ var baseSize = 1.1 * size; // eslint-disable-line no-magic-numbers
19359
+
19360
+ var distance = baseSize / 1.5; // eslint-disable-line no-magic-numbers
19361
+
19362
+ return "\n M ".concat(x - distance / 2, ", ").concat(y + baseSize, "\n v-").concat(distance, "\n h-").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h-").concat(distance, "\n v").concat(distance, "\n z");
19363
+ },
19364
+ cross: function (x, y, size) {
19365
+ var baseSize = 0.8 * size; // eslint-disable-line no-magic-numbers
19366
+
19367
+ var distance = baseSize / 1.5; // eslint-disable-line no-magic-numbers
19368
+
19369
+ return "\n M ".concat(x - distance / 2, ", ").concat(y + baseSize + distance, "\n v-").concat(distance * 2, "\n h-").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h-").concat(distance, "\n v").concat(distance * 2, "\n z");
19370
+ },
19371
+ minus: function (x, y, size) {
19372
+ var baseSize = 1.1 * size; // eslint-disable-line no-magic-numbers
19373
+
19374
+ var lineHeight = baseSize - baseSize * 0.3; // eslint-disable-line no-magic-numbers
19375
+
19376
+ var x0 = x - baseSize;
19377
+ var y1 = y + lineHeight / 2;
19378
+ var distance = x + baseSize - x0;
19379
+ return "M ".concat(x0, ", ").concat(y1, "\n h").concat(distance, "\n v-").concat(lineHeight, "\n h-").concat(distance, "\n z");
19380
+ },
19381
+ star: function (x, y, size) {
19382
+ var baseSize = 1.35 * size; // eslint-disable-line no-magic-numbers
19383
+
19384
+ var angle = Math.PI / 5; // eslint-disable-line no-magic-numbers
19385
+ // eslint-disable-next-line no-magic-numbers
19386
+
19387
+ var starCoords = lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(10).map(function (index) {
19388
+ var length = index % 2 === 0 ? baseSize : baseSize / 2;
19389
+ return "".concat(length * Math.sin(angle * (index + 1)) + x, ",\n ").concat(length * Math.cos(angle * (index + 1)) + y);
19390
+ });
19391
+
19392
+ return "M ".concat(starCoords.join("L"), " z");
19393
+ }
19394
+ });
19395
+
19396
+ /***/ }),
19397
+
19413
19398
  /***/ "../../victory-core/es/victory-util/prop-types.js":
19414
19399
  /*!********************************************************!*\
19415
19400
  !*** ../../victory-core/es/victory-util/prop-types.js ***!
@@ -20280,9 +20265,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
20280
20265
 
20281
20266
 
20282
20267
 
20283
- var Timer =
20284
- /*#__PURE__*/
20285
- function () {
20268
+ var Timer = /*#__PURE__*/function () {
20286
20269
  function Timer() {
20287
20270
  _classCallCheck(this, Timer);
20288
20271
 
@@ -26,9 +26,7 @@ var fallbackProps = {
26
26
  symbol: "circle"
27
27
  };
28
28
 
29
- var VictoryScatter =
30
- /*#__PURE__*/
31
- function (_React$Component) {
29
+ var VictoryScatter = /*#__PURE__*/function (_React$Component) {
32
30
  _inherits(VictoryScatter, _React$Component);
33
31
 
34
32
  function VictoryScatter() {
@@ -39,9 +39,7 @@ var fallbackProps = {
39
39
  symbol: "circle"
40
40
  };
41
41
 
42
- var VictoryScatter =
43
- /*#__PURE__*/
44
- function (_React$Component) {
42
+ var VictoryScatter = /*#__PURE__*/function (_React$Component) {
45
43
  _inherits(VictoryScatter, _React$Component);
46
44
 
47
45
  function VictoryScatter() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "victory-scatter",
3
- "version": "35.11.2",
3
+ "version": "36.1.0",
4
4
  "description": "Scatter Component for Victory",
5
5
  "keywords": [
6
6
  "data visualization",
@@ -21,13 +21,14 @@
21
21
  "dependencies": {
22
22
  "lodash": "^4.17.19",
23
23
  "prop-types": "^15.5.8",
24
- "victory-core": "^35.11.2"
24
+ "victory-core": "^36.1.0"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "react": "^16.6.0 || ^17.0.0"
28
28
  },
29
29
  "scripts": {
30
- "version": "nps build-libs && nps build-dists"
30
+ "version": "yarn run nps build-libs && nps build-dists"
31
31
  },
32
- "sideEffects": false
32
+ "sideEffects": false,
33
+ "gitHead": "038cd9b70d9ce54ac6b861014165583760734c99"
33
34
  }