victory-box-plot 36.6.8 → 36.6.11

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,19 @@
1
1
  # victory-box-plot
2
2
 
3
+ ## 36.6.11
4
+
5
+ ## 36.6.10
6
+
7
+ ### Patch Changes
8
+
9
+ - Setup NPM Provenance ([#2590](https://github.com/FormidableLabs/victory/pull/2590))
10
+
11
+ ## 36.6.9
12
+
13
+ ### Patch Changes
14
+
15
+ - Setup NPM Provenance ([#2587](https://github.com/FormidableLabs/victory/pull/2587))
16
+
3
17
  ## 36.6.8
4
18
 
5
19
  ### Patch Changes
@@ -890,6 +890,48 @@ VictoryBoxPlotBase.getBaseProps = function (props) {
890
890
  VictoryBoxPlotBase.expectedComponents = ["maxComponent", "maxLabelComponent", "medianComponent", "medianLabelComponent", "minComponent", "minLabelComponent", "q1Component", "q1LabelComponent", "q3Component", "q3LabelComponent", "groupComponent", "containerComponent"];
891
891
  var VictoryBoxPlot = (0,victory_core__WEBPACK_IMPORTED_MODULE_16__.addEvents)(VictoryBoxPlotBase, options);
892
892
 
893
+ /***/ }),
894
+
895
+ /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js":
896
+ /*!***********************************************************************************!*\
897
+ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js ***!
898
+ \***********************************************************************************/
899
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
900
+
901
+ var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheClear.js"),
902
+ listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js"),
903
+ listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheGet.js"),
904
+ listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheHas.js"),
905
+ listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheSet.js");
906
+
907
+ /**
908
+ * Creates an list cache object.
909
+ *
910
+ * @private
911
+ * @constructor
912
+ * @param {Array} [entries] The key-value pairs to cache.
913
+ */
914
+ function ListCache(entries) {
915
+ var index = -1,
916
+ length = entries == null ? 0 : entries.length;
917
+
918
+ this.clear();
919
+ while (++index < length) {
920
+ var entry = entries[index];
921
+ this.set(entry[0], entry[1]);
922
+ }
923
+ }
924
+
925
+ // Add methods to `ListCache`.
926
+ ListCache.prototype.clear = listCacheClear;
927
+ ListCache.prototype['delete'] = listCacheDelete;
928
+ ListCache.prototype.get = listCacheGet;
929
+ ListCache.prototype.has = listCacheHas;
930
+ ListCache.prototype.set = listCacheSet;
931
+
932
+ module.exports = ListCache;
933
+
934
+
893
935
  /***/ }),
894
936
 
895
937
  /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_SetCache.js":
@@ -5708,6 +5750,89 @@ function last(array) {
5708
5750
  module.exports = last;
5709
5751
 
5710
5752
 
5753
+ /***/ }),
5754
+
5755
+ /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js":
5756
+ /*!*********************************************************************************!*\
5757
+ !*** ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js ***!
5758
+ \*********************************************************************************/
5759
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5760
+
5761
+ var MapCache = __webpack_require__(/*! ./_MapCache */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js");
5762
+
5763
+ /** Error message constants. */
5764
+ var FUNC_ERROR_TEXT = 'Expected a function';
5765
+
5766
+ /**
5767
+ * Creates a function that memoizes the result of `func`. If `resolver` is
5768
+ * provided, it determines the cache key for storing the result based on the
5769
+ * arguments provided to the memoized function. By default, the first argument
5770
+ * provided to the memoized function is used as the map cache key. The `func`
5771
+ * is invoked with the `this` binding of the memoized function.
5772
+ *
5773
+ * **Note:** The cache is exposed as the `cache` property on the memoized
5774
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
5775
+ * constructor with one whose instances implement the
5776
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
5777
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
5778
+ *
5779
+ * @static
5780
+ * @memberOf _
5781
+ * @since 0.1.0
5782
+ * @category Function
5783
+ * @param {Function} func The function to have its output memoized.
5784
+ * @param {Function} [resolver] The function to resolve the cache key.
5785
+ * @returns {Function} Returns the new memoized function.
5786
+ * @example
5787
+ *
5788
+ * var object = { 'a': 1, 'b': 2 };
5789
+ * var other = { 'c': 3, 'd': 4 };
5790
+ *
5791
+ * var values = _.memoize(_.values);
5792
+ * values(object);
5793
+ * // => [1, 2]
5794
+ *
5795
+ * values(other);
5796
+ * // => [3, 4]
5797
+ *
5798
+ * object.a = 2;
5799
+ * values(object);
5800
+ * // => [1, 2]
5801
+ *
5802
+ * // Modify the result cache.
5803
+ * values.cache.set(object, ['a', 'b']);
5804
+ * values(object);
5805
+ * // => ['a', 'b']
5806
+ *
5807
+ * // Replace `_.memoize.Cache`.
5808
+ * _.memoize.Cache = WeakMap;
5809
+ */
5810
+ function memoize(func, resolver) {
5811
+ if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
5812
+ throw new TypeError(FUNC_ERROR_TEXT);
5813
+ }
5814
+ var memoized = function() {
5815
+ var args = arguments,
5816
+ key = resolver ? resolver.apply(this, args) : args[0],
5817
+ cache = memoized.cache;
5818
+
5819
+ if (cache.has(key)) {
5820
+ return cache.get(key);
5821
+ }
5822
+ var result = func.apply(this, args);
5823
+ memoized.cache = cache.set(key, result) || cache;
5824
+ return result;
5825
+ };
5826
+ memoized.cache = new (memoize.Cache || MapCache);
5827
+ return memoized;
5828
+ }
5829
+
5830
+ // Expose `MapCache`.
5831
+ memoize.Cache = MapCache;
5832
+
5833
+ module.exports = memoize;
5834
+
5835
+
5711
5836
  /***/ }),
