victory-pie 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 +20 -0
- package/dist/victory-pie.js +229 -15
- package/dist/victory-pie.min.js +1 -1
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# victory-pie
|
|
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-vendor@36.6.8
|
|
22
|
+
|
|
3
23
|
## 36.6.7
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/victory-pie.js
CHANGED
|
@@ -705,6 +705,48 @@ VictoryPie.getData = victory_core__WEBPACK_IMPORTED_MODULE_10__.getData;
|
|
|
705
705
|
VictoryPie.expectedComponents = ["dataComponent", "labelComponent", "groupComponent", "containerComponent"];
|
|
706
706
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,victory_core__WEBPACK_IMPORTED_MODULE_11__.addEvents)(VictoryPie));
|
|
707
707
|
|
|
708
|
+
/***/ }),
|
|
709
|
+
|
|
710
|
+
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js":
|
|
711
|
+
/*!***********************************************************************************!*\
|
|
712
|
+
!*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js ***!
|
|
713
|
+
\***********************************************************************************/
|
|
714
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
715
|
+
|
|
716
|
+
var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheClear.js"),
|
|
717
|
+
listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js"),
|
|
718
|
+
listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheGet.js"),
|
|
719
|
+
listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheHas.js"),
|
|
720
|
+
listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheSet.js");
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Creates an list cache object.
|
|
724
|
+
*
|
|
725
|
+
* @private
|
|
726
|
+
* @constructor
|
|
727
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
728
|
+
*/
|
|
729
|
+
function ListCache(entries) {
|
|
730
|
+
var index = -1,
|
|
731
|
+
length = entries == null ? 0 : entries.length;
|
|
732
|
+
|
|
733
|
+
this.clear();
|
|
734
|
+
while (++index < length) {
|
|
735
|
+
var entry = entries[index];
|
|
736
|
+
this.set(entry[0], entry[1]);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
// Add methods to `ListCache`.
|
|
741
|
+
ListCache.prototype.clear = listCacheClear;
|
|
742
|
+
ListCache.prototype['delete'] = listCacheDelete;
|
|
743
|
+
ListCache.prototype.get = listCacheGet;
|
|
744
|
+
ListCache.prototype.has = listCacheHas;
|
|
745
|
+
ListCache.prototype.set = listCacheSet;
|
|
746
|
+
|
|
747
|
+
module.exports = ListCache;
|
|
748
|
+
|
|
749
|
+
|
|
708
750
|
/***/ }),
|
|
709
751
|
|
|
710
752
|
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_SetCache.js":
|
|
@@ -5174,6 +5216,89 @@ function last(array) {
|
|
|
5174
5216
|
module.exports = last;
|
|
5175
5217
|
|
|
5176
5218
|
|
|
5219
|
+
/***/ }),
|
|
5220
|
+
|
|
5221
|
+
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js":
|
|
5222
|
+
/*!*********************************************************************************!*\
|
|
5223
|
+
!*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js ***!
|
|
5224
|
+
\*********************************************************************************/
|
|
5225
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
5226
|
+
|
|
5227
|
+
var MapCache = __webpack_require__(/*! ./_MapCache */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js");
|
|
5228
|
+
|
|
5229
|
+
/** Error message constants. */
|
|
5230
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
5231
|
+
|
|
5232
|
+
/**
|
|
5233
|
+
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
5234
|
+
* provided, it determines the cache key for storing the result based on the
|
|
5235
|
+
* arguments provided to the memoized function. By default, the first argument
|
|
5236
|
+
* provided to the memoized function is used as the map cache key. The `func`
|
|
5237
|
+
* is invoked with the `this` binding of the memoized function.
|
|
5238
|
+
*
|
|
5239
|
+
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
5240
|
+
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
5241
|
+
* constructor with one whose instances implement the
|
|
5242
|
+
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
5243
|
+
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
5244
|
+
*
|
|
5245
|
+
* @static
|
|
5246
|
+
* @memberOf _
|
|
5247
|
+
* @since 0.1.0
|
|
5248
|
+
* @category Function
|
|
5249
|
+
* @param {Function} func The function to have its output memoized.
|
|
5250
|
+
* @param {Function} [resolver] The function to resolve the cache key.
|
|
5251
|
+
* @returns {Function} Returns the new memoized function.
|
|
5252
|
+
* @example
|
|
5253
|
+
*
|
|
5254
|
+
* var object = { 'a': 1, 'b': 2 };
|
|
5255
|
+
* var other = { 'c': 3, 'd': 4 };
|
|
5256
|
+
*
|
|
5257
|
+
* var values = _.memoize(_.values);
|
|
5258
|
+
* values(object);
|
|
5259
|
+
* // => [1, 2]
|
|
5260
|
+
*
|
|
5261
|
+
* values(other);
|
|
5262
|
+
* // => [3, 4]
|
|
5263
|
+
*
|
|
5264
|
+
* object.a = 2;
|
|
5265
|
+
* values(object);
|
|
5266
|
+
* // => [1, 2]
|
|
5267
|
+
*
|
|
5268
|
+
* // Modify the result cache.
|
|
5269
|
+
* values.cache.set(object, ['a', 'b']);
|
|
5270
|
+
* values(object);
|
|
5271
|
+
* // => ['a', 'b']
|
|
5272
|
+
*
|
|
5273
|
+
* // Replace `_.memoize.Cache`.
|
|
5274
|
+
* _.memoize.Cache = WeakMap;
|
|
5275
|
+
*/
|
|
5276
|
+
function memoize(func, resolver) {
|
|
5277
|
+
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
5278
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
5279
|
+
}
|
|
5280
|
+
var memoized = function() {
|
|
5281
|
+
var args = arguments,
|
|
5282
|
+
key = resolver ? resolver.apply(this, args) : args[0],
|
|
5283
|
+
cache = memoized.cache;
|
|
5284
|
+
|
|
5285
|
+
if (cache.has(key)) {
|
|
5286
|
+
return cache.get(key);
|
|
5287
|
+
}
|
|
5288
|
+
var result = func.apply(this, args);
|
|
5289
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
5290
|
+
return result;
|
|
5291
|
+
};
|
|
5292
|
+
memoized.cache = new (memoize.Cache || MapCache);
|
|
5293
|
+
return memoized;
|
|
5294
|
+
}
|
|
5295
|
+
|
|
5296
|
+
// Expose `MapCache`.
|
|
5297
|
+
memoize.Cache = MapCache;
|
|
5298
|
+
|
|
5299
|
+
module.exports = memoize;
|
|
5300
|
+
|
|
5301
|
+
|
|
5177
5302
|
/***/ }),
|
|
5178
5303
|
|
|
5179
5304
|
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/negate.js":
|
|
@@ -12789,12 +12914,23 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12789
12914
|
/* harmony export */ "approximateTextSize": () => (/* binding */ approximateTextSize),
|
|
12790
12915
|
/* harmony export */ "convertLengthToPixels": () => (/* binding */ convertLengthToPixels)
|
|
12791
12916
|
/* harmony export */ });
|
|
12792
|
-
/* harmony import */ var
|
|
12793
|
-
/* harmony import */ var
|
|
12794
|
-
/* harmony import */ var
|
|
12795
|
-
/* harmony import */ var
|
|
12917
|
+
/* 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");
|
|
12918
|
+
/* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_memoize__WEBPACK_IMPORTED_MODULE_0__);
|
|
12919
|
+
/* 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");
|
|
12920
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
12921
|
+
/* 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");
|
|
12922
|
+
/* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_2__);
|
|
12923
|
+
|
|
12924
|
+
|
|
12796
12925
|
|
|
12797
12926
|
|
|
12927
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12928
|
+
|
|
12929
|
+
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."); }
|
|
12930
|
+
|
|
12931
|
+
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; }
|
|
12932
|
+
|
|
12933
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12798
12934
|
|
|
12799
12935
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
12800
12936
|
|
|
@@ -12999,9 +13135,9 @@ var convertLengthToPixels = function (length, fontSize) {
|
|
|
12999
13135
|
var _prepareParams = function (inputStyle, index) {
|
|
13000
13136
|
var lineStyle = Array.isArray(inputStyle) ? inputStyle[index] : inputStyle;
|
|
13001
13137
|
|
|
13002
|
-
var style =
|
|
13138
|
+
var style = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, lineStyle, defaultStyle);
|
|
13003
13139
|
|
|
13004
|
-
return
|
|
13140
|
+
return lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, style, {
|
|
13005
13141
|
fontFamily: style.fontFamily,
|
|
13006
13142
|
letterSpacing: typeof style.letterSpacing === "number" ? style.letterSpacing : convertLengthToPixels(String(style.letterSpacing), style.fontSize),
|
|
13007
13143
|
fontSize: typeof style.fontSize === "number" ? style.fontSize : convertLengthToPixels(String(style.fontSize))
|
|
@@ -13048,21 +13184,99 @@ var _approximateTextHeightInternal = function (text, style) {
|
|
|
13048
13184
|
}, 0);
|
|
13049
13185
|
};
|
|
13050
13186
|
|
|
13187
|
+
var _approximateDimensionsInternal = function (text, style) {
|
|
13188
|
+
var angle = Array.isArray(style) ? style[0] && style[0].angle : style && style.angle;
|
|
13189
|
+
|
|
13190
|
+
var height = _approximateTextHeightInternal(text, style);
|
|
13191
|
+
|
|
13192
|
+
var width = _approximateTextWidthInternal(text, style);
|
|
13193
|
+
|
|
13194
|
+
var widthWithRotate = angle ? _getSizeWithRotate(width, height, angle) : width;
|
|
13195
|
+
var heightWithRotate = angle ? _getSizeWithRotate(height, width, angle) : height;
|
|
13196
|
+
return {
|
|
13197
|
+
width: widthWithRotate,
|
|
13198
|
+
height: heightWithRotate * coefficients.heightOverlapCoef
|
|
13199
|
+
};
|
|
13200
|
+
};
|
|
13201
|
+
|
|
13202
|
+
var _getMeasurementContainer = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function () {
|
|
13203
|
+
var element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
13204
|
+
element.setAttribute("xlink", "http://www.w3.org/1999/xlink");
|
|
13205
|
+
var containerElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
13206
|
+
element.appendChild(containerElement);
|
|
13207
|
+
element.style.position = "fixed";
|
|
13208
|
+
element.style.top = "-9999px";
|
|
13209
|
+
element.style.left = "-9999px";
|
|
13210
|
+
document.body.appendChild(element);
|
|
13211
|
+
return containerElement;
|
|
13212
|
+
});
|
|
13213
|
+
|
|
13214
|
+
var styleToKeyComponent = function (style) {
|
|
13215
|
+
if (!style) {
|
|
13216
|
+
return "null";
|
|
13217
|
+
}
|
|
13218
|
+
|
|
13219
|
+
return "".concat(style.angle, ":").concat(style.fontFamily, ":").concat(style.fontSize, ":").concat(style.letterSpacing, ":").concat(style.lineHeight);
|
|
13220
|
+
};
|
|
13221
|
+
|
|
13222
|
+
var _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function (text, style) {
|
|
13223
|
+
var containerElement = _getMeasurementContainer();
|
|
13224
|
+
|
|
13225
|
+
var lines = _splitToLines(text);
|
|
13226
|
+
|
|
13227
|
+
var heightAcc = 0;
|
|
13228
|
+
|
|
13229
|
+
for (var _ref of lines.entries()) {
|
|
13230
|
+
var _ref2 = _slicedToArray(_ref, 2);
|
|
13231
|
+
|
|
13232
|
+
var i = _ref2[0];
|
|
13233
|
+
var line = _ref2[1];
|
|
13234
|
+
var textElement = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
13235
|
+
|
|
13236
|
+
var params = _prepareParams(style, i);
|
|
13237
|
+
|
|
13238
|
+
textElement.style.fontFamily = params.fontFamily;
|
|
13239
|
+
textElement.style.transform = "rotate(".concat(params.angle, ")");
|
|
13240
|
+
textElement.style.fontSize = "".concat(params.fontSize, "px");
|
|
13241
|
+
textElement.style.lineHeight = params.lineHeight;
|
|
13242
|
+
textElement.style.fontFamily = params.fontFamily;
|
|
13243
|
+
textElement.style.letterSpacing = params.letterSpacing;
|
|
13244
|
+
textElement.textContent = line;
|
|
13245
|
+
textElement.setAttribute("x", "0");
|
|
13246
|
+
textElement.setAttribute("y", "".concat(heightAcc));
|
|
13247
|
+
heightAcc += params.lineHeight * params.fontSize;
|
|
13248
|
+
containerElement.appendChild(textElement);
|
|
13249
|
+
}
|
|
13250
|
+
|
|
13251
|
+
var _containerElement$get = containerElement.getBoundingClientRect(),
|
|
13252
|
+
width = _containerElement$get.width,
|
|
13253
|
+
height = _containerElement$get.height;
|
|
13254
|
+
|
|
13255
|
+
containerElement.innerHTML = "";
|
|
13256
|
+
return {
|
|
13257
|
+
width: width,
|
|
13258
|
+
height: height
|
|
13259
|
+
};
|
|
13260
|
+
}, function (text, style) {
|
|
13261
|
+
var totalText = Array.isArray(text) ? text.join() : text;
|
|
13262
|
+
var totalStyle = Array.isArray(style) ? style.map(styleToKeyComponent).join() : styleToKeyComponent(style);
|
|
13263
|
+
return "".concat(totalText, "::").concat(totalStyle);
|
|
13264
|
+
});
|
|
13265
|
+
|
|
13051
13266
|
// Stubbable implementation.
|
|
13052
13267
|
var _approximateTextSizeInternal = {
|
|
13053
13268
|
impl: function (text, style) {
|
|
13054
|
-
var
|
|
13269
|
+
var __debugForceApproximate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
13055
13270
|
|
|
13056
|
-
|
|
13271
|
+
// Attempt to first measure the element in DOM. If there is no DOM, fallback
|
|
13272
|
+
// to the less accurate approximation algorithm.
|
|
13273
|
+
var isClient = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
13057
13274
|
|
|
13058
|
-
|
|
13275
|
+
if (!isClient || __debugForceApproximate) {
|
|
13276
|
+
return _approximateDimensionsInternal(text, style);
|
|
13277
|
+
}
|
|
13059
13278
|
|
|
13060
|
-
|
|
13061
|
-
var heightWithRotate = angle ? _getSizeWithRotate(height, width, angle) : height;
|
|
13062
|
-
return {
|
|
13063
|
-
width: widthWithRotate,
|
|
13064
|
-
height: heightWithRotate * coefficients.heightOverlapCoef
|
|
13065
|
-
};
|
|
13279
|
+
return _measureDimensionsInternal(text, style);
|
|
13066
13280
|
}
|
|
13067
13281
|
};
|
|
13068
13282
|
/**
|