victory-box-plot 36.4.0 → 36.5.1

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.
@@ -13,7 +13,7 @@ import {
13
13
  Whisker,
14
14
  DefaultTransitions,
15
15
  CommonProps,
16
- UserProps
16
+ UserProps,
17
17
  } from "victory-core";
18
18
  import { getDomain, getData, getBaseProps } from "./helper-methods";
19
19
 
@@ -24,13 +24,13 @@ const fallbackProps = {
24
24
  top: 20,
25
25
  right: 20,
26
26
  bottom: 20,
27
- left: 20
28
- }
27
+ left: 20,
28
+ },
29
29
  };
30
30
 
31
31
  const defaultData = [
32
32
  { x: 1, min: 5, q1: 7, median: 12, q3: 18, max: 20 },
33
- { x: 2, min: 2, q1: 5, median: 8, q3: 12, max: 15 }
33
+ { x: 2, min: 2, q1: 5, median: 8, q3: 12, max: 15 },
34
34
  ];
35
35
 
36
36
  const options = {
@@ -45,8 +45,8 @@ const options = {
45
45
  { name: "q1Labels" },
46
46
  { name: "q3" },
47
47
  { name: "q3Labels" },
48
- { name: "parent", index: "parent" }
49
- ]
48
+ { name: "parent", index: "parent" },
49
+ ],
50
50
  };
51
51
 
52
52
  class VictoryBoxPlot extends React.Component {
@@ -56,7 +56,7 @@ class VictoryBoxPlot extends React.Component {
56
56
  "height",
57
57
  "padding",
58
58
  "style",
59
- "width"
59
+ "width",
60
60
  ];
61
61
 
62
62
  static displayName = "VictoryBoxPlot";
@@ -79,18 +79,18 @@ class VictoryBoxPlot extends React.Component {
79
79
  "q1Labels",
80
80
  "q3",
81
81
  "q3Labels",
82
- "parent"
82
+ "parent",
83
83
  ]),
84
84
  eventKey: PropTypes.oneOfType([
85
85
  PropTypes.array,
86
86
  CustomPropTypes.allOfType([
87
87
  CustomPropTypes.integer,
88
- CustomPropTypes.nonNegative
88
+ CustomPropTypes.nonNegative,
89
89
  ]),
90
- PropTypes.string
90
+ PropTypes.string,
91
91
  ]),
92
- eventHandlers: PropTypes.object
93
- })
92
+ eventHandlers: PropTypes.object,
93
+ }),
94
94
  ),
95
95
  horizontal: PropTypes.bool,
96
96
  labelOrientation: PropTypes.oneOfType([
@@ -100,89 +100,89 @@ class VictoryBoxPlot extends React.Component {
100
100
  q3: PropTypes.oneOf(["top", "bottom", "left", "right"]),
101
101
  min: PropTypes.oneOf(["top", "bottom", "left", "right"]),
102
102
  max: PropTypes.oneOf(["top", "bottom", "left", "right"]),
103
- median: PropTypes.oneOf(["top", "bottom", "left", "right"])
104
- })
103
+ median: PropTypes.oneOf(["top", "bottom", "left", "right"]),
104
+ }),
105
105
  ]),
106
106
  labels: PropTypes.bool,
107
107
  max: PropTypes.oneOfType([
108
108
  PropTypes.func,
109
109
  CustomPropTypes.allOfType([
110
110
  CustomPropTypes.integer,
111
- CustomPropTypes.nonNegative
111
+ CustomPropTypes.nonNegative,
112
112
  ]),
113
113
  PropTypes.string,
114
- PropTypes.arrayOf(PropTypes.string)
114
+ PropTypes.arrayOf(PropTypes.string),
115
115
  ]),
116
116
  maxComponent: PropTypes.element,
117
117
  maxLabelComponent: PropTypes.element,
118
118
  maxLabels: PropTypes.oneOfType([
119
119
  PropTypes.func,
120
120
  PropTypes.array,
121
- PropTypes.bool
121
+ PropTypes.bool,
122
122
  ]),
123
123
  median: PropTypes.oneOfType([
124
124
  PropTypes.func,
125
125
  CustomPropTypes.allOfType([
126
126
  CustomPropTypes.integer,
127
- CustomPropTypes.nonNegative
127
+ CustomPropTypes.nonNegative,
128
128
  ]),
129
129
  PropTypes.string,
130
- PropTypes.arrayOf(PropTypes.string)
130
+ PropTypes.arrayOf(PropTypes.string),
131
131
  ]),
132
132
  medianComponent: PropTypes.element,
133
133
  medianLabelComponent: PropTypes.element,
134
134
  medianLabels: PropTypes.oneOfType([
135
135
  PropTypes.func,
136
136
  PropTypes.array,
137
- PropTypes.bool
137
+ PropTypes.bool,
138
138
  ]),
139
139
  min: PropTypes.oneOfType([
140
140
  PropTypes.func,
141
141
  CustomPropTypes.allOfType([
142
142
  CustomPropTypes.integer,
143
- CustomPropTypes.nonNegative
143
+ CustomPropTypes.nonNegative,
144
144
  ]),
145
145
  PropTypes.string,
146
- PropTypes.arrayOf(PropTypes.string)
146
+ PropTypes.arrayOf(PropTypes.string),
147
147
  ]),
