victory-group 36.8.2 → 36.8.4

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.
@@ -1,4 +1,4 @@
1
- export declare function getCalculatedProps(props: any, childComponents: any): {
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(props: any, childComponents?: any, calculatedProps?: any): any;
51
+ export declare function getChildren(initialProps: any, childComponents?: any, calculatedProps?: any): any;
52
52
  //# sourceMappingURL=helper-methods.d.ts.map
@@ -36,16 +36,15 @@ var fallbackProps = {
36
36
  offset: 0
37
37
  }; // eslint-disable-next-line max-statements
38
38
 
39
- export function getCalculatedProps(props, childComponents) {
39
+ export function getCalculatedProps(initialProps, childComponents) {
40
40
  var role = "group";
41
- props = Helpers.modifyProps(props, fallbackProps, role);
41
+ var props = Helpers.modifyProps(initialProps, fallbackProps, role);
42
42
  var style = Wrapper.getStyle(props.theme, props.style, role);
43
- var _props = props,
44
- offset = _props.offset,
45
- colorScale = _props.colorScale,
46
- color = _props.color,
47
- polar = _props.polar,
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(props, childComponents, calculatedProps) {
219
- props = Helpers.modifyProps(props, fallbackProps, "stack");
220
- childComponents = childComponents || React.Children.toArray(props.children);
221
- calculatedProps = calculatedProps || getCalculatedProps(props, childComponents);
222
- var _calculatedProps = calculatedProps,
223
- datasets = _calculatedProps.datasets;
224
- var _props2 = props,
225
- labelComponent = _props2.labelComponent,
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 childComponents.map(function (child, index) {
226
+ return children.map(function (child, index) {
230
227
  var role = child.type && child.type.role;
231
- var xOffset = polar ? getPolarX0(props, calculatedProps, index, role) : getX0(props, calculatedProps, index, role);
232
- var style = role === "voronoi" || role === "tooltip" || role === "label" ? child.props.style : Wrapper.getChildStyle(child, index, calculatedProps);
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({
@@ -1,4 +1,4 @@
1
- export declare function getCalculatedProps(props: any, childComponents: any): {
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(props: any, childComponents?: any, calculatedProps?: any): any;
51
+ export declare function getChildren(initialProps: any, childComponents?: any, calculatedProps?: any): any;
52
52
  //# sourceMappingURL=helper-methods.d.ts.map
@@ -50,18 +50,18 @@ var fallbackProps = {
50
50
  offset: 0
51
51
  }; // eslint-disable-next-line max-statements
52
52
 
53
- function getCalculatedProps(props, childComponents) {
53
+ function getCalculatedProps(initialProps, childComponents) {
54
54
  var role = "group";
55
- props = _victoryCore.Helpers.modifyProps(props, fallbackProps, role);
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 _props = props,
60
- offset = _props.offset,
61
- colorScale = _props.colorScale,
62
- color = _props.color,
63
- polar = _props.polar,
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(props, childComponents, calculatedProps) {
245
- props = _victoryCore.Helpers.modifyProps(props, fallbackProps, "stack");
246
- childComponents = childComponents || _react.default.Children.toArray(props.children);
247
- calculatedProps = calculatedProps || getCalculatedProps(props, childComponents);
248
- var _calculatedProps = calculatedProps,
249
- datasets = _calculatedProps.datasets;
250
- var _props2 = props,
251
- labelComponent = _props2.labelComponent,
252
- polar = _props2.polar;
253
- var childProps = getChildProps(props, calculatedProps);
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 childComponents.map(function (child, index) {
255
+ return children.map(function (child, index) {
256
256
  var role = child.type && child.type.role;
257
- var xOffset = polar ? getPolarX0(props, calculatedProps, index, role) : getX0(props, calculatedProps, index, role);
258
- var style = role === "voronoi" || role === "tooltip" || role === "label" ? child.props.style : _victoryCore.Wrapper.getChildStyle(child, index, calculatedProps);
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.2",
3
+ "version": "36.8.4",
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.2",
27
- "victory-shared-events": "^36.8.2"
26
+ "victory-core": "^36.8.4",
27
+ "victory-shared-events": "^36.8.4"
28
28
  },
29
29
  "devDependencies": {
30
30
  "victory-bar": "*",
@@ -12,9 +12,9 @@ const fallbackProps = {
12
12
  };
13
13
 
14
14
  // eslint-disable-next-line max-statements
15
- export function getCalculatedProps(props, childComponents) {
15
+ export function getCalculatedProps(initialProps, childComponents) {
16
16
  const role = "group";
17
- props = Helpers.modifyProps(props, fallbackProps, role);
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(props, childComponents?, calculatedProps?) {
192
- props = Helpers.modifyProps(props, fallbackProps, "stack");
193
- childComponents = childComponents || React.Children.toArray(props.children);
194
- calculatedProps =
195
- calculatedProps || getCalculatedProps(props, childComponents);
196
- const { datasets } = calculatedProps;
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, calculatedProps);
198
+ const childProps = getChildProps(props, newCalculatedProps);
199
199
  const parentName = props.name || "group";
200
- return childComponents.map((child, index) => {
200
+ return children.map((child, index) => {
201
201
  const role = child.type && child.type.role;
202
202
  const xOffset = polar
203
- ? getPolarX0(props, calculatedProps, index, role)
204
- : getX0(props, calculatedProps, index, role);
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, calculatedProps);
208
+ : Wrapper.getChildStyle(child, index, newCalculatedProps);
209
209
  const labels = props.labels
210
210
  ? getLabels(props, datasets, index)
211
211
  : child.props.labels;