victory-chart 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,6 +1,6 @@
1
1
  import React from "react";
2
2
  export declare function getBackgroundWithProps(props: any, calculatedProps: any): React.DetailedReactHTMLElement<any, HTMLElement>;
3
- export declare function getCalculatedProps(props: any, childComponents: any): {
3
+ export declare function getCalculatedProps(initialProps: any, childComponents: any): {
4
4
  categories: {
5
5
  x: any;
6
6
  y: any;
@@ -84,12 +84,11 @@ function getStyles(props) {
84
84
  };
85
85
  }
86
86
 
87
- export function getCalculatedProps(props, childComponents) {
88
- var style = getStyles(props);
89
- props = Helpers.modifyProps(props, fallbackProps, "chart");
90
- var _props = props,
91
- horizontal = _props.horizontal,
92
- polar = _props.polar;
87
+ export function getCalculatedProps(initialProps, childComponents) {
88
+ var style = getStyles(initialProps);
89
+ var props = Helpers.modifyProps(initialProps, fallbackProps, "chart");
90
+ var horizontal = props.horizontal,
91
+ polar = props.polar;
93
92
  var allStrings = Wrapper.getStringsFromChildren(props, childComponents);
94
93
  var categories = Wrapper.getCategories(props, childComponents, allStrings);
95
94
  var stringMap = createStringMap(props, childComponents, allStrings);
@@ -128,23 +127,22 @@ export function getCalculatedProps(props, childComponents) {
128
127
  };
129
128
  }
130
129
  export function getChildren(props, childComponents, calculatedProps) {
131
- childComponents = childComponents || getChildComponents(props);
132
- calculatedProps = calculatedProps || getCalculatedProps(props, childComponents);
133
- var baseStyle = calculatedProps.style.parent;
130
+ var children = childComponents || getChildComponents(props);
131
+ var newCalculatedProps = calculatedProps || getCalculatedProps(props, children);
132
+ var baseStyle = newCalculatedProps.style.parent;
134
133
  var height = props.height,
135
134
  polar = props.polar,
136
135
  theme = props.theme,
137
136
  width = props.width;
138
- var _calculatedProps = calculatedProps,
139
- origin = _calculatedProps.origin,
140
- horizontal = _calculatedProps.horizontal;
137
+ var origin = newCalculatedProps.origin,
138
+ horizontal = newCalculatedProps.horizontal;
141
139
  var parentName = props.name || "chart";
142
- return childComponents.filter(React.isValidElement).map(function (child, index) {
140
+ return children.filter(React.isValidElement).map(function (child, index) {
143
141
  var role = child.type && child.type.role;
144
142
  var style = Array.isArray(child.props.style) ? child.props.style : _defaults({}, child.props.style, {
145
143
  parent: baseStyle
146
144
  });
147
- var childProps = getChildProps(child, props, calculatedProps);
145
+ var childProps = getChildProps(child, props, newCalculatedProps);
148
146
  var name = child.props.name || "".concat(parentName, "-").concat(role, "-").concat(index);
149
147
 
150
148
  var newProps = _defaults({
@@ -156,7 +154,7 @@ export function getChildren(props, childComponents, calculatedProps) {
156
154
  style: style,
157
155
  name: name,
158
156
  origin: polar ? origin : undefined,
159
- padding: calculatedProps.padding,
157
+ padding: newCalculatedProps.padding,
160
158
  key: "".concat(name, "-key-").concat(index),
161
159
  standalone: false
162
160
  }, childProps);
@@ -184,9 +182,9 @@ export var getChildComponents = function (props, defaultAxes) {
184
182
  };
185
183
 
186
184
  var getDomain = function (props, axis, childComponents) {
187
- childComponents = childComponents || React.Children.toArray(props.children);
188
- var domain = Wrapper.getDomain(props, axis, childComponents);
189
- var axisComponent = Axis.getAxisComponent(childComponents, axis);
185
+ var children = childComponents || React.Children.toArray(props.children);
186
+ var domain = Wrapper.getDomain(props, axis, children);
187
+ var axisComponent = Axis.getAxisComponent(children, axis);
190
188
  var invertDomain = axisComponent && axisComponent.props && axisComponent.props.invertAxis;
191
189
  return invertDomain ? domain.concat().reverse() : domain;
192
190
  };
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  export declare function getBackgroundWithProps(props: any, calculatedProps: any): React.DetailedReactHTMLElement<any, HTMLElement>;
3
- export declare function getCalculatedProps(props: any, childComponents: any): {
3
+ export declare function getCalculatedProps(initialProps: any, childComponents: any): {
4
4
  categories: {
5
5
  x: any;
6
6
  y: any;
@@ -99,12 +99,13 @@ function getStyles(props) {
99
99
  };
100
100
  }
101
101
 
102
- function getCalculatedProps(props, childComponents) {
103
- var style = getStyles(props);
104
- props = _victoryCore.Helpers.modifyProps(props, fallbackProps, "chart");
105
- var _props = props,
106
- horizontal = _props.horizontal,
107
- polar = _props.polar;
102
+ function getCalculatedProps(initialProps, childComponents) {
103
+ var style = getStyles(initialProps);
104
+
105
+ var props = _victoryCore.Helpers.modifyProps(initialProps, fallbackProps, "chart");
106
+
107
+ var horizontal = props.horizontal,
108
+ polar = props.polar;
108
109
 
109
110
  var allStrings = _victoryCore.Wrapper.getStringsFromChildren(props, childComponents);
110
111
 
@@ -149,23 +150,22 @@ function getCalculatedProps(props, childComponents) {
149
150
  }
150
151
 
151
152
  function getChildren(props, childComponents, calculatedProps) {
152
- childComponents = childComponents || getChildComponents(props);
153
- calculatedProps = calculatedProps || getCalculatedProps(props, childComponents);
154
- var baseStyle = calculatedProps.style.parent;
153
+ var children = childComponents || getChildComponents(props);
154
+ var newCalculatedProps = calculatedProps || getCalculatedProps(props, children);
155
+ var baseStyle = newCalculatedProps.style.parent;
155
156
  var height = props.height,
156
157
  polar = props.polar,
157
158
  theme = props.theme,
158
159
  width = props.width;
159
- var _calculatedProps = calculatedProps,
160
- origin = _calculatedProps.origin,
161
- horizontal = _calculatedProps.horizontal;
160
+ var origin = newCalculatedProps.origin,
161
+ horizontal = newCalculatedProps.horizontal;
162
162
  var parentName = props.name || "chart";
163
- return childComponents.filter(_react.default.isValidElement).map(function (child, index) {
163
+ return children.filter(_react.default.isValidElement).map(function (child, index) {
164
164
  var role = child.type && child.type.role;
165
165
  var style = Array.isArray(child.props.style) ? child.props.style : (0, _defaults2.default)({}, child.props.style, {
166
166
  parent: baseStyle
167
167
  });
168
- var childProps = getChildProps(child, props, calculatedProps);
168
+ var childProps = getChildProps(child, props, newCalculatedProps);
169
169
  var name = child.props.name || "".concat(parentName, "-").concat(role, "-").concat(index);
170
170
  var newProps = (0, _defaults2.default)({
171
171
  horizontal: horizontal,
@@ -176,7 +176,7 @@ function getChildren(props, childComponents, calculatedProps) {
176
176
  style: style,
177
177
  name: name,
178
178
  origin: polar ? origin : undefined,
179
- padding: calculatedProps.padding,
179
+ padding: newCalculatedProps.padding,
180
180
  key: "".concat(name, "-key-").concat(index),
181
181
  standalone: false
182
182
  }, childProps);
@@ -206,11 +206,11 @@ var getChildComponents = function (props, defaultAxes) {
206
206
  exports.getChildComponents = getChildComponents;
207
207
 
208
208
  var getDomain = function (props, axis, childComponents) {
209
- childComponents = childComponents || _react.default.Children.toArray(props.children);
209
+ var children = childComponents || _react.default.Children.toArray(props.children);
210
210
 
211
- var domain = _victoryCore.Wrapper.getDomain(props, axis, childComponents);
211
+ var domain = _victoryCore.Wrapper.getDomain(props, axis, children);
212
212
 
213
- var axisComponent = _victoryCore.Axis.getAxisComponent(childComponents, axis);
213
+ var axisComponent = _victoryCore.Axis.getAxisComponent(children, axis);
214
214
 
215
215
  var invertDomain = axisComponent && axisComponent.props && axisComponent.props.invertAxis;
216
216
  return invertDomain ? domain.concat().reverse() : domain;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "victory-chart",
3
- "version": "36.8.2",
3
+ "version": "36.8.4",
4
4
  "description": "Chart Component for Victory",
5
5
  "keywords": [
6
6
  "data visualization",
@@ -23,10 +23,10 @@
23
23
  "lodash": "^4.17.19",
24
24
  "prop-types": "^15.8.1",
25
25
  "react-fast-compare": "^3.2.0",
26
- "victory-axis": "^36.8.2",
27
- "victory-core": "^36.8.2",
28
- "victory-polar-axis": "^36.8.2",
29
- "victory-shared-events": "^36.8.2"
26
+ "victory-axis": "^36.8.4",
27
+ "victory-core": "^36.8.4",
28
+ "victory-polar-axis": "^36.8.4",
29
+ "victory-shared-events": "^36.8.4"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": ">=16.6.0"
@@ -82,9 +82,9 @@ function getStyles(props) {
82
82
  };
83
83
  }
84
84
 
85
- export function getCalculatedProps(props, childComponents) {
86
- const style = getStyles(props);
87
- props = Helpers.modifyProps(props, fallbackProps, "chart");
85
+ export function getCalculatedProps(initialProps, childComponents) {
86
+ const style = getStyles(initialProps);
87
+ const props = Helpers.modifyProps(initialProps, fallbackProps, "chart");
88
88
  const { horizontal, polar } = props;
89
89
  const allStrings = Wrapper.getStringsFromChildren(props, childComponents);
90
90
  const categories = Wrapper.getCategories(props, childComponents, allStrings);
@@ -125,20 +125,20 @@ export function getCalculatedProps(props, childComponents) {
125
125
  }
126
126
 
127
127
  export function getChildren(props, childComponents, calculatedProps) {
128
- childComponents = childComponents || getChildComponents(props);
129
- calculatedProps =
130
- calculatedProps || getCalculatedProps(props, childComponents);
131
- const baseStyle = calculatedProps.style.parent;
128
+ const children = childComponents || getChildComponents(props);
129
+ const newCalculatedProps =
130
+ calculatedProps || getCalculatedProps(props, children);
131
+ const baseStyle = newCalculatedProps.style.parent;
132
132
  const { height, polar, theme, width } = props;
133
- const { origin, horizontal } = calculatedProps;
133
+ const { origin, horizontal } = newCalculatedProps;
134
134
  const parentName = props.name || "chart";
135
135
 
136
- return childComponents.filter(React.isValidElement).map((child, index) => {
136
+ return children.filter(React.isValidElement).map((child, index) => {
137
137
  const role = child.type && child.type.role;
138
138
  const style = Array.isArray(child.props.style)
139
139
  ? child.props.style
140
140
  : defaults({}, child.props.style, { parent: baseStyle });
141
- const childProps = getChildProps(child, props, calculatedProps);
141
+ const childProps = getChildProps(child, props, newCalculatedProps);
142
142
  const name = child.props.name || `${parentName}-${role}-${index}`;
143
143
  const newProps = defaults(
144
144
  {
@@ -150,7 +150,7 @@ export function getChildren(props, childComponents, calculatedProps) {
150
150
  style,
151
151
  name,
152
152
  origin: polar ? origin : undefined,
153
- padding: calculatedProps.padding,
153
+ padding: newCalculatedProps.padding,
154
154
  key: `${name}-key-${index}`,
155
155
  standalone: false,
156
156
  },
@@ -193,9 +193,9 @@ export const getChildComponents = (props, defaultAxes?) => {
193
193
  };
194
194
 
195
195
  const getDomain = (props, axis, childComponents) => {
196
- childComponents = childComponents || React.Children.toArray(props.children);
197
- const domain = Wrapper.getDomain(props, axis, childComponents);
198
- const axisComponent = Axis.getAxisComponent(childComponents, axis);
196
+ const children = childComponents || React.Children.toArray(props.children);
197
+ const domain = Wrapper.getDomain(props, axis, children);
198
+ const axisComponent = Axis.getAxisComponent(children, axis);
199
199
  const invertDomain =
200
200
  axisComponent && axisComponent.props && axisComponent.props.invertAxis;
201
201
  return invertDomain ? domain.concat().reverse() : domain;