5712
5837
 
5713
5838
  /***/ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/negate.js":
@@ -14244,13 +14369,24 @@ __webpack_require__.r(__webpack_exports__);
14244
14369
  /* harmony export */ "approximateTextSize": () => (/* binding */ approximateTextSize),
14245
14370
  /* harmony export */ "convertLengthToPixels": () => (/* binding */ convertLengthToPixels)
14246
14371
  /* harmony export */ });
14247
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
14248
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
14249
- /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/assign */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/assign.js");
14250
- /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_1__);
14372
+ /* 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");
14373
+ /* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_memoize__WEBPACK_IMPORTED_MODULE_0__);
14374
+ /* 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");
14375
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
14376
+ /* 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");
14377
+ /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_2__);
14378
+
14251
14379
 
14252
14380
 
14253
14381
 
14382
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14383
+
14384
+ 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."); }
14385
+
14386
+ 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; }
14387
+
14388
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14389
+
14254
14390
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
14255
14391
 
14256
14392
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -14454,9 +14590,9 @@ var convertLengthToPixels = function (length, fontSize) {
14454
14590
  var _prepareParams = function (inputStyle, index) {
14455
14591
  var lineStyle = Array.isArray(inputStyle) ? inputStyle[index] : inputStyle;
14456
14592
 
14457
- var style = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, lineStyle, defaultStyle);
14593
+ var style = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, lineStyle, defaultStyle);
14458
14594
 
14459
- return lodash_assign__WEBPACK_IMPORTED_MODULE_1___default()({}, style, {
14595
+ return lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, style, {
14460
14596
  fontFamily: style.fontFamily,
14461
14597
  letterSpacing: typeof style.letterSpacing === "number" ? style.letterSpacing : convertLengthToPixels(String(style.letterSpacing), style.fontSize),
14462
14598
  fontSize: typeof style.fontSize === "number" ? style.fontSize : convertLengthToPixels(String(style.fontSize))
@@ -14503,21 +14639,100 @@ var _approximateTextHeightInternal = function (text, style) {
14503
14639
  }, 0);
14504
14640
  };
14505
14641
 
14642
+ var _approximateDimensionsInternal = function (text, style) {
14643
+ var angle = Array.isArray(style) ? style[0] && style[0].angle : style && style.angle;
14644
+
14645
+ var height = _approximateTextHeightInternal(text, style);
14646
+
14647
+ var width = _approximateTextWidthInternal(text, style);
14648
+
14649
+ var widthWithRotate = angle ? _getSizeWithRotate(width, height, angle) : width;
14650
+ var heightWithRotate = angle ? _getSizeWithRotate(height, width, angle) : height;
14651
+ return {
14652
+ width: widthWithRotate,
14653
+ height: heightWithRotate * coefficients.heightOverlapCoef
14654
+ };
14655
+ };
14656
+
14657
+ var _getMeasurementContainer = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function () {
14658
+ var element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
14659
+ element.setAttribute("xlink", "http://www.w3.org/1999/xlink");
14660
+ element.setAttribute("width", "300");
14661
+ element.setAttribute("height", "300");
14662
+ element.setAttribute("viewBox", "0 0 300 300");
14663
+ var containerElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
14664
+ element.appendChild(containerElement);
14665
+ element.style.position = "fixed";
14666
+ element.style.top = "-9999px";
14667
+ element.style.left = "-9999px";
14668
+ document.body.appendChild(element);
14669
+ return containerElement;
14670
+ });
14671
+
14672
+ var styleToKeyComponent = function (style) {
14673
+ if (!style) {
14674
+ return "null";
14675
+ }
14676
+
14677
+ return "".concat(style.angle, ":").concat(style.fontFamily, ":").concat(style.fontSize, ":").concat(style.letterSpacing, ":").concat(style.lineHeight);
14678
+ };
14679
+
14680
+ var _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function (text, style) {
14681
+ var containerElement = _getMeasurementContainer();
14682
+
14683
+ var lines = _splitToLines(text);
14684
+
14685
+ var heightAcc = 0;
14686
+
14687
+ for (var _ref of lines.entries()) {
14688
+ var _ref2 = _slicedToArray(_ref, 2);
14689
+
14690
+ var i = _ref2[0];
14691
+ var line = _ref2[1];
14692
+ var textElement = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
14693
+
14694
+ var params = _prepareParams(style, i);
14695
+
14696
+ textElement.style.fontFamily = params.fontFamily;
14697
+ textElement.style.fontSize = "".concat(params.fontSize, "px");
14698
+ textElement.style.lineHeight = params.lineHeight;
14699
+ textElement.style.fontFamily = params.fontFamily;
14700
+ textElement.style.letterSpacing = params.letterSpacing;
14701
+ textElement.textContent = line;
14702
+ textElement.setAttribute("x", "0");
14703
+ textElement.setAttribute("y", "".concat(heightAcc));
14704
+ containerElement.appendChild(textElement);
14705
+ heightAcc += params.lineHeight * textElement.getBoundingClientRect().height;
14706
+ }
14707
+
14708
+ var _containerElement$get = containerElement.getBoundingClientRect(),
14709
+ width = _containerElement$get.width;
14710
+
14711
+ containerElement.innerHTML = "";
14712
+ return {
14713
+ width: style !== null && style !== void 0 && style.angle ? _getSizeWithRotate(width, heightAcc, style === null || style === void 0 ? void 0 : style.angle) : width,
14714
+ height: style !== null && style !== void 0 && style.angle ? _getSizeWithRotate(heightAcc, width, style === null || style === void 0 ? void 0 : style.angle) : heightAcc
14715
+ };
14716
+ }, function (text, style) {
14717
+ var totalText = Array.isArray(text) ? text.join() : text;
14718
+ var totalStyle = Array.isArray(style) ? style.map(styleToKeyComponent).join() : styleToKeyComponent(style);
14719
+ return "".concat(totalText, "::").concat(totalStyle);
14720
+ });
14721
+
14506
14722
  // Stubbable implementation.
14507
14723
  var _approximateTextSizeInternal = {
14508
14724
  impl: function (text, style) {
14509
- var angle = Array.isArray(style) ? style[0] && style[0].angle : style && style.angle;
14725
+ var __debugForceApproximate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
14510
14726
 
14511
- var height = _approximateTextHeightInternal(text, style);
14727
+ // Attempt to first measure the element in DOM. If there is no DOM, fallback
14728
+ // to the less accurate approximation algorithm.
14729
+ var isClient = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
14512
14730
 
14513
- var width = _approximateTextWidthInternal(text, style);
14731
+ if (!isClient || __debugForceApproximate) {
14732
+ return _approximateDimensionsInternal(text, style);
14733
+ }
14514
14734
 
14515
- var widthWithRotate = angle ? _getSizeWithRotate(width, height, angle) : width;
14516
- var heightWithRotate = angle ? _getSizeWithRotate(height, width, angle) : height;
14517
- return {
14518
- width: widthWithRotate,
14519
- height: heightWithRotate * coefficients.heightOverlapCoef
14520
- };
14735
+ return _measureDimensionsInternal(text, style);
14521
14736
  }
14522
14737
  };
14523
14738
  /**