victory-box-plot 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-box-plot.js +229 -15
- package/dist/victory-box-plot.min.js +1 -1
- package/package.json +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# victory-box-plot
|
|
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-box-plot.js
CHANGED
|
@@ -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,12 +14369,23 @@ __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
|
|
14248
|
-
/* harmony import */ var
|
|
14249
|
-
/* harmony import */ var
|
|
14250
|
-
/* harmony import */ var
|
|
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
|
+
|
|
14379
|
+
|
|
14251
14380
|
|
|
14252
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; }
|
|
14253
14389
|
|
|
14254
14390
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
14255
14391
|
|
|
@@ -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 =
|
|
14593
|
+
var style = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, lineStyle, defaultStyle);
|
|
14458
14594
|
|
|
14459
|
-
return
|
|
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,99 @@ 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
|
+
var containerElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
14661
|
+
element.appendChild(containerElement);
|
|
14662
|
+
element.style.position = "fixed";
|
|
14663
|
+
element.style.top = "-9999px";
|
|
14664
|
+
element.style.left = "-9999px";
|
|
14665
|
+
document.body.appendChild(element);
|
|
14666
|
+
return containerElement;
|
|
14667
|
+
});
|
|
14668
|
+
|
|
14669
|
+
var styleToKeyComponent = function (style) {
|
|
14670
|
+
if (!style) {
|
|
14671
|
+
return "null";
|
|
14672
|
+
}
|
|
14673
|
+
|
|
14674
|
+
return "".concat(style.angle, ":").concat(style.fontFamily, ":").concat(style.fontSize, ":").concat(style.letterSpacing, ":").concat(style.lineHeight);
|
|
14675
|
+
};
|
|
14676
|
+
|
|
14677
|
+
var _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function (text, style) {
|
|
14678
|
+
var containerElement = _getMeasurementContainer();
|
|
14679
|
+
|
|
14680
|
+
var lines = _splitToLines(text);
|
|
14681
|
+
|
|
14682
|
+
var heightAcc = 0;
|
|
14683
|
+
|
|
14684
|
+
for (var _ref of lines.entries()) {
|
|
14685
|
+
var _ref2 = _slicedToArray(_ref, 2);
|
|
14686
|
+
|
|
14687
|
+
var i = _ref2[0];
|
|
14688
|
+
var line = _ref2[1];
|
|
14689
|
+
var textElement = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
14690
|
+
|
|
14691
|
+
var params = _prepareParams(style, i);
|
|
14692
|
+
|
|
14693
|
+
textElement.style.fontFamily = params.fontFamily;
|
|
14694
|
+
textElement.style.transform = "rotate(".concat(params.angle, ")");
|
|
14695
|
+
textElement.style.fontSize = "".concat(params.fontSize, "px");
|
|
14696
|
+
textElement.style.lineHeight = params.lineHeight;
|
|
14697
|
+
textElement.style.fontFamily = params.fontFamily;
|
|
14698
|
+
textElement.style.letterSpacing = params.letterSpacing;
|
|
14699
|
+
textElement.textContent = line;
|
|
14700
|
+
textElement.setAttribute("x", "0");
|
|
14701
|
+
textElement.setAttribute("y", "".concat(heightAcc));
|
|
14702
|
+
heightAcc += params.lineHeight * params.fontSize;
|
|
14703
|
+
containerElement.appendChild(textElement);
|
|
14704
|
+
}
|
|
14705
|
+
|
|
14706
|
+
var _containerElement$get = containerElement.getBoundingClientRect(),
|
|
14707
|
+
width = _containerElement$get.width,
|
|
14708
|
+
height = _containerElement$get.height;
|
|
14709
|
+
|
|
14710
|
+
containerElement.innerHTML = "";
|
|
14711
|
+
return {
|
|
14712
|
+
width: width,
|
|
14713
|
+
height: height
|
|
14714
|
+
};
|
|
14715
|
+
}, function (text, style) {
|
|
14716
|
+
var totalText = Array.isArray(text) ? text.join() : text;
|
|
14717
|
+
var totalStyle = Array.isArray(style) ? style.map(styleToKeyComponent).join() : styleToKeyComponent(style);
|
|
14718
|
+
return "".concat(totalText, "::").concat(totalStyle);
|
|
14719
|
+
});
|
|
14720
|
+
|
|
14506
14721
|
// Stubbable implementation.
|
|
14507
14722
|
var _approximateTextSizeInternal = {
|
|
14508
14723
|
impl: function (text, style) {
|
|
14509
|
-
var
|
|
14724
|
+
var __debugForceApproximate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
14510
14725
|
|
|
14511
|
-
|
|
14726
|
+
// Attempt to first measure the element in DOM. If there is no DOM, fallback
|
|
14727
|
+
// to the less accurate approximation algorithm.
|
|
14728
|
+
var isClient = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
14512
14729
|
|
|
14513
|
-
|
|
14730
|
+
if (!isClient || __debugForceApproximate) {
|
|
14731
|
+
return _approximateDimensionsInternal(text, style);
|
|
14732
|
+
}
|
|
14514
14733
|
|
|
14515
|
-
|
|
14516
|
-
var heightWithRotate = angle ? _getSizeWithRotate(height, width, angle) : height;
|
|
14517
|
-
return {
|
|
14518
|
-
width: widthWithRotate,
|
|
14519
|
-
height: heightWithRotate * coefficients.heightOverlapCoef
|
|
14520
|
-
};
|
|
14734
|
+
return _measureDimensionsInternal(text, style);
|
|
14521
14735
|
}
|
|
14522
14736
|
};
|
|
14523
14737
|
/**
|