victory-bar 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,14 @@
1
1
  # victory-bar
2
2
 
3
- ## 36.8.5-next.0
3
+ ## 36.8.6
4
+
5
+ ## 36.8.5
4
6
 
5
7
  ### Patch Changes
6
8
 
7
- - c8c2eb2f5: Replace instances of lodash.assign with Object.assign
8
- - Updated dependencies [c8c2eb2f5]
9
- - Updated dependencies [0f3abe234]
10
- - victory-core@36.8.5-next.0
11
- - victory-vendor@36.8.5-next.0
9
+ - Replace instances of lodash.assign with Object.assign ([#2757](https://github.com/FormidableLabs/victory/pull/2757))
10
+
11
+ * Replace instances of lodash.range with equivalent native code ([#2760](https://github.com/FormidableLabs/victory/pull/2760))
12
12
 
13
13
  ## 36.8.4
14
14
 
@@ -2515,44 +2515,6 @@ function basePropertyDeep(path) {
2515
2515
  module.exports = basePropertyDeep;
2516
2516
 
2517
2517
 
2518
- /***/ }),
2519
-
2520
- /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseRange.js":
2521
- /*!************************************************************************************!*\
2522
- !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseRange.js ***!
2523
- \************************************************************************************/
2524
- /***/ ((module) => {
2525
-
2526
- /* Built-in method references for those with the same name as other `lodash` methods. */
2527
- var nativeCeil = Math.ceil,
2528
- nativeMax = Math.max;
2529
-
2530
- /**
2531
- * The base implementation of `_.range` and `_.rangeRight` which doesn't
2532
- * coerce arguments.
2533
- *
2534
- * @private
2535
- * @param {number} start The start of the range.
2536
- * @param {number} end The end of the range.
2537
- * @param {number} step The value to increment or decrement by.
2538
- * @param {boolean} [fromRight] Specify iterating from right to left.
2539
- * @returns {Array} Returns the range of numbers.
2540
- */
2541
- function baseRange(start, end, step, fromRight) {
2542
- var index = -1,
2543
- length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
2544
- result = Array(length);
2545
-
2546
- while (length--) {
2547
- result[fromRight ? length : ++index] = start;
2548
- start += step;
2549
- }
2550
- return result;
2551
- }
2552
-
2553
- module.exports = baseRange;
2554
-
2555
-
2556
2518
  /***/ }),
2557
2519
 
2558
2520
  /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseRest.js":
@@ -3092,46 +3054,6 @@ function createFind(findIndexFunc) {
3092
3054
  module.exports = createFind;
3093
3055
 
3094
3056
 
3095
- /***/ }),
3096
-
3097
- /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createRange.js":
3098
- /*!**************************************************************************************!*\
3099
- !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createRange.js ***!
3100
- \**************************************************************************************/
3101
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3102
-
3103
- var baseRange = __webpack_require__(/*! ./_baseRange */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseRange.js"),
3104
- isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isIterateeCall.js"),
3105
- toFinite = __webpack_require__(/*! ./toFinite */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toFinite.js");
3106
-
3107
- /**
3108
- * Creates a `_.range` or `_.rangeRight` function.
3109
- *
3110
- * @private
3111
- * @param {boolean} [fromRight] Specify iterating from right to left.
3112
- * @returns {Function} Returns the new range function.
3113
- */
3114
- function createRange(fromRight) {
3115
- return function(start, end, step) {
3116
- if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
3117
- end = step = undefined;
3118
- }
3119
- // Ensure the sign of `-0` is preserved.
3120
- start = toFinite(start);
3121
- if (end === undefined) {
3122
- end = start;
3123
- start = 0;
3124
- } else {
3125
- end = toFinite(end);
3126
- }
3127
- step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
3128
- return baseRange(start, end, step, fromRight);
3129
- };
3130
- }
3131
-
3132
- module.exports = createRange;
3133
-
3134
-
3135
3057
  /***/ }),
3136
3058
 
3137
3059
  /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createSet.js":
@@ -5996,62 +5918,6 @@ function property(path) {
5996
5918
  module.exports = property;
5997
5919
 
5998
5920
 
5999
- /***/ }),
6000
-
6001
- /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/range.js":
6002
- /*!*******************************************************************************!*\
6003
- !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/range.js ***!
6004
- \*******************************************************************************/
6005
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6006
-
6007
- var createRange = __webpack_require__(/*! ./_createRange */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createRange.js");
6008
-
6009
- /**
6010
- * Creates an array of numbers (positive and/or negative) progressing from
6011
- * `start` up to, but not including, `end`. A step of `-1` is used if a negative
6012
- * `start` is specified without an `end` or `step`. If `end` is not specified,
6013
- * it's set to `start` with `start` then set to `0`.
6014
- *
6015
- * **Note:** JavaScript follows the IEEE-754 standard for resolving
6016
- * floating-point values which can produce unexpected results.
6017
- *
6018
- * @static
6019
- * @since 0.1.0
6020
- * @memberOf _
6021
- * @category Util
6022
- * @param {number} [start=0] The start of the range.
6023
- * @param {number} end The end of the range.
6024
- * @param {number} [step=1] The value to increment or decrement by.
6025
- * @returns {Array} Returns the range of numbers.
6026
- * @see _.inRange, _.rangeRight
6027
- * @example
6028
- *
6029
- * _.range(4);
6030
- * // => [0, 1, 2, 3]
6031
- *
6032
- * _.range(-4);
6033
- * // => [0, -1, -2, -3]
6034
- *
6035
- * _.range(1, 5);
6036
- * // => [1, 2, 3, 4]
6037
- *
6038
- * _.range(0, 20, 5);
6039
- * // => [0, 5, 10, 15]
6040
- *
6041
- * _.range(0, -4, -1);
6042
- * // => [0, -1, -2, -3]
6043
- *
6044
- * _.range(1, 4, 0);
6045
- * // => [1, 1, 1]
6046
- *
6047
- * _.range(0);
6048
- * // => []
6049
- */
6050
- var range = createRange();
6051
-
6052
- module.exports = range;
6053
-
6054
-
6055
5921
  /***/ }),
