victory-group 36.4.1 → 36.5.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/dist/victory-group.js +405 -376
- package/dist/victory-group.min.js +1 -1
- package/es/helper-methods.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +2 -1
- package/es/victory-group.js +2 -1
- package/lib/helper-methods.js +2 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -1
- package/lib/victory-group.js +2 -1
- package/package.json +5 -5
- package/src/helper-methods.js +13 -14
- package/src/index.d.ts +1 -1
- package/src/victory-group.js +15 -15
package/es/helper-methods.js
CHANGED
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default as VictoryGroup } from "./victory-group";
|
|
1
|
+
export { default as VictoryGroup } from "./victory-group";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
package/es/victory-group.js
CHANGED
|
@@ -137,4 +137,5 @@ VictoryGroupMemo.displayName = "VictoryGroup";
|
|
|
137
137
|
VictoryGroupMemo.role = "group";
|
|
138
138
|
VictoryGroupMemo.expectedComponents = ["groupComponent", "containerComponent", "labelComponent"];
|
|
139
139
|
VictoryGroupMemo.getChildren = getChildren;
|
|
140
|
-
export default VictoryGroupMemo;
|
|
140
|
+
export default VictoryGroupMemo;
|
|
141
|
+
//# sourceMappingURL=victory-group.js.map
|
package/lib/helper-methods.js
CHANGED
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -12,4 +12,5 @@ Object.defineProperty(exports, "VictoryGroup", {
|
|
|
12
12
|
|
|
13
13
|
var _victoryGroup = _interopRequireDefault(require("./victory-group"));
|
|
14
14
|
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
package/lib/victory-group.js
CHANGED
|
@@ -165,4 +165,5 @@ VictoryGroupMemo.role = "group";
|
|
|
165
165
|
VictoryGroupMemo.expectedComponents = ["groupComponent", "containerComponent", "labelComponent"];
|
|
166
166
|
VictoryGroupMemo.getChildren = _helperMethods.getChildren;
|
|
167
167
|
var _default = VictoryGroupMemo;
|
|
168
|
-
exports.default = _default;
|
|
168
|
+
exports.default = _default;
|
|
169
|
+
//# sourceMappingURL=victory-group.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-group",
|
|
3
|
-
"version": "36.
|
|
3
|
+
"version": "36.5.2",
|
|
4
4
|
"description": "Group Layout Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"lodash": "^4.17.19",
|
|
23
23
|
"prop-types": "^15.8.1",
|
|
24
24
|
"react-fast-compare": "^3.2.0",
|
|
25
|
-
"victory-core": "^36.
|
|
26
|
-
"victory-shared-events": "^36.
|
|
25
|
+
"victory-core": "^36.5.2",
|
|
26
|
+
"victory-shared-events": "^36.5.2"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"react": "
|
|
29
|
+
"react": ">=16.6.0"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"version": "yarn run nps build-libs && nps build-dists"
|
|
33
33
|
},
|
|
34
34
|
"sideEffects": false,
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "def218e9749ecafc159ef458dd03a8b92e227666"
|
|
36
36
|
}
|
package/src/helper-methods.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable func-style */
|
|
2
1
|
/* eslint-disable no-use-before-define */
|
|
3
2
|
import { assign } from "lodash";
|
|
4
3
|
import React from "react";
|
|
@@ -9,7 +8,7 @@ const fallbackProps = {
|
|
|
9
8
|
width: 450,
|
|
10
9
|
height: 300,
|
|
11
10
|
padding: 50,
|
|
12
|
-
offset: 0
|
|
11
|
+
offset: 0,
|
|
13
12
|
};
|
|
14
13
|
|
|
15
14
|
// eslint-disable-next-line max-statements
|
|
@@ -25,25 +24,25 @@ export function getCalculatedProps(props, childComponents) {
|
|
|
25
24
|
x: Wrapper.getDomain(
|
|
26
25
|
assign({}, props, { categories }),
|
|
27
26
|
"x",
|
|
28
|
-
childComponents
|
|
27
|
+
childComponents,
|
|
29
28
|
),
|
|
30
29
|
y: Wrapper.getDomain(
|
|
31
30
|
assign({}, props, { categories }),
|
|
32
31
|
"y",
|
|
33
|
-
childComponents
|
|
34
|
-
)
|
|
32
|
+
childComponents,
|
|
33
|
+
),
|
|
35
34
|
};
|
|
36
35
|
const range = props.range || {
|
|
37
36
|
x: Helpers.getRange(props, "x"),
|
|
38
|
-
y: Helpers.getRange(props, "y")
|
|
37
|
+
y: Helpers.getRange(props, "y"),
|
|
39
38
|
};
|
|
40
39
|
const baseScale = {
|
|
41
40
|
x: Scale.getScaleFromProps(props, "x") || Wrapper.getScale(props, "x"),
|
|
42
|
-
y: Scale.getScaleFromProps(props, "y") || Wrapper.getScale(props, "y")
|
|
41
|
+
y: Scale.getScaleFromProps(props, "y") || Wrapper.getScale(props, "y"),
|
|
43
42
|
};
|
|
44
43
|
const scale = {
|
|
45
44
|
x: baseScale.x.domain(domain.x).range(props.horizontal ? range.y : range.x),
|
|
46
|
-
y: baseScale.y.domain(domain.y).range(props.horizontal ? range.x : range.y)
|
|
45
|
+
y: baseScale.y.domain(domain.y).range(props.horizontal ? range.x : range.y),
|
|
47
46
|
};
|
|
48
47
|
|
|
49
48
|
const origin = polar ? props.origin : Helpers.getPolarOrigin(props);
|
|
@@ -60,7 +59,7 @@ export function getCalculatedProps(props, childComponents) {
|
|
|
60
59
|
color,
|
|
61
60
|
offset,
|
|
62
61
|
origin,
|
|
63
|
-
padding
|
|
62
|
+
padding,
|
|
64
63
|
};
|
|
65
64
|
}
|
|
66
65
|
|
|
@@ -71,7 +70,7 @@ const withoutSharedEvents = (props) => {
|
|
|
71
70
|
const modifiedChildren = React.Children.toArray(children).map((child) => {
|
|
72
71
|
return {
|
|
73
72
|
...child,
|
|
74
|
-
props: Helpers.omit(child.props, ["sharedEvents"])
|
|
73
|
+
props: Helpers.omit(child.props, ["sharedEvents"]),
|
|
75
74
|
};
|
|
76
75
|
});
|
|
77
76
|
props.children = modifiedChildren;
|
|
@@ -159,7 +158,7 @@ function getChildProps(props, calculatedProps) {
|
|
|
159
158
|
scale,
|
|
160
159
|
horizontal,
|
|
161
160
|
padding,
|
|
162
|
-
standalone: false
|
|
161
|
+
standalone: false,
|
|
163
162
|
};
|
|
164
163
|
}
|
|
165
164
|
|
|
@@ -220,10 +219,10 @@ export function getChildren(props, childComponents, calculatedProps) {
|
|
|
220
219
|
data: getDataWithOffset(props, datasets[index], xOffset),
|
|
221
220
|
colorScale: getColorScale(props, child),
|
|
222
221
|
labelComponent: labelComponent || child.props.labelComponent,
|
|
223
|
-
xOffset
|
|
222
|
+
xOffset,
|
|
224
223
|
},
|
|
225
|
-
childProps
|
|
226
|
-
)
|
|
224
|
+
childProps,
|
|
225
|
+
),
|
|
227
226
|
);
|
|
228
227
|
});
|
|
229
228
|
}
|
package/src/index.d.ts
CHANGED
package/src/victory-group.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
UserProps,
|
|
9
9
|
VictoryContainer,
|
|
10
10
|
VictoryTheme,
|
|
11
|
-
Wrapper
|
|
11
|
+
Wrapper,
|
|
12
12
|
} from "victory-core";
|
|
13
13
|
import { VictorySharedEvents } from "victory-shared-events";
|
|
14
14
|
import { getChildren, useMemoizedProps } from "./helper-methods";
|
|
@@ -18,7 +18,7 @@ const fallbackProps = {
|
|
|
18
18
|
width: 450,
|
|
19
19
|
height: 300,
|
|
20
20
|
padding: 50,
|
|
21
|
-
offset: 0
|
|
21
|
+
offset: 0,
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const VictoryGroup = (initialProps) => {
|
|
@@ -40,7 +40,7 @@ const VictoryGroup = (initialProps) => {
|
|
|
40
40
|
theme,
|
|
41
41
|
polar,
|
|
42
42
|
horizontal,
|
|
43
|
-
name
|
|
43
|
+
name,
|
|
44
44
|
} = modifiedProps;
|
|
45
45
|
|
|
46
46
|
const childComponents = React.Children.toArray(modifiedProps.children);
|
|
@@ -52,7 +52,7 @@ const VictoryGroup = (initialProps) => {
|
|
|
52
52
|
return children.map((child, index) => {
|
|
53
53
|
const childProps = assign(
|
|
54
54
|
{ animate: getAnimationProps(props, child, index, "victory-group") },
|
|
55
|
-
child.props
|
|
55
|
+
child.props,
|
|
56
56
|
);
|
|
57
57
|
return React.cloneElement(child, childProps);
|
|
58
58
|
});
|
|
@@ -71,7 +71,7 @@ const VictoryGroup = (initialProps) => {
|
|
|
71
71
|
horizontal,
|
|
72
72
|
polar,
|
|
73
73
|
origin,
|
|
74
|
-
name
|
|
74
|
+
name,
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
return {};
|
|
@@ -86,12 +86,12 @@ const VictoryGroup = (initialProps) => {
|
|
|
86
86
|
horizontal,
|
|
87
87
|
polar,
|
|
88
88
|
origin,
|
|
89
|
-
name
|
|
89
|
+
name,
|
|
90
90
|
]);
|
|
91
91
|
|
|
92
92
|
const userProps = React.useMemo(
|
|
93
93
|
() => UserProps.getSafeUserProps(initialProps),
|
|
94
|
-
[initialProps]
|
|
94
|
+
[initialProps],
|
|
95
95
|
);
|
|
96
96
|
|
|
97
97
|
const container = React.useMemo(() => {
|
|
@@ -100,7 +100,7 @@ const VictoryGroup = (initialProps) => {
|
|
|
100
100
|
{},
|
|
101
101
|
containerComponent.props,
|
|
102
102
|
containerProps,
|
|
103
|
-
userProps
|
|
103
|
+
userProps,
|
|
104
104
|
);
|
|
105
105
|
return React.cloneElement(containerComponent, defaultContainerProps);
|
|
106
106
|
}
|
|
@@ -111,7 +111,7 @@ const VictoryGroup = (initialProps) => {
|
|
|
111
111
|
standalone,
|
|
112
112
|
containerComponent,
|
|
113
113
|
containerProps,
|
|
114
|
-
userProps
|
|
114
|
+
userProps,
|
|
115
115
|
]);
|
|
116
116
|
|
|
117
117
|
const events = React.useMemo(() => {
|
|
@@ -149,7 +149,7 @@ VictoryGroup.propTypes = {
|
|
|
149
149
|
...CommonProps.dataProps,
|
|
150
150
|
children: PropTypes.oneOfType([
|
|
151
151
|
PropTypes.arrayOf(PropTypes.node),
|
|
152
|
-
PropTypes.node
|
|
152
|
+
PropTypes.node,
|
|
153
153
|
]),
|
|
154
154
|
color: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
|
|
155
155
|
colorScale: PropTypes.oneOfType([
|
|
@@ -162,11 +162,11 @@ VictoryGroup.propTypes = {
|
|
|
162
162
|
"cool",
|
|
163
163
|
"red",
|
|
164
164
|
"green",
|
|
165
|
-
"blue"
|
|
166
|
-
])
|
|
165
|
+
"blue",
|
|
166
|
+
]),
|
|
167
167
|
]),
|
|
168
168
|
horizontal: PropTypes.bool,
|
|
169
|
-
offset: PropTypes.number
|
|
169
|
+
offset: PropTypes.number,
|
|
170
170
|
};
|
|
171
171
|
|
|
172
172
|
VictoryGroup.defaultProps = {
|
|
@@ -175,7 +175,7 @@ VictoryGroup.defaultProps = {
|
|
|
175
175
|
samples: 50,
|
|
176
176
|
sortOrder: "ascending",
|
|
177
177
|
standalone: true,
|
|
178
|
-
theme: VictoryTheme.grayscale
|
|
178
|
+
theme: VictoryTheme.grayscale,
|
|
179
179
|
};
|
|
180
180
|
|
|
181
181
|
// We need to attatch the static properties to the memoized version, or else
|
|
@@ -188,7 +188,7 @@ VictoryGroupMemo.role = "group";
|
|
|
188
188
|
VictoryGroupMemo.expectedComponents = [
|
|
189
189
|
"groupComponent",
|
|
190
190
|
"containerComponent",
|
|
191
|
-
"labelComponent"
|
|
191
|
+
"labelComponent",
|
|
192
192
|
];
|
|
193
193
|
|
|
194
194
|
VictoryGroupMemo.getChildren = getChildren;
|