victory-group 36.8.2 → 36.8.3
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 +2 -0
- package/dist/victory-group.js +152 -155
- package/dist/victory-group.min.js +1 -1
- package/es/helper-methods.d.ts +2 -2
- package/es/helper-methods.js +18 -21
- package/lib/helper-methods.d.ts +2 -2
- package/lib/helper-methods.js +21 -21
- package/package.json +3 -3
- package/src/helper-methods.tsx +13 -13
package/es/helper-methods.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function getCalculatedProps(
|
|
1
|
+
export declare function getCalculatedProps(initialProps: any, childComponents: any): {
|
|
2
2
|
datasets: any;
|
|
3
3
|
categories: any;
|
|
4
4
|
range: any;
|
|
@@ -48,5 +48,5 @@ export declare function useMemoizedProps(initialProps: any): {
|
|
|
48
48
|
right: any;
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
|
-
export declare function getChildren(
|
|
51
|
+
export declare function getChildren(initialProps: any, childComponents?: any, calculatedProps?: any): any;
|
|
52
52
|
//# sourceMappingURL=helper-methods.d.ts.map
|
package/es/helper-methods.js
CHANGED
|
@@ -36,16 +36,15 @@ var fallbackProps = {
|
|
|
36
36
|
offset: 0
|
|
37
37
|
}; // eslint-disable-next-line max-statements
|
|
38
38
|
|
|
39
|
-
export function getCalculatedProps(
|
|
39
|
+
export function getCalculatedProps(initialProps, childComponents) {
|
|
40
40
|
var role = "group";
|
|
41
|
-
props = Helpers.modifyProps(
|
|
41
|
+
var props = Helpers.modifyProps(initialProps, fallbackProps, role);
|
|
42
42
|
var style = Wrapper.getStyle(props.theme, props.style, role);
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
horizontal = _props.horizontal;
|
|
43
|
+
var offset = props.offset,
|
|
44
|
+
colorScale = props.colorScale,
|
|
45
|
+
color = props.color,
|
|
46
|
+
polar = props.polar,
|
|
47
|
+
horizontal = props.horizontal;
|
|
49
48
|
var categories = props.categories || Wrapper.getCategories(props, childComponents, null);
|
|
50
49
|
var datasets = props.datasets || Wrapper.getDataFromChildren(props, null);
|
|
51
50
|
var domain = {
|
|
@@ -215,21 +214,19 @@ function getDataWithOffset(props) {
|
|
|
215
214
|
});
|
|
216
215
|
}
|
|
217
216
|
|
|
218
|
-
export function getChildren(
|
|
219
|
-
props = Helpers.modifyProps(
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
var
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
polar = _props2.polar;
|
|
227
|
-
var childProps = getChildProps(props, calculatedProps);
|
|
217
|
+
export function getChildren(initialProps, childComponents, calculatedProps) {
|
|
218
|
+
var props = Helpers.modifyProps(initialProps, fallbackProps, "stack");
|
|
219
|
+
var children = childComponents || React.Children.toArray(props.children);
|
|
220
|
+
var newCalculatedProps = calculatedProps || getCalculatedProps(props, children);
|
|
221
|
+
var datasets = newCalculatedProps.datasets;
|
|
222
|
+
var labelComponent = props.labelComponent,
|
|
223
|
+
polar = props.polar;
|
|
224
|
+
var childProps = getChildProps(props, newCalculatedProps);
|
|
228
225
|
var parentName = props.name || "group";
|
|
229
|
-
return
|
|
226
|
+
return children.map(function (child, index) {
|
|
230
227
|
var role = child.type && child.type.role;
|
|
231
|
-
var xOffset = polar ? getPolarX0(props,
|
|
232
|
-
var style = role === "voronoi" || role === "tooltip" || role === "label" ? child.props.style : Wrapper.getChildStyle(child, index,
|
|
228
|
+
var xOffset = polar ? getPolarX0(props, newCalculatedProps, index, role) : getX0(props, newCalculatedProps, index, role);
|
|
229
|
+
var style = role === "voronoi" || role === "tooltip" || role === "label" ? child.props.style : Wrapper.getChildStyle(child, index, newCalculatedProps);
|
|
233
230
|
var labels = props.labels ? getLabels(props, datasets, index) : child.props.labels;
|
|
234
231
|
var name = child.props.name || "".concat(parentName, "-").concat(role, "-").concat(index);
|
|
235
232
|
return /*#__PURE__*/React.cloneElement(child, _assign({
|
package/lib/helper-methods.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function getCalculatedProps(
|
|
1
|
+
export declare function getCalculatedProps(initialProps: any, childComponents: any): {
|
|
2
2
|
datasets: any;
|
|
3
3
|
categories: any;
|
|
4
4
|
range: any;
|
|
@@ -48,5 +48,5 @@ export declare function useMemoizedProps(initialProps: any): {
|
|
|
48
48
|
right: any;
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
|
-
export declare function getChildren(
|
|
51
|
+
export declare function getChildren(initialProps: any, childComponents?: any, calculatedProps?: any): any;
|
|
52
52
|
//# sourceMappingURL=helper-methods.d.ts.map
|
package/lib/helper-methods.js
CHANGED
|
@@ -50,18 +50,18 @@ var fallbackProps = {
|
|
|
50
50
|
offset: 0
|
|
51
51
|
}; // eslint-disable-next-line max-statements
|
|
52
52
|
|
|
53
|
-
function getCalculatedProps(
|
|
53
|
+
function getCalculatedProps(initialProps, childComponents) {
|
|
54
54
|
var role = "group";
|
|
55
|
-
|
|
55
|
+
|
|
56
|
+
var props = _victoryCore.Helpers.modifyProps(initialProps, fallbackProps, role);
|
|
56
57
|
|
|
57
58
|
var style = _victoryCore.Wrapper.getStyle(props.theme, props.style, role);
|
|
58
59
|
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
horizontal = _props.horizontal;
|
|
60
|
+
var offset = props.offset,
|
|
61
|
+
colorScale = props.colorScale,
|
|
62
|
+
color = props.color,
|
|
63
|
+
polar = props.polar,
|
|
64
|
+
horizontal = props.horizontal;
|
|
65
65
|
|
|
66
66
|
var categories = props.categories || _victoryCore.Wrapper.getCategories(props, childComponents, null);
|
|
67
67
|
|
|
@@ -241,21 +241,21 @@ function getDataWithOffset(props) {
|
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
-
function getChildren(
|
|
245
|
-
props = _victoryCore.Helpers.modifyProps(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
var
|
|
251
|
-
|
|
252
|
-
polar =
|
|
253
|
-
var childProps = getChildProps(props,
|
|
244
|
+
function getChildren(initialProps, childComponents, calculatedProps) {
|
|
245
|
+
var props = _victoryCore.Helpers.modifyProps(initialProps, fallbackProps, "stack");
|
|
246
|
+
|
|
247
|
+
var children = childComponents || _react.default.Children.toArray(props.children);
|
|
248
|
+
|
|
249
|
+
var newCalculatedProps = calculatedProps || getCalculatedProps(props, children);
|
|
250
|
+
var datasets = newCalculatedProps.datasets;
|
|
251
|
+
var labelComponent = props.labelComponent,
|
|
252
|
+
polar = props.polar;
|
|
253
|
+
var childProps = getChildProps(props, newCalculatedProps);
|
|
254
254
|
var parentName = props.name || "group";
|
|
255
|
-
return
|
|
255
|
+
return children.map(function (child, index) {
|
|
256
256
|
var role = child.type && child.type.role;
|
|
257
|
-
var xOffset = polar ? getPolarX0(props,
|
|
258
|
-
var style = role === "voronoi" || role === "tooltip" || role === "label" ? child.props.style : _victoryCore.Wrapper.getChildStyle(child, index,
|
|
257
|
+
var xOffset = polar ? getPolarX0(props, newCalculatedProps, index, role) : getX0(props, newCalculatedProps, index, role);
|
|
258
|
+
var style = role === "voronoi" || role === "tooltip" || role === "label" ? child.props.style : _victoryCore.Wrapper.getChildStyle(child, index, newCalculatedProps);
|
|
259
259
|
var labels = props.labels ? getLabels(props, datasets, index) : child.props.labels;
|
|
260
260
|
var name = child.props.name || "".concat(parentName, "-").concat(role, "-").concat(index);
|
|
261
261
|
return /*#__PURE__*/_react.default.cloneElement(child, (0, _assign2.default)({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-group",
|
|
3
|
-
"version": "36.8.
|
|
3
|
+
"version": "36.8.3",
|
|
4
4
|
"description": "Group Layout Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"lodash": "^4.17.19",
|
|
24
24
|
"prop-types": "^15.8.1",
|
|
25
25
|
"react-fast-compare": "^3.2.0",
|
|
26
|
-
"victory-core": "^36.8.
|
|
27
|
-
"victory-shared-events": "^36.8.
|
|
26
|
+
"victory-core": "^36.8.3",
|
|
27
|
+
"victory-shared-events": "^36.8.3"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"victory-bar": "*",
|
package/src/helper-methods.tsx
CHANGED
|
@@ -12,9 +12,9 @@ const fallbackProps = {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
// eslint-disable-next-line max-statements
|
|
15
|
-
export function getCalculatedProps(
|
|
15
|
+
export function getCalculatedProps(initialProps, childComponents) {
|
|
16
16
|
const role = "group";
|
|
17
|
-
props = Helpers.modifyProps(
|
|
17
|
+
const props = Helpers.modifyProps(initialProps, fallbackProps, role);
|
|
18
18
|
const style = Wrapper.getStyle(props.theme, props.style, role);
|
|
19
19
|
const { offset, colorScale, color, polar, horizontal } = props;
|
|
20
20
|
const categories =
|
|
@@ -188,24 +188,24 @@ function getDataWithOffset(props, defaultDataset = [], offset) {
|
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
export function getChildren(
|
|
192
|
-
props = Helpers.modifyProps(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
calculatedProps || getCalculatedProps(props,
|
|
196
|
-
const { datasets } =
|
|
191
|
+
export function getChildren(initialProps, childComponents?, calculatedProps?) {
|
|
192
|
+
const props = Helpers.modifyProps(initialProps, fallbackProps, "stack");
|
|
193
|
+
const children = childComponents || React.Children.toArray(props.children);
|
|
194
|
+
const newCalculatedProps =
|
|
195
|
+
calculatedProps || getCalculatedProps(props, children);
|
|
196
|
+
const { datasets } = newCalculatedProps;
|
|
197
197
|
const { labelComponent, polar } = props;
|
|
198
|
-
const childProps = getChildProps(props,
|
|
198
|
+
const childProps = getChildProps(props, newCalculatedProps);
|
|
199
199
|
const parentName = props.name || "group";
|
|
200
|
-
return
|
|
200
|
+
return children.map((child, index) => {
|
|
201
201
|
const role = child.type && child.type.role;
|
|
202
202
|
const xOffset = polar
|
|
203
|
-
? getPolarX0(props,
|
|
204
|
-
: getX0(props,
|
|
203
|
+
? getPolarX0(props, newCalculatedProps, index, role)
|
|
204
|
+
: getX0(props, newCalculatedProps, index, role);
|
|
205
205
|
const style =
|
|
206
206
|
role === "voronoi" || role === "tooltip" || role === "label"
|
|
207
207
|
? child.props.style
|
|
208
|
-
: Wrapper.getChildStyle(child, index,
|
|
208
|
+
: Wrapper.getChildStyle(child, index, newCalculatedProps);
|
|
209
209
|
const labels = props.labels
|
|
210
210
|
? getLabels(props, datasets, index)
|
|
211
211
|
: child.props.labels;
|