victory-core 36.9.2 → 37.0.0
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-core.js +4371 -5749
- package/dist/victory-core.min.js +1 -1
- package/es/victory-accessible-group/victory-accessible-group.js +9 -15
- package/es/victory-animation/util.js +28 -47
- package/es/victory-animation/victory-animation.js +51 -67
- package/es/victory-clip-container/victory-clip-container.js +153 -229
- package/es/victory-container/victory-container.js +157 -216
- package/es/victory-label/victory-label.js +246 -323
- package/es/victory-portal/portal-context.js +1 -2
- package/es/victory-portal/portal.js +30 -76
- package/es/victory-portal/victory-portal.js +47 -104
- package/es/victory-primitives/arc.js +44 -47
- package/es/victory-primitives/background.js +14 -17
- package/es/victory-primitives/border.js +20 -24
- package/es/victory-primitives/circle.js +13 -27
- package/es/victory-primitives/clip-path.js +3 -7
- package/es/victory-primitives/line-segment.js +20 -24
- package/es/victory-primitives/line.js +13 -27
- package/es/victory-primitives/path.js +13 -27
- package/es/victory-primitives/point.js +36 -40
- package/es/victory-primitives/rect.js +13 -27
- package/es/victory-primitives/text.js +15 -28
- package/es/victory-primitives/tspan.js +13 -26
- package/es/victory-primitives/whisker.js +43 -47
- package/es/victory-theme/grayscale.js +22 -22
- package/es/victory-theme/material.js +46 -46
- package/es/victory-theme/victory-theme.js +3 -3
- package/es/victory-transition/victory-transition.js +126 -206
- package/es/victory-util/add-events.js +263 -374
- package/es/victory-util/axis.js +126 -222
- package/es/victory-util/collection.js +13 -41
- package/es/victory-util/data.js +159 -214
- package/es/victory-util/default-transitions.js +33 -51
- package/es/victory-util/domain.js +122 -171
- package/es/victory-util/events.js +168 -258
- package/es/victory-util/helpers.js +153 -178
- package/es/victory-util/hooks/use-animation-state.js +61 -99
- package/es/victory-util/hooks/use-previous-props.js +2 -2
- package/es/victory-util/immutable.js +6 -8
- package/es/victory-util/label-helpers.js +128 -130
- package/es/victory-util/line-helpers.js +29 -41
- package/es/victory-util/log.js +1 -1
- package/es/victory-util/point-path-helpers.js +89 -49
- package/es/victory-util/scale.js +24 -42
- package/es/victory-util/selection.js +39 -40
- package/es/victory-util/style.js +8 -13
- package/es/victory-util/textsize.js +80 -154
- package/es/victory-util/timer-context.js +2 -2
- package/es/victory-util/timer.js +40 -76
- package/es/victory-util/transitions.js +110 -150
- package/es/victory-util/type-helpers.js +2 -3
- package/es/victory-util/user-props.js +24 -49
- package/es/victory-util/wrapper.js +184 -247
- package/lib/index.js +0 -30
- package/lib/victory-accessible-group/victory-accessible-group.js +9 -19
- package/lib/victory-animation/util.js +28 -63
- package/lib/victory-animation/victory-animation.js +54 -83
- package/lib/victory-clip-container/victory-clip-container.js +156 -243
- package/lib/victory-container/victory-container.js +160 -232
- package/lib/victory-label/victory-label.js +248 -344
- package/lib/victory-portal/portal-context.js +1 -6
- package/lib/victory-portal/portal.js +31 -81
- package/lib/victory-portal/victory-portal.js +50 -116
- package/lib/victory-primitives/arc.js +48 -57
- package/lib/victory-primitives/background.js +16 -28
- package/lib/victory-primitives/border.js +22 -34
- package/lib/victory-primitives/circle.js +16 -36
- package/lib/victory-primitives/clip-path.js +3 -11
- package/lib/victory-primitives/index.js +0 -28
- package/lib/victory-primitives/line-segment.js +22 -34
- package/lib/victory-primitives/line.js +16 -36
- package/lib/victory-primitives/path.js +16 -36
- package/lib/victory-primitives/point.js +38 -52
- package/lib/victory-primitives/rect.js +16 -36
- package/lib/victory-primitives/text.js +15 -33
- package/lib/victory-primitives/tspan.js +13 -31
- package/lib/victory-primitives/whisker.js +45 -57
- package/lib/victory-theme/grayscale.js +23 -24
- package/lib/victory-theme/material.js +47 -48
- package/lib/victory-theme/victory-theme.js +2 -7
- package/lib/victory-transition/victory-transition.js +129 -224
- package/lib/victory-util/add-events.js +263 -380
- package/lib/victory-util/axis.js +128 -241
- package/lib/victory-util/collection.js +13 -50
- package/lib/victory-util/data.js +160 -239
- package/lib/victory-util/default-transitions.js +33 -54
- package/lib/victory-util/domain.js +123 -193
- package/lib/victory-util/events.js +167 -274
- package/lib/victory-util/helpers.js +156 -207
- package/lib/victory-util/hooks/index.js +0 -2
- package/lib/victory-util/hooks/use-animation-state.js +63 -113
- package/lib/victory-util/hooks/use-previous-props.js +2 -7
- package/lib/victory-util/immutable.js +6 -18
- package/lib/victory-util/index.js +2 -51
- package/lib/victory-util/label-helpers.js +130 -141
- package/lib/victory-util/line-helpers.js +31 -49
- package/lib/victory-util/log.js +1 -2
- package/lib/victory-util/point-path-helpers.js +91 -63
- package/lib/victory-util/scale.js +26 -57
- package/lib/victory-util/selection.js +41 -49
- package/lib/victory-util/style.js +8 -16
- package/lib/victory-util/textsize.js +80 -157
- package/lib/victory-util/timer-context.js +2 -8
- package/lib/victory-util/timer.js +40 -76
- package/lib/victory-util/transitions.js +110 -152
- package/lib/victory-util/type-helpers.js +2 -9
- package/lib/victory-util/user-props.js +25 -59
- package/lib/victory-util/wrapper.js +186 -281
- package/package.json +2 -2
|
@@ -12,90 +12,53 @@ exports.getMaxValue = getMaxValue;
|
|
|
12
12
|
exports.getMinValue = getMinValue;
|
|
13
13
|
exports.isArrayOfArrays = isArrayOfArrays;
|
|
14
14
|
exports.removeUndefined = removeUndefined;
|
|
15
|
-
|
|
16
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
17
|
-
|
|
18
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
19
|
-
|
|
20
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
21
|
-
|
|
22
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
23
|
-
|
|
24
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
25
|
-
|
|
26
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
27
|
-
|
|
28
15
|
function isNonEmptyArray(collection) {
|
|
29
16
|
return Array.isArray(collection) && collection.length > 0;
|
|
30
17
|
}
|
|
31
|
-
|
|
32
18
|
function containsStrings(collection) {
|
|
33
|
-
return Array.isArray(collection) && collection.some(
|
|
34
|
-
return typeof value === "string";
|
|
35
|
-
});
|
|
19
|
+
return Array.isArray(collection) && collection.some(value => typeof value === "string");
|
|
36
20
|
}
|
|
37
|
-
|
|
38
21
|
function containsDates(collection) {
|
|
39
|
-
return Array.isArray(collection) && collection.some(
|
|
40
|
-
return value instanceof Date;
|
|
41
|
-
});
|
|
22
|
+
return Array.isArray(collection) && collection.some(value => value instanceof Date);
|
|
42
23
|
}
|
|
43
|
-
|
|
44
24
|
function containsNumbers(collection) {
|
|
45
|
-
return Array.isArray(collection) && collection.some(
|
|
46
|
-
return typeof value === "number";
|
|
47
|
-
});
|
|
25
|
+
return Array.isArray(collection) && collection.some(value => typeof value === "number");
|
|
48
26
|
}
|
|
49
|
-
|
|
50
27
|
function containsOnlyStrings(collection) {
|
|
51
|
-
return isNonEmptyArray(collection) && collection.every(
|
|
52
|
-
return typeof value === "string";
|
|
53
|
-
});
|
|
28
|
+
return isNonEmptyArray(collection) && collection.every(value => typeof value === "string");
|
|
54
29
|
}
|
|
30
|
+
|
|
55
31
|
/**
|
|
56
32
|
* Creates an array of array values not included in the other given arrays
|
|
57
33
|
* @param a The array to inspect
|
|
58
34
|
* @param b The values to exclude
|
|
59
35
|
* @returns The new array of filtered values
|
|
60
36
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
37
|
function difference(a, b) {
|
|
64
38
|
if (a && b) {
|
|
65
|
-
return a.filter(
|
|
66
|
-
return !b.includes(value);
|
|
67
|
-
});
|
|
39
|
+
return a.filter(value => !b.includes(value));
|
|
68
40
|
}
|
|
69
|
-
|
|
70
41
|
return [];
|
|
71
42
|
}
|
|
72
|
-
|
|
73
43
|
function isArrayOfArrays(collection) {
|
|
74
44
|
return isNonEmptyArray(collection) && collection.every(Array.isArray);
|
|
75
45
|
}
|
|
76
|
-
|
|
77
46
|
function removeUndefined(arr) {
|
|
78
|
-
return arr.filter(
|
|
79
|
-
return el !== undefined;
|
|
80
|
-
});
|
|
47
|
+
return arr.filter(el => el !== undefined);
|
|
81
48
|
}
|
|
82
|
-
|
|
83
49
|
function getMaxValue(arr) {
|
|
84
50
|
for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
85
51
|
values[_key - 1] = arguments[_key];
|
|
86
52
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
: Math.max.apply(Math, _toConsumableArray(array));
|
|
53
|
+
const array = arr.concat(values);
|
|
54
|
+
return containsDates(array) ? new Date(Math.max(...array)) // Dates will be coerced to numbers
|
|
55
|
+
: Math.max(...array);
|
|
91
56
|
}
|
|
92
|
-
|
|
93
57
|
function getMinValue(arr) {
|
|
94
58
|
for (var _len2 = arguments.length, values = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
95
59
|
values[_key2 - 1] = arguments[_key2];
|
|
96
60
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
: Math.min.apply(Math, _toConsumableArray(array));
|
|
61
|
+
const array = arr.concat(values);
|
|
62
|
+
return containsDates(array) ? new Date(Math.min(...array)) // Dates will be coerced to numbers
|
|
63
|
+
: Math.min(...array);
|
|
101
64
|
}
|