6056
5922
 
6057
5923
  /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/sortedUniq.js":
@@ -11037,17 +10903,14 @@ __webpack_require__.r(__webpack_exports__);
11037
10903
  /* harmony import */ var lodash_isFunction__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash_isFunction__WEBPACK_IMPORTED_MODULE_8__);
11038
10904
  /* 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");
11039
10905
  /* harmony import */ var lodash_last__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash_last__WEBPACK_IMPORTED_MODULE_9__);
11040
- /* 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");
11041
- /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash_range__WEBPACK_IMPORTED_MODULE_10__);
11042
- /* 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");
11043
- /* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_11__);
11044
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react */ "react");
11045
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_12__);
11046
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
10906
+ /* 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");
10907
+ /* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_10__);
10908
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react */ "react");
10909
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_11__);
10910
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
11047
10911
  /* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
11048
- /* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
11049
- /* harmony import */ var _immutable__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./immutable */ "../../victory-core/es/victory-util/immutable.js");
11050
-
10912
+ /* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
10913
+ /* harmony import */ var _immutable__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./immutable */ "../../victory-core/es/victory-util/immutable.js");
11051
10914
 
11052
10915
 
11053
10916
 
@@ -11084,24 +10947,22 @@ function parseDatum(datum) {
11084
10947
  errorX: true,
11085
10948
  errorY: true
11086
10949
  };
11087
- return _immutable__WEBPACK_IMPORTED_MODULE_13__.isImmutable(datum) ? _immutable__WEBPACK_IMPORTED_MODULE_13__.shallowToJS(datum, immutableDatumWhitelist) : datum;
10950
+ return _immutable__WEBPACK_IMPORTED_MODULE_12__.isImmutable(datum) ? _immutable__WEBPACK_IMPORTED_MODULE_12__.shallowToJS(datum, immutableDatumWhitelist) : datum;
11088
10951
  }
11089
10952
 
11090
10953
  function getLength(data) {
11091
- return _immutable__WEBPACK_IMPORTED_MODULE_13__.isIterable(data) ? data.size : data.length;
10954
+ return _immutable__WEBPACK_IMPORTED_MODULE_12__.isIterable(data) ? data.size : data.length;
11092
10955
  } // Returns generated data for a given axis based on domain and sample from props
11093
10956
 
11094
10957
 
