victory-voronoi 36.6.7 → 36.6.10

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,5 +1,24 @@
1
1
  # victory-voronoi
2
2
 
3
+ ## 36.6.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Setup NPM Provenance ([#2590](https://github.com/FormidableLabs/victory/pull/2590))
8
+
9
+ ## 36.6.9
10
+
11
+ ### Patch Changes
12
+
13
+ - Setup NPM Provenance ([#2587](https://github.com/FormidableLabs/victory/pull/2587))
14
+
15
+ ## 36.6.8
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies []:
20
+ - victory-core@36.6.8
21
+
3
22
  ## 36.6.7
4
23
 
5
24
  ### Patch Changes
@@ -1653,6 +1653,48 @@ __webpack_require__.r(__webpack_exports__);
1653
1653
  }
1654
1654
 
1655
1655
 
1656
+ /***/ }),
1657
+
1658
+ /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js":
1659
+ /*!***********************************************************************************!*\
1660
+ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js ***!
1661
+ \***********************************************************************************/
1662
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1663
+
1664
+ var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheClear.js"),
1665
+ listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js"),
1666
+ listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheGet.js"),
1667
+ listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheHas.js"),
1668
+ listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheSet.js");
1669
+
1670
+ /**
1671
+ * Creates an list cache object.
1672
+ *
1673
+ * @private
1674
+ * @constructor
1675
+ * @param {Array} [entries] The key-value pairs to cache.
1676
+ */
1677
+ function ListCache(entries) {
1678
+ var index = -1,
1679
+ length = entries == null ? 0 : entries.length;
1680
+
1681
+ this.clear();
1682
+ while (++index < length) {
1683
+ var entry = entries[index];
1684
+ this.set(entry[0], entry[1]);
1685
+ }
1686
+ }
1687
+
1688
+ // Add methods to `ListCache`.
1689
+ ListCache.prototype.clear = listCacheClear;
1690
+ ListCache.prototype['delete'] = listCacheDelete;
1691
+ ListCache.prototype.get = listCacheGet;
1692
+ ListCache.prototype.has = listCacheHas;
1693
+ ListCache.prototype.set = listCacheSet;
1694
+
1695
+ module.exports = ListCache;
1696
+
1697
+
1656
1698
  /***/ }),
1657
1699
 
1658
1700
  /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_SetCache.js":
@@ -6227,6 +6269,89 @@ function last(array) {
6227
6269
  module.exports = last;
6228
6270
 
6229
6271
 
6272
+ /***/ }),
6273
+
6274
+ /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js":
6275
+ /*!*********************************************************************************!*\
6276
+ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js ***!
6277
+ \*********************************************************************************/
6278
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6279
+
6280
+ var MapCache = __webpack_require__(/*! ./_MapCache */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js");
6281
+
6282
+ /** Error message constants. */
6283
+ var FUNC_ERROR_TEXT = 'Expected a function';
6284
+
6285
+ /**
6286
+ * Creates a function that memoizes the result of `func`. If `resolver` is
6287
+ * provided, it determines the cache key for storing the result based on the
6288
+ * arguments provided to the memoized function. By default, the first argument
6289
+ * provided to the memoized function is used as the map cache key. The `func`
6290
+ * is invoked with the `this` binding of the memoized function.
6291
+ *
6292
+ * **Note:** The cache is exposed as the `cache` property on the memoized
6293
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
6294
+ * constructor with one whose instances implement the
6295
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
6296
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
6297
+ *
6298
+ * @static
6299
+ * @memberOf _
6300
+ * @since 0.1.0
6301
+ * @category Function
6302
+ * @param {Function} func The function to have its output memoized.
6303
+ * @param {Function} [resolver] The function to resolve the cache key.
6304
+ * @returns {Function} Returns the new memoized function.
6305
+ * @example
6306
+ *
6307
+ * var object = { 'a': 1, 'b': 2 };
6308
+ * var other = { 'c': 3, 'd': 4 };
6309
+ *
6310
+ * var values = _.memoize(_.values);
6311
+ * values(object);
6312
+ * // => [1, 2]
6313
+ *
6314
+ * values(other);
6315
+ * // => [3, 4]
6316
+ *
6317
+ * object.a = 2;
6318
+ * values(object);
6319
+ * // => [1, 2]
6320
+ *
6321
+ * // Modify the result cache.
6322
+ * values.cache.set(object, ['a', 'b']);
6323
+ * values(object);
6324
+ * // => ['a', 'b']
6325
+ *
6326
+ * // Replace `_.memoize.Cache`.
6327
+ * _.memoize.Cache = WeakMap;
6328
+ */
6329
+ function memoize(func, resolver) {
6330
+ if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
6331
+ throw new TypeError(FUNC_ERROR_TEXT);
6332
+ }
6333
+ var memoized = function() {
6334
+ var args = arguments,
6335
+ key = resolver ? resolver.apply(this, args) : args[0],
6336
+ cache = memoized.cache;
6337
+
6338
+ if (cache.has(key)) {
6339
+ return cache.get(key);
6340
+ }
6341
+ var result = func.apply(this, args);
6342
+ memoized.cache = cache.set(key, result) || cache;
6343
+ return result;
6344
+ };
6345
+ memoized.cache = new (memoize.Cache || MapCache);
6346
+ return memoized;
6347
+ }
6348
+
6349
+ // Expose `MapCache`.
6350
+ memoize.Cache = MapCache;
6351
+
6352
+ module.exports = memoize;
6353
+
6354
+
6230
6355
  /***/ }),
