victory-chart 37.0.1-next.2 → 37.0.2
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 -6
- package/dist/victory-chart.js +52 -58
- package/dist/victory-chart.min.js +1 -1
- package/es/helper-methods.d.ts +40 -40
- package/es/index.d.ts +1 -1
- package/es/victory-chart.d.ts +26 -26
- package/es/victory-chart.js +1 -4
- package/lib/helper-methods.d.ts +40 -40
- package/lib/index.d.ts +1 -1
- package/lib/victory-chart.d.ts +26 -26
- package/lib/victory-chart.js +1 -4
- package/package.json +8 -5
- package/src/victory-chart.tsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
# victory-chart
|
|
2
2
|
|
|
3
|
-
## 37.0.
|
|
3
|
+
## 37.0.2
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- victory-core@37.0.1-next.2
|
|
11
|
-
- victory-shared-events@37.0.1-next.2
|
|
7
|
+
- Ensure undefined props do not overwrite defaults ([#2852](https://github.com/FormidableLabs/victory/pull/2852))
|
|
8
|
+
|
|
9
|
+
## 37.0.1
|
|
12
10
|
|
|
13
11
|
## 37.0.0
|
|
14
12
|
|
package/dist/victory-chart.js
CHANGED
|
@@ -301,10 +301,7 @@ const defaultProps = {
|
|
|
301
301
|
theme: victory_core__WEBPACK_IMPORTED_MODULE_8__.VictoryTheme.grayscale
|
|
302
302
|
};
|
|
303
303
|
const VictoryChartImpl = initialProps => {
|
|
304
|
-
const propsWithDefaults = react__WEBPACK_IMPORTED_MODULE_2___default().useMemo(() => ({
|
|
305
|
-
...defaultProps,
|
|
306
|
-
...initialProps
|
|
307
|
-
}), [initialProps]);
|
|
304
|
+
const propsWithDefaults = react__WEBPACK_IMPORTED_MODULE_2___default().useMemo(() => lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, initialProps, defaultProps), [initialProps]);
|
|
308
305
|
const role = "chart";
|
|
309
306
|
const {
|
|
310
307
|
getAnimationProps,
|
|
@@ -6990,10 +6987,7 @@ const defaultProps = {
|
|
|
6990
6987
|
lineHeight: 1
|
|
6991
6988
|
};
|
|
6992
6989
|
const VictoryLabel = initialProps => {
|
|
6993
|
-
const props = evaluateProps({
|
|
6994
|
-
...defaultProps,
|
|
6995
|
-
...initialProps
|
|
6996
|
-
});
|
|
6990
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, initialProps, defaultProps));
|
|
6997
6991
|
if (props.text === null || props.text === undefined) {
|
|
6998
6992
|
return null;
|
|
6999
6993
|
}
|
|
@@ -7197,10 +7191,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7197
7191
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7198
7192
|
/* harmony export */ "Arc": function() { return /* binding */ Arc; }
|
|
7199
7193
|
/* harmony export */ });
|
|
7200
|
-
/* harmony import */ var
|
|
7201
|
-
/* harmony import */ var
|
|
7202
|
-
/* harmony import */ var
|
|
7203
|
-
/* harmony import */ var
|
|
7194
|
+
/* 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");
|
|
7195
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
7196
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
7197
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
7198
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
7199
|
+
/* harmony import */ var _path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./path */ "../../victory-core/es/victory-primitives/path.js");
|
|
7200
|
+
|
|
7204
7201
|
/* eslint no-magic-numbers: ["error", { "ignore": [0, 1, 2, 180] }]*/
|
|
7205
7202
|
|
|
7206
7203
|
|
|
@@ -7216,12 +7213,12 @@ const getArcPath = props => {
|
|
|
7216
7213
|
} = props;
|
|
7217
7214
|
// Always draw the path as two arcs so that complete circles may be rendered.
|
|
7218
7215
|
const halfAngle = Math.abs(endAngle - startAngle) / 2 + startAngle;
|
|
7219
|
-
const x1 = cx + r * Math.cos(
|
|
7220
|
-
const y1 = cy - r * Math.sin(
|
|
7221
|
-
const x2 = cx + r * Math.cos(
|
|
7222
|
-
const y2 = cy - r * Math.sin(
|
|
7223
|
-
const x3 = cx + r * Math.cos(
|
|
7224
|
-
const y3 = cy - r * Math.sin(
|
|
7216
|
+
const x1 = cx + r * Math.cos(_victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.degreesToRadians(startAngle));
|
|
7217
|
+
const y1 = cy - r * Math.sin(_victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.degreesToRadians(startAngle));
|
|
7218
|
+
const x2 = cx + r * Math.cos(_victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.degreesToRadians(halfAngle));
|
|
7219
|
+
const y2 = cy - r * Math.sin(_victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.degreesToRadians(halfAngle));
|
|
7220
|
+
const x3 = cx + r * Math.cos(_victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.degreesToRadians(endAngle));
|
|
7221
|
+
const y3 = cy - r * Math.sin(_victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.degreesToRadians(endAngle));
|
|
7225
7222
|
const largerArcFlag1 = halfAngle - startAngle <= 180 ? 0 : 1;
|
|
7226
7223
|
const largerArcFlag2 = endAngle - halfAngle <= 180 ? 0 : 1;
|
|
7227
7224
|
const arcStart = closedPath ? ` M ${cx}, ${cy} L ${x1}, ${y1}` : `M ${x1}, ${y1}`;
|
|
@@ -7239,14 +7236,14 @@ const evaluateProps = props => {
|
|
|
7239
7236
|
* `style`
|
|
7240
7237
|
* `tabIndex`
|
|
7241
7238
|
*/
|
|
7242
|
-
const ariaLabel =
|
|
7243
|
-
const desc =
|
|
7244
|
-
const id =
|
|
7245
|
-
const style =
|
|
7239
|
+
const ariaLabel = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.ariaLabel, props);
|
|
7240
|
+
const desc = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.desc, props);
|
|
7241
|
+
const id = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.id, props);
|
|
7242
|
+
const style = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateStyle(Object.assign({
|
|
7246
7243
|
stroke: "black",
|
|
7247
7244
|
fill: "none"
|
|
7248
7245
|
}, props.style), props);
|
|
7249
|
-
const tabIndex =
|
|
7246
|
+
const tabIndex = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.tabIndex, props);
|
|
7250
7247
|
return Object.assign({}, props, {
|
|
7251
7248
|
ariaLabel,
|
|
7252
7249
|
desc,
|
|
@@ -7256,16 +7253,13 @@ const evaluateProps = props => {
|
|
|
7256
7253
|
});
|
|
7257
7254
|
};
|
|
7258
7255
|
const defaultProps = {
|
|
7259
|
-
pathComponent: /*#__PURE__*/
|
|
7256
|
+
pathComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_path__WEBPACK_IMPORTED_MODULE_3__.Path, null),
|
|
7260
7257
|
role: "presentation",
|
|
7261
7258
|
shapeRendering: "auto"
|
|
7262
7259
|
};
|
|
7263
7260
|
const Arc = initialProps => {
|
|
7264
|
-
const props = evaluateProps({
|
|
7265
|
-
|
|
7266
|
-
...initialProps
|
|
7267
|
-
});
|
|
7268
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.pathComponent, {
|
|
7261
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, initialProps, defaultProps));
|
|
7262
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.pathComponent, {
|
|
7269
7263
|
...props.events,
|
|
7270
7264
|
"aria-label": props.ariaLabel,
|
|
7271
7265
|
d: getArcPath(props),
|
|
@@ -7293,11 +7287,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7293
7287
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7294
7288
|
/* harmony export */ "Background": function() { return /* binding */ Background; }
|
|
7295
7289
|
/* harmony export */ });
|
|
7296
|
-
/* harmony import */ var
|
|
7297
|
-
/* harmony import */ var
|
|
7298
|
-
/* harmony import */ var
|
|
7299
|
-
/* harmony import */ var
|
|
7300
|
-
/* harmony import */ var
|
|
7290
|
+
/* 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");
|
|
7291
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
7292
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
7293
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
7294
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
7295
|
+
/* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./rect */ "../../victory-core/es/victory-primitives/rect.js");
|
|
7296
|
+
/* harmony import */ var _circle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./circle */ "../../victory-core/es/victory-primitives/circle.js");
|
|
7297
|
+
|
|
7301
7298
|
|
|
7302
7299
|
|
|
7303
7300
|
|
|
@@ -7307,23 +7304,20 @@ const evaluateProps = props => {
|
|
|
7307
7304
|
* Potential evaluated prop is:
|
|
7308
7305
|
* `id`
|
|
7309
7306
|
*/
|
|
7310
|
-
const id =
|
|
7307
|
+
const id = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.id, props);
|
|
7311
7308
|
return Object.assign({}, props, {
|
|
7312
7309
|
id
|
|
7313
7310
|
});
|
|
7314
7311
|
};
|
|
7315
7312
|
const defaultProps = {
|
|
7316
|
-
circleComponent: /*#__PURE__*/
|
|
7317
|
-
rectComponent: /*#__PURE__*/
|
|
7313
|
+
circleComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_circle__WEBPACK_IMPORTED_MODULE_3__.Circle, null),
|
|
7314
|
+
rectComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_rect__WEBPACK_IMPORTED_MODULE_4__.Rect, null),
|
|
7318
7315
|
role: "presentation",
|
|
7319
7316
|
shapeRendering: "auto"
|
|
7320
7317
|
};
|
|
7321
7318
|
const Background = initialProps => {
|
|
7322
|
-
const props = evaluateProps({
|
|
7323
|
-
|
|
7324
|
-
...initialProps
|
|
7325
|
-
});
|
|
7326
|
-
return props.polar ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.circleComponent, {
|
|
7319
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, initialProps, defaultProps));
|
|
7320
|
+
return props.polar ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.circleComponent, {
|
|
7327
7321
|
...props.events,
|
|
7328
7322
|
style: props.style,
|
|
7329
7323
|
role: props.role,
|
|
@@ -7332,7 +7326,7 @@ const Background = initialProps => {
|
|
|
7332
7326
|
cy: props.y,
|
|
7333
7327
|
r: props.height,
|
|
7334
7328
|
className: props.className
|
|
7335
|
-
}) : /*#__PURE__*/
|
|
7329
|
+
}) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.rectComponent, {
|
|
7336
7330
|
...props.events,
|
|
7337
7331
|
style: props.style,
|
|
7338
7332
|
role: props.role,
|
|
@@ -7403,10 +7397,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7403
7397
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7404
7398
|
/* harmony export */ "LineSegment": function() { return /* binding */ LineSegment; }
|
|
7405
7399
|
/* harmony export */ });
|
|
7406
|
-
/* harmony import */ var
|
|
7407
|
-
/* harmony import */ var
|
|
7408
|
-
/* harmony import */ var
|
|
7409
|
-
/* harmony import */ var
|
|
7400
|
+
/* 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");
|
|
7401
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
7402
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
7403
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
7404
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
7405
|
+
/* harmony import */ var _line__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./line */ "../../victory-core/es/victory-primitives/line.js");
|
|
7406
|
+
|
|
7410
7407
|
|
|
7411
7408
|
|
|
7412
7409
|
|
|
@@ -7419,13 +7416,13 @@ const evaluateProps = props => {
|
|
|
7419
7416
|
* `style`
|
|
7420
7417
|
* `tabIndex`
|
|
7421
7418
|
*/
|
|
7422
|
-
const ariaLabel =
|
|
7423
|
-
const desc =
|
|
7424
|
-
const id =
|
|
7425
|
-
const style =
|
|
7419
|
+
const ariaLabel = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.ariaLabel, props);
|
|
7420
|
+
const desc = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.desc, props);
|
|
7421
|
+
const id = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.id, props);
|
|
7422
|
+
const style = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateStyle(Object.assign({
|
|
7426
7423
|
stroke: "black"
|
|
7427
7424
|
}, props.style), props);
|
|
7428
|
-
const tabIndex =
|
|
7425
|
+
const tabIndex = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__.evaluateProp(props.tabIndex, props);
|
|
7429
7426
|
return Object.assign({}, props, {
|
|
7430
7427
|
ariaLabel,
|
|
7431
7428
|
desc,
|
|
@@ -7435,16 +7432,13 @@ const evaluateProps = props => {
|
|
|
7435
7432
|
});
|
|
7436
7433
|
};
|
|
7437
7434
|
const defaultProps = {
|
|
7438
|
-
lineComponent: /*#__PURE__*/
|
|
7435
|
+
lineComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_line__WEBPACK_IMPORTED_MODULE_3__.Line, null),
|
|
7439
7436
|
role: "presentation",
|
|
7440
7437
|
shapeRendering: "auto"
|
|
7441
7438
|
};
|
|
7442
7439
|
const LineSegment = initialProps => {
|
|
7443
|
-
const props = evaluateProps({
|
|
7444
|
-
|
|
7445
|
-
...initialProps
|
|
7446
|
-
});
|
|
7447
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.lineComponent, {
|
|
7440
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, initialProps, defaultProps));
|
|
7441
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.lineComponent, {
|
|
7448
7442
|
...props.events,
|
|
7449
7443
|
"aria-label": props.ariaLabel,
|
|
7450
7444
|
style: props.style,
|