148
148
  minComponent: PropTypes.element,
149
149
  minLabelComponent: PropTypes.element,
150
150
  minLabels: PropTypes.oneOfType([
151
151
  PropTypes.func,
152
152
  PropTypes.array,
153
- PropTypes.bool
153
+ PropTypes.bool,
154
154
  ]),
155
155
  q1: PropTypes.oneOfType([
156
156
  PropTypes.func,
157
157
  CustomPropTypes.allOfType([
158
158
  CustomPropTypes.integer,
159
- CustomPropTypes.nonNegative
159
+ CustomPropTypes.nonNegative,
160
160
  ]),
161
161
  PropTypes.string,
162
- PropTypes.arrayOf(PropTypes.string)
162
+ PropTypes.arrayOf(PropTypes.string),
163
163
  ]),
164
164
  q1Component: PropTypes.element,
165
165
  q1LabelComponent: PropTypes.element,
166
166
  q1Labels: PropTypes.oneOfType([
167
167
  PropTypes.func,
168
168
  PropTypes.array,
169
- PropTypes.bool
169
+ PropTypes.bool,
170
170
  ]),
171
171
  q3: PropTypes.oneOfType([
172
172
  PropTypes.func,
173
173
  CustomPropTypes.allOfType([
174
174
  CustomPropTypes.integer,
175
- CustomPropTypes.nonNegative
175
+ CustomPropTypes.nonNegative,
176
176
  ]),
177
177
  PropTypes.string,
178
- PropTypes.arrayOf(PropTypes.string)
178
+ PropTypes.arrayOf(PropTypes.string),
179
179
  ]),
180
180
  q3Component: PropTypes.element,
181
181
  q3LabelComponent: PropTypes.element,
182
182
  q3Labels: PropTypes.oneOfType([
183
183
  PropTypes.func,
184
184
  PropTypes.array,
185
- PropTypes.bool
185
+ PropTypes.bool,
186
186
  ]),
187
187
  style: PropTypes.shape({
188
188
  boxes: PropTypes.object,
@@ -198,9 +198,9 @@ class VictoryBoxPlot extends React.Component {
198
198
  q1Labels: PropTypes.object,
199
199
  q3: PropTypes.object,
200
200
  q3Labels: PropTypes.object,
201
- whiskers: PropTypes.object
201
+ whiskers: PropTypes.object,
202
202
  }),
203
- whiskerWidth: PropTypes.number
203
+ whiskerWidth: PropTypes.number,
204
204
  };
205
205
 
206
206
  static defaultProps = {
@@ -222,7 +222,7 @@ class VictoryBoxPlot extends React.Component {
222
222
  sortKey: "x",
223
223
  sortOrder: "ascending",
224
224
  standalone: true,
225
- theme: VictoryTheme.grayscale
225
+ theme: VictoryTheme.grayscale,
226
226
  };
227
227
 
228
228
  static getDomain = getDomain;
@@ -240,7 +240,7 @@ class VictoryBoxPlot extends React.Component {
240
240
  "q3Component",
241
241
  "q3LabelComponent",
242
242
  "groupComponent",
243
- "containerComponent"
243
+ "containerComponent",
244
244
  ];
245
245
 
246
246
  renderBoxPlot(props) {
@@ -252,16 +252,16 @@ class VictoryBoxPlot extends React.Component {
252
252
  const componentProps = this.getComponentProps(
253
253
  baseComponent,
254
254
  type,
255
- index
255
+ index,
256
256
  );
257
257
  if (this.shouldRenderDatum(componentProps.datum)) {
258
258
  validDataComponents.push(
259
- React.cloneElement(baseComponent, componentProps)
259
+ React.cloneElement(baseComponent, componentProps),
260
260
  );
261
261
  }
262
262
  return validDataComponents;
263
263
  }, []);
264
- })
264
+ }),
265
265
  );
266
266
 
267
267
  const labelComponents = flatten(
@@ -276,7 +276,7 @@ class VictoryBoxPlot extends React.Component {
276
276
  return undefined;
277
277
  });
278
278
  return components.filter(Boolean);
279
- })
279
+ }),
280
280
  );
281
281
  const children = [...dataComponents, ...labelComponents];
282
282
  return this.renderContainer(props.groupComponent, children);
@@ -309,13 +309,11 @@ class VictoryBoxPlot extends React.Component {
309
309
  }
310
310
 
311
311
  const children = this.renderBoxPlot(props);
312
- const container = React.cloneElement(
313
- props.containerComponent,
314
- UserProps.getSafeUserProps(props)
315
- );
316
- return props.standalone
317
- ? this.renderContainer(container, children)
312
+ const component = props.standalone
313
+ ? this.renderContainer(props.containerComponent, children)
318
314
  : children;
315
+
316
+ return UserProps.withSafeUserProps(component, props);
319
317
  }
320
318
  }
321
319