victory-scatter 36.8.5-next.0 → 36.8.6

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/CHANGELOG.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # victory-scatter
2
2
 
3
- ## 36.8.5-next.0
3
+ ## 36.8.6
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - c8c2eb2f5: Replace instances of lodash.assign with Object.assign
8
- - 0f3abe234: Migrate victory-native to TypeScript
9
- - Updated dependencies [c8c2eb2f5]
10
- - Updated dependencies [0f3abe234]
11
- - victory-core@36.8.5-next.0
7
+ - Migrate victory-native to TypeScript ([#2739](https://github.com/FormidableLabs/victory/pull/2739))
8
+
9
+ ## 36.8.5
10
+
11
+ ### Patch Changes
12
+
13
+ - Replace instances of lodash.assign with Object.assign ([#2757](https://github.com/FormidableLabs/victory/pull/2757))
14
+
15
+ * Replace instances of lodash.range with equivalent native code ([#2760](https://github.com/FormidableLabs/victory/pull/2760))
12
16
 
13
17
  ## 36.8.4
14
18
 
@@ -1666,44 +1666,6 @@ function basePropertyDeep(path) {
1666
1666
  module.exports = basePropertyDeep;
1667
1667
 
1668
1668
 
1669
- /***/ }),
1670
-
1671
- /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseRange.js":
1672
- /*!************************************************************************************!*\
1673
- !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseRange.js ***!
1674
- \************************************************************************************/
1675
- /***/ ((module) => {
1676
-
1677
- /* Built-in method references for those with the same name as other `lodash` methods. */
1678
- var nativeCeil = Math.ceil,
1679
- nativeMax = Math.max;
1680
-
1681
- /**
1682
- * The base implementation of `_.range` and `_.rangeRight` which doesn't
1683
- * coerce arguments.
1684
- *
1685
- * @private
1686
- * @param {number} start The start of the range.
1687
- * @param {number} end The end of the range.
1688
- * @param {number} step The value to increment or decrement by.
1689
- * @param {boolean} [fromRight] Specify iterating from right to left.
1690
- * @returns {Array} Returns the range of numbers.
1691
- */
1692
- function baseRange(start, end, step, fromRight) {
1693
- var index = -1,
1694
- length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
1695
- result = Array(length);
1696
-
1697
- while (length--) {
1698
- result[fromRight ? length : ++index] = start;
1699
- start += step;
1700
- }
1701
- return result;
1702
- }
1703
-
1704
- module.exports = baseRange;
1705
-
1706
-
1707
1669
  /***/ }),
1708
1670
 
1709
1671
  /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseRest.js":
@@ -2272,46 +2234,6 @@ function createFind(findIndexFunc) {
2272
2234
  module.exports = createFind;
2273
2235
 
2274
2236
 
2275
- /***/ }),
2276
-
2277
- /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createRange.js":
2278
- /*!**************************************************************************************!*\
2279
- !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createRange.js ***!
2280
- \**************************************************************************************/
2281
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2282
-
2283
- var baseRange = __webpack_require__(/*! ./_baseRange */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseRange.js"),
2284
- isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isIterateeCall.js"),
2285
- toFinite = __webpack_require__(/*! ./toFinite */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toFinite.js");
2286
-
2287
- /**
2288
- * Creates a `_.range` or `_.rangeRight` function.
2289
- *
2290
- * @private
2291
- * @param {boolean} [fromRight] Specify iterating from right to left.
2292
- * @returns {Function} Returns the new range function.
2293
- */
2294
- function createRange(fromRight) {
2295
- return function(start, end, step) {
2296
- if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
2297
- end = step = undefined;
2298
- }
2299
- // Ensure the sign of `-0` is preserved.
2300
- start = toFinite(start);
2301
- if (end === undefined) {
2302
- end = start;
2303
- start = 0;
2304
- } else {
2305
- end = toFinite(end);
2306
- }
2307
- step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
2308
- return baseRange(start, end, step, fromRight);
2309
- };
2310
- }
2311
-
2312
- module.exports = createRange;
2313
-
2314
-
2315
2237
  /***/ }),
2316
2238
 
2317
2239
  /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createSet.js":
@@ -5176,62 +5098,6 @@ function property(path) {
5176
5098
  module.exports = property;
5177
5099
 
5178
5100
 
5179
- /***/ }),
5180
-
5181
- /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/range.js":
5182
- /*!*******************************************************************************!*\
5183
- !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/range.js ***!
5184
- \*******************************************************************************/
5185
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5186
-
5187
- var createRange = __webpack_require__(/*! ./_createRange */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createRange.js");
5188
-
5189
- /**
5190
- * Creates an array of numbers (positive and/or negative) progressing from
5191
- * `start` up to, but not including, `end`. A step of `-1` is used if a negative
5192
- * `start` is specified without an `end` or `step`. If `end` is not specified,
5193
- * it's set to `start` with `start` then set to `0`.
5194
- *
5195
- * **Note:** JavaScript follows the IEEE-754 standard for resolving
5196
- * floating-point values which can produce unexpected results.
5197
- *
5198
- * @static
5199
- * @since 0.1.0
5200
- * @memberOf _
5201
- * @category Util
5202
- * @param {number} [start=0] The start of the range.
5203
- * @param {number} end The end of the range.
5204
- * @param {number} [step=1] The value to increment or decrement by.
5205
- * @returns {Array} Returns the range of numbers.
5206
- * @see _.inRange, _.rangeRight
5207
- * @example
5208
- *
5209
- * _.range(4);
5210
- * // => [0, 1, 2, 3]
5211
- *
5212
- * _.range(-4);
5213
- * // => [0, -1, -2, -3]
5214
- *
5215
- * _.range(1, 5);
5216
- * // => [1, 2, 3, 4]
5217
- *
5218
- * _.range(0, 20, 5);
5219
- * // => [0, 5, 10, 15]
5220
- *
5221
- * _.range(0, -4, -1);
5222
- * // => [0, -1, -2, -3]
5223
- *
5224
- * _.range(1, 4, 0);
5225
- * // => [1, 1, 1]
5226
- *
5227
- * _.range(0);
5228
- * // => []
5229
- */
5230
- var range = createRange();
5231
-
5232
- module.exports = range;
5233
-
5234
-
5235
5101
  /***/ }),
5236
5102
 
5237
5103
  /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/sortedUniq.js":
@@ -10521,17 +10387,14 @@ __webpack_require__.r(__webpack_exports__);
10521
10387
  /* harmony import */ var lodash_isFunction__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash_isFunction__WEBPACK_IMPORTED_MODULE_8__);
