victory-chart 36.6.11 → 36.7.0
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 +4 -0
- package/dist/victory-chart.js +37 -10
- package/dist/victory-chart.min.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
package/dist/victory-chart.js
CHANGED
|
@@ -8001,6 +8001,14 @@ var getStandaloneOffset = function (props, calculatedValues) {
|
|
|
8001
8001
|
x: offsetX !== null && offsetX !== undefined ? offsetX : x,
|
|
8002
8002
|
y: offsetY !== null && offsetY !== undefined ? offsetY : y
|
|
8003
8003
|
};
|
|
8004
|
+
};
|
|
8005
|
+
|
|
8006
|
+
var isEqual = function (a, b) {
|
|
8007
|
+
if (a instanceof Date && b instanceof Date) {
|
|
8008
|
+
return a.getTime() === b.getTime();
|
|
8009
|
+
}
|
|
8010
|
+
|
|
8011
|
+
return a === b;
|
|
8004
8012
|
}; // eslint-disable-next-line complexity
|
|
8005
8013
|
|
|
8006
8014
|
|
|
@@ -8029,8 +8037,8 @@ var getOffset = function (props, calculatedValues) {
|
|
|
8029
8037
|
y: calculatedOrientation.x === "bottom" ? props.height : 0
|
|
8030
8038
|
};
|
|
8031
8039
|
var originPosition = {
|
|
8032
|
-
x: origin.x
|
|
8033
|
-
y: origin.y
|
|
8040
|
+
x: isEqual(origin.x, domain.x[0]) || isEqual(origin.x, domain.x[1]) ? 0 : scale.x(origin.x),
|
|
8041
|
+
y: isEqual(origin.y, domain.y[0]) || isEqual(origin.y, domain.y[1]) ? 0 : scale.y(origin.y)
|
|
8034
8042
|
};
|
|
8035
8043
|
var x = originPosition.x ? Math.abs(originOffset.x - originPosition.x) : orientationOffset.x;
|
|
8036
8044
|
var y = originPosition.y ? Math.abs(originOffset.y - originPosition.y) : orientationOffset.y;
|
|
@@ -8068,8 +8076,8 @@ var getHorizontalOffset = function (props, calculatedValues) {
|
|
|
8068
8076
|
x: calculatedOrientation.y === "bottom" ? props.height : 0
|
|
8069
8077
|
};
|
|
8070
8078
|
var originPosition = {
|
|
8071
|
-
x: origin.x
|
|
8072
|
-
y: origin.y
|
|
8079
|
+
x: isEqual(origin.x, domain.x[0]) || isEqual(origin.x, domain.x[1]) ? 0 : scale.x(origin.x),
|
|
8080
|
+
y: isEqual(origin.y, domain.y[0]) || isEqual(origin.y, domain.y[1]) ? 0 : scale.y(origin.y)
|
|
8073
8081
|
};
|
|
8074
8082
|
var y = originPosition.x ? Math.abs(originOffset.x - originPosition.x) : orientationOffset.x;
|
|
8075
8083
|
var x = originPosition.y ? Math.abs(originOffset.y - originPosition.y) : orientationOffset.y;
|
|
@@ -8300,7 +8308,8 @@ var getBaseProps = function (props, fallbackProps) {
|
|
|
8300
8308
|
dimension: otherAxis,
|
|
8301
8309
|
range: _defineProperty({}, otherAxis, victory_core__WEBPACK_IMPORTED_MODULE_4__.getRange(props, otherAxis)),
|
|
8302
8310
|
scale: props.scale && props.scale[otherAxis] ? _defineProperty({}, otherAxis, props.scale[otherAxis]) : undefined
|
|
8303
|
-
};
|
|
8311
|
+
}; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
8312
|
+
|
|
8304
8313
|
return ticks.reduce(function (childProps, tickValue, index) {
|
|
8305
8314
|
var _scale$axis, _scale$axis2, _scale$axis3;
|
|
8306
8315
|
|
|
@@ -10808,12 +10817,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10808
10817
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
10809
10818
|
var _excluded = ["desc"];
|
|
10810
10819
|
|
|
10820
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
10821
|
+
|
|
10811
10822
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10812
10823
|
|
|
10813
10824
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10814
10825
|
|
|
10815
10826
|
|
|
10816
|
-
|
|
10827
|
+
// eslint-disable-next-line prefer-arrow-callback
|
|
10828
|
+
var Path = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function Path(props, ref) {
|
|
10817
10829
|
// eslint-disable-next-line react/prop-types
|
|
10818
10830
|
var desc = props.desc,
|
|
10819
10831
|
rest = _objectWithoutProperties(props, _excluded);
|
|
@@ -10821,11 +10833,15 @@ var Path = function (props) {
|
|
|
10821
10833
|
return desc ?
|
|
10822
10834
|
/*#__PURE__*/
|
|
10823
10835
|
// @ts-expect-error FIXME: "id cannot be a number"
|
|
10824
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path",
|
|
10836
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", _extends({}, rest, {
|
|
10837
|
+
ref: ref
|
|
10838
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("desc", null, desc)) :
|
|
10825
10839
|
/*#__PURE__*/
|
|
10826
10840
|
// @ts-expect-error FIXME: "id cannot be a number"
|
|
10827
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", rest
|
|
10828
|
-
|
|
10841
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", _extends({}, rest, {
|
|
10842
|
+
ref: ref
|
|
10843
|
+
}));
|
|
10844
|
+
});
|
|
10829
10845
|
|
|
10830
10846
|
/***/ }),
|
|
10831
10847
|
|
|
@@ -12519,6 +12535,11 @@ function getStringTicks(props) {
|
|
|
12519
12535
|
function getTickArray(props) {
|
|
12520
12536
|
var tickValues = props.tickValues,
|
|
12521
12537
|
tickFormat = props.tickFormat;
|
|
12538
|
+
|
|
12539
|
+
if ((tickValues === null || tickValues === void 0 ? void 0 : tickValues.length) === 0) {
|
|
12540
|
+
return [];
|
|
12541
|
+
}
|
|
12542
|
+
|
|
12522
12543
|
var axis = getAxis(props);
|
|
12523
12544
|
var stringMap = props.stringMap && props.stringMap[axis];
|
|
12524
12545
|
|
|
@@ -12633,6 +12654,11 @@ function getTicks(props, scale) {
|
|
|
12633
12654
|
var filterZero = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
12634
12655
|
var tickCount = props.tickCount;
|
|
12635
12656
|
var tickArray = getTickArray(props);
|
|
12657
|
+
|
|
12658
|
+
if ((tickArray === null || tickArray === void 0 ? void 0 : tickArray.length) === 0) {
|
|
12659
|
+
return [""];
|
|
12660
|
+
}
|
|
12661
|
+
|
|
12636
12662
|
var tickValues = tickArray ? tickArray.map(function (v) {
|
|
12637
12663
|
return v.value;
|
|
12638
12664
|
}) : undefined;
|
|
@@ -12671,7 +12697,7 @@ function getDomainFromData(props, axis) {
|
|
|
12671
12697
|
_props$endAngle = props.endAngle,
|
|
12672
12698
|
endAngle = _props$endAngle === void 0 ? 360 : _props$endAngle;
|
|
12673
12699
|
var tickArray = getTickArray(props);
|
|
12674
|
-
var tickValues = tickArray ? tickArray.map(function (v) {
|
|
12700
|
+
var tickValues = tickArray && (tickArray === null || tickArray === void 0 ? void 0 : tickArray.length) !== 0 ? tickArray.map(function (v) {
|
|
12675
12701
|
return v.value;
|
|
12676
12702
|
}) : undefined;
|
|
12677
12703
|
|
|
@@ -16191,6 +16217,7 @@ var _getMeasurementContainer = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___defau
|
|
|
16191
16217
|
element.setAttribute("width", "300");
|
|
16192
16218
|
element.setAttribute("height", "300");
|
|
16193
16219
|
element.setAttribute("viewBox", "0 0 300 300");
|
|
16220
|
+
element.setAttribute("aria-hidden", "true");
|
|
16194
16221
|
var containerElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
16195
16222
|
element.appendChild(containerElement);
|
|
16196
16223
|
element.style.position = "fixed";
|