11095
10958
  function generateDataArray(props, axis) {
11096
10959
  var propsDomain = lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_7___default()(props.domain) ? props.domain[axis] : props.domain;
11097
- var domain = propsDomain || _scale__WEBPACK_IMPORTED_MODULE_14__.getBaseScale(props, axis).domain();
10960
+ var domain = propsDomain || _scale__WEBPACK_IMPORTED_MODULE_13__.getBaseScale(props, axis).domain();
11098
10961
  var samples = props.samples || 1;
11099
10962
  var domainMax = Math.max.apply(Math, _toConsumableArray(domain));
11100
10963
  var domainMin = Math.min.apply(Math, _toConsumableArray(domain));
11101
10964
  var step = (domainMax - domainMin) / samples;
11102
-
11103
- var values = lodash_range__WEBPACK_IMPORTED_MODULE_10___default()(domainMin, domainMax, step);
11104
-
10965
+ var values = _helpers__WEBPACK_IMPORTED_MODULE_14__.range(domainMin, domainMax, step);
11105
10966
  return lodash_last__WEBPACK_IMPORTED_MODULE_9___default()(values) === domainMax ? values : values.concat(domainMax);
11106
10967
  } // Returns sorted data. If no sort keys are provided, data is returned unaltered.
11107
10968
 
