victory-core 36.9.2-next.3 → 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 +28 -10
- package/README.md +1 -1
- package/dist/victory-core.js +4449 -6196
- package/dist/victory-core.min.js +1 -1
- package/es/index.d.ts +17 -17
- package/es/types/callbacks.d.ts +36 -36
- package/es/types/prop-types.d.ts +129 -129
- package/es/victory-accessible-group/victory-accessible-group.d.ts +10 -10
- package/es/victory-accessible-group/victory-accessible-group.js +9 -15
- package/es/victory-animation/util.d.ts +66 -66
- package/es/victory-animation/util.js +28 -47
- package/es/victory-animation/victory-animation.d.ts +34 -34
- package/es/victory-animation/victory-animation.js +51 -67
- package/es/victory-clip-container/victory-clip-container.d.ts +46 -46
- package/es/victory-clip-container/victory-clip-container.js +153 -229
- package/es/victory-container/victory-container.d.ts +68 -68
- package/es/victory-container/victory-container.js +157 -216
- package/es/victory-label/victory-label.d.ts +58 -58
- package/es/victory-label/victory-label.js +246 -323
- package/es/victory-portal/portal-context.d.ts +11 -11
- package/es/victory-portal/portal-context.js +1 -2
- package/es/victory-portal/portal.d.ts +20 -20
- package/es/victory-portal/portal.js +30 -76
- package/es/victory-portal/victory-portal.d.ts +26 -26
- package/es/victory-portal/victory-portal.js +47 -104
- package/es/victory-primitives/arc.d.ts +14 -14
- package/es/victory-primitives/arc.js +44 -47
- package/es/victory-primitives/background.d.ts +13 -13
- package/es/victory-primitives/background.js +14 -17
- package/es/victory-primitives/border.d.ts +10 -10
- package/es/victory-primitives/border.js +20 -24
- package/es/victory-primitives/circle.d.ts +3 -3
- package/es/victory-primitives/circle.js +13 -27
- package/es/victory-primitives/clip-path.d.ts +7 -7
- package/es/victory-primitives/clip-path.js +3 -7
- package/es/victory-primitives/index.d.ts +14 -14
- package/es/victory-primitives/line-segment.d.ts +11 -11
- package/es/victory-primitives/line-segment.js +20 -24
- package/es/victory-primitives/line.d.ts +3 -3
- package/es/victory-primitives/line.js +13 -27
- package/es/victory-primitives/path.d.ts +3 -3
- package/es/victory-primitives/path.js +13 -27
- package/es/victory-primitives/point.d.ts +13 -13
- package/es/victory-primitives/point.js +36 -40
- package/es/victory-primitives/rect.d.ts +3 -3
- package/es/victory-primitives/rect.js +13 -27
- package/es/victory-primitives/text.d.ts +8 -8
- package/es/victory-primitives/text.js +15 -28
- package/es/victory-primitives/tspan.d.ts +3 -3
- package/es/victory-primitives/tspan.js +13 -26
- package/es/victory-primitives/types.d.ts +7 -7
- package/es/victory-primitives/whisker.d.ts +15 -15
- package/es/victory-primitives/whisker.js +43 -47
- package/es/victory-theme/grayscale.d.ts +2 -2
- package/es/victory-theme/grayscale.js +22 -22
- package/es/victory-theme/material.d.ts +2 -2
- package/es/victory-theme/material.js +46 -46
- package/es/victory-theme/types.d.ts +238 -238
- package/es/victory-theme/victory-theme.d.ts +5 -5
- package/es/victory-theme/victory-theme.js +3 -3
- package/es/victory-transition/victory-transition.d.ts +53 -53
- package/es/victory-transition/victory-transition.js +126 -206
- package/es/victory-util/add-events.d.ts +126 -126
- package/es/victory-util/add-events.js +265 -380
- package/es/victory-util/axis.d.ts +50 -50
- package/es/victory-util/axis.js +133 -222
- package/es/victory-util/collection.d.ts +15 -8
- package/es/victory-util/collection.js +24 -36
- package/es/victory-util/common-props.d.ts +79 -79
- package/es/victory-util/data.d.ts +74 -74
- package/es/victory-util/data.js +159 -214
- package/es/victory-util/default-transitions.d.ts +4 -4
- package/es/victory-util/default-transitions.js +33 -51
- package/es/victory-util/domain.d.ts +90 -90
- package/es/victory-util/domain.js +122 -171
- package/es/victory-util/events.d.ts +64 -64
- package/es/victory-util/events.js +168 -258
- package/es/victory-util/helpers.d.ts +96 -91
- package/es/victory-util/helpers.js +162 -176
- package/es/victory-util/hooks/index.d.ts +2 -2
- package/es/victory-util/hooks/use-animation-state.d.ts +21 -21
- package/es/victory-util/hooks/use-animation-state.js +61 -99
- package/es/victory-util/hooks/use-previous-props.d.ts +1 -1
- package/es/victory-util/hooks/use-previous-props.js +2 -2
- package/es/victory-util/immutable.d.ts +11 -11
- package/es/victory-util/immutable.js +6 -8
- package/es/victory-util/index.d.ts +26 -26
- package/es/victory-util/label-helpers.d.ts +26 -26
- package/es/victory-util/label-helpers.js +128 -130
- package/es/victory-util/line-helpers.d.ts +4 -4
- package/es/victory-util/line-helpers.js +29 -41
- package/es/victory-util/log.d.ts +1 -1
- package/es/victory-util/log.js +1 -1
- package/es/victory-util/point-path-helpers.d.ts +9 -9
- package/es/victory-util/point-path-helpers.js +89 -49
- package/es/victory-util/scale.d.ts +9 -9
- package/es/victory-util/scale.js +24 -42
- package/es/victory-util/selection.d.ts +28 -28
- package/es/victory-util/selection.js +39 -40
- package/es/victory-util/style.d.ts +18 -18
- package/es/victory-util/style.js +8 -13
- package/es/victory-util/textsize.d.ts +35 -35
- package/es/victory-util/textsize.js +80 -154
- package/es/victory-util/timer-context.d.ts +11 -11
- package/es/victory-util/timer-context.js +2 -2
- package/es/victory-util/timer.d.ts +16 -16
- package/es/victory-util/timer.js +40 -76
- package/es/victory-util/transitions.d.ts +48 -48
- package/es/victory-util/transitions.js +110 -150
- package/es/victory-util/type-helpers.d.ts +9 -9
- package/es/victory-util/type-helpers.js +2 -3
- package/es/victory-util/user-props.d.ts +26 -26
- package/es/victory-util/user-props.js +24 -49
- package/es/victory-util/wrapper.d.ts +33 -37
- package/es/victory-util/wrapper.js +182 -245
- package/lib/index.d.ts +17 -17
- package/lib/index.js +0 -30
- package/lib/types/callbacks.d.ts +36 -36
- package/lib/types/prop-types.d.ts +129 -129
- package/lib/victory-accessible-group/victory-accessible-group.d.ts +10 -10
- package/lib/victory-accessible-group/victory-accessible-group.js +9 -19
- package/lib/victory-animation/util.d.ts +66 -66
- package/lib/victory-animation/util.js +28 -63
- package/lib/victory-animation/victory-animation.d.ts +34 -34
- package/lib/victory-animation/victory-animation.js +54 -83
- package/lib/victory-clip-container/victory-clip-container.d.ts +46 -46
- package/lib/victory-clip-container/victory-clip-container.js +156 -243
- package/lib/victory-container/victory-container.d.ts +68 -68
- package/lib/victory-container/victory-container.js +160 -232
- package/lib/victory-label/victory-label.d.ts +58 -58
- package/lib/victory-label/victory-label.js +248 -344
- package/lib/victory-portal/portal-context.d.ts +11 -11
- package/lib/victory-portal/portal-context.js +1 -6
- package/lib/victory-portal/portal.d.ts +20 -20
- package/lib/victory-portal/portal.js +31 -81
- package/lib/victory-portal/victory-portal.d.ts +26 -26
- package/lib/victory-portal/victory-portal.js +50 -116
- package/lib/victory-primitives/arc.d.ts +14 -14
- package/lib/victory-primitives/arc.js +48 -57
- package/lib/victory-primitives/background.d.ts +13 -13
- package/lib/victory-primitives/background.js +16 -28
- package/lib/victory-primitives/border.d.ts +10 -10
- package/lib/victory-primitives/border.js +22 -34
- package/lib/victory-primitives/circle.d.ts +3 -3
- package/lib/victory-primitives/circle.js +16 -36
- package/lib/victory-primitives/clip-path.d.ts +7 -7
- package/lib/victory-primitives/clip-path.js +3 -11
- package/lib/victory-primitives/index.d.ts +14 -14
- package/lib/victory-primitives/index.js +0 -28
- package/lib/victory-primitives/line-segment.d.ts +11 -11
- package/lib/victory-primitives/line-segment.js +22 -34
- package/lib/victory-primitives/line.d.ts +3 -3
- package/lib/victory-primitives/line.js +16 -36
- package/lib/victory-primitives/path.d.ts +3 -3
- package/lib/victory-primitives/path.js +16 -36
- package/lib/victory-primitives/point.d.ts +13 -13
- package/lib/victory-primitives/point.js +38 -52
- package/lib/victory-primitives/rect.d.ts +3 -3
- package/lib/victory-primitives/rect.js +16 -36
- package/lib/victory-primitives/text.d.ts +8 -8
- package/lib/victory-primitives/text.js +15 -33
- package/lib/victory-primitives/tspan.d.ts +3 -3
- package/lib/victory-primitives/tspan.js +13 -31
- package/lib/victory-primitives/types.d.ts +7 -7
- package/lib/victory-primitives/whisker.d.ts +15 -15
- package/lib/victory-primitives/whisker.js +45 -57
- package/lib/victory-theme/grayscale.d.ts +2 -2
- package/lib/victory-theme/grayscale.js +23 -24
- package/lib/victory-theme/material.d.ts +2 -2
- package/lib/victory-theme/material.js +47 -48
- package/lib/victory-theme/types.d.ts +238 -238
- package/lib/victory-theme/victory-theme.d.ts +5 -5
- package/lib/victory-theme/victory-theme.js +2 -7
- package/lib/victory-transition/victory-transition.d.ts +53 -53
- package/lib/victory-transition/victory-transition.js +129 -224
- package/lib/victory-util/add-events.d.ts +126 -126
- package/lib/victory-util/add-events.js +265 -382
- package/lib/victory-util/axis.d.ts +50 -50
- package/lib/victory-util/axis.js +135 -242
- package/lib/victory-util/collection.d.ts +15 -8
- package/lib/victory-util/collection.js +24 -43
- package/lib/victory-util/common-props.d.ts +79 -79
- package/lib/victory-util/data.d.ts +74 -74
- package/lib/victory-util/data.js +160 -239
- package/lib/victory-util/default-transitions.d.ts +4 -4
- package/lib/victory-util/default-transitions.js +33 -54
- package/lib/victory-util/domain.d.ts +90 -90
- package/lib/victory-util/domain.js +123 -193
- package/lib/victory-util/events.d.ts +64 -64
- package/lib/victory-util/events.js +167 -274
- package/lib/victory-util/helpers.d.ts +96 -91
- package/lib/victory-util/helpers.js +166 -204
- package/lib/victory-util/hooks/index.d.ts +2 -2
- package/lib/victory-util/hooks/index.js +0 -2
- package/lib/victory-util/hooks/use-animation-state.d.ts +21 -21
- package/lib/victory-util/hooks/use-animation-state.js +63 -113
- package/lib/victory-util/hooks/use-previous-props.d.ts +1 -1
- package/lib/victory-util/hooks/use-previous-props.js +2 -7
- package/lib/victory-util/immutable.d.ts +11 -11
- package/lib/victory-util/immutable.js +6 -18
- package/lib/victory-util/index.d.ts +26 -26
- package/lib/victory-util/index.js +2 -51
- package/lib/victory-util/label-helpers.d.ts +26 -26
- package/lib/victory-util/label-helpers.js +130 -141
- package/lib/victory-util/line-helpers.d.ts +4 -4
- package/lib/victory-util/line-helpers.js +31 -49
- package/lib/victory-util/log.d.ts +1 -1
- package/lib/victory-util/log.js +1 -2
- package/lib/victory-util/point-path-helpers.d.ts +9 -9
- package/lib/victory-util/point-path-helpers.js +91 -63
- package/lib/victory-util/scale.d.ts +9 -9
- package/lib/victory-util/scale.js +26 -57
- package/lib/victory-util/selection.d.ts +28 -28
- package/lib/victory-util/selection.js +41 -49
- package/lib/victory-util/style.d.ts +18 -18
- package/lib/victory-util/style.js +8 -16
- package/lib/victory-util/textsize.d.ts +35 -35
- package/lib/victory-util/textsize.js +80 -157
- package/lib/victory-util/timer-context.d.ts +11 -11
- package/lib/victory-util/timer-context.js +2 -8
- package/lib/victory-util/timer.d.ts +16 -16
- package/lib/victory-util/timer.js +40 -76
- package/lib/victory-util/transitions.d.ts +48 -48
- package/lib/victory-util/transitions.js +110 -152
- package/lib/victory-util/type-helpers.d.ts +9 -9
- package/lib/victory-util/type-helpers.js +2 -9
- package/lib/victory-util/user-props.d.ts +26 -26
- package/lib/victory-util/user-props.js +25 -59
- package/lib/victory-util/wrapper.d.ts +33 -37
- package/lib/victory-util/wrapper.js +184 -279
- package/package.json +6 -3
- package/src/types/prop-types.ts +0 -7
- package/src/victory-container/victory-container.tsx +195 -171
- package/src/victory-portal/portal-context.ts +4 -5
- package/src/victory-portal/portal.tsx +42 -5
- package/src/victory-portal/victory-portal.tsx +71 -34
- package/src/victory-util/add-events.tsx +6 -4
- package/src/victory-util/axis.tsx +12 -3
- package/src/victory-util/collection.tsx +13 -0
- package/src/victory-util/helpers.ts +11 -0
- package/src/victory-util/index.ts +0 -1
- package/src/victory-util/wrapper.tsx +1 -0
- package/src/victory-util/merge-refs.ts +0 -13
|
@@ -7,77 +7,58 @@ exports.containsDates = containsDates;
|
|
|
7
7
|
exports.containsNumbers = containsNumbers;
|
|
8
8
|
exports.containsOnlyStrings = containsOnlyStrings;
|
|
9
9
|
exports.containsStrings = containsStrings;
|
|
10
|
+
exports.difference = difference;
|
|
10
11
|
exports.getMaxValue = getMaxValue;
|
|
11
12
|
exports.getMinValue = getMinValue;
|
|
12
13
|
exports.isArrayOfArrays = isArrayOfArrays;
|
|
13
14
|
exports.removeUndefined = removeUndefined;
|
|
14
|
-
|
|
15
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
16
|
-
|
|
17
|
-
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."); }
|
|
18
|
-
|
|
19
|
-
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); }
|
|
20
|
-
|
|
21
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
22
|
-
|
|
23
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
24
|
-
|
|
25
|
-
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; }
|
|
26
|
-
|
|
27
15
|
function isNonEmptyArray(collection) {
|
|
28
16
|
return Array.isArray(collection) && collection.length > 0;
|
|
29
17
|
}
|
|
30
|
-
|
|
31
18
|
function containsStrings(collection) {
|
|
32
|
-
return Array.isArray(collection) && collection.some(
|
|
33
|
-
return typeof value === "string";
|
|
34
|
-
});
|
|
19
|
+
return Array.isArray(collection) && collection.some(value => typeof value === "string");
|
|
35
20
|
}
|
|
36
|
-
|
|
37
21
|
function containsDates(collection) {
|
|
38
|
-
return Array.isArray(collection) && collection.some(
|
|
39
|
-
return value instanceof Date;
|
|
40
|
-
});
|
|
22
|
+
return Array.isArray(collection) && collection.some(value => value instanceof Date);
|
|
41
23
|
}
|
|
42
|
-
|
|
43
24
|
function containsNumbers(collection) {
|
|
44
|
-
return Array.isArray(collection) && collection.some(
|
|
45
|
-
return typeof value === "number";
|
|
46
|
-
});
|
|
25
|
+
return Array.isArray(collection) && collection.some(value => typeof value === "number");
|
|
47
26
|
}
|
|
48
|
-
|
|
49
27
|
function containsOnlyStrings(collection) {
|
|
50
|
-
return isNonEmptyArray(collection) && collection.every(
|
|
51
|
-
return typeof value === "string";
|
|
52
|
-
});
|
|
28
|
+
return isNonEmptyArray(collection) && collection.every(value => typeof value === "string");
|
|
53
29
|
}
|
|
54
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Creates an array of array values not included in the other given arrays
|
|
33
|
+
* @param a The array to inspect
|
|
34
|
+
* @param b The values to exclude
|
|
35
|
+
* @returns The new array of filtered values
|
|
36
|
+
*/
|
|
37
|
+
function difference(a, b) {
|
|
38
|
+
if (a && b) {
|
|
39
|
+
return a.filter(value => !b.includes(value));
|
|
40
|
+
}
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
55
43
|
function isArrayOfArrays(collection) {
|
|
56
44
|
return isNonEmptyArray(collection) && collection.every(Array.isArray);
|
|
57
45
|
}
|
|
58
|
-
|
|
59
46
|
function removeUndefined(arr) {
|
|
60
|
-
return arr.filter(
|
|
61
|
-
return el !== undefined;
|
|
62
|
-
});
|
|
47
|
+
return arr.filter(el => el !== undefined);
|
|
63
48
|
}
|
|
64
|
-
|
|
65
49
|
function getMaxValue(arr) {
|
|
66
50
|
for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
67
51
|
values[_key - 1] = arguments[_key];
|
|
68
52
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
: 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);
|
|
73
56
|
}
|
|
74
|
-
|
|
75
57
|
function getMinValue(arr) {
|
|
76
58
|
for (var _len2 = arguments.length, values = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
77
59
|
values[_key2 - 1] = arguments[_key2];
|
|
78
60
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
: 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);
|
|
83
64
|
}
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { OriginType } from "../victory-label/victory-label";
|
|
3
|
-
import { PaddingProps, VictoryThemeDefinition } from "../victory-theme/types";
|
|
4
|
-
import { AnimatePropTypeInterface, CategoryPropType, ColorScalePropType, D3Scale, DataGetterPropType, DomainPaddingPropType, DomainPropType, EventCallbackInterface, RangePropType, ScalePropType, SortOrderPropType, StringOrNumberOrList } from "../types/prop-types";
|
|
5
|
-
import { NumberOrCallback, StringOrCallback } from "../types/callbacks";
|
|
6
|
-
export interface VictoryDatableProps {
|
|
7
|
-
categories?: CategoryPropType;
|
|
8
|
-
data?: readonly any[];
|
|
9
|
-
dataComponent?: React.ReactElement;
|
|
10
|
-
domain?: DomainPropType;
|
|
11
|
-
domainPadding?: DomainPaddingPropType;
|
|
12
|
-
samples?: number;
|
|
13
|
-
sortKey?: DataGetterPropType;
|
|
14
|
-
sortOrder?: SortOrderPropType;
|
|
15
|
-
x?: DataGetterPropType;
|
|
16
|
-
y?: DataGetterPropType;
|
|
17
|
-
y0?: DataGetterPropType;
|
|
18
|
-
}
|
|
19
|
-
export interface VictoryCommonThemeProps {
|
|
20
|
-
animate?: boolean | AnimatePropTypeInterface;
|
|
21
|
-
colorScale?: ColorScalePropType;
|
|
22
|
-
containerComponent?: React.ReactElement;
|
|
23
|
-
disableInlineStyles?: boolean;
|
|
24
|
-
domainPadding?: DomainPaddingPropType;
|
|
25
|
-
externalEventMutations?: EventCallbackInterface<string | string[], StringOrNumberOrList>[];
|
|
26
|
-
groupComponent?: React.ReactElement;
|
|
27
|
-
height?: number;
|
|
28
|
-
horizontal?: boolean;
|
|
29
|
-
maxDomain?: number | {
|
|
30
|
-
x?: number;
|
|
31
|
-
y?: number;
|
|
32
|
-
};
|
|
33
|
-
minDomain?: number | {
|
|
34
|
-
x?: number;
|
|
35
|
-
y?: number;
|
|
36
|
-
};
|
|
37
|
-
name?: string;
|
|
38
|
-
origin?: OriginType;
|
|
39
|
-
padding?: PaddingProps;
|
|
40
|
-
polar?: boolean;
|
|
41
|
-
range?: RangePropType;
|
|
42
|
-
scale?: ScalePropType | D3Scale | {
|
|
43
|
-
x?: ScalePropType | D3Scale;
|
|
44
|
-
y?: ScalePropType | D3Scale;
|
|
45
|
-
};
|
|
46
|
-
sharedEvents?: {
|
|
47
|
-
events: any[];
|
|
48
|
-
getEventState: Function;
|
|
49
|
-
};
|
|
50
|
-
singleQuadrantDomainPadding?: boolean | {
|
|
51
|
-
x?: boolean;
|
|
52
|
-
y?: boolean;
|
|
53
|
-
};
|
|
54
|
-
standalone?: boolean;
|
|
55
|
-
width?: number;
|
|
56
|
-
}
|
|
57
|
-
export interface VictoryCommonProps extends VictoryCommonThemeProps {
|
|
58
|
-
theme?: VictoryThemeDefinition;
|
|
59
|
-
}
|
|
60
|
-
export interface VictoryCommonPrimitiveProps {
|
|
61
|
-
active?: boolean;
|
|
62
|
-
ariaLabel?: StringOrCallback;
|
|
63
|
-
className?: string;
|
|
64
|
-
clipPath?: string;
|
|
65
|
-
data?: any;
|
|
66
|
-
desc?: string | Function;
|
|
67
|
-
disableInlineStyles?: boolean;
|
|
68
|
-
events?: object;
|
|
69
|
-
id?: number | string | Function;
|
|
70
|
-
index?: number | string;
|
|
71
|
-
origin?: OriginType;
|
|
72
|
-
polar?: boolean;
|
|
73
|
-
role?: string;
|
|
74
|
-
scale?: any;
|
|
75
|
-
shapeRendering?: string;
|
|
76
|
-
style?: any;
|
|
77
|
-
tabIndex?: NumberOrCallback;
|
|
78
|
-
transform?: string;
|
|
79
|
-
}
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { OriginType } from "../victory-label/victory-label";
|
|
3
|
+
import { PaddingProps, VictoryThemeDefinition } from "../victory-theme/types";
|
|
4
|
+
import { AnimatePropTypeInterface, CategoryPropType, ColorScalePropType, D3Scale, DataGetterPropType, DomainPaddingPropType, DomainPropType, EventCallbackInterface, RangePropType, ScalePropType, SortOrderPropType, StringOrNumberOrList } from "../types/prop-types";
|
|
5
|
+
import { NumberOrCallback, StringOrCallback } from "../types/callbacks";
|
|
6
|
+
export interface VictoryDatableProps {
|
|
7
|
+
categories?: CategoryPropType;
|
|
8
|
+
data?: readonly any[];
|
|
9
|
+
dataComponent?: React.ReactElement;
|
|
10
|
+
domain?: DomainPropType;
|
|
11
|
+
domainPadding?: DomainPaddingPropType;
|
|
12
|
+
samples?: number;
|
|
13
|
+
sortKey?: DataGetterPropType;
|
|
14
|
+
sortOrder?: SortOrderPropType;
|
|
15
|
+
x?: DataGetterPropType;
|
|
16
|
+
y?: DataGetterPropType;
|
|
17
|
+
y0?: DataGetterPropType;
|
|
18
|
+
}
|
|
19
|
+
export interface VictoryCommonThemeProps {
|
|
20
|
+
animate?: boolean | AnimatePropTypeInterface;
|
|
21
|
+
colorScale?: ColorScalePropType;
|
|
22
|
+
containerComponent?: React.ReactElement;
|
|
23
|
+
disableInlineStyles?: boolean;
|
|
24
|
+
domainPadding?: DomainPaddingPropType;
|
|
25
|
+
externalEventMutations?: EventCallbackInterface<string | string[], StringOrNumberOrList>[];
|
|
26
|
+
groupComponent?: React.ReactElement;
|
|
27
|
+
height?: number;
|
|
28
|
+
horizontal?: boolean;
|
|
29
|
+
maxDomain?: number | {
|
|
30
|
+
x?: number;
|
|
31
|
+
y?: number;
|
|
32
|
+
};
|
|
33
|
+
minDomain?: number | {
|
|
34
|
+
x?: number;
|
|
35
|
+
y?: number;
|
|
36
|
+
};
|
|
37
|
+
name?: string;
|
|
38
|
+
origin?: OriginType;
|
|
39
|
+
padding?: PaddingProps;
|
|
40
|
+
polar?: boolean;
|
|
41
|
+
range?: RangePropType;
|
|
42
|
+
scale?: ScalePropType | D3Scale | {
|
|
43
|
+
x?: ScalePropType | D3Scale;
|
|
44
|
+
y?: ScalePropType | D3Scale;
|
|
45
|
+
};
|
|
46
|
+
sharedEvents?: {
|
|
47
|
+
events: any[];
|
|
48
|
+
getEventState: Function;
|
|
49
|
+
};
|
|
50
|
+
singleQuadrantDomainPadding?: boolean | {
|
|
51
|
+
x?: boolean;
|
|
52
|
+
y?: boolean;
|
|
53
|
+
};
|
|
54
|
+
standalone?: boolean;
|
|
55
|
+
width?: number;
|
|
56
|
+
}
|
|
57
|
+
export interface VictoryCommonProps extends VictoryCommonThemeProps {
|
|
58
|
+
theme?: VictoryThemeDefinition;
|
|
59
|
+
}
|
|
60
|
+
export interface VictoryCommonPrimitiveProps {
|
|
61
|
+
active?: boolean;
|
|
62
|
+
ariaLabel?: StringOrCallback;
|
|
63
|
+
className?: string;
|
|
64
|
+
clipPath?: string;
|
|
65
|
+
data?: any;
|
|
66
|
+
desc?: string | Function;
|
|
67
|
+
disableInlineStyles?: boolean;
|
|
68
|
+
events?: object;
|
|
69
|
+
id?: number | string | Function;
|
|
70
|
+
index?: number | string;
|
|
71
|
+
origin?: OriginType;
|
|
72
|
+
polar?: boolean;
|
|
73
|
+
role?: string;
|
|
74
|
+
scale?: any;
|
|
75
|
+
shapeRendering?: string;
|
|
76
|
+
style?: any;
|
|
77
|
+
tabIndex?: NumberOrCallback;
|
|
78
|
+
transform?: string;
|
|
79
|
+
}
|
|
80
80
|
//# sourceMappingURL=common-props.d.ts.map
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
export declare function formatDataFromDomain(dataset: any, domain: any, defaultBaseline?: any): any;
|
|
2
|
-
/**
|
|
3
|
-
* Returns an object mapping string data to numeric data
|
|
4
|
-
* @param {Object} props: the props object
|
|
5
|
-
* @param {String} axis: the current axis
|
|
6
|
-
* @returns {Object} an object mapping string data to numeric data
|
|
7
|
-
*/
|
|
8
|
-
export declare function createStringMap(props: any, axis: any): any;
|
|
9
|
-
/**
|
|
10
|
-
* Reduces the size of a data array, such that it is <= maxPoints.
|
|
11
|
-
* @param {Array} data: an array of data; must be sorted
|
|
12
|
-
* @param {Number} maxPoints: maximum number of data points to return
|
|
13
|
-
* @param {Number} startingIndex: the index of the data[0] *in the entire dataset*; this function
|
|
14
|
-
assumes `data` param is a subset of larger dataset that has been zoommed
|
|
15
|
-
* @returns {Array} an array of data, a subset of data param
|
|
16
|
-
*/
|
|
17
|
-
export declare function downsample(data: any, maxPoints: any, startingIndex?: number): any;
|
|
18
|
-
/**
|
|
19
|
-
* Returns formatted data. Data accessors are applied, and string values are replaced.
|
|
20
|
-
* @param {Array} dataset: the original domain
|
|
21
|
-
* @param {Object} props: the props object
|
|
22
|
-
* @param {Array} expectedKeys: an array of expected data keys
|
|
23
|
-
* @returns {Array} the formatted data
|
|
24
|
-
*/
|
|
25
|
-
export declare function formatData(dataset: any[], props: any, expectedKeys?: string[]): any;
|
|
26
|
-
/**
|
|
27
|
-
* Returns generated x and y data based on domain and sample from props
|
|
28
|
-
* @param {Object} props: the props object
|
|
29
|
-
* @returns {Array} an array of data
|
|
30
|
-
*/
|
|
31
|
-
export declare function generateData(props: any): {
|
|
32
|
-
x: number;
|
|
33
|
-
y: number;
|
|
34
|
-
}[];
|
|
35
|
-
/**
|
|
36
|
-
* Returns an array of categories for a given axis
|
|
37
|
-
* @param {Object} props: the props object
|
|
38
|
-
* @param {String} axis: the current axis
|
|
39
|
-
* @returns {Array} an array of categories
|
|
40
|
-
*/
|
|
41
|
-
export declare function getCategories(props: any, axis: any): any;
|
|
42
|
-
/**
|
|
43
|
-
* Returns an array of formatted data
|
|
44
|
-
* @param {Object} props: the props object
|
|
45
|
-
* @returns {Array} an array of data
|
|
46
|
-
*/
|
|
47
|
-
export declare function getData(props: any): any;
|
|
48
|
-
/**
|
|
49
|
-
* Returns an array of strings from axis tickValues for a given axis
|
|
50
|
-
* @param {Object} props: the props object
|
|
51
|
-
* @param {String} axis: the current axis
|
|
52
|
-
* @returns {Array} an array of strings
|
|
53
|
-
*/
|
|
54
|
-
export declare function getStringsFromAxes(props: any, axis: any): any;
|
|
55
|
-
/**
|
|
56
|
-
* Returns an array of strings from categories for a given axis
|
|
57
|
-
* @param {Object} props: the props object
|
|
58
|
-
* @param {String} axis: the current axis
|
|
59
|
-
* @returns {Array} an array of strings
|
|
60
|
-
*/
|
|
61
|
-
export declare function getStringsFromCategories(props: any, axis: any): any;
|
|
62
|
-
/**
|
|
63
|
-
* Returns an array of strings from data
|
|
64
|
-
* @param {Object} props: the props object
|
|
65
|
-
* @param {String} axis: the current axis
|
|
66
|
-
* @returns {Array} an array of strings
|
|
67
|
-
*/
|
|
68
|
-
export declare function getStringsFromData(props: any, axis: any): any;
|
|
69
|
-
/**
|
|
70
|
-
* Checks whether a given component can be used to calculate data
|
|
71
|
-
* @param {Component} component: a React component instance
|
|
72
|
-
* @returns {Boolean} Returns true if the given component has a role included in the whitelist
|
|
73
|
-
*/
|
|
74
|
-
export declare function isDataComponent(component: any): boolean;
|
|
1
|
+
export declare function formatDataFromDomain(dataset: any, domain: any, defaultBaseline?: any): any;
|
|
2
|
+
/**
|
|
3
|
+
* Returns an object mapping string data to numeric data
|
|
4
|
+
* @param {Object} props: the props object
|
|
5
|
+
* @param {String} axis: the current axis
|
|
6
|
+
* @returns {Object} an object mapping string data to numeric data
|
|
7
|
+
*/
|
|
8
|
+
export declare function createStringMap(props: any, axis: any): any;
|
|
9
|
+
/**
|
|
10
|
+
* Reduces the size of a data array, such that it is <= maxPoints.
|
|
11
|
+
* @param {Array} data: an array of data; must be sorted
|
|
12
|
+
* @param {Number} maxPoints: maximum number of data points to return
|
|
13
|
+
* @param {Number} startingIndex: the index of the data[0] *in the entire dataset*; this function
|
|
14
|
+
assumes `data` param is a subset of larger dataset that has been zoommed
|
|
15
|
+
* @returns {Array} an array of data, a subset of data param
|
|
16
|
+
*/
|
|
17
|
+
export declare function downsample(data: any, maxPoints: any, startingIndex?: number): any;
|
|
18
|
+
/**
|
|
19
|
+
* Returns formatted data. Data accessors are applied, and string values are replaced.
|
|
20
|
+
* @param {Array} dataset: the original domain
|
|
21
|
+
* @param {Object} props: the props object
|
|
22
|
+
* @param {Array} expectedKeys: an array of expected data keys
|
|
23
|
+
* @returns {Array} the formatted data
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatData(dataset: any[], props: any, expectedKeys?: string[]): any;
|
|
26
|
+
/**
|
|
27
|
+
* Returns generated x and y data based on domain and sample from props
|
|
28
|
+
* @param {Object} props: the props object
|
|
29
|
+
* @returns {Array} an array of data
|
|
30
|
+
*/
|
|
31
|
+
export declare function generateData(props: any): {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
}[];
|
|
35
|
+
/**
|
|
36
|
+
* Returns an array of categories for a given axis
|
|
37
|
+
* @param {Object} props: the props object
|
|
38
|
+
* @param {String} axis: the current axis
|
|
39
|
+
* @returns {Array} an array of categories
|
|
40
|
+
*/
|
|
41
|
+
export declare function getCategories(props: any, axis: any): any;
|
|
42
|
+
/**
|
|
43
|
+
* Returns an array of formatted data
|
|
44
|
+
* @param {Object} props: the props object
|
|
45
|
+
* @returns {Array} an array of data
|
|
46
|
+
*/
|
|
47
|
+
export declare function getData(props: any): any;
|
|
48
|
+
/**
|
|
49
|
+
* Returns an array of strings from axis tickValues for a given axis
|
|
50
|
+
* @param {Object} props: the props object
|
|
51
|
+
* @param {String} axis: the current axis
|
|
52
|
+
* @returns {Array} an array of strings
|
|
53
|
+
*/
|
|
54
|
+
export declare function getStringsFromAxes(props: any, axis: any): any;
|
|
55
|
+
/**
|
|
56
|
+
* Returns an array of strings from categories for a given axis
|
|
57
|
+
* @param {Object} props: the props object
|
|
58
|
+
* @param {String} axis: the current axis
|
|
59
|
+
* @returns {Array} an array of strings
|
|
60
|
+
*/
|
|
61
|
+
export declare function getStringsFromCategories(props: any, axis: any): any;
|
|
62
|
+
/**
|
|
63
|
+
* Returns an array of strings from data
|
|
64
|
+
* @param {Object} props: the props object
|
|
65
|
+
* @param {String} axis: the current axis
|
|
66
|
+
* @returns {Array} an array of strings
|
|
67
|
+
*/
|
|
68
|
+
export declare function getStringsFromData(props: any, axis: any): any;
|
|
69
|
+
/**
|
|
70
|
+
* Checks whether a given component can be used to calculate data
|
|
71
|
+
* @param {Component} component: a React component instance
|
|
72
|
+
* @returns {Boolean} Returns true if the given component has a role included in the whitelist
|
|
73
|
+
*/
|
|
74
|
+
export declare function isDataComponent(component: any): boolean;
|
|
75
75
|
//# sourceMappingURL=data.d.ts.map
|