10522
10388
  /* harmony import */ var lodash_last__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash/last */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/last.js");
10523
10389
  /* harmony import */ var lodash_last__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash_last__WEBPACK_IMPORTED_MODULE_9__);
10524
- /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! lodash/range */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/range.js");
10525
- /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash_range__WEBPACK_IMPORTED_MODULE_10__);
10526
- /* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! lodash/uniq */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniq.js");
10527
- /* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_11__);
10528
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react */ "react");
10529
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_12__);
10530
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
10390
+ /* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! lodash/uniq */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniq.js");
10391
+ /* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_10__);
10392
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react */ "react");
10393
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_11__);
10394
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
10531
10395
  /* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
10532
- /* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
10533
- /* harmony import */ var _immutable__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./immutable */ "../../victory-core/es/victory-util/immutable.js");
10534
-
10396
+ /* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
10397
+ /* harmony import */ var _immutable__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./immutable */ "../../victory-core/es/victory-util/immutable.js");
10535
10398
 
10536
10399
 
10537
10400
 
@@ -10568,24 +10431,22 @@ function parseDatum(datum) {
10568
10431
  errorX: true,
10569
10432
  errorY: true
10570
10433
  };
10571
- return _immutable__WEBPACK_IMPORTED_MODULE_13__.isImmutable(datum) ? _immutable__WEBPACK_IMPORTED_MODULE_13__.shallowToJS(datum, immutableDatumWhitelist) : datum;
10434
+ return _immutable__WEBPACK_IMPORTED_MODULE_12__.isImmutable(datum) ? _immutable__WEBPACK_IMPORTED_MODULE_12__.shallowToJS(datum, immutableDatumWhitelist) : datum;
10572
10435
  }
10573
10436
 
10574
10437
  function getLength(data) {
10575
- return _immutable__WEBPACK_IMPORTED_MODULE_13__.isIterable(data) ? data.size : data.length;
10438
+ return _immutable__WEBPACK_IMPORTED_MODULE_12__.isIterable(data) ? data.size : data.length;
10576
10439
  } // Returns generated data for a given axis based on domain and sample from props
10577
10440
 
10578
10441
 
10579
10442
  function generateDataArray(props, axis) {
10580
10443
  var propsDomain = lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_7___default()(props.domain) ? props.domain[axis] : props.domain;
10581
- var domain = propsDomain || _scale__WEBPACK_IMPORTED_MODULE_14__.getBaseScale(props, axis).domain();
10444
+ var domain = propsDomain || _scale__WEBPACK_IMPORTED_MODULE_13__.getBaseScale(props, axis).domain();
10582
10445
  var samples = props.samples || 1;
10583
10446
  var domainMax = Math.max.apply(Math, _toConsumableArray(domain));
10584
10447
  var domainMin = Math.min.apply(Math, _toConsumableArray(domain));
10585
10448
  var step = (domainMax - domainMin) / samples;
10586
-
10587
- var values = lodash_range__WEBPACK_IMPORTED_MODULE_10___default()(domainMin, domainMax, step);
10588
-
10449
+ var values = _helpers__WEBPACK_IMPORTED_MODULE_14__.range(domainMin, domainMax, step);
10589
10450
  return lodash_last__WEBPACK_IMPORTED_MODULE_9___default()(values) === domainMax ? values : values.concat(domainMax);
10590
10451
  } // Returns sorted data. If no sort keys are provided, data is returned unaltered.