6231
6356
 
6232
6357
  /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/negate.js":
@@ -14527,12 +14652,23 @@ __webpack_require__.r(__webpack_exports__);
14527
14652
  /* harmony export */ "approximateTextSize": () => (/* binding */ approximateTextSize),
14528
14653
  /* harmony export */ "convertLengthToPixels": () => (/* binding */ convertLengthToPixels)
14529
14654
  /* harmony export */ });
14530
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
14531
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
14532
- /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/assign */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/assign.js");
14533
- /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_1__);
14655
+ /* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/memoize */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js");
14656
+ /* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_memoize__WEBPACK_IMPORTED_MODULE_0__);
14657
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
14658
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
14659
+ /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/assign */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/assign.js");
14660
+ /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_2__);
14661
+
14662
+
14534
14663
 
14535
14664
 
14665
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14666
+
14667
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14668
+
14669
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
14670
+
14671
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14536
14672
 
14537
14673
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
14538
14674
 
@@ -14737,9 +14873,9 @@ var convertLengthToPixels = function (length, fontSize) {
14737
14873
  var _prepareParams = function (inputStyle, index) {
14738
14874
  var lineStyle = Array.isArray(inputStyle) ? inputStyle[index] : inputStyle;
14739
14875
 
14740
- var style = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, lineStyle, defaultStyle);
14876
+ var style = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, lineStyle, defaultStyle);
14741
14877
 