@@ -11128,8 +10989,8 @@ function sortData(dataset, sortKey) {
11128
10989
  function cleanData(dataset, props) {
11129
10990
  var smallNumber = 1 / Number.MAX_SAFE_INTEGER;
11130
10991
  var scaleType = {
11131
- x: _scale__WEBPACK_IMPORTED_MODULE_14__.getScaleType(props, "x"),
11132
- y: _scale__WEBPACK_IMPORTED_MODULE_14__.getScaleType(props, "y")
10992
+ x: _scale__WEBPACK_IMPORTED_MODULE_13__.getScaleType(props, "x"),
10993
+ y: _scale__WEBPACK_IMPORTED_MODULE_13__.getScaleType(props, "y")
11133
10994
  };
11134
10995
 
11135
10996
  if (scaleType.x !== "log" && scaleType.y !== "log") {
@@ -11264,7 +11125,7 @@ function createStringMap(props, axis) {
11264
11125
  var stringsFromCategories = getStringsFromCategories(props, axis);
11265
11126
  var stringsFromData = getStringsFromData(props, axis);
11266
11127
 
11267
- var allStrings = lodash_uniq__WEBPACK_IMPORTED_MODULE_11___default()([].concat(_toConsumableArray(stringsFromAxes), _toConsumableArray(stringsFromCategories), _toConsumableArray(stringsFromData)));
11128
+ var allStrings = lodash_uniq__WEBPACK_IMPORTED_MODULE_10___default()([].concat(_toConsumableArray(stringsFromAxes), _toConsumableArray(stringsFromCategories), _toConsumableArray(stringsFromData)));
11268
11129
 
11269
11130
  return allStrings.length === 0 ? null : allStrings.reduce(function (memo, string, index) {
11270
11131
  memo[string] = index + 1;
@@ -11306,7 +11167,7 @@ function downsample(data, maxPoints) {
11306
11167
  */
11307
11168
 
11308
11169
  function formatData(dataset, props, expectedKeys) {
11309
- var isArrayOrIterable = Array.isArray(dataset) || _immutable__WEBPACK_IMPORTED_MODULE_13__.isIterable(dataset);
11170
+ var isArrayOrIterable = Array.isArray(dataset) || _immutable__WEBPACK_IMPORTED_MODULE_12__.isIterable(dataset);
11310
11171
 
11311
11172
  if (!isArrayOrIterable || getLength(dataset) < 1) {
11312
11173
  return [];
@@ -11319,7 +11180,7 @@ function formatData(dataset, props, expectedKeys) {
11319
11180
  expectedKeys = Array.isArray(expectedKeys) ? expectedKeys : defaultKeys;
11320
11181
 
11321
11182
  var createAccessor = function (name) {
11322
- return _helpers__WEBPACK_IMPORTED_MODULE_16__.createAccessor(props[name] !== undefined ? props[name] : name);
11183
+ return _helpers__WEBPACK_IMPORTED_MODULE_14__.createAccessor(props[name] !== undefined ? props[name] : name);
11323
11184
  };
11324
11185
 
11325
11186
  var accessor = expectedKeys.reduce(function (memo, type) {
@@ -11456,14 +11317,14 @@ function getStringsFromCategories(props, axis) {
11456
11317
  */
11457
11318
 
11458
11319
  function getStringsFromData(props, axis) {
11459
- var isArrayOrIterable = Array.isArray(props.data) || _immutable__WEBPACK_IMPORTED_MODULE_13__.isIterable(props.data);
11320
+ var isArrayOrIterable = Array.isArray(props.data) || _immutable__WEBPACK_IMPORTED_MODULE_12__.isIterable(props.data);
11460
11321
 
11461
11322
  if (!isArrayOrIterable) {
11462
11323
  return [];
11463
11324
  }
11464
11325
 
11465
11326
  var key = props[axis] === undefined ? axis : props[axis];
11466
- var accessor = _helpers__WEBPACK_IMPORTED_MODULE_16__.createAccessor(key); // support immutable data
11327
+ var accessor = _helpers__WEBPACK_IMPORTED_MODULE_14__.createAccessor(key); // support immutable data
11467
11328
 
11468
11329
  var data = props.data.reduce(function (memo, d) {
11469
11330
  memo.push(parseDatum(d));
@@ -11500,7 +11361,7 @@ function isDataComponent(component) {
11500
11361
  var role = getRole(component);
11501
11362
 
11502
11363
  if (role === "portal") {
11503
- var children = react__WEBPACK_IMPORTED_MODULE_12___default().Children.toArray(component.props.children);
11364
+ var children = react__WEBPACK_IMPORTED_MODULE_11___default().Children.toArray(component.props.children);
11504
11365
  role = children.length ? getRole(children[0]) : "";
11505
11366
  }
11506
11367
 
@@ -12490,6 +12351,7 @@ __webpack_require__.r(__webpack_exports__);
12490
12351
  /* harmony export */ "modifyProps": () => (/* binding */ modifyProps),
12491
12352
  /* harmony export */ "omit": () => (/* binding */ omit),
12492
12353
  /* harmony export */ "radiansToDegrees": () => (/* binding */ radiansToDegrees),
12354
+ /* harmony export */ "range": () => (/* binding */ range),
12493
12355
  /* harmony export */ "reduceChildren": () => (/* binding */ reduceChildren),
12494
12356
  /* harmony export */ "scalePoint": () => (/* binding */ scalePoint)
12495
12357
  /* harmony export */ });
@@ -12769,6 +12631,38 @@ function getCurrentAxis(axis, horizontal) {
12769
12631
  var otherAxis = axis === "x" ? "y" : "x";
12770
12632
  return horizontal ? otherAxis : axis;
12771
12633
  }
12634
+ /**
12635
+ * Creates an array of numbers (positive and/or negative) progressing
12636
+ * from start up to, but not including, end.
12637
+ * A step of -1 is used if a negative start is specified without an end or step.
12638
+ * If end is not specified, it's set to start with start then set to 0.
12639
+ *
12640
+ * @param start The length of the array to create, or the start value
12641
+ * @param end [The end value] If this is defined, start is the start value
12642
+ * @returns An array of the given length
12643
+ */
12644
+
12645
+ function range(start, end, increment) {
12646
+ // when the end index is not given, start from 0
12647
+ var startIndex = end ? start : 0; // when the end index is not given, the end of the range is the start index
12648
+
12649
+ var endIndex = end ? end : start; // ensure endIndex is not a falsy value
12650
+
12651
+ if (!endIndex) endIndex = 0;
12652
+ var k = endIndex - startIndex; // the value range
12653
+
12654
+ var length = Math.abs(k); // the length of the range
12655
+
12656
+ var sign = k / length || 1; // the sign of the range (negative or positive)
12657
+
12658
+ var inc = increment || 1; // the step size of each increment
12659
+ // normalize the array length when dealing with floating point values
12660
+
12661
+ var arrayLength = Math.max(Math.ceil(length / inc), 0);
12662
+ return Array.from(Array(arrayLength), function (_, i) {
12663
+ return startIndex + i * sign * inc;
12664
+ });
12665
+ }
12772
12666
  /**
12773
12667
  * @param {Array} children: an array of child components
12774
12668
  * @param {Function} iteratee: a function with arguments "child", "childName", and "parent"