10591
10452
 
@@ -10612,8 +10473,8 @@ function sortData(dataset, sortKey) {
10612
10473
  function cleanData(dataset, props) {
10613
10474
  var smallNumber = 1 / Number.MAX_SAFE_INTEGER;
10614
10475
  var scaleType = {
10615
- x: _scale__WEBPACK_IMPORTED_MODULE_14__.getScaleType(props, "x"),
10616
- y: _scale__WEBPACK_IMPORTED_MODULE_14__.getScaleType(props, "y")
10476
+ x: _scale__WEBPACK_IMPORTED_MODULE_13__.getScaleType(props, "x"),
10477
+ y: _scale__WEBPACK_IMPORTED_MODULE_13__.getScaleType(props, "y")
10617
10478
  };
10618
10479
 
10619
10480
  if (scaleType.x !== "log" && scaleType.y !== "log") {
@@ -10748,7 +10609,7 @@ function createStringMap(props, axis) {
10748
10609
  var stringsFromCategories = getStringsFromCategories(props, axis);
10749
10610
  var stringsFromData = getStringsFromData(props, axis);
10750
10611
 
10751
- var allStrings = lodash_uniq__WEBPACK_IMPORTED_MODULE_11___default()([].concat(_toConsumableArray(stringsFromAxes), _toConsumableArray(stringsFromCategories), _toConsumableArray(stringsFromData)));
10612
+ var allStrings = lodash_uniq__WEBPACK_IMPORTED_MODULE_10___default()([].concat(_toConsumableArray(stringsFromAxes), _toConsumableArray(stringsFromCategories), _toConsumableArray(stringsFromData)));
10752
10613
 
10753
10614
  return allStrings.length === 0 ? null : allStrings.reduce(function (memo, string, index) {
10754
10615
  memo[string] = index + 1;
@@ -10790,7 +10651,7 @@ function downsample(data, maxPoints) {
10790
10651
  */
10791
10652
 
10792
10653
  function formatData(dataset, props, expectedKeys) {
10793
- var isArrayOrIterable = Array.isArray(dataset) || _immutable__WEBPACK_IMPORTED_MODULE_13__.isIterable(dataset);
10654
+ var isArrayOrIterable = Array.isArray(dataset) || _immutable__WEBPACK_IMPORTED_MODULE_12__.isIterable(dataset);
10794
10655
 
10795
10656
  if (!isArrayOrIterable || getLength(dataset) < 1) {
10796
10657
  return [];
@@ -10803,7 +10664,7 @@ function formatData(dataset, props, expectedKeys) {
10803
10664
  expectedKeys = Array.isArray(expectedKeys) ? expectedKeys : defaultKeys;
10804
10665
 
10805
10666
  var createAccessor = function (name) {
10806
- return _helpers__WEBPACK_IMPORTED_MODULE_16__.createAccessor(props[name] !== undefined ? props[name] : name);
10667
+ return _helpers__WEBPACK_IMPORTED_MODULE_14__.createAccessor(props[name] !== undefined ? props[name] : name);
10807
10668
  };
10808
10669
 
10809
10670
  var accessor = expectedKeys.reduce(function (memo, type) {
@@ -10940,14 +10801,14 @@ function getStringsFromCategories(props, axis) {
10940
10801
  */
10941
10802
 
10942
10803
  function getStringsFromData(props, axis) {
10943
- var isArrayOrIterable = Array.isArray(props.data) || _immutable__WEBPACK_IMPORTED_MODULE_13__.isIterable(props.data);
10804
+ var isArrayOrIterable = Array.isArray(props.data) || _immutable__WEBPACK_IMPORTED_MODULE_12__.isIterable(props.data);
10944
10805
 
10945
10806
  if (!isArrayOrIterable) {
10946
10807
  return [];
10947
10808
  }
10948
10809
 
10949
10810
  var key = props[axis] === undefined ? axis : props[axis];
10950
- var accessor = _helpers__WEBPACK_IMPORTED_MODULE_16__.createAccessor(key); // support immutable data
10811
+ var accessor = _helpers__WEBPACK_IMPORTED_MODULE_14__.createAccessor(key); // support immutable data
10951
10812
 
10952
10813
  var data = props.data.reduce(function (memo, d) {
10953
10814
  memo.push(parseDatum(d));
@@ -10984,7 +10845,7 @@ function isDataComponent(component) {
10984
10845
  var role = getRole(component);
10985
10846
 
10986
10847
  if (role === "portal") {
10987
- var children = react__WEBPACK_IMPORTED_MODULE_12___default().Children.toArray(component.props.children);
10848
+ var children = react__WEBPACK_IMPORTED_MODULE_11___default().Children.toArray(component.props.children);
10988
10849
  role = children.length ? getRole(children[0]) : "";
10989
10850
  }
10990
10851
 
@@ -12096,6 +11957,7 @@ __webpack_require__.r(__webpack_exports__);
12096
11957
  /* harmony export */ "modifyProps": () => (/* binding */ modifyProps),
12097
11958
  /* harmony export */ "omit": () => (/* binding */ omit),
12098
11959
  /* harmony export */ "radiansToDegrees": () => (/* binding */ radiansToDegrees),
11960
+ /* harmony export */ "range": () => (/* binding */ range),
12099
11961
  /* harmony export */ "reduceChildren": () => (/* binding */ reduceChildren),
12100
11962
  /* harmony export */ "scalePoint": () => (/* binding */ scalePoint)
12101
11963
  /* harmony export */ });
@@ -12375,6 +12237,38 @@ function getCurrentAxis(axis, horizontal) {
12375
12237
  var otherAxis = axis === "x" ? "y" : "x";
12376
12238
  return horizontal ? otherAxis : axis;
12377
12239
  }
12240
+ /**
12241
+ * Creates an array of numbers (positive and/or negative) progressing
12242
+ * from start up to, but not including, end.
12243
+ * A step of -1 is used if a negative start is specified without an end or step.
12244
+ * If end is not specified, it's set to start with start then set to 0.
12245
+ *
12246
+ * @param start The length of the array to create, or the start value
12247
+ * @param end [The end value] If this is defined, start is the start value
12248
+ * @returns An array of the given length
12249
+ */
12250
+
12251
+ function range(start, end, increment) {
12252
+ // when the end index is not given, start from 0
12253
+ var startIndex = end ? start : 0; // when the end index is not given, the end of the range is the start index
12254
+
12255
+ var endIndex = end ? end : start; // ensure endIndex is not a falsy value
12256
+
12257
+ if (!endIndex) endIndex = 0;
12258
+ var k = endIndex - startIndex; // the value range
12259
+
12260
+ var length = Math.abs(k); // the length of the range
12261
+
12262
+ var sign = k / length || 1; // the sign of the range (negative or positive)
12263
+
12264
+ var inc = increment || 1; // the step size of each increment
12265
+ // normalize the array length when dealing with floating point values
12266
+
12267
+ var arrayLength = Math.max(Math.ceil(length / inc), 0);
12268
+ return Array.from(Array(arrayLength), function (_, i) {
12269
+ return startIndex + i * sign * inc;
12270
+ });
12271
+ }
12378
12272
  /**
12379
12273
  * @param {Array} children: an array of child components
12380
12274
  * @param {Function} iteratee: a function with arguments "child", "childName", and "parent"
@@ -12816,8 +12710,8 @@ __webpack_require__.r(__webpack_exports__);
12816
12710
  /* harmony export */ "triangleDown": () => (/* binding */ triangleDown),
12817
12711
  /* harmony export */ "triangleUp": () => (/* binding */ triangleUp)
12818
12712
  /* harmony export */ });
12819
- /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/range */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/range.js");
12820
- /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_range__WEBPACK_IMPORTED_MODULE_0__);
12713
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
12714
+ /* eslint no-magic-numbers: ["error", { "ignore": [0, 1, 2, 2.5, 3] }]*/
12821
12715
 
12822
12716
  function circle(x, y, size) {
12823
12717
  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");
@@ -12882,11 +12776,10 @@ function star(x, y, size) {
12882
12776
  var angle = Math.PI / 5; // eslint-disable-line no-magic-numbers
12883
12777
  // eslint-disable-next-line no-magic-numbers
12884
12778
 
12885
- var starCoords = lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(10).map(function (index) {
12779
+ var starCoords = _helpers__WEBPACK_IMPORTED_MODULE_0__.range(10).map(function (index) {
12886
12780
  var length = index % 2 === 0 ? baseSize : baseSize / 2;
12887
12781
  return "".concat(length * Math.sin(angle * (index + 1)) + x, ",\n ").concat(length * Math.cos(angle * (index + 1)) + y);
12888
12782
  });
12889
-
12890
12783
  return "M ".concat(starCoords.join("L"), " z");
12891
12784
  }
12892
12785