victory 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 +47 -0
- package/dist/victory.js +231 -16
- package/dist/victory.min.js +1 -1
- package/package.json +32 -29
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# victory
|
|
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
|
+
* Setup NPM Provenance ([#2587](https://github.com/FormidableLabs/victory/pull/2587))
|
|
16
|
+
|
|
17
|
+
## 36.6.8
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [[`c5b4f660c`](https://github.com/FormidableLabs/victory/commit/c5b4f660cb91d8d1979d216b846a44f0c5030ec1), [`1da86d186`](https://github.com/FormidableLabs/victory/commit/1da86d18615bf75db35cfc55cc8e3d5c0b5772b6)]:
|
|
22
|
+
- victory-zoom-container@36.6.8
|
|
23
|
+
- victory-stack@36.6.8
|
|
24
|
+
- victory-area@36.6.8
|
|
25
|
+
- victory-axis@36.6.8
|
|
26
|
+
- victory-bar@36.6.8
|
|
27
|
+
- victory-box-plot@36.6.8
|
|
28
|
+
- victory-brush-container@36.6.8
|
|
29
|
+
- victory-brush-line@36.6.8
|
|
30
|
+
- victory-candlestick@36.6.8
|
|
31
|
+
- victory-canvas@36.6.8
|
|
32
|
+
- victory-chart@36.6.8
|
|
33
|
+
- victory-core@36.6.8
|
|
34
|
+
- victory-create-container@36.6.8
|
|
35
|
+
- victory-cursor-container@36.6.8
|
|
36
|
+
- victory-errorbar@36.6.8
|
|
37
|
+
- victory-group@36.6.8
|
|
38
|
+
- victory-histogram@36.6.8
|
|
39
|
+
- victory-legend@36.6.8
|
|
40
|
+
- victory-line@36.6.8
|
|
41
|
+
- victory-pie@36.6.8
|
|
42
|
+
- victory-polar-axis@36.6.8
|
|
43
|
+
- victory-scatter@36.6.8
|
|
44
|
+
- victory-selection-container@36.6.8
|
|
45
|
+
- victory-shared-events@36.6.8
|
|
46
|
+
- victory-tooltip@36.6.8
|
|
47
|
+
- victory-voronoi@36.6.8
|
|
48
|
+
- victory-voronoi-container@36.6.8
|
|
49
|
+
|
|
3
50
|
## 36.6.7
|
|
4
51
|
|
|
5
52
|
### Patch Changes
|
package/dist/victory.js
CHANGED
|
@@ -2023,6 +2023,48 @@ function noop() {
|
|
|
2023
2023
|
module.exports = noop;
|
|
2024
2024
|
|
|
2025
2025
|
|
|
2026
|
+
/***/ }),
|
|
2027
|
+
|
|
2028
|
+
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js":
|
|
2029
|
+
/*!***********************************************************************************!*\
|
|
2030
|
+
!*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js ***!
|
|
2031
|
+
\***********************************************************************************/
|
|
2032
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
2033
|
+
|
|
2034
|
+
var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheClear.js"),
|
|
2035
|
+
listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js"),
|
|
2036
|
+
listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheGet.js"),
|
|
2037
|
+
listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheHas.js"),
|
|
2038
|
+
listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheSet.js");
|
|
2039
|
+
|
|
2040
|
+
/**
|
|
2041
|
+
* Creates an list cache object.
|
|
2042
|
+
*
|
|
2043
|
+
* @private
|
|
2044
|
+
* @constructor
|
|
2045
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
2046
|
+
*/
|
|
2047
|
+
function ListCache(entries) {
|
|
2048
|
+
var index = -1,
|
|
2049
|
+
length = entries == null ? 0 : entries.length;
|
|
2050
|
+
|
|
2051
|
+
this.clear();
|
|
2052
|
+
while (++index < length) {
|
|
2053
|
+
var entry = entries[index];
|
|
2054
|
+
this.set(entry[0], entry[1]);
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
// Add methods to `ListCache`.
|
|
2059
|
+
ListCache.prototype.clear = listCacheClear;
|
|
2060
|
+
ListCache.prototype['delete'] = listCacheDelete;
|
|
2061
|
+
ListCache.prototype.get = listCacheGet;
|
|
2062
|
+
ListCache.prototype.has = listCacheHas;
|
|
2063
|
+
ListCache.prototype.set = listCacheSet;
|
|
2064
|
+
|
|
2065
|
+
module.exports = ListCache;
|
|
2066
|
+
|
|
2067
|
+
|
|
2026
2068
|
/***/ }),
|
|
2027
2069
|
|
|
2028
2070
|
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_SetCache.js":
|
|
@@ -7957,6 +7999,89 @@ function mapValues(object, iteratee) {
|
|
|
7957
7999
|
module.exports = mapValues;
|
|
7958
8000
|
|
|
7959
8001
|
|
|
8002
|
+
/***/ }),
|
|
8003
|
+
|
|
8004
|
+
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js":
|
|
8005
|
+
/*!*********************************************************************************!*\
|
|
8006
|
+
!*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js ***!
|
|
8007
|
+
\*********************************************************************************/
|
|
8008
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
8009
|
+
|
|
8010
|
+
var MapCache = __webpack_require__(/*! ./_MapCache */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js");
|
|
8011
|
+
|
|
8012
|
+
/** Error message constants. */
|
|
8013
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
8014
|
+
|
|
8015
|
+
/**
|
|
8016
|
+
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
8017
|
+
* provided, it determines the cache key for storing the result based on the
|
|
8018
|
+
* arguments provided to the memoized function. By default, the first argument
|
|
8019
|
+
* provided to the memoized function is used as the map cache key. The `func`
|
|
8020
|
+
* is invoked with the `this` binding of the memoized function.
|
|
8021
|
+
*
|
|
8022
|
+
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
8023
|
+
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
8024
|
+
* constructor with one whose instances implement the
|
|
8025
|
+
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
8026
|
+
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
8027
|
+
*
|
|
8028
|
+
* @static
|
|
8029
|
+
* @memberOf _
|
|
8030
|
+
* @since 0.1.0
|
|
8031
|
+
* @category Function
|
|
8032
|
+
* @param {Function} func The function to have its output memoized.
|
|
8033
|
+
* @param {Function} [resolver] The function to resolve the cache key.
|
|
8034
|
+
* @returns {Function} Returns the new memoized function.
|
|
8035
|
+
* @example
|
|
8036
|
+
*
|
|
8037
|
+
* var object = { 'a': 1, 'b': 2 };
|
|
8038
|
+
* var other = { 'c': 3, 'd': 4 };
|
|
8039
|
+
*
|
|
8040
|
+
* var values = _.memoize(_.values);
|
|
8041
|
+
* values(object);
|
|
8042
|
+
* // => [1, 2]
|
|
8043
|
+
*
|
|
8044
|
+
* values(other);
|
|
8045
|
+
* // => [3, 4]
|
|
8046
|
+
*
|
|
8047
|
+
* object.a = 2;
|
|
8048
|
+
* values(object);
|
|
8049
|
+
* // => [1, 2]
|
|
8050
|
+
*
|
|
8051
|
+
* // Modify the result cache.
|
|
8052
|
+
* values.cache.set(object, ['a', 'b']);
|
|
8053
|
+
* values(object);
|
|
8054
|
+
* // => ['a', 'b']
|
|
8055
|
+
*
|
|
8056
|
+
* // Replace `_.memoize.Cache`.
|
|
8057
|
+
* _.memoize.Cache = WeakMap;
|
|
8058
|
+
*/
|
|
8059
|
+
function memoize(func, resolver) {
|
|
8060
|
+
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
8061
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
8062
|
+
}
|
|
8063
|
+
var memoized = function() {
|
|
8064
|
+
var args = arguments,
|
|
8065
|
+
key = resolver ? resolver.apply(this, args) : args[0],
|
|
8066
|
+
cache = memoized.cache;
|
|
8067
|
+
|
|
8068
|
+
if (cache.has(key)) {
|
|
8069
|
+
return cache.get(key);
|
|
8070
|
+
}
|
|
8071
|
+
var result = func.apply(this, args);
|
|
8072
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
8073
|
+
return result;
|
|
8074
|
+
};
|
|
8075
|
+
memoized.cache = new (memoize.Cache || MapCache);
|
|
8076
|
+
return memoized;
|
|
8077
|
+
}
|
|
8078
|
+
|
|
8079
|
+
// Expose `MapCache`.
|
|
8080
|
+
memoize.Cache = MapCache;
|
|
8081
|
+
|
|
8082
|
+
module.exports = memoize;
|
|
8083
|
+
|
|
8084
|
+
|
|
7960
8085
|
/***/ }),
|
|
7961
8086
|
|
|
7962
8087
|
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/negate.js":
|
|
@@ -26097,12 +26222,23 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
26097
26222
|
/* harmony export */ "approximateTextSize": () => (/* binding */ approximateTextSize),
|
|
26098
26223
|
/* harmony export */ "convertLengthToPixels": () => (/* binding */ convertLengthToPixels)
|
|
26099
26224
|
/* harmony export */ });
|
|
26100
|
-
/* harmony import */ var
|
|
26101
|
-
/* harmony import */ var
|
|
26102
|
-
/* harmony import */ var
|
|
26103
|
-
/* harmony import */ var
|
|
26225
|
+
/* 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");
|
|
26226
|
+
/* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_memoize__WEBPACK_IMPORTED_MODULE_0__);
|
|
26227
|
+
/* 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");
|
|
26228
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
26229
|
+
/* 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");
|
|
26230
|
+
/* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_2__);
|
|
26231
|
+
|
|
26232
|
+
|
|
26233
|
+
|
|
26104
26234
|
|
|
26235
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
26236
|
+
|
|
26237
|
+
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."); }
|
|
26238
|
+
|
|
26239
|
+
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; }
|
|
26105
26240
|
|
|
26241
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26106
26242
|
|
|
26107
26243
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
26108
26244
|
|
|
@@ -26307,9 +26443,9 @@ var convertLengthToPixels = function (length, fontSize) {
|
|
|
26307
26443
|
var _prepareParams = function (inputStyle, index) {
|
|
26308
26444
|
var lineStyle = Array.isArray(inputStyle) ? inputStyle[index] : inputStyle;
|
|
26309
26445
|
|
|
26310
|
-
var style =
|
|
26446
|
+
var style = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, lineStyle, defaultStyle);
|
|
26311
26447
|
|
|
26312
|
-
return
|
|
26448
|
+
return lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, style, {
|
|
26313
26449
|
fontFamily: style.fontFamily,
|
|
26314
26450
|
letterSpacing: typeof style.letterSpacing === "number" ? style.letterSpacing : convertLengthToPixels(String(style.letterSpacing), style.fontSize),
|
|
26315
26451
|
fontSize: typeof style.fontSize === "number" ? style.fontSize : convertLengthToPixels(String(style.fontSize))
|
|
@@ -26356,21 +26492,99 @@ var _approximateTextHeightInternal = function (text, style) {
|
|
|
26356
26492
|
}, 0);
|
|
26357
26493
|
};
|
|
26358
26494
|
|
|
26495
|
+
var _approximateDimensionsInternal = function (text, style) {
|
|
26496
|
+
var angle = Array.isArray(style) ? style[0] && style[0].angle : style && style.angle;
|
|
26497
|
+
|
|
26498
|
+
var height = _approximateTextHeightInternal(text, style);
|
|
26499
|
+
|
|
26500
|
+
var width = _approximateTextWidthInternal(text, style);
|
|
26501
|
+
|
|
26502
|
+
var widthWithRotate = angle ? _getSizeWithRotate(width, height, angle) : width;
|
|
26503
|
+
var heightWithRotate = angle ? _getSizeWithRotate(height, width, angle) : height;
|
|
26504
|
+
return {
|
|
26505
|
+
width: widthWithRotate,
|
|
26506
|
+
height: heightWithRotate * coefficients.heightOverlapCoef
|
|
26507
|
+
};
|
|
26508
|
+
};
|
|
26509
|
+
|
|
26510
|
+
var _getMeasurementContainer = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function () {
|
|
26511
|
+
var element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
26512
|
+
element.setAttribute("xlink", "http://www.w3.org/1999/xlink");
|
|
26513
|
+
var containerElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
26514
|
+
element.appendChild(containerElement);
|
|
26515
|
+
element.style.position = "fixed";
|
|
26516
|
+
element.style.top = "-9999px";
|
|
26517
|
+
element.style.left = "-9999px";
|
|
26518
|
+
document.body.appendChild(element);
|
|
26519
|
+
return containerElement;
|
|
26520
|
+
});
|
|
26521
|
+
|
|
26522
|
+
var styleToKeyComponent = function (style) {
|
|
26523
|
+
if (!style) {
|
|
26524
|
+
return "null";
|
|
26525
|
+
}
|
|
26526
|
+
|
|
26527
|
+
return "".concat(style.angle, ":").concat(style.fontFamily, ":").concat(style.fontSize, ":").concat(style.letterSpacing, ":").concat(style.lineHeight);
|
|
26528
|
+
};
|
|
26529
|
+
|
|
26530
|
+
var _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function (text, style) {
|
|
26531
|
+
var containerElement = _getMeasurementContainer();
|
|
26532
|
+
|
|
26533
|
+
var lines = _splitToLines(text);
|
|
26534
|
+
|
|
26535
|
+
var heightAcc = 0;
|
|
26536
|
+
|
|
26537
|
+
for (var _ref of lines.entries()) {
|
|
26538
|
+
var _ref2 = _slicedToArray(_ref, 2);
|
|
26539
|
+
|
|
26540
|
+
var i = _ref2[0];
|
|
26541
|
+
var line = _ref2[1];
|
|
26542
|
+
var textElement = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
26543
|
+
|
|
26544
|
+
var params = _prepareParams(style, i);
|
|
26545
|
+
|
|
26546
|
+
textElement.style.fontFamily = params.fontFamily;
|
|
26547
|
+
textElement.style.transform = "rotate(".concat(params.angle, ")");
|
|
26548
|
+
textElement.style.fontSize = "".concat(params.fontSize, "px");
|
|
26549
|
+
textElement.style.lineHeight = params.lineHeight;
|
|
26550
|
+
textElement.style.fontFamily = params.fontFamily;
|
|
26551
|
+
textElement.style.letterSpacing = params.letterSpacing;
|
|
26552
|
+
textElement.textContent = line;
|
|
26553
|
+
textElement.setAttribute("x", "0");
|
|
26554
|
+
textElement.setAttribute("y", "".concat(heightAcc));
|
|
26555
|
+
heightAcc += params.lineHeight * params.fontSize;
|
|
26556
|
+
containerElement.appendChild(textElement);
|
|
26557
|
+
}
|
|
26558
|
+
|
|
26559
|
+
var _containerElement$get = containerElement.getBoundingClientRect(),
|
|
26560
|
+
width = _containerElement$get.width,
|
|
26561
|
+
height = _containerElement$get.height;
|
|
26562
|
+
|
|
26563
|
+
containerElement.innerHTML = "";
|
|
26564
|
+
return {
|
|
26565
|
+
width: width,
|
|
26566
|
+
height: height
|
|
26567
|
+
};
|
|
26568
|
+
}, function (text, style) {
|
|
26569
|
+
var totalText = Array.isArray(text) ? text.join() : text;
|
|
26570
|
+
var totalStyle = Array.isArray(style) ? style.map(styleToKeyComponent).join() : styleToKeyComponent(style);
|
|
26571
|
+
return "".concat(totalText, "::").concat(totalStyle);
|
|
26572
|
+
});
|
|
26573
|
+
|
|
26359
26574
|
// Stubbable implementation.
|
|
26360
26575
|
var _approximateTextSizeInternal = {
|
|
26361
26576
|
impl: function (text, style) {
|
|
26362
|
-
var
|
|
26577
|
+
var __debugForceApproximate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
26363
26578
|
|
|
26364
|
-
|
|
26579
|
+
// Attempt to first measure the element in DOM. If there is no DOM, fallback
|
|
26580
|
+
// to the less accurate approximation algorithm.
|
|
26581
|
+
var isClient = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
26365
26582
|
|
|
26366
|
-
|
|
26583
|
+
if (!isClient || __debugForceApproximate) {
|
|
26584
|
+
return _approximateDimensionsInternal(text, style);
|
|
26585
|
+
}
|
|
26367
26586
|
|
|
26368
|
-
|
|
26369
|
-
var heightWithRotate = angle ? _getSizeWithRotate(height, width, angle) : height;
|
|
26370
|
-
return {
|
|
26371
|
-
width: widthWithRotate,
|
|
26372
|
-
height: heightWithRotate * coefficients.heightOverlapCoef
|
|
26373
|
-
};
|
|
26587
|
+
return _measureDimensionsInternal(text, style);
|
|
26374
26588
|
}
|
|
26375
26589
|
};
|
|
26376
26590
|
/**
|
|
@@ -30617,7 +30831,8 @@ var evaluateProps = function (props) {
|
|
|
30617
30831
|
var id = victory_core__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.id, props);
|
|
30618
30832
|
var style = victory_core__WEBPACK_IMPORTED_MODULE_2__.evaluateStyle(lodash_assign__WEBPACK_IMPORTED_MODULE_0___default()({
|
|
30619
30833
|
fill: "none",
|
|
30620
|
-
stroke: "black"
|
|
30834
|
+
stroke: "black",
|
|
30835
|
+
pointerEvents: "stroke"
|
|
30621
30836
|
}, props.style), props);
|
|
30622
30837
|
var tabIndex = victory_core__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.tabIndex, props);
|
|
30623
30838
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_0___default()({}, props, {
|