victory-stack 36.5.0 → 36.5.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.
@@ -285,4 +285,5 @@ export function getChildren(props, childComponents, calculatedProps) {
285
285
  polar: props.polar
286
286
  }, childProps));
287
287
  });
288
- }
288
+ }
289
+ //# sourceMappingURL=helper-methods.js.map
package/es/index.d.ts CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  VictoryCommonProps,
9
9
  VictoryLabelableProps,
10
10
  VictoryMultiLabelableProps,
11
- VictoryStyleInterface
11
+ VictoryStyleInterface,
12
12
  } from "victory-core";
13
13
 
14
14
  export type VictoryStackTTargetType = "data" | "labels" | "parent";
package/es/index.js CHANGED
@@ -1 +1,2 @@
1
- export { default as VictoryStack } from "./victory-stack";
1
+ export { default as VictoryStack } from "./victory-stack";
2
+ //# sourceMappingURL=index.js.map
@@ -152,4 +152,5 @@ VictoryStackMemo.displayName = "VictoryStack";
152
152
  VictoryStackMemo.role = "stack";
153
153
  VictoryStackMemo.expectedComponents = ["groupComponent", "containerComponent", "labelComponent"];
154
154
  VictoryStackMemo.getChildren = getChildren;
155
- export default VictoryStackMemo;
155
+ export default VictoryStackMemo;
156
+ //# sourceMappingURL=victory-stack.js.map
@@ -309,4 +309,5 @@ function getChildren(props, childComponents, calculatedProps) {
309
309
  polar: props.polar
310
310
  }, childProps));
311
311
  });
312
- }
312
+ }
313
+ //# sourceMappingURL=helper-methods.js.map
package/lib/index.d.ts CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  VictoryCommonProps,
9
9
  VictoryLabelableProps,
10
10
  VictoryMultiLabelableProps,
11
- VictoryStyleInterface
11
+ VictoryStyleInterface,
12
12
  } from "victory-core";
13
13
 
14
14
  export type VictoryStackTTargetType = "data" | "labels" | "parent";
package/lib/index.js CHANGED
@@ -12,4 +12,5 @@ Object.defineProperty(exports, "VictoryStack", {
12
12
 
13
13
  var _victoryStack = _interopRequireDefault(require("./victory-stack"));
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
@@ -181,4 +181,5 @@ VictoryStackMemo.role = "stack";
181
181
  VictoryStackMemo.expectedComponents = ["groupComponent", "containerComponent", "labelComponent"];
182
182
  VictoryStackMemo.getChildren = _helperMethods.getChildren;
183
183
  var _default = VictoryStackMemo;
184
- exports.default = _default;
184
+ exports.default = _default;
185
+ //# sourceMappingURL=victory-stack.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "victory-stack",
3
- "version": "36.5.0",
3
+ "version": "36.5.3",
4
4
  "description": "Stack Layout Component for Victory",
5
5
  "keywords": [
6
6
  "data visualization",
@@ -22,8 +22,8 @@
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.5.0",
26
- "victory-shared-events": "^36.5.0"
25
+ "victory-core": "^36.5.3",
26
+ "victory-shared-events": "^36.5.3"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": ">=16.6.0"
@@ -32,5 +32,5 @@
32
32
  "version": "yarn run nps build-libs && nps build-dists"
33
33
  },
34
34
  "sideEffects": false,
35
- "gitHead": "7cecba921f751c3decc8215f7e866f51d11203c1"
35
+ "gitHead": "55338af3c57eacca5956e53c08a58e47ba41d01e"
36
36
  }
@@ -7,7 +7,7 @@ import isEqual from "react-fast-compare";
7
7
  const fallbackProps = {
8
8
  width: 450,
9
9
  height: 300,
10
- padding: 50
10
+ padding: 50,
11
11
  };
12
12
 
13
13
  // Assumes data in `datasets` is sorted by `Data.getData`.
@@ -65,9 +65,9 @@ function getY0(datum, index, datasets) {
65
65
  .filter((previousDatum) =>
66
66
  datum._x instanceof Date
67
67
  ? previousDatum._x.getTime() === datum._x.getTime()
68
- : previousDatum._x === datum._x
68
+ : previousDatum._x === datum._x,
69
69
  )
70
- .map((previousDatum) => previousDatum._y || 0)
70
+ .map((previousDatum) => previousDatum._y || 0),
71
71
  );
72
72
  }, []);
73
73
 
@@ -104,7 +104,7 @@ function addLayoutData(props, datasets, index) {
104
104
  ? null
105
105
  : datum._x instanceof Date
106
106
  ? new Date(+datum._x + +xOffset)
107
- : datum._x + xOffset
107
+ : datum._x + xOffset,
108
108
  });
