victory-box-plot 36.8.4 → 36.8.5
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/CHANGELOG.md +6 -0
- package/dist/victory-box-plot.js +493 -832
- package/dist/victory-box-plot.min.js +1 -1
- package/es/helper-methods.js +5 -10
- package/lib/helper-methods.js +5 -7
- package/package.json +4 -4
- package/src/helper-methods.tsx +10 -15
package/es/helper-methods.js
CHANGED
|
@@ -3,7 +3,6 @@ import _isNaN from "lodash/isNaN";
|
|
|
3
3
|
import _keys from "lodash/keys";
|
|
4
4
|
import _groupBy from "lodash/groupBy";
|
|
5
5
|
import _uniq from "lodash/uniq";
|
|
6
|
-
import _assign from "lodash/assign";
|
|
7
6
|
import _defaults from "lodash/defaults";
|
|
8
7
|
import _orderBy from "lodash/orderBy";
|
|
9
8
|
|
|
@@ -55,7 +54,7 @@ var getSummaryStatistics = function (data) {
|
|
|
55
54
|
_median: nanToNull(d3Quantile(dependentVars, 0.5)),
|
|
56
55
|
_max: nanToNull(d3Max(dependentVars))
|
|
57
56
|
};
|
|
58
|
-
return
|
|
57
|
+
return Object.assign({}, data[0], quartiles, {
|
|
59
58
|
_y: data[0]._y
|
|
60
59
|
});
|
|
61
60
|
};
|
|
@@ -83,7 +82,7 @@ var processData = function (data) {
|
|
|
83
82
|
the depedentVarArray and process each datum separately */
|
|
84
83
|
return data.map(function (datum) {
|
|
85
84
|
var dataArray = datum[sortKey].map(function (d) {
|
|
86
|
-
return
|
|
85
|
+
return Object.assign({}, datum, _defineProperty({}, sortKey, d));
|
|
87
86
|
});
|
|
88
87
|
|
|
89
88
|
var sortedData = _orderBy(dataArray, sortKey);
|
|
@@ -465,9 +464,7 @@ var isDatumOutOfBounds = function (datum, domain) {
|
|
|
465
464
|
|
|
466
465
|
export var getBaseProps = function (initialProps, fallbackProps) {
|
|
467
466
|
var modifiedProps = Helpers.modifyProps(initialProps, fallbackProps, "boxplot");
|
|
468
|
-
|
|
469
|
-
var props = _assign({}, modifiedProps, getCalculatedValues(modifiedProps));
|
|
470
|
-
|
|
467
|
+
var props = Object.assign({}, modifiedProps, getCalculatedValues(modifiedProps));
|
|
471
468
|
var groupComponent = props.groupComponent,
|
|
472
469
|
width = props.width,
|
|
473
470
|
height = props.height,
|
|
@@ -511,13 +508,11 @@ export var getBaseProps = function (initialProps, fallbackProps) {
|
|
|
511
508
|
q1: boxScale(datum._q1),
|
|
512
509
|
q3: boxScale(datum._q3)
|
|
513
510
|
};
|
|
514
|
-
|
|
515
|
-
var dataProps = _assign({
|
|
511
|
+
var dataProps = Object.assign({
|
|
516
512
|
index: index,
|
|
517
513
|
datum: datum,
|
|
518
514
|
positions: positions
|
|
519
515
|
}, props);
|
|
520
|
-
|
|
521
516
|
var dataObj = TYPES.reduce(function (memo, type) {
|
|
522
517
|
memo[type] = getDataProps(dataProps, type);
|
|
523
518
|
return memo;
|
|
@@ -529,7 +524,7 @@ export var getBaseProps = function (initialProps, fallbackProps) {
|
|
|
529
524
|
|
|
530
525
|
if (labelText !== null && labelText !== undefined || labelProp && (events || sharedEvents)) {
|
|
531
526
|
var target = "".concat(type, "Labels");
|
|
532
|
-
acc[eventKey][target] = getLabelProps(
|
|
527
|
+
acc[eventKey][target] = getLabelProps(Object.assign({}, props, dataProps), labelText, type);
|
|
533
528
|
}
|
|
534
529
|
});
|
|
535
530
|
return acc;
|
package/lib/helper-methods.js
CHANGED
|
@@ -15,8 +15,6 @@ var _groupBy2 = _interopRequireDefault(require("lodash/groupBy"));
|
|
|
15
15
|
|
|
16
16
|
var _uniq2 = _interopRequireDefault(require("lodash/uniq"));
|
|
17
17
|
|
|
18
|
-
var _assign3 = _interopRequireDefault(require("lodash/assign"));
|
|
19
|
-
|
|
20
18
|
var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
|
|
21
19
|
|
|
22
20
|
var _orderBy2 = _interopRequireDefault(require("lodash/orderBy"));
|
|
@@ -73,7 +71,7 @@ var getSummaryStatistics = function (data) {
|
|
|
73
71
|
_median: nanToNull((0, _d3Array.quantile)(dependentVars, 0.5)),
|
|
74
72
|
_max: nanToNull((0, _d3Array.max)(dependentVars))
|
|
75
73
|
};
|
|
76
|
-
return
|
|
74
|
+
return Object.assign({}, data[0], quartiles, {
|
|
77
75
|
_y: data[0]._y
|
|
78
76
|
});
|
|
79
77
|
};
|
|
@@ -101,7 +99,7 @@ var processData = function (data) {
|
|
|
101
99
|
the depedentVarArray and process each datum separately */
|
|
102
100
|
return data.map(function (datum) {
|
|
103
101
|
var dataArray = datum[sortKey].map(function (d) {
|
|
104
|
-
return
|
|
102
|
+
return Object.assign({}, datum, _defineProperty({}, sortKey, d));
|
|
105
103
|
});
|
|
106
104
|
var sortedData = (0, _orderBy2.default)(dataArray, sortKey);
|
|
107
105
|
return getSummaryStatistics(sortedData);
|
|
@@ -491,7 +489,7 @@ var isDatumOutOfBounds = function (datum, domain) {
|
|
|
491
489
|
var getBaseProps = function (initialProps, fallbackProps) {
|
|
492
490
|
var modifiedProps = _victoryCore.Helpers.modifyProps(initialProps, fallbackProps, "boxplot");
|
|
493
491
|
|
|
494
|
-
var props =
|
|
492
|
+
var props = Object.assign({}, modifiedProps, getCalculatedValues(modifiedProps));
|
|
495
493
|
var groupComponent = props.groupComponent,
|
|
496
494
|
width = props.width,
|
|
497
495
|
height = props.height,
|
|
@@ -535,7 +533,7 @@ var getBaseProps = function (initialProps, fallbackProps) {
|
|
|
535
533
|
q1: boxScale(datum._q1),
|
|
536
534
|
q3: boxScale(datum._q3)
|
|
537
535
|
};
|
|
538
|
-
var dataProps =
|
|
536
|
+
var dataProps = Object.assign({
|
|
539
537
|
index: index,
|
|
540
538
|
datum: datum,
|
|
541
539
|
positions: positions
|
|
@@ -551,7 +549,7 @@ var getBaseProps = function (initialProps, fallbackProps) {
|
|
|
551
549
|
|
|
552
550
|
if (labelText !== null && labelText !== undefined || labelProp && (events || sharedEvents)) {
|
|
553
551
|
var target = "".concat(type, "Labels");
|
|
554
|
-
acc[eventKey][target] = getLabelProps(
|
|
552
|
+
acc[eventKey][target] = getLabelProps(Object.assign({}, props, dataProps), labelText, type);
|
|
555
553
|
}
|
|
556
554
|
});
|
|
557
555
|
return acc;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-box-plot",
|
|
3
|
-
"version": "36.8.
|
|
3
|
+
"version": "36.8.5",
|
|
4
4
|
"description": "Box Plot Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"lodash": "^4.17.19",
|
|
24
24
|
"prop-types": "^15.8.1",
|
|
25
|
-
"victory-core": "^36.8.
|
|
26
|
-
"victory-vendor": "^36.8.
|
|
25
|
+
"victory-core": "^36.8.5",
|
|
26
|
+
"victory-vendor": "^36.8.5"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"react": ">=16.6.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"victory-box-plot": "*",
|
|
33
|
-
"victory-chart": "^36.8.
|
|
33
|
+
"victory-chart": "^36.8.5"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"provenance": true
|
package/src/helper-methods.tsx
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
orderBy,
|
|
3
|
-
defaults,
|
|
4
|
-
assign,
|
|
5
|
-
uniq,
|
|
6
|
-
groupBy,
|
|
7
|
-
keys,
|
|
8
|
-
isNaN,
|
|
9
|
-
isNil,
|
|
10
|
-
} from "lodash";
|
|
1
|
+
import { orderBy, defaults, uniq, groupBy, keys, isNaN, isNil } from "lodash";
|
|
11
2
|
import { Helpers, Scale, Domain, Data, Collection } from "victory-core";
|
|
12
3
|
import {
|
|
13
4
|
min as d3Min,
|
|
@@ -51,7 +42,7 @@ const getSummaryStatistics = (data) => {
|
|
|
51
42
|
_max: nanToNull(d3Max(dependentVars)),
|
|
52
43
|
};
|
|
53
44
|
|
|
54
|
-
return assign({}, data[0], quartiles, { _y: data[0]._y });
|
|
45
|
+
return Object.assign({}, data[0], quartiles, { _y: data[0]._y });
|
|
55
46
|
};
|
|
56
47
|
|
|
57
48
|
const processData = (data) => {
|
|
@@ -73,7 +64,7 @@ const processData = (data) => {
|
|
|
73
64
|
the depedentVarArray and process each datum separately */
|
|
74
65
|
return data.map((datum) => {
|
|
75
66
|
const dataArray = datum[sortKey].map((d) =>
|
|
76
|
-
assign({}, datum, { [sortKey]: d }),
|
|
67
|
+
Object.assign({}, datum, { [sortKey]: d }),
|
|
77
68
|
);
|
|
78
69
|
const sortedData = orderBy(dataArray, sortKey);
|
|
79
70
|
return getSummaryStatistics(sortedData);
|
|
@@ -463,7 +454,11 @@ export const getBaseProps = (initialProps, fallbackProps) => {
|
|
|
463
454
|
fallbackProps,
|
|
464
455
|
"boxplot",
|
|
465
456
|
);
|
|
466
|
-
const props = assign(
|
|
457
|
+
const props = Object.assign(
|
|
458
|
+
{},
|
|
459
|
+
modifiedProps,
|
|
460
|
+
getCalculatedValues(modifiedProps),
|
|
461
|
+
);
|
|
467
462
|
const {
|
|
468
463
|
groupComponent,
|
|
469
464
|
width,
|
|
@@ -511,7 +506,7 @@ export const getBaseProps = (initialProps, fallbackProps) => {
|
|
|
511
506
|
q1: boxScale(datum._q1),
|
|
512
507
|
q3: boxScale(datum._q3),
|
|
513
508
|
};
|
|
514
|
-
const dataProps = assign({ index, datum, positions }, props);
|
|
509
|
+
const dataProps = Object.assign({ index, datum, positions }, props);
|
|
515
510
|
const dataObj = TYPES.reduce((memo, type) => {
|
|
516
511
|
memo[type] = getDataProps(dataProps, type);
|
|
517
512
|
return memo;
|
|
@@ -528,7 +523,7 @@ export const getBaseProps = (initialProps, fallbackProps) => {
|
|
|
528
523
|
) {
|
|
529
524
|
const target = `${type}Labels`;
|
|
530
525
|
acc[eventKey][target] = getLabelProps(
|
|
531
|
-
assign({}, props, dataProps),
|
|
526
|
+
Object.assign({}, props, dataProps),
|
|
532
527
|
labelText,
|
|
533
528
|
type,
|
|
534
529
|
);
|