victory-errorbar 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-errorbar.js +229 -15
- package/dist/victory-errorbar.min.js +1 -1
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# victory-errorbar
|
|
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-errorbar.js
CHANGED
|
@@ -590,6 +590,48 @@ VictoryErrorBarBase.getBaseProps = function (props) {
|
|
|
590
590
|
VictoryErrorBarBase.expectedComponents = ["dataComponent", "labelComponent", "groupComponent", "containerComponent"];
|
|
591
591
|
var VictoryErrorBar = (0,victory_core__WEBPACK_IMPORTED_MODULE_12__.addEvents)(VictoryErrorBarBase);
|
|
592
592
|
|
|
593
|
+
/***/ }),
|
|
594
|
+
|
|
595
|
+
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js":
|
|
596
|
+
/*!***********************************************************************************!*\
|
|
597
|
+
!*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js ***!
|
|
598
|
+
\***********************************************************************************/
|
|
599
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
600
|
+
|
|
601
|
+
var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheClear.js"),
|
|
602
|
+
listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js"),
|
|
603
|
+
listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheGet.js"),
|
|
604
|
+
listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheHas.js"),
|
|
605
|
+
listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheSet.js");
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Creates an list cache object.
|
|
609
|
+
*
|
|
610
|
+
* @private
|
|
611
|
+
* @constructor
|
|
612
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
613
|
+
*/
|
|
614
|
+
function ListCache(entries) {
|
|
615
|
+
var index = -1,
|
|
616
|
+
length = entries == null ? 0 : entries.length;
|
|
617
|
+
|
|
618
|
+
this.clear();
|
|
619
|
+
while (++index < length) {
|
|
620
|
+
var entry = entries[index];
|
|
621
|
+
this.set(entry[0], entry[1]);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
// Add methods to `ListCache`.
|
|
626
|
+
ListCache.prototype.clear = listCacheClear;
|
|
627
|
+
ListCache.prototype['delete'] = listCacheDelete;
|
|
628
|
+
ListCache.prototype.get = listCacheGet;
|
|
629
|
+
ListCache.prototype.has = listCacheHas;
|
|
630
|
+
ListCache.prototype.set = listCacheSet;
|
|
631
|
+
|
|
632
|
+
module.exports = ListCache;
|
|
633
|
+
|
|
634
|
+
|
|
593
635
|
/***/ }),
|
|
594
636
|
|
|
595
637
|
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_SetCache.js":
|
|
@@ -5164,6 +5206,89 @@ function last(array) {
|
|
|
5164
5206
|
module.exports = last;
|
|
5165
5207
|
|
|
5166
5208
|
|
|
5209
|
+
/***/ }),
|
|
5210
|
+
|
|
5211
|
+
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js":
|
|
5212
|
+
/*!*********************************************************************************!*\
|
|
5213
|
+
!*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js ***!
|
|
5214
|
+
\*********************************************************************************/
|
|
5215
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
5216
|
+
|
|
5217
|
+
var MapCache = __webpack_require__(/*! ./_MapCache */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js");
|
|
5218
|
+
|
|
5219
|
+
/** Error message constants. */
|
|
5220
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
5221
|
+
|
|
5222
|
+
/**
|
|
5223
|
+
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
5224
|
+
* provided, it determines the cache key for storing the result based on the
|
|
5225
|
+
* arguments provided to the memoized function. By default, the first argument
|
|
5226
|
+
* provided to the memoized function is used as the map cache key. The `func`
|
|
5227
|
+
* is invoked with the `this` binding of the memoized function.
|
|
5228
|
+
*
|
|
5229
|
+
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
5230
|
+
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
5231
|
+
* constructor with one whose instances implement the
|
|
5232
|
+
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
5233
|
+
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
5234
|
+
*
|
|
5235
|
+
* @static
|
|
5236
|
+
* @memberOf _
|
|
5237
|
+
* @since 0.1.0
|
|
5238
|
+
* @category Function
|
|
5239
|
+
* @param {Function} func The function to have its output memoized.
|
|
5240
|
+
* @param {Function} [resolver] The function to resolve the cache key.
|
|
5241
|
+
* @returns {Function} Returns the new memoized function.
|
|
5242
|
+
* @example
|
|
5243
|
+
*
|
|
5244
|
+
* var object = { 'a': 1, 'b': 2 };
|
|
5245
|
+
* var other = { 'c': 3, 'd': 4 };
|
|
5246
|
+
*
|
|
5247
|
+
* var values = _.memoize(_.values);
|
|
5248
|
+
* values(object);
|
|
5249
|
+
* // => [1, 2]
|
|
5250
|
+
*
|
|
5251
|
+
* values(other);
|
|
5252
|
+
* // => [3, 4]
|
|
5253
|
+
*
|
|
5254
|
+
* object.a = 2;
|
|
5255
|
+
* values(object);
|
|
5256
|
+
* // => [1, 2]
|
|
5257
|
+
*
|
|
5258
|
+
* // Modify the result cache.
|
|
5259
|
+
* values.cache.set(object, ['a', 'b']);
|
|
5260
|
+
* values(object);
|
|
5261
|
+
* // => ['a', 'b']
|
|
5262
|
+
*
|
|
5263
|
+
* // Replace `_.memoize.Cache`.
|
|
5264
|
+
* _.memoize.Cache = WeakMap;
|
|
5265
|
+
*/
|
|
5266
|
+
function memoize(func, resolver) {
|
|
5267
|
+
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
5268
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
5269
|
+
}
|
|
5270
|
+
var memoized = function() {
|
|
5271
|
+
var args = arguments,
|
|
5272
|
+
key = resolver ? resolver.apply(this, args) : args[0],
|
|
5273
|
+
cache = memoized.cache;
|
|
5274
|
+
|
|
5275
|
+
if (cache.has(key)) {
|
|
5276
|
+
return cache.get(key);
|
|
5277
|
+
}
|
|
5278
|
+
var result = func.apply(this, args);
|
|
5279
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
5280
|
+
return result;
|
|
5281
|
+
};
|
|
5282
|
+
memoized.cache = new (memoize.Cache || MapCache);
|
|
5283
|
+
return memoized;
|
|
5284
|
+
}
|
|
5285
|
+
|
|
5286
|
+
// Expose `MapCache`.
|
|
5287
|
+
memoize.Cache = MapCache;
|
|
5288
|
+
|
|
5289
|
+
module.exports = memoize;
|
|
5290
|
+
|
|
5291
|
+
|
|
5167
5292
|
/***/ }),
|
|
5168
5293
|
|
|
5169
5294
|
/***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/negate.js":
|
|
@@ -13396,12 +13521,23 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13396
13521
|
/* harmony export */ "approximateTextSize": () => (/* binding */ approximateTextSize),
|
|
13397
13522
|
/* harmony export */ "convertLengthToPixels": () => (/* binding */ convertLengthToPixels)
|
|
13398
13523
|
/* harmony export */ });
|
|
13399
|
-
/* harmony import */ var
|
|
13400
|
-
/* harmony import */ var
|
|
13401
|
-
/* harmony import */ var
|
|
13402
|
-
/* harmony import */ var
|
|
13524
|
+
/* 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");
|
|
13525
|
+
/* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_memoize__WEBPACK_IMPORTED_MODULE_0__);
|
|
13526
|
+
/* 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");
|
|
13527
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
13528
|
+
/* 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");
|
|
13529
|
+
/* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_2__);
|
|
13530
|
+
|
|
13531
|
+
|
|
13403
13532
|
|
|
13404
13533
|
|
|
13534
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13535
|
+
|
|
13536
|
+
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."); }
|
|
13537
|
+
|
|
13538
|
+
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; }
|
|
13539
|
+
|
|
13540
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13405
13541
|
|
|
13406
13542
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
13407
13543
|
|
|
@@ -13606,9 +13742,9 @@ var convertLengthToPixels = function (length, fontSize) {
|
|
|
13606
13742
|
var _prepareParams = function (inputStyle, index) {
|
|
13607
13743
|
var lineStyle = Array.isArray(inputStyle) ? inputStyle[index] : inputStyle;
|
|
13608
13744
|
|
|
13609
|
-
var style =
|
|
13745
|
+
var style = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, lineStyle, defaultStyle);
|
|
13610
13746
|
|
|
13611
|
-
return
|
|
13747
|
+
return lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, style, {
|
|
13612
13748
|
fontFamily: style.fontFamily,
|
|
13613
13749
|
letterSpacing: typeof style.letterSpacing === "number" ? style.letterSpacing : convertLengthToPixels(String(style.letterSpacing), style.fontSize),
|
|
13614
13750
|
fontSize: typeof style.fontSize === "number" ? style.fontSize : convertLengthToPixels(String(style.fontSize))
|
|
@@ -13655,21 +13791,99 @@ var _approximateTextHeightInternal = function (text, style) {
|
|
|
13655
13791
|
}, 0);
|
|
13656
13792
|
};
|
|
13657
13793
|
|
|
13794
|
+
var _approximateDimensionsInternal = function (text, style) {
|
|
13795
|
+
var angle = Array.isArray(style) ? style[0] && style[0].angle : style && style.angle;
|
|
13796
|
+
|
|
13797
|
+
var height = _approximateTextHeightInternal(text, style);
|
|
13798
|
+
|
|
13799
|
+
var width = _approximateTextWidthInternal(text, style);
|
|
13800
|
+
|
|
13801
|
+
var widthWithRotate = angle ? _getSizeWithRotate(width, height, angle) : width;
|
|
13802
|
+
var heightWithRotate = angle ? _getSizeWithRotate(height, width, angle) : height;
|
|
13803
|
+
return {
|
|
13804
|
+
width: widthWithRotate,
|
|
13805
|
+
height: heightWithRotate * coefficients.heightOverlapCoef
|
|
13806
|
+
};
|
|
13807
|
+
};
|
|
13808
|
+
|
|
13809
|
+
var _getMeasurementContainer = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function () {
|
|
13810
|
+
var element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
13811
|
+
element.setAttribute("xlink", "http://www.w3.org/1999/xlink");
|
|
13812
|
+
var containerElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
13813
|
+
element.appendChild(containerElement);
|
|
13814
|
+
element.style.position = "fixed";
|
|
13815
|
+
element.style.top = "-9999px";
|
|
13816
|
+
element.style.left = "-9999px";
|
|
13817
|
+
document.body.appendChild(element);
|
|
13818
|
+
return containerElement;
|
|
13819
|
+
});
|
|
13820
|
+
|
|
13821
|
+
var styleToKeyComponent = function (style) {
|
|
13822
|
+
if (!style) {
|
|
13823
|
+
return "null";
|
|
13824
|
+
}
|
|
13825
|
+
|
|
13826
|
+
return "".concat(style.angle, ":").concat(style.fontFamily, ":").concat(style.fontSize, ":").concat(style.letterSpacing, ":").concat(style.lineHeight);
|
|
13827
|
+
};
|
|
13828
|
+
|
|
13829
|
+
var _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function (text, style) {
|
|
13830
|
+
var containerElement = _getMeasurementContainer();
|
|
13831
|
+
|
|
13832
|
+
var lines = _splitToLines(text);
|
|
13833
|
+
|
|
13834
|
+
var heightAcc = 0;
|
|
13835
|
+
|
|
13836
|
+
for (var _ref of lines.entries()) {
|
|
13837
|
+
var _ref2 = _slicedToArray(_ref, 2);
|
|
13838
|
+
|
|
13839
|
+
var i = _ref2[0];
|
|
13840
|
+
var line = _ref2[1];
|
|
13841
|
+
var textElement = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
13842
|
+
|
|
13843
|
+
var params = _prepareParams(style, i);
|
|
13844
|
+
|
|
13845
|
+
textElement.style.fontFamily = params.fontFamily;
|
|
13846
|
+
textElement.style.transform = "rotate(".concat(params.angle, ")");
|
|
13847
|
+
textElement.style.fontSize = "".concat(params.fontSize, "px");
|
|
13848
|
+
textElement.style.lineHeight = params.lineHeight;
|
|
13849
|
+
textElement.style.fontFamily = params.fontFamily;
|
|
13850
|
+
textElement.style.letterSpacing = params.letterSpacing;
|
|
13851
|
+
textElement.textContent = line;
|
|
13852
|
+
textElement.setAttribute("x", "0");
|
|
13853
|
+
textElement.setAttribute("y", "".concat(heightAcc));
|
|
13854
|
+
heightAcc += params.lineHeight * params.fontSize;
|
|
13855
|
+
containerElement.appendChild(textElement);
|
|
13856
|
+
}
|
|
13857
|
+
|
|
13858
|
+
var _containerElement$get = containerElement.getBoundingClientRect(),
|
|
13859
|
+
width = _containerElement$get.width,
|
|
13860
|
+
height = _containerElement$get.height;
|
|
13861
|
+
|
|
13862
|
+
containerElement.innerHTML = "";
|
|
13863
|
+
return {
|
|
13864
|
+
width: width,
|
|
13865
|
+
height: height
|
|
13866
|
+
};
|
|
13867
|
+
}, function (text, style) {
|
|
13868
|
+
var totalText = Array.isArray(text) ? text.join() : text;
|
|
13869
|
+
var totalStyle = Array.isArray(style) ? style.map(styleToKeyComponent).join() : styleToKeyComponent(style);
|
|
13870
|
+
return "".concat(totalText, "::").concat(totalStyle);
|
|
13871
|
+
});
|
|
13872
|
+
|
|
13658
13873
|
// Stubbable implementation.
|
|
13659
13874
|
var _approximateTextSizeInternal = {
|
|
13660
13875
|
impl: function (text, style) {
|
|
13661
|
-
var
|
|
13876
|
+
var __debugForceApproximate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
13662
13877
|
|
|
13663
|
-
|
|
13878
|
+
// Attempt to first measure the element in DOM. If there is no DOM, fallback
|
|
13879
|
+
// to the less accurate approximation algorithm.
|
|
13880
|
+
var isClient = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
13664
13881
|
|
|
13665
|
-
|
|
13882
|
+
if (!isClient || __debugForceApproximate) {
|
|
13883
|
+
return _approximateDimensionsInternal(text, style);
|
|
13884
|
+
}
|
|
13666
13885
|
|
|
13667
|
-
|
|
13668
|
-
var heightWithRotate = angle ? _getSizeWithRotate(height, width, angle) : height;
|
|
13669
|
-
return {
|
|
13670
|
-
width: widthWithRotate,
|
|
13671
|
-
height: heightWithRotate * coefficients.heightOverlapCoef
|
|
13672
|
-
};
|
|
13886
|
+
return _measureDimensionsInternal(text, style);
|
|
13673
13887
|
}
|
|
13674
13888
|
};
|
|
13675
13889
|
/**
|