109
109
  });
110
110
  }
@@ -113,7 +113,7 @@ function addLayoutData(props, datasets, index) {
113
113
  function stackData(props, childComponents) {
114
114
  const dataFromChildren = Wrapper.getDataFromChildren(props, childComponents);
115
115
  const filterNullChildData = dataFromChildren.map((dataset) =>
116
- dataset.filter((datum) => datum._x !== null && datum._y !== null)
116
+ dataset.filter((datum) => datum._x !== null && datum._y !== null),
117
117
  );
118
118
  const datasets = fillData(props, filterNullChildData);
119
119
  return datasets.map((d, i) => addLayoutData(props, datasets, i));
@@ -132,19 +132,19 @@ export function getCalculatedProps(props, childComponents) {
132
132
  });
133
133
  const domain = {
134
134
  x: Wrapper.getDomain(assign({}, props, { categories }), "x", children),
135
- y: Wrapper.getDomain(assign({}, props, { categories }), "y", children)
135
+ y: Wrapper.getDomain(assign({}, props, { categories }), "y", children),
136
136
  };
137
137
  const range = props.range || {
138
138
  x: Helpers.getRange(props, "x"),
139
- y: Helpers.getRange(props, "y")
139
+ y: Helpers.getRange(props, "y"),
140
140
  };
141
141
  const baseScale = {
142
142
  x: Scale.getScaleFromProps(props, "x") || Wrapper.getScale(props, "x"),
143
- y: Scale.getScaleFromProps(props, "y") || Wrapper.getScale(props, "y")
143
+ y: Scale.getScaleFromProps(props, "y") || Wrapper.getScale(props, "y"),
144
144
  };
145
145
  const scale = {
146
146
  x: baseScale.x.domain(domain.x).range(props.horizontal ? range.y : range.x),
147
- y: baseScale.y.domain(domain.y).range(props.horizontal ? range.x : range.y)
147
+ y: baseScale.y.domain(domain.y).range(props.horizontal ? range.x : range.y),
148
148
  };
149
149
  const { colorScale, horizontal } = props;
150
150
  return {
@@ -156,7 +156,7 @@ export function getCalculatedProps(props, childComponents) {
156
156
  scale,
157
157
  style,
158
158
  colorScale,
159
- role
159
+ role,
160
160
  };
161
161
  }
162
162
 
@@ -167,7 +167,7 @@ const withoutSharedEvents = (props) => {
167
167
  const modifiedChildren = React.Children.toArray(children).map((child) => {
168
168
  return {
169
169
  ...child,
170
- props: Helpers.omit(child.props, ["sharedEvents"])
170
+ props: Helpers.omit(child.props, ["sharedEvents"]),
171
171
  };
172
172
  });
173
173
  props.children = modifiedChildren;
@@ -210,7 +210,7 @@ export function getChildProps(props, calculatedProps) {
210
210
  domain,
211
211
  range,
212
212
  scale,
213
- horizontal
213
+ horizontal,
214
214
  };
215
215
  }
216
216
 
@@ -254,10 +254,10 @@ export function getChildren(props, childComponents, calculatedProps) {
254
254
  style,
255
255
  colorScale: getColorScale(props, child),
256
256
  data,
257
- polar: props.polar
257
+ polar: props.polar,
258
258
  },
259
- childProps
260
- )
259
+ childProps,
260
+ ),
261
261
  );
262
262
  });
263
263
  }
package/src/index.d.ts CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  VictoryCommonProps,
9
9
  VictoryLabelableProps,
10
10
  VictoryMultiLabelableProps,
11
- VictoryStyleInterface
11
+ VictoryStyleInterface,
12
12
  } from "victory-core";
13
13
 
14
14
  export type VictoryStackTTargetType = "data" | "labels" | "parent";
@@ -9,7 +9,7 @@ import {
9
9
  UserProps,
10
10
  VictoryContainer,
11
11
  VictoryTheme,
12
- Wrapper
12
+ Wrapper,
13
13
  } from "victory-core";
14
14
  import { VictorySharedEvents } from "victory-shared-events";
15
15
  import { getChildren, useMemoizedProps } from "./helper-methods";
@@ -18,7 +18,7 @@ import isEqual from "react-fast-compare";
18
18
  const fallbackProps = {
19
19
  width: 450,
20
20
  height: 300,
21
- padding: 50
21
+ padding: 50,
22
22
  };
23
23
 
