victory 36.6.10 → 36.6.12
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 +8 -0
- package/dist/victory.js +8 -6
- package/dist/victory.min.js +1 -1
- package/package.json +28 -28
package/CHANGELOG.md
CHANGED
package/dist/victory.js
CHANGED
|
@@ -26510,6 +26510,10 @@ var _approximateDimensionsInternal = function (text, style) {
|
|
|
26510
26510
|
var _getMeasurementContainer = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function () {
|
|
26511
26511
|
var element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
26512
26512
|
element.setAttribute("xlink", "http://www.w3.org/1999/xlink");
|
|
26513
|
+
element.setAttribute("width", "300");
|
|
26514
|
+
element.setAttribute("height", "300");
|
|
26515
|
+
element.setAttribute("viewBox", "0 0 300 300");
|
|
26516
|
+
element.setAttribute("aria-hidden", "true");
|
|
26513
26517
|
var containerElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
26514
26518
|
element.appendChild(containerElement);
|
|
26515
26519
|
element.style.position = "fixed";
|
|
@@ -26544,7 +26548,6 @@ var _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___def
|
|
|
26544
26548
|
var params = _prepareParams(style, i);
|
|
26545
26549
|
|
|
26546
26550
|
textElement.style.fontFamily = params.fontFamily;
|
|
26547
|
-
textElement.style.transform = "rotate(".concat(params.angle, ")");
|
|
26548
26551
|
textElement.style.fontSize = "".concat(params.fontSize, "px");
|
|
26549
26552
|
textElement.style.lineHeight = params.lineHeight;
|
|
26550
26553
|
textElement.style.fontFamily = params.fontFamily;
|
|
@@ -26552,18 +26555,17 @@ var _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___def
|
|
|
26552
26555
|
textElement.textContent = line;
|
|
26553
26556
|
textElement.setAttribute("x", "0");
|
|
26554
26557
|
textElement.setAttribute("y", "".concat(heightAcc));
|
|
26555
|
-
heightAcc += params.lineHeight * params.fontSize;
|
|
26556
26558
|
containerElement.appendChild(textElement);
|
|
26559
|
+
heightAcc += params.lineHeight * textElement.getBoundingClientRect().height;
|
|
26557
26560
|
}
|
|
26558
26561
|
|
|
26559
26562
|
var _containerElement$get = containerElement.getBoundingClientRect(),
|
|
26560
|
-
width = _containerElement$get.width
|
|
26561
|
-
height = _containerElement$get.height;
|
|
26563
|
+
width = _containerElement$get.width;
|
|
26562
26564
|
|
|
26563
26565
|
containerElement.innerHTML = "";
|
|
26564
26566
|
return {
|
|
26565
|
-
width: width,
|
|
26566
|
-
height:
|
|
26567
|
+
width: style !== null && style !== void 0 && style.angle ? _getSizeWithRotate(width, heightAcc, style === null || style === void 0 ? void 0 : style.angle) : width,
|
|
26568
|
+
height: style !== null && style !== void 0 && style.angle ? _getSizeWithRotate(heightAcc, width, style === null || style === void 0 ? void 0 : style.angle) : heightAcc
|
|
26567
26569
|
};
|
|
26568
26570
|
}, function (text, style) {
|
|
26569
26571
|
var totalText = Array.isArray(text) ? text.join() : text;
|