victory-voronoi-container 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,25 @@
|
|
|
1
1
|
# victory-voronoi-container
|
|
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
|
+
- victory-tooltip@36.6.8
|
|
22
|
+
|
|
3
23
|
## 36.6.7
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -1425,6 +1425,48 @@ Delaunay.from = function (points, fx, fy, that) {
|
|
|
1425
1425
|
return new Delaunay(flatArray(points, fx, fy, that));
|
|
1426
1426
|
}; // only public methods will be .from and .find
|
|
1427
1427
|
|
|
1428
|
+
/***/ }),
|
|
1429
|
+
|
|
1430
|
+
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js":
|
|
1431
|
+
/*!***********************************************************************************!*\
|
|
1432
|
+
!*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js ***!
|
|
1433
|
+
\***********************************************************************************/
|
|
1434
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1435
|
+
|
|
1436
|
+
var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheClear.js"),
|
|
1437
|
+
listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js"),
|
|
1438
|
+
listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheGet.js"),
|
|
1439
|
+
listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheHas.js"),
|
|
1440
|
+
listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheSet.js");
|
|
1441
|
+
|
|
1442
|
+
/**
|
|
1443
|
+
* Creates an list cache object.
|
|
1444
|
+
*
|
|
1445
|
+
* @private
|
|
1446
|
+
* @constructor
|
|
1447
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
1448
|
+
*/
|
|
1449
|
+
function ListCache(entries) {
|
|
1450
|
+
var index = -1,
|
|
1451
|
+
length = entries == null ? 0 : entries.length;
|
|
1452
|
+
|
|
1453
|
+
this.clear();
|
|
1454
|
+
while (++index < length) {
|
|
1455
|
+
var entry = entries[index];
|
|
1456
|
+
this.set(entry[0], entry[1]);
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
// Add methods to `ListCache`.
|
|
1461
|
+
ListCache.prototype.clear = listCacheClear;
|
|
1462
|
+
ListCache.prototype['delete'] = listCacheDelete;
|
|
1463
|
+
ListCache.prototype.get = listCacheGet;
|
|
1464
|
+
ListCache.prototype.has = listCacheHas;
|
|
1465
|
+
ListCache.prototype.set = listCacheSet;
|
|
1466
|
+
|
|
1467
|
+
module.exports = ListCache;
|
|
1468
|
+
|
|
1469
|
+
|
|
1428
1470
|
/***/ }),
|
|
1429
1471
|
|
|
1430
1472
|
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_SetCache.js":
|
|
@@ -5879,6 +5921,89 @@ function last(array) {
|
|
|
5879
5921
|
module.exports = last;
|
|
5880
5922
|
|
|
5881
5923
|
|
|
5924
|
+
/***/ }),
|
|
5925
|
+
|
|
5926
|
+
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js":
|
|
5927
|
+
/*!*********************************************************************************!*\
|
|
5928
|
+
!*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js ***!
|
|
5929
|
+
\*********************************************************************************/
|
|
5930
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
5931
|
+
|
|
5932
|
+
var MapCache = __webpack_require__(/*! ./_MapCache */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js");
|
|
5933
|
+
|
|
5934
|
+
/** Error message constants. */
|
|
5935
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
5936
|
+
|
|
5937
|
+
/**
|
|
5938
|
+
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
5939
|
+
* provided, it determines the cache key for storing the result based on the
|
|
5940
|
+
* arguments provided to the memoized function. By default, the first argument
|
|
5941
|
+
* provided to the memoized function is used as the map cache key. The `func`
|
|
5942
|
+
* is invoked with the `this` binding of the memoized function.
|
|
5943
|
+
*
|
|
5944
|
+
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
5945
|
+
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
5946
|
+
* constructor with one whose instances implement the
|
|
5947
|
+
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
5948
|
+
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
5949
|
+
*
|
|
5950
|
+
* @static
|
|
5951
|
+
* @memberOf _
|
|
5952
|
+
* @since 0.1.0
|
|
5953
|
+
* @category Function
|
|
5954
|
+
* @param {Function} func The function to have its output memoized.
|
|
5955
|
+
* @param {Function} [resolver] The function to resolve the cache key.
|
|
5956
|
+
* @returns {Function} Returns the new memoized function.
|
|
5957
|
+
* @example
|
|
5958
|
+
*
|
|
5959
|
+
* var object = { 'a': 1, 'b': 2 };
|
|
5960
|
+
* var other = { 'c': 3, 'd': 4 };
|
|
5961
|
+
*
|
|
5962
|
+
* var values = _.memoize(_.values);
|
|
5963
|
+
* values(object);
|
|
5964
|
+
* // => [1, 2]
|
|
5965
|
+
*
|
|
5966
|
+
* values(other);
|
|
5967
|
+
* // => [3, 4]
|
|
5968
|
+
*
|
|
5969
|
+
* object.a = 2;
|
|
5970
|
+
* values(object);
|
|
5971
|
+
* // => [1, 2]
|
|
5972
|
+
*
|
|
5973
|
+
* // Modify the result cache.
|
|
5974
|
+
* values.cache.set(object, ['a', 'b']);
|
|
5975
|
+
* values(object);
|
|
5976
|
+
* // => ['a', 'b']
|
|
5977
|
+
*
|
|
5978
|
+
* // Replace `_.memoize.Cache`.
|
|
5979
|
+
* _.memoize.Cache = WeakMap;
|
|
5980
|
+
*/
|
|
5981
|
+
function memoize(func, resolver) {
|
|
5982
|
+
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
5983
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
5984
|
+
}
|
|
5985
|
+
var memoized = function() {
|
|
5986
|
+
var args = arguments,
|
|
5987
|
+
key = resolver ? resolver.apply(this, args) : args[0],
|
|
5988
|
+
cache = memoized.cache;
|
|
5989
|
+
|
|
5990
|
+
if (cache.has(key)) {
|
|
5991
|
+
return cache.get(key);
|
|
5992
|
+
}
|
|
5993
|
+
var result = func.apply(this, args);
|
|
5994
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
5995
|
+
return result;
|
|
5996
|
+
};
|
|
5997
|
+
memoized.cache = new (memoize.Cache || MapCache);
|
|
5998
|
+
return memoized;
|
|
5999
|
+
}
|
|
6000
|
+
|
|
6001
|
+
// Expose `MapCache`.
|
|
6002
|
+
memoize.Cache = MapCache;
|
|
6003
|
+
|
|
6004
|
+
module.exports = memoize;
|
|
6005
|
+
|
|
6006
|
+
|
|
5882
6007
|
/***/ }),
|
|
5883
6008
|
|
|
5884
6009
|
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/negate.js":
|
|
@@ -11918,12 +12043,23 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11918
12043
|
/* harmony export */ "approximateTextSize": () => (/* binding */ approximateTextSize),
|
|
11919
12044
|
/* harmony export */ "convertLengthToPixels": () => (/* binding */ convertLengthToPixels)
|
|
11920
12045
|
/* harmony export */ });
|
|
11921
|
-
/* harmony import */ var
|
|
11922
|
-
/* harmony import */ var
|
|
11923
|
-
/* harmony import */ var
|
|
11924
|
-
/* harmony import */ var
|
|
12046
|
+
/* 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");
|
|
12047
|
+
/* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_memoize__WEBPACK_IMPORTED_MODULE_0__);
|
|
12048
|
+
/* 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");
|
|
12049
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
12050
|
+
/* 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");
|
|
12051
|
+
/* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_2__);
|
|
12052
|
+
|
|
12053
|
+
|
|
11925
12054
|
|
|
11926
12055
|
|
|
12056
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12057
|
+
|
|
12058
|
+
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."); }
|
|
12059
|
+
|
|
12060
|
+
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; }
|
|
12061
|
+
|
|
12062
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11927
12063
|
|
|
11928
12064
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
11929
12065
|
|
|
@@ -12128,9 +12264,9 @@ var convertLengthToPixels = function (length, fontSize) {
|
|
|
12128
12264
|
var _prepareParams = function (inputStyle, index) {
|
|
12129
12265
|
var lineStyle = Array.isArray(inputStyle) ? inputStyle[index] : inputStyle;
|
|
12130
12266
|
|
|
12131
|
-
var style =
|
|
12267
|
+
var style = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, lineStyle, defaultStyle);
|
|
12132
12268
|
|
|
12133
|
-
return
|
|
12269
|
+
return lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, style, {
|
|
12134
12270
|
fontFamily: style.fontFamily,
|
|
12135
12271
|
letterSpacing: typeof style.letterSpacing === "number" ? style.letterSpacing : convertLengthToPixels(String(style.letterSpacing), style.fontSize),
|
|
12136
12272
|
fontSize: typeof style.fontSize === "number" ? style.fontSize : convertLengthToPixels(String(style.fontSize))
|
|
@@ -12177,21 +12313,99 @@ var _approximateTextHeightInternal = function (text, style) {
|
|
|
12177
12313
|
}, 0);
|
|
12178
12314
|
};
|
|
12179
12315
|
|
|
12316
|
+
var _approximateDimensionsInternal = function (text, style) {
|
|
12317
|
+
var angle = Array.isArray(style) ? style[0] && style[0].angle : style && style.angle;
|
|
12318
|
+
|
|
12319
|
+
var height = _approximateTextHeightInternal(text, style);
|
|
12320
|
+
|
|
12321
|
+
var width = _approximateTextWidthInternal(text, style);
|
|
12322
|
+
|
|
12323
|
+
var widthWithRotate = angle ? _getSizeWithRotate(width, height, angle) : width;
|
|
12324
|
+
var heightWithRotate = angle ? _getSizeWithRotate(height, width, angle) : height;
|
|
12325
|
+
return {
|
|
12326
|
+
width: widthWithRotate,
|
|
12327
|
+
height: heightWithRotate * coefficients.heightOverlapCoef
|
|
12328
|
+
};
|
|
12329
|
+
};
|
|
12330
|
+
|
|
12331
|
+
var _getMeasurementContainer = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function () {
|
|
12332
|
+
var element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
12333
|
+
element.setAttribute("xlink", "http://www.w3.org/1999/xlink");
|
|
12334
|
+
var containerElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
12335
|
+
element.appendChild(containerElement);
|
|
12336
|
+
element.style.position = "fixed";
|
|
12337
|
+
element.style.top = "-9999px";
|
|
12338
|
+
element.style.left = "-9999px";
|
|
12339
|
+
document.body.appendChild(element);
|
|
12340
|
+
return containerElement;
|
|
12341
|
+
});
|
|
12342
|
+
|
|
12343
|
+
var styleToKeyComponent = function (style) {
|
|
12344
|
+
if (!style) {
|
|
12345
|
+
return "null";
|
|
12346
|
+
}
|
|
12347
|
+
|
|
12348
|
+
return "".concat(style.angle, ":").concat(style.fontFamily, ":").concat(style.fontSize, ":").concat(style.letterSpacing, ":").concat(style.lineHeight);
|
|
12349
|
+
};
|
|
12350
|
+
|
|
12351
|
+
var _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function (text, style) {
|
|
12352
|
+
var containerElement = _getMeasurementContainer();
|
|
12353
|
+
|
|
12354
|
+
var lines = _splitToLines(text);
|
|
12355
|
+
|
|
12356
|
+
var heightAcc = 0;
|
|
12357
|
+
|
|
12358
|
+
for (var _ref of lines.entries()) {
|
|
12359
|
+
var _ref2 = _slicedToArray(_ref, 2);
|
|
12360
|
+
|
|
12361
|
+
var i = _ref2[0];
|
|
12362
|
+
var line = _ref2[1];
|
|
12363
|
+
var textElement = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
12364
|
+
|
|
12365
|
+
var params = _prepareParams(style, i);
|
|
12366
|
+
|
|
12367
|
+
textElement.style.fontFamily = params.fontFamily;
|
|
12368
|
+
textElement.style.transform = "rotate(".concat(params.angle, ")");
|
|
12369
|
+
textElement.style.fontSize = "".concat(params.fontSize, "px");
|
|
12370
|
+
textElement.style.lineHeight = params.lineHeight;
|
|
12371
|
+
textElement.style.fontFamily = params.fontFamily;
|
|
12372
|
+
textElement.style.letterSpacing = params.letterSpacing;
|
|
12373
|
+
textElement.textContent = line;
|
|
12374
|
+
textElement.setAttribute("x", "0");
|
|
12375
|
+
textElement.setAttribute("y", "".concat(heightAcc));
|
|
12376
|
+
heightAcc += params.lineHeight * params.fontSize;
|
|
12377
|
+
containerElement.appendChild(textElement);
|
|
12378
|
+
}
|
|
12379
|
+
|
|
12380
|
+
var _containerElement$get = containerElement.getBoundingClientRect(),
|
|
12381
|
+
width = _containerElement$get.width,
|
|
12382
|
+
height = _containerElement$get.height;
|
|
12383
|
+
|
|
12384
|
+
containerElement.innerHTML = "";
|
|
12385
|
+
return {
|
|
12386
|
+
width: width,
|
|
12387
|
+
height: height
|
|
12388
|
+
};
|
|
12389
|
+
}, function (text, style) {
|
|
12390
|
+
var totalText = Array.isArray(text) ? text.join() : text;
|
|
12391
|
+
var totalStyle = Array.isArray(style) ? style.map(styleToKeyComponent).join() : styleToKeyComponent(style);
|
|
12392
|
+
return "".concat(totalText, "::").concat(totalStyle);
|
|
12393
|
+
});
|
|
12394
|
+
|
|
12180
12395
|
// Stubbable implementation.
|
|
12181
12396
|
var _approximateTextSizeInternal = {
|
|
12182
12397
|
impl: function (text, style) {
|
|
12183
|
-
var
|
|
12398
|
+
var __debugForceApproximate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
12184
12399
|
|
|
12185
|
-
|
|
12400
|
+
// Attempt to first measure the element in DOM. If there is no DOM, fallback
|
|
12401
|
+
// to the less accurate approximation algorithm.
|
|
12402
|
+
var isClient = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
12186
12403
|
|
|
12187
|
-
|
|
12404
|
+
if (!isClient || __debugForceApproximate) {
|
|
12405
|
+
return _approximateDimensionsInternal(text, style);
|
|
12406
|
+
}
|
|
12188
12407
|
|
|
12189
|
-
|
|
12190
|
-
var heightWithRotate = angle ? _getSizeWithRotate(height, width, angle) : height;
|
|
12191
|
-
return {
|
|
12192
|
-
width: widthWithRotate,
|
|
12193
|
-
height: heightWithRotate * coefficients.heightOverlapCoef
|
|
12194
|
-
};
|
|
12408
|
+
return _measureDimensionsInternal(text, style);
|
|
12195
12409
|
}
|
|
12196
12410
|
};
|
|
12197
12411
|
/**
|