24
24
  const VictoryStack = (initialProps) => {
@@ -41,7 +41,7 @@ const VictoryStack = (initialProps) => {
41
41
  theme,
42
42
  polar,
43
43
  horizontal,
44
- name
44
+ name,
45
45
  } = modifiedProps;
46
46
 
47
47
  const childComponents = React.Children.toArray(modifiedProps.children);
@@ -53,7 +53,7 @@ const VictoryStack = (initialProps) => {
53
53
  const orderedChildren = children.map((child, index) => {
54
54
  const childProps = assign(
55
55
  { animate: getAnimationProps(props, child, index, "victory-stack") },
56
- child.props
56
+ child.props,
57
57
  );
58
58
  return React.cloneElement(child, childProps);
59
59
  });
@@ -78,7 +78,7 @@ const VictoryStack = (initialProps) => {
78
78
  horizontal,
79
79
  polar,
80
80
  origin,
81
- name
81
+ name,
82
82
  };
83
83
  }
84
84
  return {};
@@ -93,11 +93,11 @@ const VictoryStack = (initialProps) => {
93
93
  horizontal,
94
94
  polar,
95
95
  origin,
96
- name
96
+ name,
97
97
  ]);
98
98
  const userProps = React.useMemo(
99
99
  () => UserProps.getSafeUserProps(initialProps),
100
- [initialProps]
100
+ [initialProps],
101
101
  );
102
102
 
103
103
  const container = React.useMemo(() => {
@@ -106,7 +106,7 @@ const VictoryStack = (initialProps) => {
106
106
  {},
107
107
  containerComponent.props,
108
108
  containerProps,
109
- userProps
109
+ userProps,
110
110
  );
111
111
  return React.cloneElement(containerComponent, defaultContainerProps);
112
112
  }
@@ -116,7 +116,7 @@ const VictoryStack = (initialProps) => {
116
116
  standalone,
117
117
  containerComponent,
118
118
  containerProps,
119
- userProps
119
+ userProps,
120
120
  ]);
121
121
 
122
122
  const events = React.useMemo(() => {
@@ -156,21 +156,21 @@ VictoryStack.propTypes = {
156
156
  PropTypes.arrayOf(
157
157
  PropTypes.oneOfType([
158
158
  CustomPropTypes.nonNegative,
159
- PropTypes.instanceOf(Date)
160
- ])
159
+ PropTypes.instanceOf(Date),
160
+ ]),
161
161
  ),
162
- CustomPropTypes.nonNegative
162
+ CustomPropTypes.nonNegative,
163
163
  ]),
164
164
  categories: PropTypes.oneOfType([
165
165
  PropTypes.arrayOf(PropTypes.string),
166
166
  PropTypes.shape({
167
167
  x: PropTypes.arrayOf(PropTypes.string),
168
- y: PropTypes.arrayOf(PropTypes.string)
169
- })
168
+ y: PropTypes.arrayOf(PropTypes.string),
169
+ }),
170
170
  ]),
171
171
  children: PropTypes.oneOfType([
172
172
  PropTypes.arrayOf(PropTypes.node),
173
- PropTypes.node
173
+ PropTypes.node,
174
174
  ]),
175
175
  colorScale: PropTypes.oneOfType([
176
176
  PropTypes.arrayOf(PropTypes.string),
@@ -182,8 +182,8 @@ VictoryStack.propTypes = {
182
182
  "cool",
183
183
  "red",
184
184
  "green",
185
- "blue"
186
- ])
185
+ "blue",
186
+ ]),
187
187
  ]),
188
188
  fillInMissingData: PropTypes.bool,
189
189
  horizontal: PropTypes.bool,
@@ -192,9 +192,9 @@ VictoryStack.propTypes = {
192
192
  style: PropTypes.shape({
193
193
  parent: PropTypes.object,
194
194
  data: PropTypes.object,
195
- labels: PropTypes.object
195
+ labels: PropTypes.object,
196
196
  }),
197
- xOffset: PropTypes.number
197
+ xOffset: PropTypes.number,
198
198
  };
199
199
 
200
200
  VictoryStack.defaultProps = {
@@ -202,7 +202,7 @@ VictoryStack.defaultProps = {
202
202
  groupComponent: <g />,
203
203
  standalone: true,
204
204
  theme: VictoryTheme.grayscale,
205
- fillInMissingData: true
205
+ fillInMissingData: true,
206
206
  };
207
207
 
208
208
  const VictoryStackMemo = React.memo(VictoryStack, isEqual);
@@ -213,7 +213,7 @@ VictoryStackMemo.role = "stack";
213
213
  VictoryStackMemo.expectedComponents = [
214
214
  "groupComponent",
215
215
  "containerComponent",
216
- "labelComponent"
216
+ "labelComponent",
217
217
  ];
218
218
 
219
219
  VictoryStackMemo.getChildren = getChildren;