victory-area 36.6.8 → 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 +12 -0
- package/dist/victory-area.js +229 -15
- package/dist/victory-area.min.js +1 -1
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# victory-area
|
|
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
|
+
|
|
3
15
|
## 36.6.8
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/victory-area.js
CHANGED
|
@@ -504,6 +504,48 @@ VictoryAreaBase.getBaseProps = function (props) {
|
|
|
504
504
|
VictoryAreaBase.expectedComponents = ["dataComponent", "labelComponent", "groupComponent", "containerComponent"];
|
|
505
505
|
var VictoryArea = (0,victory_core__WEBPACK_IMPORTED_MODULE_15__.addEvents)(VictoryAreaBase, options);
|
|
506
506
|
|
|
507
|
+
/***/ }),
|
|
508
|
+
|
|
509
|
+
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js":
|
|
510
|
+
/*!***********************************************************************************!*\
|
|
511
|
+
!*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js ***!
|
|
512
|
+
\***********************************************************************************/
|
|
513
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
514
|
+
|
|
515
|
+
var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheClear.js"),
|
|
516
|
+
listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js"),
|
|
517
|
+
listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheGet.js"),
|
|
518
|
+
listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheHas.js"),
|
|
519
|
+
listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheSet.js");
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Creates an list cache object.
|
|
523
|
+
*
|
|
524
|
+
* @private
|
|
525
|
+
* @constructor
|
|
526
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
527
|
+
*/
|
|
528
|
+
function ListCache(entries) {
|
|
529
|
+
var index = -1,
|
|
530
|
+
length = entries == null ? 0 : entries.length;
|
|
531
|
+
|
|
532
|
+
this.clear();
|
|
533
|
+
while (++index < length) {
|
|
534
|
+
var entry = entries[index];
|
|
535
|
+
this.set(entry[0], entry[1]);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
// Add methods to `ListCache`.
|
|
540
|
+
ListCache.prototype.clear = listCacheClear;
|
|
541
|
+
ListCache.prototype['delete'] = listCacheDelete;
|
|
542
|
+
ListCache.prototype.get = listCacheGet;
|
|
543
|
+
ListCache.prototype.has = listCacheHas;
|
|
544
|
+
ListCache.prototype.set = listCacheSet;
|
|
545
|
+
|
|
546
|
+
module.exports = ListCache;
|
|
547
|
+
|
|
548
|
+
|
|
507
549
|
/***/ }),
|
|
508
550
|
|
|
509
551
|
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_SetCache.js":
|
|
@@ -5078,6 +5120,89 @@ function last(array) {
|
|
|
5078
5120
|
module.exports = last;
|
|
5079
5121
|
|
|
5080
5122
|
|
|
5123
|
+
/***/ }),
|
|
5124
|
+
|
|
5125
|
+
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js":
|
|
5126
|
+
/*!*********************************************************************************!*\
|
|
5127
|
+
!*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js ***!
|
|
5128
|
+
\*********************************************************************************/
|
|
5129
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
5130
|
+
|
|
5131
|
+
var MapCache = __webpack_require__(/*! ./_MapCache */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js");
|
|
5132
|
+
|
|
5133
|
+
/** Error message constants. */
|
|
5134
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
5135
|
+
|
|
5136
|
+
/**
|
|
5137
|
+
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
5138
|
+
* provided, it determines the cache key for storing the result based on the
|
|
5139
|
+
* arguments provided to the memoized function. By default, the first argument
|
|
5140
|
+
* provided to the memoized function is used as the map cache key. The `func`
|
|
5141
|
+
* is invoked with the `this` binding of the memoized function.
|
|
5142
|
+
*
|
|
5143
|
+
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
5144
|
+
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
5145
|
+
* constructor with one whose instances implement the
|
|
5146
|
+
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
5147
|
+
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
5148
|
+
*
|
|
5149
|
+
* @static
|
|
5150
|
+
* @memberOf _
|
|
5151
|
+
* @since 0.1.0
|
|
5152
|
+
* @category Function
|
|
5153
|
+
* @param {Function} func The function to have its output memoized.
|
|
5154
|
+
* @param {Function} [resolver] The function to resolve the cache key.
|
|
5155
|
+
* @returns {Function} Returns the new memoized function.
|
|
5156
|
+
* @example
|
|
5157
|
+
*
|
|
5158
|
+
* var object = { 'a': 1, 'b': 2 };
|
|
5159
|
+
* var other = { 'c': 3, 'd': 4 };
|
|
5160
|
+
*
|
|
5161
|
+
* var values = _.memoize(_.values);
|
|
5162
|
+
* values(object);
|
|
5163
|
+
* // => [1, 2]
|
|
5164
|
+
*
|
|
5165
|
+
* values(other);
|
|
5166
|
+
* // => [3, 4]
|
|
5167
|
+
*
|
|
5168
|
+
* object.a = 2;
|
|
5169
|
+
* values(object);
|
|
5170
|
+
* // => [1, 2]
|
|
5171
|
+
*
|
|
5172
|
+
* // Modify the result cache.
|
|
5173
|
+
* values.cache.set(object, ['a', 'b']);
|
|
5174
|
+
* values(object);
|
|
5175
|
+
* // => ['a', 'b']
|
|
5176
|
+
*
|
|
5177
|
+
* // Replace `_.memoize.Cache`.
|
|
5178
|
+
* _.memoize.Cache = WeakMap;
|
|
5179
|
+
*/
|
|
5180
|
+
function memoize(func, resolver) {
|
|
5181
|
+
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
5182
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
5183
|
+
}
|
|
5184
|
+
var memoized = function() {
|
|
5185
|
+
var args = arguments,
|
|
5186
|
+
key = resolver ? resolver.apply(this, args) : args[0],
|
|
5187
|
+
cache = memoized.cache;
|
|
5188
|
+
|
|
5189
|
+
if (cache.has(key)) {
|
|
5190
|
+
return cache.get(key);
|
|
5191
|
+
}
|
|
5192
|
+
var result = func.apply(this, args);
|
|
5193
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
5194
|
+
return result;
|
|
5195
|
+
};
|
|
5196
|
+
memoized.cache = new (memoize.Cache || MapCache);
|
|
5197
|
+
return memoized;
|
|
5198
|
+
}
|
|
5199
|
+
|
|
5200
|
+
// Expose `MapCache`.
|
|
5201
|
+
memoize.Cache = MapCache;
|
|
5202
|
+
|
|
5203
|
+
module.exports = memoize;
|
|
5204
|
+
|
|
5205
|
+
|
|
5081
5206
|
/***/ }),
|
|
5082
5207
|
|
|
5083
5208
|
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/negate.js":
|
|
@@ -13766,12 +13891,23 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13766
13891
|
/* harmony export */ "approximateTextSize": () => (/* binding */ approximateTextSize),
|
|
13767
13892
|
/* harmony export */ "convertLengthToPixels": () => (/* binding */ convertLengthToPixels)
|
|
13768
13893
|
/* harmony export */ });
|
|
13769
|
-
/* harmony import */ var
|
|
13770
|
-
/* harmony import */ var
|
|
13771
|
-
/* harmony import */ var
|
|
13772
|
-
/* harmony import */ var
|
|
13894
|
+
/* 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");
|
|
13895
|
+
/* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_memoize__WEBPACK_IMPORTED_MODULE_0__);
|
|
13896
|
+
/* 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");
|
|
13897
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
13898
|
+
/* 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");
|
|
13899
|
+
/* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_2__);
|
|
13900
|
+
|
|
13901
|
+
|
|
13773
13902
|
|
|
13774
13903
|
|
|
13904
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13905
|
+
|
|
13906
|
+
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."); }
|
|
13907
|
+
|
|
13908
|
+
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; }
|
|
13909
|
+
|
|
13910
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13775
13911
|
|
|
13776
13912
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
13777
13913
|
|
|
@@ -13976,9 +14112,9 @@ var convertLengthToPixels = function (length, fontSize) {
|
|
|
13976
14112
|
var _prepareParams = function (inputStyle, index) {
|
|
13977
14113
|
var lineStyle = Array.isArray(inputStyle) ? inputStyle[index] : inputStyle;
|
|
13978
14114
|
|
|
13979
|
-
var style =
|
|
14115
|
+
var style = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, lineStyle, defaultStyle);
|
|
13980
14116
|
|
|
13981
|
-
return
|
|
14117
|
+
return lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, style, {
|
|
13982
14118
|
fontFamily: style.fontFamily,
|
|
13983
14119
|
letterSpacing: typeof style.letterSpacing === "number" ? style.letterSpacing : convertLengthToPixels(String(style.letterSpacing), style.fontSize),
|
|
13984
14120
|
fontSize: typeof style.fontSize === "number" ? style.fontSize : convertLengthToPixels(String(style.fontSize))
|
|
@@ -14025,21 +14161,99 @@ var _approximateTextHeightInternal = function (text, style) {
|
|
|
14025
14161
|
}, 0);
|
|
14026
14162
|
};
|
|
14027
14163
|
|
|
14164
|
+
var _approximateDimensionsInternal = function (text, style) {
|
|
14165
|
+
var angle = Array.isArray(style) ? style[0] && style[0].angle : style && style.angle;
|
|
14166
|
+
|
|
14167
|
+
var height = _approximateTextHeightInternal(text, style);
|
|
14168
|
+
|
|
14169
|
+
var width = _approximateTextWidthInternal(text, style);
|
|
14170
|
+
|
|
14171
|
+
var widthWithRotate = angle ? _getSizeWithRotate(width, height, angle) : width;
|
|
14172
|
+
var heightWithRotate = angle ? _getSizeWithRotate(height, width, angle) : height;
|
|
14173
|
+
return {
|
|
14174
|
+
width: widthWithRotate,
|
|
14175
|
+
height: heightWithRotate * coefficients.heightOverlapCoef
|
|
14176
|
+
};
|
|
14177
|
+
};
|
|
14178
|
+
|
|
14179
|
+
var _getMeasurementContainer = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function () {
|
|
14180
|
+
var element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
14181
|
+
element.setAttribute("xlink", "http://www.w3.org/1999/xlink");
|
|
14182
|
+
var containerElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
14183
|
+
element.appendChild(containerElement);
|
|
14184
|
+
element.style.position = "fixed";
|
|
14185
|
+
element.style.top = "-9999px";
|
|
14186
|
+
element.style.left = "-9999px";
|
|
14187
|
+
document.body.appendChild(element);
|
|
14188
|
+
return containerElement;
|
|
14189
|
+
});
|
|
14190
|
+
|
|
14191
|
+
var styleToKeyComponent = function (style) {
|
|
14192
|
+
if (!style) {
|
|
14193
|
+
return "null";
|
|
14194
|
+
}
|
|
14195
|
+
|
|
14196
|
+
return "".concat(style.angle, ":").concat(style.fontFamily, ":").concat(style.fontSize, ":").concat(style.letterSpacing, ":").concat(style.lineHeight);
|
|
14197
|
+
};
|
|
14198
|
+
|
|
14199
|
+
var _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function (text, style) {
|
|
14200
|
+
var containerElement = _getMeasurementContainer();
|
|
14201
|
+
|
|
14202
|
+
var lines = _splitToLines(text);
|
|
14203
|
+
|
|
14204
|
+
var heightAcc = 0;
|
|
14205
|
+
|
|
14206
|
+
for (var _ref of lines.entries()) {
|
|
14207
|
+
var _ref2 = _slicedToArray(_ref, 2);
|
|
14208
|
+
|
|
14209
|
+
var i = _ref2[0];
|
|
14210
|
+
var line = _ref2[1];
|
|
14211
|
+
var textElement = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
14212
|
+
|
|
14213
|
+
var params = _prepareParams(style, i);
|
|
14214
|
+
|
|
14215
|
+
textElement.style.fontFamily = params.fontFamily;
|
|
14216
|
+
textElement.style.transform = "rotate(".concat(params.angle, ")");
|
|
14217
|
+
textElement.style.fontSize = "".concat(params.fontSize, "px");
|
|
14218
|
+
textElement.style.lineHeight = params.lineHeight;
|
|
14219
|
+
textElement.style.fontFamily = params.fontFamily;
|
|
14220
|
+
textElement.style.letterSpacing = params.letterSpacing;
|
|
14221
|
+
textElement.textContent = line;
|
|
14222
|
+
textElement.setAttribute("x", "0");
|
|
14223
|
+
textElement.setAttribute("y", "".concat(heightAcc));
|
|
14224
|
+
heightAcc += params.lineHeight * params.fontSize;
|
|
14225
|
+
containerElement.appendChild(textElement);
|
|
14226
|
+
}
|
|
14227
|
+
|
|
14228
|
+
var _containerElement$get = containerElement.getBoundingClientRect(),
|
|
14229
|
+
width = _containerElement$get.width,
|
|
14230
|
+
height = _containerElement$get.height;
|
|
14231
|
+
|
|
14232
|
+
containerElement.innerHTML = "";
|
|
14233
|
+
return {
|
|
14234
|
+
width: width,
|
|
14235
|
+
height: height
|
|
14236
|
+
};
|
|
14237
|
+
}, function (text, style) {
|
|
14238
|
+
var totalText = Array.isArray(text) ? text.join() : text;
|
|
14239
|
+
var totalStyle = Array.isArray(style) ? style.map(styleToKeyComponent).join() : styleToKeyComponent(style);
|
|
14240
|
+
return "".concat(totalText, "::").concat(totalStyle);
|
|
14241
|
+
});
|
|
14242
|
+
|
|
14028
14243
|
// Stubbable implementation.
|
|
14029
14244
|
var _approximateTextSizeInternal = {
|
|
14030
14245
|
impl: function (text, style) {
|
|
14031
|
-
var
|
|
14246
|
+
var __debugForceApproximate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
14032
14247
|
|
|
14033
|
-
|
|
14248
|
+
// Attempt to first measure the element in DOM. If there is no DOM, fallback
|
|
14249
|
+
// to the less accurate approximation algorithm.
|
|
14250
|
+
var isClient = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
14034
14251
|
|
|
14035
|
-
|
|
14252
|
+
if (!isClient || __debugForceApproximate) {
|
|
14253
|
+
return _approximateDimensionsInternal(text, style);
|
|
14254
|
+
}
|
|
14036
14255
|
|
|
14037
|
-
|
|
14038
|
-
var heightWithRotate = angle ? _getSizeWithRotate(height, width, angle) : height;
|
|
14039
|
-
return {
|
|
14040
|
-
width: widthWithRotate,
|
|
14041
|
-
height: heightWithRotate * coefficients.heightOverlapCoef
|
|
14042
|
-
};
|
|
14256
|
+
return _measureDimensionsInternal(text, style);
|
|
14043
14257
|
}
|
|
14044
14258
|
};
|
|
14045
14259
|
/**
|