14742
- return lodash_assign__WEBPACK_IMPORTED_MODULE_1___default()({}, style, {
14878
+ return lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, style, {
14743
14879
  fontFamily: style.fontFamily,
14744
14880
  letterSpacing: typeof style.letterSpacing === "number" ? style.letterSpacing : convertLengthToPixels(String(style.letterSpacing), style.fontSize),
14745
14881
  fontSize: typeof style.fontSize === "number" ? style.fontSize : convertLengthToPixels(String(style.fontSize))
@@ -14786,21 +14922,99 @@ var _approximateTextHeightInternal = function (text, style) {
14786
14922
  }, 0);
14787
14923
  };
14788
14924
 
14925
+ var _approximateDimensionsInternal = function (text, style) {
14926
+ var angle = Array.isArray(style) ? style[0] && style[0].angle : style && style.angle;
14927
+
14928
+ var height = _approximateTextHeightInternal(text, style);
14929
+
14930
+ var width = _approximateTextWidthInternal(text, style);
14931
+
14932
+ var widthWithRotate = angle ? _getSizeWithRotate(width, height, angle) : width;
14933
+ var heightWithRotate = angle ? _getSizeWithRotate(height, width, angle) : height;
14934
+ return {
14935
+ width: widthWithRotate,
14936
+ height: heightWithRotate * coefficients.heightOverlapCoef
14937
+ };
14938
+ };
14939
+
14940
+ var _getMeasurementContainer = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function () {
14941
+ var element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
14942
+ element.setAttribute("xlink", "http://www.w3.org/1999/xlink");
14943
+ var containerElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
14944
+ element.appendChild(containerElement);
14945
+ element.style.position = "fixed";
14946
+ element.style.top = "-9999px";
14947
+ element.style.left = "-9999px";
14948
+ document.body.appendChild(element);
14949
+ return containerElement;
14950
+ });
14951
+
14952
+ var styleToKeyComponent = function (style) {
14953
+ if (!style) {
14954
+ return "null";
14955
+ }
14956
+
14957
+ return "".concat(style.angle, ":").concat(style.fontFamily, ":").concat(style.fontSize, ":").concat(style.letterSpacing, ":").concat(style.lineHeight);
14958
+ };
14959
+
14960
+ var _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function (text, style) {
14961
+ var containerElement = _getMeasurementContainer();
14962
+
14963
+ var lines = _splitToLines(text);
14964
+
14965
+ var heightAcc = 0;
14966
+
14967
+ for (var _ref of lines.entries()) {
14968
+ var _ref2 = _slicedToArray(_ref, 2);
14969
+
14970
+ var i = _ref2[0];
14971
+ var line = _ref2[1];
14972
+ var textElement = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
14973
+
14974
+ var params = _prepareParams(style, i);
14975
+
14976
+ textElement.style.fontFamily = params.fontFamily;
14977
+ textElement.style.transform = "rotate(".concat(params.angle, ")");
14978
+ textElement.style.fontSize = "".concat(params.fontSize, "px");
14979
+ textElement.style.lineHeight = params.lineHeight;
14980
+ textElement.style.fontFamily = params.fontFamily;
14981
+ textElement.style.letterSpacing = params.letterSpacing;
14982
+ textElement.textContent = line;
14983
+ textElement.setAttribute("x", "0");
14984
+ textElement.setAttribute("y", "".concat(heightAcc));
14985
+ heightAcc += params.lineHeight * params.fontSize;
14986
+ containerElement.appendChild(textElement);
14987
+ }
14988
+
14989
+ var _containerElement$get = containerElement.getBoundingClientRect(),
14990
+ width = _containerElement$get.width,
14991
+ height = _containerElement$get.height;
14992
+
14993
+ containerElement.innerHTML = "";
14994
+ return {
14995
+ width: width,
14996
+ height: height
14997
+ };
14998
+ }, function (text, style) {
14999
+ var totalText = Array.isArray(text) ? text.join() : text;
15000
+ var totalStyle = Array.isArray(style) ? style.map(styleToKeyComponent).join() : styleToKeyComponent(style);
15001
+ return "".concat(totalText, "::").concat(totalStyle);
15002
+ });
15003
+
14789
15004
  // Stubbable implementation.
14790
15005
  var _approximateTextSizeInternal = {
14791
15006
  impl: function (text, style) {
14792
- var angle = Array.isArray(style) ? style[0] && style[0].angle : style && style.angle;
15007
+ var __debugForceApproximate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
14793
15008
 
14794
- var height = _approximateTextHeightInternal(text, style);
15009
+ // Attempt to first measure the element in DOM. If there is no DOM, fallback
15010
+ // to the less accurate approximation algorithm.
15011
+ var isClient = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
14795
15012
 
14796
- var width = _approximateTextWidthInternal(text, style);
15013
+ if (!isClient || __debugForceApproximate) {
15014
+ return _approximateDimensionsInternal(text, style);
15015
+ }
14797
15016
 
14798
- var widthWithRotate = angle ? _getSizeWithRotate(width, height, angle) : width;
14799
- var heightWithRotate = angle ? _getSizeWithRotate(height, width, angle) : height;
14800
- return {
14801
- width: widthWithRotate,
14802
- height: heightWithRotate * coefficients.heightOverlapCoef
14803
- };
15017
+ return _measureDimensionsInternal(text, style);
14804
15018
  }
14805
15019
  };
14806
15020
  /**