victory-area 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 +8 -4
- package/dist/victory-area.js +28 -31
- package/dist/victory-area.min.js +1 -1
- package/es/area.d.ts +12 -12
- package/es/area.js +2 -4
- package/es/helper-methods.d.ts +2 -2
- package/es/index.d.ts +2 -2
- package/es/victory-area.d.ts +90 -90
- package/lib/area.d.ts +12 -12
- package/lib/area.js +2 -4
- package/lib/helper-methods.d.ts +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/victory-area.d.ts +90 -90
- package/package.json +7 -4
- package/src/area.tsx +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
# victory-area
|
|
2
2
|
|
|
3
|
-
## 37.0.
|
|
3
|
+
## 37.0.2
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
- Ensure undefined props do not overwrite defaults ([#2852](https://github.com/FormidableLabs/victory/pull/2852))
|
|
8
|
+
|
|
9
|
+
## 37.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Fix the signature of class static functions in components ([#2840](https://github.com/FormidableLabs/victory/pull/2840))
|
|
10
14
|
|
|
11
15
|
## 37.0.0
|
|
12
16
|
|
package/dist/victory-area.js
CHANGED
|
@@ -22,13 +22,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22
22
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
23
23
|
/* harmony export */ "Area": function() { return /* binding */ Area; }
|
|
24
24
|
/* harmony export */ });
|
|
25
|
-
/* harmony import */ var
|
|
26
|
-
/* harmony import */ var
|
|
27
|
-
/* harmony import */ var
|
|
28
|
-
/* harmony import */ var
|
|
29
|
-
/* harmony import */ var
|
|
30
|
-
/* harmony import */ var
|
|
31
|
-
/* harmony import */ var
|
|
25
|
+
/* 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");
|
|
26
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
27
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
28
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
29
|
+
/* harmony import */ var victory_vendor_d3_shape__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-vendor/d3-shape */ "../../victory-vendor/es/d3-shape.js");
|
|
30
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/line-helpers.js");
|
|
31
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
32
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-primitives/path.js");
|
|
33
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/user-props.js");
|
|
34
|
+
|
|
32
35
|
/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2] }]*/
|
|
33
36
|
|
|
34
37
|
|
|
@@ -57,16 +60,16 @@ const getCartesianArea = props => {
|
|
|
57
60
|
horizontal,
|
|
58
61
|
scale
|
|
59
62
|
} = props;
|
|
60
|
-
const interpolationFunction =
|
|
61
|
-
return horizontal ?
|
|
63
|
+
const interpolationFunction = victory_core__WEBPACK_IMPORTED_MODULE_3__.getInterpolationFunction(props);
|
|
64
|
+
return horizontal ? victory_vendor_d3_shape__WEBPACK_IMPORTED_MODULE_2__.area().defined(defined).curve(interpolationFunction).x0(getY0Accessor(scale)).x1(getYAccessor(scale)).y(getXAccessor(scale)) : victory_vendor_d3_shape__WEBPACK_IMPORTED_MODULE_2__.area().defined(defined).curve(interpolationFunction).x(getXAccessor(scale)).y1(getYAccessor(scale)).y0(getY0Accessor(scale));
|
|
62
65
|
};
|
|
63
66
|
const getAreaFunction = props => {
|
|
64
67
|
const {
|
|
65
68
|
polar,
|
|
66
69
|
scale
|
|
67
70
|
} = props;
|
|
68
|
-
const interpolationFunction =
|
|
69
|
-
return polar ?
|
|
71
|
+
const interpolationFunction = victory_core__WEBPACK_IMPORTED_MODULE_3__.getInterpolationFunction(props);
|
|
72
|
+
return polar ? victory_vendor_d3_shape__WEBPACK_IMPORTED_MODULE_2__.radialArea().defined(defined).curve(interpolationFunction).angle(getAngleAccessor(scale)).outerRadius(getYAccessor(scale)).innerRadius(getY0Accessor(scale)) : getCartesianArea(props);
|
|
70
73
|
};
|
|
71
74
|
const evaluateProps = props => {
|
|
72
75
|
/**
|
|
@@ -77,13 +80,13 @@ const evaluateProps = props => {
|
|
|
77
80
|
* `style`
|
|
78
81
|
* `tabIndex`
|
|
79
82
|
*/
|
|
80
|
-
const ariaLabel =
|
|
81
|
-
const desc =
|
|
82
|
-
const id =
|
|
83
|
-
const style =
|
|
83
|
+
const ariaLabel = victory_core__WEBPACK_IMPORTED_MODULE_4__.evaluateProp(props.ariaLabel, props);
|
|
84
|
+
const desc = victory_core__WEBPACK_IMPORTED_MODULE_4__.evaluateProp(props.desc, props);
|
|
85
|
+
const id = victory_core__WEBPACK_IMPORTED_MODULE_4__.evaluateProp(props.id, props);
|
|
86
|
+
const style = victory_core__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(Object.assign({
|
|
84
87
|
fill: "black"
|
|
85
88
|
}, props.style), props);
|
|
86
|
-
const tabIndex =
|
|
89
|
+
const tabIndex = victory_core__WEBPACK_IMPORTED_MODULE_4__.evaluateProp(props.tabIndex, props);
|
|
87
90
|
return Object.assign({}, props, {
|
|
88
91
|
ariaLabel,
|
|
89
92
|
desc,
|
|
@@ -93,8 +96,8 @@ const evaluateProps = props => {
|
|
|
93
96
|
});
|
|
94
97
|
};
|
|
95
98
|
const defaultProps = {
|
|
96
|
-
groupComponent: /*#__PURE__*/
|
|
97
|
-
pathComponent: /*#__PURE__*/
|
|
99
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null),
|
|
100
|
+
pathComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_5__.Path, null),
|
|
98
101
|
role: "presentation",
|
|
99
102
|
shapeRendering: "auto"
|
|
100
103
|
};
|
|
@@ -103,10 +106,7 @@ const defaultProps = {
|
|
|
103
106
|
* The area primitive used by VictoryArea
|
|
104
107
|
*/
|
|
105
108
|
const Area = initialProps => {
|
|
106
|
-
const props = evaluateProps({
|
|
107
|
-
...defaultProps,
|
|
108
|
-
...initialProps
|
|
109
|
-
});
|
|
109
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, initialProps, defaultProps));
|
|
110
110
|
const {
|
|
111
111
|
ariaLabel,
|
|
112
112
|
role,
|
|
@@ -124,12 +124,12 @@ const Area = initialProps => {
|
|
|
124
124
|
desc,
|
|
125
125
|
tabIndex
|
|
126
126
|
} = props;
|
|
127
|
-
const userProps =
|
|
127
|
+
const userProps = victory_core__WEBPACK_IMPORTED_MODULE_6__.getSafeUserProps(props);
|
|
128
128
|
const defaultTransform = polar && origin ? `translate(${origin.x}, ${origin.y})` : undefined;
|
|
129
129
|
const transform = props.transform || defaultTransform;
|
|
130
130
|
const renderLine = style.stroke && style.stroke !== "none" && style.stroke !== "transparent";
|
|
131
131
|
const areaFunction = getAreaFunction(props);
|
|
132
|
-
const lineFunction = renderLine &&
|
|
132
|
+
const lineFunction = renderLine && victory_core__WEBPACK_IMPORTED_MODULE_3__.getLineFunction(props);
|
|
133
133
|
const areaStroke = style.stroke ? "none" : style.fill;
|
|
134
134
|
const sharedProps = {
|
|
135
135
|
"aria-label": ariaLabel,
|
|
@@ -141,7 +141,7 @@ const Area = initialProps => {
|
|
|
141
141
|
clipPath,
|
|
142
142
|
tabIndex
|
|
143
143
|
};
|
|
144
|
-
const area = /*#__PURE__*/
|
|
144
|
+
const area = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(pathComponent, Object.assign({
|
|
145
145
|
key: `${id}-area`,
|
|
146
146
|
style: Object.assign({}, style, {
|
|
147
147
|
stroke: areaStroke
|
|
@@ -150,14 +150,14 @@ const Area = initialProps => {
|
|
|
150
150
|
desc,
|
|
151
151
|
tabIndex
|
|
152
152
|
}, sharedProps, userProps));
|
|
153
|
-
const line = renderLine ? /*#__PURE__*/
|
|
153
|
+
const line = renderLine ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(pathComponent, Object.assign({
|
|
154
154
|
key: `${id}-area-stroke`,
|
|
155
155
|
style: Object.assign({}, style, {
|
|
156
156
|
fill: "none"
|
|
157
157
|
}),
|
|
158
158
|
d: lineFunction(data)
|
|
159
159
|
}, sharedProps)) : null;
|
|
160
|
-
return renderLine ? /*#__PURE__*/
|
|
160
|
+
return renderLine ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(groupComponent, userProps, [area, line]) : area;
|
|
161
161
|
};
|
|
162
162
|
|
|
163
163
|
/***/ }),
|
|
@@ -6091,10 +6091,7 @@ const defaultProps = {
|
|
|
6091
6091
|
lineHeight: 1
|
|
6092
6092
|
};
|
|
6093
6093
|
const VictoryLabel = initialProps => {
|
|
6094
|
-
const props = evaluateProps({
|
|
6095
|
-
...defaultProps,
|
|
6096
|
-
...initialProps
|
|
6097
|
-
});
|
|
6094
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, initialProps, defaultProps));
|
|
6098
6095
|
if (props.text === null || props.text === undefined) {
|
|
6099
6096
|
return null;
|
|
6100
6097
|
}
|