victory-box-plot 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.
- package/dist/victory-box-plot.js +252 -239
- package/dist/victory-box-plot.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-box-plot.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-box-plot.js +2 -1
- package/package.json +4 -4
- package/src/helper-methods.js +32 -32
- package/src/index.d.ts +1 -1
- package/src/victory-box-plot.js +37 -37
package/es/helper-methods.js
CHANGED
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default as VictoryBoxPlot } from "./victory-box-plot";
|
|
1
|
+
export { default as VictoryBoxPlot } from "./victory-box-plot";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
package/es/victory-box-plot.js
CHANGED
|
@@ -270,4 +270,5 @@ VictoryBoxPlot.getBaseProps = function (props) {
|
|
|
270
270
|
};
|
|
271
271
|
|
|
272
272
|
VictoryBoxPlot.expectedComponents = ["maxComponent", "maxLabelComponent", "medianComponent", "medianLabelComponent", "minComponent", "minLabelComponent", "q1Component", "q1LabelComponent", "q3Component", "q3LabelComponent", "groupComponent", "containerComponent"];
|
|
273
|
-
export default addEvents(VictoryBoxPlot, options);
|
|
273
|
+
export default addEvents(VictoryBoxPlot, options);
|
|
274
|
+
//# sourceMappingURL=victory-box-plot.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, "VictoryBoxPlot", {
|
|
|
12
12
|
|
|
13
13
|
var _victoryBoxPlot = _interopRequireDefault(require("./victory-box-plot"));
|
|
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-box-plot.js
CHANGED
|
@@ -285,4 +285,5 @@ VictoryBoxPlot.expectedComponents = ["maxComponent", "maxLabelComponent", "media
|
|
|
285
285
|
|
|
286
286
|
var _default = (0, _victoryCore.addEvents)(VictoryBoxPlot, options);
|
|
287
287
|
|
|
288
|
-
exports.default = _default;
|
|
288
|
+
exports.default = _default;
|
|
289
|
+
//# sourceMappingURL=victory-box-plot.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-box-plot",
|
|
3
|
-
"version": "36.5.
|
|
3
|
+
"version": "36.5.3",
|
|
4
4
|
"description": "Box Plot Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"lodash": "^4.17.19",
|
|
23
23
|
"prop-types": "^15.8.1",
|
|
24
|
-
"victory-core": "^36.5.
|
|
25
|
-
"victory-vendor": "^36.5.
|
|
24
|
+
"victory-core": "^36.5.3",
|
|
25
|
+
"victory-vendor": "^36.5.1"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": ">=16.6.0"
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"version": "yarn run nps build-libs && nps build-dists"
|
|
32
32
|
},
|
|
33
33
|
"sideEffects": false,
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "55338af3c57eacca5956e53c08a58e47ba41d01e"
|
|
35
35
|
}
|
package/src/helper-methods.js
CHANGED
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
groupBy,
|
|
7
7
|
keys,
|
|
8
8
|
isNaN,
|
|
9
|
-
isNil
|
|
9
|
+
isNil,
|
|
10
10
|
} from "lodash";
|
|
11
11
|
import { Helpers, Scale, Domain, Data, Collection } from "victory-core";
|
|
12
12
|
import {
|
|
13
13
|
min as d3Min,
|
|
14
14
|
max as d3Max,
|
|
15
|
-
quantile as d3Quantile
|
|
15
|
+
quantile as d3Quantile,
|
|
16
16
|
} from "victory-vendor/d3-array";
|
|
17
17
|
|
|
18
18
|
const TYPES = ["max", "min", "median", "q1", "q3"];
|
|
@@ -47,7 +47,7 @@ const getSummaryStatistics = (data) => {
|
|
|
47
47
|
_q3: nanToNull(d3Quantile(dependentVars, 0.75)), // eslint-disable-line no-magic-numbers
|
|
48
48
|
_min: nanToNull(d3Min(dependentVars)),
|
|
49
49
|
_median: nanToNull(d3Quantile(dependentVars, 0.5)),
|
|
50
|
-
_max: nanToNull(d3Max(dependentVars))
|
|
50
|
+
_max: nanToNull(d3Max(dependentVars)),
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
return assign({}, data[0], quartiles, { _y: data[0]._y });
|
|
@@ -72,7 +72,7 @@ const processData = (data) => {
|
|
|
72
72
|
the depedentVarArray and process each datum separately */
|
|
73
73
|
return data.map((datum) => {
|
|
74
74
|
const dataArray = datum[sortKey].map((d) =>
|
|
75
|
-
assign({}, datum, { [sortKey]: d })
|
|
75
|
+
assign({}, datum, { [sortKey]: d }),
|
|
76
76
|
);
|
|
77
77
|
const sortedData = orderBy(dataArray, sortKey);
|
|
78
78
|
return getSummaryStatistics(sortedData);
|
|
@@ -172,7 +172,7 @@ const getStyles = (props, styleObject) => {
|
|
|
172
172
|
const labelStyles = defaults(
|
|
173
173
|
{},
|
|
174
174
|
style.labels,
|
|
175
|
-
getLabelStyle(props, styleObject)
|
|
175
|
+
getLabelStyle(props, styleObject),
|
|
176
176
|
);
|
|
177
177
|
const boxStyles = defaults({}, style.boxes, styleObject.boxes);
|
|
178
178
|
const whiskerStyles = defaults({}, style.whiskers, styleObject.whiskers);
|
|
@@ -185,37 +185,37 @@ const getStyles = (props, styleObject) => {
|
|
|
185
185
|
{},
|
|
186
186
|
style.maxLabels,
|
|
187
187
|
getLabelStyle(props, styleObject, "max"),
|
|
188
|
-
labelStyles
|
|
188
|
+
labelStyles,
|
|
189
189
|
),
|
|
190
190
|
median: defaults({}, style.median, styleObject.median, whiskerStyles),
|
|
191
191
|
medianLabels: defaults(
|
|
192
192
|
{},
|
|
193
193
|
style.medianLabels,
|
|
194
194
|
getLabelStyle(props, styleObject, "median"),
|
|
195
|
-
labelStyles
|
|
195
|
+
labelStyles,
|
|
196
196
|
),
|
|
197
197
|
min: defaults({}, style.min, styleObject.min, whiskerStyles),
|
|
198
198
|
minLabels: defaults(
|
|
199
199
|
{},
|
|
200
200
|
style.minLabels,
|
|
201
201
|
getLabelStyle(props, styleObject, "min"),
|
|
202
|
-
labelStyles
|
|
202
|
+
labelStyles,
|
|
203
203
|
),
|
|
204
204
|
q1: defaults({}, style.q1, styleObject.q1, boxStyles),
|
|
205
205
|
q1Labels: defaults(
|
|
206
206
|
{},
|
|
207
207
|
style.q1Labels,
|
|
208
208
|
getLabelStyle(props, styleObject, "q1"),
|
|
209
|
-
labelStyles
|
|
209
|
+
labelStyles,
|
|
210
210
|
),
|
|
211
211
|
q3: defaults({}, style.q3, styleObject.q3, boxStyles),
|
|
212
212
|
q3Labels: defaults(
|
|
213
213
|
{},
|
|
214
214
|
style.q3Labels,
|
|
215
215
|
getLabelStyle(props, styleObject, "q3"),
|
|
216
|
-
labelStyles
|
|
216
|
+
labelStyles,
|
|
217
217
|
),
|
|
218
|
-
whiskers: whiskerStyles
|
|
218
|
+
whiskers: whiskerStyles,
|
|
219
219
|
};
|
|
220
220
|
};
|
|
221
221
|
|
|
@@ -224,11 +224,11 @@ const getCalculatedValues = (props) => {
|
|
|
224
224
|
const data = getData(props);
|
|
225
225
|
const range = {
|
|
226
226
|
x: Helpers.getRange(props, "x"),
|
|
227
|
-
y: Helpers.getRange(props, "y")
|
|
227
|
+
y: Helpers.getRange(props, "y"),
|
|
228
228
|
};
|
|
229
229
|
const domain = {
|
|
230
230
|
x: getDomain(props, "x"),
|
|
231
|
-
y: getDomain(props, "y")
|
|
231
|
+
y: getDomain(props, "y"),
|
|
232
232
|
};
|
|
233
233
|
const scale = {
|
|
234
234
|
x: Scale.getBaseScale(props, "x")
|
|
@@ -236,7 +236,7 @@ const getCalculatedValues = (props) => {
|
|
|
236
236
|
.range(props.horizontal ? range.y : range.x),
|
|
237
237
|
y: Scale.getBaseScale(props, "y")
|
|
238
238
|
.domain(domain.y)
|
|
239
|
-
.range(props.horizontal ? range.x : range.y)
|
|
239
|
+
.range(props.horizontal ? range.x : range.y),
|
|
240
240
|
};
|
|
241
241
|
const defaultStyles =
|
|
242
242
|
theme && theme.boxplot && theme.boxplot.style ? theme.boxplot.style : {};
|
|
@@ -257,7 +257,7 @@ const getWhiskerProps = (props, type) => {
|
|
|
257
257
|
datum,
|
|
258
258
|
scale,
|
|
259
259
|
index,
|
|
260
|
-
disableInlineStyles
|
|
260
|
+
disableInlineStyles,
|
|
261
261
|
} = props;
|
|
262
262
|
const { min, max, q1, q3, x, y } = props.positions;
|
|
263
263
|
const boxValue = type === "min" ? q1 : q3;
|
|
@@ -271,16 +271,16 @@ const getWhiskerProps = (props, type) => {
|
|
|
271
271
|
x1: horizontal ? boxValue : x,
|
|
272
272
|
y1: horizontal ? y : boxValue,
|
|
273
273
|
x2: horizontal ? whiskerValue : x,
|
|
274
|
-
y2: horizontal ? y : whiskerValue
|
|
274
|
+
y2: horizontal ? y : whiskerValue,
|
|
275
275
|
},
|
|
276
276
|
minorWhisker: {
|
|
277
277
|
x1: horizontal ? whiskerValue : x - width / 2,
|
|
278
278
|
y1: horizontal ? y - width / 2 : whiskerValue,
|
|
279
279
|
x2: horizontal ? whiskerValue : x + width / 2,
|
|
280
|
-
y2: horizontal ? y + width / 2 : whiskerValue
|
|
280
|
+
y2: horizontal ? y + width / 2 : whiskerValue,
|
|
281
281
|
},
|
|
282
282
|
style: disableInlineStyles ? {} : style[type] || style.whisker,
|
|
283
|
-
disableInlineStyles
|
|
283
|
+
disableInlineStyles,
|
|
284
284
|
};
|
|
285
285
|
};
|
|
286
286
|
|
|
@@ -292,7 +292,7 @@ const getBoxProps = (props, type) => {
|
|
|
292
292
|
scale,
|
|
293
293
|
datum,
|
|
294
294
|
index,
|
|
295
|
-
disableInlineStyles
|
|
295
|
+
disableInlineStyles,
|
|
296
296
|
} = props;
|
|
297
297
|
const { median, q1, q3, x, y } = props.positions;
|
|
298
298
|
const defaultX = type === "q1" ? q1 : median;
|
|
@@ -308,7 +308,7 @@ const getBoxProps = (props, type) => {
|
|
|
308
308
|
width: horizontal ? defaultWidth : boxWidth,
|
|
309
309
|
height: horizontal ? boxWidth : defaultHeight,
|
|
310
310
|
style: disableInlineStyles ? {} : style[type] || style.boxes,
|
|
311
|
-
disableInlineStyles
|
|
311
|
+
disableInlineStyles,
|
|
312
312
|
};
|
|
313
313
|
};
|
|
314
314
|
|
|
@@ -320,7 +320,7 @@ const getMedianProps = (props) => {
|
|
|
320
320
|
datum,
|
|
321
321
|
scale,
|
|
322
322
|
index,
|
|
323
|
-
disableInlineStyles
|
|
323
|
+
disableInlineStyles,
|
|
324
324
|
} = props;
|
|
325
325
|
const { median, x, y } = props.positions;
|
|
326
326
|
return {
|
|
@@ -332,7 +332,7 @@ const getMedianProps = (props) => {
|
|
|
332
332
|
x2: horizontal ? median : x + boxWidth / 2,
|
|
333
333
|
y2: horizontal ? y + boxWidth / 2 : median,
|
|
334
334
|
style: disableInlineStyles ? {} : style.median,
|
|
335
|
-
disableInlineStyles
|
|
335
|
+
disableInlineStyles,
|
|
336
336
|
};
|
|
337
337
|
};
|
|
338
338
|
|
|
@@ -363,7 +363,7 @@ const getLabelProps = (props, text, type) => {
|
|
|
363
363
|
labelOrientation,
|
|
364
364
|
style,
|
|
365
365
|
theme,
|
|
366
|
-
disableInlineStyles
|
|
366
|
+
disableInlineStyles,
|
|
367
367
|
} = props;
|
|
368
368
|
const orientation = getOrientation(labelOrientation, type);
|
|
369
369
|
const namespace = `${type}Labels`;
|
|
@@ -372,13 +372,13 @@ const getLabelProps = (props, text, type) => {
|
|
|
372
372
|
top: "end",
|
|
373
373
|
bottom: "start",
|
|
374
374
|
left: "middle",
|
|
375
|
-
right: "middle"
|
|
375
|
+
right: "middle",
|
|
376
376
|
};
|
|
377
377
|
const defaultTextAnchors = {
|
|
378
378
|
left: "end",
|
|
379
379
|
right: "start",
|
|
380
380
|
top: "middle",
|
|
381
|
-
bottom: "middle"
|
|
381
|
+
bottom: "middle",
|
|
382
382
|
};
|
|
383
383
|
const whiskerWidth =
|
|
384
384
|
typeof props.whiskerWidth === "number" ? props.whiskerWidth : boxWidth;
|
|
@@ -387,7 +387,7 @@ const getLabelProps = (props, text, type) => {
|
|
|
387
387
|
const getOffset = (coord) => {
|
|
388
388
|
const sign = {
|
|
389
389
|
x: orientation === "left" ? -1 : 1,
|
|
390
|
-
y: orientation === "top" ? -1 : 1
|
|
390
|
+
y: orientation === "top" ? -1 : 1,
|
|
391
391
|
};
|
|
392
392
|
return (sign[coord] * width) / 2 + sign[coord] * (labelStyle.padding || 0);
|
|
393
393
|
};
|
|
@@ -407,7 +407,7 @@ const getLabelProps = (props, text, type) => {
|
|
|
407
407
|
labelStyle.verticalAnchor || defaultVerticalAnchors[orientation],
|
|
408
408
|
angle: labelStyle.angle,
|
|
409
409
|
horizontal,
|
|
410
|
-
disableInlineStyles
|
|
410
|
+
disableInlineStyles,
|
|
411
411
|
};
|
|
412
412
|
|
|
413
413
|
const component = props[`${type}LabelComponent`];
|
|
@@ -474,7 +474,7 @@ export const getBaseProps = (props, fallbackProps) => {
|
|
|
474
474
|
data,
|
|
475
475
|
style,
|
|
476
476
|
domain,
|
|
477
|
-
name
|
|
477
|
+
name,
|
|
478
478
|
} = props;
|
|
479
479
|
const initialChildProps = {
|
|
480
480
|
parent: {
|
|
@@ -489,8 +489,8 @@ export const getBaseProps = (props, fallbackProps) => {
|
|
|
489
489
|
style: style.parent || {},
|
|
490
490
|
padding,
|
|
491
491
|
groupComponent,
|
|
492
|
-
horizontal
|
|
493
|
-
}
|
|
492
|
+
horizontal,
|
|
493
|
+
},
|
|
494
494
|
};
|
|
495
495
|
const boxScale = scale.y;
|
|
496
496
|
return data.reduce((acc, datum, index) => {
|
|
@@ -505,7 +505,7 @@ export const getBaseProps = (props, fallbackProps) => {
|
|
|
505
505
|
max: boxScale(datum._max),
|
|
506
506
|
median: boxScale(datum._median),
|
|
507
507
|
q1: boxScale(datum._q1),
|
|
508
|
-
q3: boxScale(datum._q3)
|
|
508
|
+
q3: boxScale(datum._q3),
|
|
509
509
|
};
|
|
510
510
|
const dataProps = assign({ index, datum, positions }, props);
|
|
511
511
|
const dataObj = TYPES.reduce((memo, type) => {
|
|
@@ -526,7 +526,7 @@ export const getBaseProps = (props, fallbackProps) => {
|
|
|
526
526
|
acc[eventKey][target] = getLabelProps(
|
|
527
527
|
assign({}, props, dataProps),
|
|
528
528
|
labelText,
|
|
529
|
-
type
|
|
529
|
+
type,
|
|
530
530
|
);
|
|
531
531
|
}
|
|
532
532
|
});
|
package/src/index.d.ts
CHANGED
package/src/victory-box-plot.js
CHANGED
|
@@ -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);
|