victory-core 36.4.1 → 36.5.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/dist/victory-core.js +874 -879
- package/dist/victory-core.min.js +1 -1
- package/es/index.d.ts +38 -941
- package/es/index.js +19 -28
- package/es/types.d.ts +33 -0
- package/es/types.js +1 -0
- package/es/victory-accessible-group/victory-accessible-group.d.ts +25 -0
- package/es/victory-accessible-group/victory-accessible-group.js +8 -16
- package/es/victory-animation/util.d.ts +66 -0
- package/es/victory-animation/util.js +2 -1
- package/es/victory-animation/victory-animation.d.ts +69 -0
- package/es/victory-animation/victory-animation.js +59 -67
- package/es/victory-clip-container/victory-clip-container.d.ts +76 -0
- package/es/victory-clip-container/victory-clip-container.js +15 -21
- package/es/victory-container/victory-container.d.ts +99 -0
- package/es/victory-container/victory-container.js +31 -31
- package/es/victory-label/victory-label.d.ts +61 -0
- package/es/victory-label/victory-label.js +13 -8
- package/es/victory-portal/portal-context.d.ts +11 -0
- package/es/victory-portal/portal-context.js +3 -4
- package/es/victory-portal/portal.d.ts +28 -0
- package/es/victory-portal/portal.js +25 -33
- package/es/victory-portal/victory-portal.d.ts +31 -0
- package/es/victory-portal/victory-portal.js +23 -22
- package/es/victory-primitives/arc.d.ts +21 -0
- package/es/victory-primitives/arc.js +3 -5
- package/es/victory-primitives/background.d.ts +22 -0
- package/es/victory-primitives/background.js +4 -6
- package/es/victory-primitives/border.d.ts +18 -0
- package/es/victory-primitives/border.js +3 -5
- package/es/victory-primitives/circle.d.ts +2 -0
- package/es/victory-primitives/circle.js +11 -8
- package/es/victory-primitives/clip-path.d.ts +14 -0
- package/es/victory-primitives/clip-path.js +6 -6
- package/es/victory-primitives/index.d.ts +14 -0
- package/es/victory-primitives/index.js +14 -0
- package/es/victory-primitives/line-segment.d.ts +19 -0
- package/es/victory-primitives/line-segment.js +3 -5
- package/es/victory-primitives/line.d.ts +2 -0
- package/es/victory-primitives/line.js +11 -8
- package/es/victory-primitives/path.d.ts +2 -0
- package/es/victory-primitives/path.js +9 -6
- package/es/victory-primitives/point.d.ts +21 -0
- package/es/victory-primitives/point.js +9 -19
- package/es/victory-primitives/rect.d.ts +2 -0
- package/es/victory-primitives/rect.js +11 -8
- package/es/victory-primitives/text.d.ts +16 -0
- package/es/victory-primitives/text.js +7 -6
- package/es/victory-primitives/tspan.d.ts +2 -0
- package/es/victory-primitives/tspan.js +7 -6
- package/es/victory-primitives/types.d.ts +7 -0
- package/es/victory-primitives/types.js +1 -0
- package/es/victory-primitives/whisker.d.ts +24 -0
- package/es/victory-primitives/whisker.js +3 -5
- package/es/victory-theme/grayscale.d.ts +2 -0
- package/es/victory-theme/grayscale.js +1 -1
- package/es/victory-theme/material.d.ts +2 -0
- package/es/victory-theme/material.js +1 -1
- package/es/victory-theme/victory-theme-definition.d.ts +244 -0
- package/es/victory-theme/victory-theme-definition.js +1 -0
- package/es/victory-theme/victory-theme.d.ts +5 -0
- package/es/victory-theme/victory-theme.js +6 -5
- package/es/victory-transition/victory-transition.d.ts +59 -0
- package/es/victory-transition/victory-transition.js +19 -23
- package/es/victory-util/add-events.js +6 -3
- package/es/victory-util/axis.js +0 -1
- package/es/victory-util/collection.js +0 -2
- package/es/victory-util/data.js +0 -2
- package/es/victory-util/default-transitions.js +0 -1
- package/es/victory-util/domain.js +0 -2
- package/es/victory-util/helpers.js +0 -2
- package/es/victory-util/immutable.js +0 -1
- package/es/victory-util/label-helpers.js +0 -2
- package/es/victory-util/log.js +0 -1
- package/es/victory-util/point-path-helpers.d.ts +9 -0
- package/es/victory-util/point-path-helpers.js +59 -61
- package/es/victory-util/selection.d.ts +23 -0
- package/es/victory-util/selection.js +0 -2
- package/es/victory-util/style.js +0 -2
- package/es/victory-util/textsize.d.ts +8 -0
- package/es/victory-util/timer-context.d.ts +11 -0
- package/es/victory-util/timer.d.ts +16 -0
- package/es/victory-util/timer.js +13 -8
- package/es/victory-util/types.d.ts +188 -0
- package/es/victory-util/types.js +1 -0
- package/lib/index.d.ts +38 -941
- package/lib/index.js +195 -193
- package/lib/types.d.ts +33 -0
- package/lib/types.js +1 -0
- package/lib/victory-accessible-group/victory-accessible-group.d.ts +25 -0
- package/lib/victory-accessible-group/victory-accessible-group.js +9 -15
- package/lib/victory-animation/util.d.ts +66 -0
- package/lib/victory-animation/util.js +2 -1
- package/lib/victory-animation/victory-animation.d.ts +69 -0
- package/lib/victory-animation/victory-animation.js +60 -65
- package/lib/victory-clip-container/victory-clip-container.d.ts +76 -0
- package/lib/victory-clip-container/victory-clip-container.js +19 -22
- package/lib/victory-container/victory-container.d.ts +99 -0
- package/lib/victory-container/victory-container.js +34 -31
- package/lib/victory-label/victory-label.d.ts +61 -0
- package/lib/victory-label/victory-label.js +19 -13
- package/lib/victory-portal/portal-context.d.ts +11 -0
- package/lib/victory-portal/portal-context.js +3 -4
- package/lib/victory-portal/portal.d.ts +28 -0
- package/lib/victory-portal/portal.js +26 -31
- package/lib/victory-portal/victory-portal.d.ts +31 -0
- package/lib/victory-portal/victory-portal.js +24 -20
- package/lib/victory-primitives/arc.d.ts +21 -0
- package/lib/victory-primitives/arc.js +5 -6
- package/lib/victory-primitives/background.d.ts +22 -0
- package/lib/victory-primitives/background.js +7 -8
- package/lib/victory-primitives/border.d.ts +18 -0
- package/lib/victory-primitives/border.js +5 -6
- package/lib/victory-primitives/circle.d.ts +2 -0
- package/lib/victory-primitives/circle.js +11 -6
- package/lib/victory-primitives/clip-path.d.ts +14 -0
- package/lib/victory-primitives/clip-path.js +7 -5
- package/lib/victory-primitives/index.d.ts +14 -0
- package/lib/victory-primitives/index.js +187 -0
- package/lib/victory-primitives/line-segment.d.ts +19 -0
- package/lib/victory-primitives/line-segment.js +5 -6
- package/lib/victory-primitives/line.d.ts +2 -0
- package/lib/victory-primitives/line.js +11 -6
- package/lib/victory-primitives/path.d.ts +2 -0
- package/lib/victory-primitives/path.js +9 -4
- package/lib/victory-primitives/point.d.ts +21 -0
- package/lib/victory-primitives/point.js +13 -21
- package/lib/victory-primitives/rect.d.ts +2 -0
- package/lib/victory-primitives/rect.js +11 -6
- package/lib/victory-primitives/text.d.ts +16 -0
- package/lib/victory-primitives/text.js +8 -5
- package/lib/victory-primitives/tspan.d.ts +2 -0
- package/lib/victory-primitives/tspan.js +7 -4
- package/lib/victory-primitives/types.d.ts +7 -0
- package/lib/victory-primitives/types.js +1 -0
- package/lib/victory-primitives/whisker.d.ts +24 -0
- package/lib/victory-primitives/whisker.js +5 -6
- package/lib/victory-theme/grayscale.d.ts +2 -0
- package/lib/victory-theme/grayscale.js +3 -3
- package/lib/victory-theme/material.d.ts +2 -0
- package/lib/victory-theme/material.js +3 -3
- package/lib/victory-theme/victory-theme-definition.d.ts +244 -0
- package/lib/victory-theme/victory-theme-definition.js +1 -0
- package/lib/victory-theme/victory-theme.d.ts +5 -0
- package/lib/victory-theme/victory-theme.js +22 -8
- package/lib/victory-transition/victory-transition.d.ts +59 -0
- package/lib/victory-transition/victory-transition.js +21 -23
- package/lib/victory-util/add-events.js +8 -4
- package/lib/victory-util/collection.js +0 -2
- package/lib/victory-util/default-transitions.js +0 -1
- package/lib/victory-util/helpers.js +0 -2
- package/lib/victory-util/immutable.js +0 -2
- package/lib/victory-util/label-helpers.js +0 -2
- package/lib/victory-util/log.js +0 -1
- package/lib/victory-util/point-path-helpers.d.ts +9 -0
- package/lib/victory-util/point-path-helpers.js +86 -73
- package/lib/victory-util/selection.d.ts +23 -0
- package/lib/victory-util/selection.js +0 -2
- package/lib/victory-util/style.js +0 -2
- package/lib/victory-util/textsize.d.ts +8 -0
- package/lib/victory-util/timer-context.d.ts +11 -0
- package/lib/victory-util/timer.d.ts +16 -0
- package/lib/victory-util/timer.js +13 -8
- package/lib/victory-util/types.d.ts +188 -0
- package/lib/victory-util/types.js +1 -0
- package/package.json +4 -4
- package/src/index.ts +42 -0
- package/src/types.ts +45 -0
- package/src/victory-accessible-group/{victory-accessible-group.js → victory-accessible-group.tsx} +10 -3
- package/src/victory-animation/{util.js → util.ts} +4 -3
- package/src/victory-animation/{victory-animation.js → victory-animation.tsx} +89 -12
- package/src/victory-clip-container/{victory-clip-container.js → victory-clip-container.tsx} +29 -5
- package/src/victory-container/{victory-container.js → victory-container.tsx} +70 -26
- package/src/victory-label/{victory-label.js → victory-label.tsx} +71 -14
- package/src/victory-portal/portal-context.ts +14 -0
- package/src/victory-portal/{portal.js → portal.tsx} +23 -12
- package/src/victory-portal/{victory-portal.js → victory-portal.tsx} +21 -6
- package/src/victory-primitives/{arc.js → arc.tsx} +15 -5
- package/src/victory-primitives/{background.js → background.tsx} +17 -7
- package/src/victory-primitives/{border.js → border.tsx} +12 -5
- package/src/victory-primitives/{circle.js → circle.tsx} +4 -3
- package/src/victory-primitives/clip-path.tsx +25 -0
- package/src/victory-primitives/index.ts +14 -0
- package/src/victory-primitives/{line-segment.js → line-segment.tsx} +13 -5
- package/src/victory-primitives/{line.js → line.tsx} +4 -3
- package/src/victory-primitives/{path.js → path.tsx} +4 -3
- package/src/victory-primitives/{point.js → point.tsx} +25 -20
- package/src/victory-primitives/{rect.js → rect.tsx} +4 -2
- package/src/victory-primitives/{text.js → text.tsx} +9 -3
- package/src/victory-primitives/tspan.tsx +7 -0
- package/src/victory-primitives/types.ts +19 -0
- package/src/victory-primitives/{whisker.js → whisker.tsx} +20 -7
- package/src/victory-theme/{grayscale.js → grayscale.tsx} +2 -1
- package/src/victory-theme/{material.js → material.tsx} +2 -1
- package/src/victory-theme/victory-theme-definition.ts +261 -0
- package/src/victory-theme/victory-theme.tsx +5 -0
- package/src/victory-transition/{victory-transition.js → victory-transition.tsx} +68 -19
- package/src/victory-util/add-events.js +6 -1
- package/src/victory-util/axis.js +0 -1
- package/src/victory-util/collection.js +0 -1
- package/src/victory-util/data.js +0 -1
- package/src/victory-util/default-transitions.js +0 -1
- package/src/victory-util/domain.js +0 -1
- package/src/victory-util/events.js +1 -1
- package/src/victory-util/helpers.js +0 -1
- package/src/victory-util/immutable.js +0 -1
- package/src/victory-util/label-helpers.js +0 -1
- package/src/victory-util/log.js +0 -1
- package/src/victory-util/point-path-helpers.ts +119 -0
- package/src/victory-util/prop-types.js +0 -1
- package/src/victory-util/scale.js +0 -1
- package/src/victory-util/selection.d.ts +23 -0
- package/src/victory-util/selection.js +0 -1
- package/src/victory-util/style.js +0 -1
- package/src/victory-util/textsize.d.ts +8 -0
- package/src/victory-util/{timer-context.js → timer-context.ts} +0 -0
- package/src/victory-util/{timer.js → timer.ts} +19 -4
- package/src/victory-util/transitions.js +0 -1
- package/src/victory-util/types.ts +247 -0
- package/src/victory-util/wrapper.js +0 -1
- package/src/index.d.ts +0 -941
- package/src/index.js +0 -51
- package/src/victory-portal/portal-context.js +0 -10
- package/src/victory-primitives/clip-path.js +0 -18
- package/src/victory-primitives/tspan.js +0 -5
- package/src/victory-theme/victory-theme.js +0 -7
- package/src/victory-util/point-path-helpers.js +0 -121
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function circle(x: number, y: number, size: number): string;
|
|
2
|
+
export declare function square(x: number, y: number, size: number): string;
|
|
3
|
+
export declare function diamond(x: number, y: number, size: number): string;
|
|
4
|
+
export declare function triangleDown(x: number, y: number, size: number): string;
|
|
5
|
+
export declare function triangleUp(x: number, y: number, size: number): string;
|
|
6
|
+
export declare function plus(x: number, y: number, size: number): string;
|
|
7
|
+
export declare function cross(x: number, y: number, size: number): string;
|
|
8
|
+
export declare function minus(x: number, y: number, size: number): string;
|
|
9
|
+
export declare function star(x: number, y: number, size: number): string;
|
|
@@ -1,73 +1,71 @@
|
|
|
1
1
|
import _range from "lodash/range";
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var baseSize = 0.87 * size; // eslint-disable-line no-magic-numbers
|
|
2
|
+
export function circle(x, y, size) {
|
|
3
|
+
return "M ".concat(x, ", ").concat(y, "\n m ").concat(-size, ", 0\n a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(size * 2, ",0\n a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(-size * 2, ",0");
|
|
4
|
+
}
|
|
5
|
+
export function square(x, y, size) {
|
|
6
|
+
var baseSize = 0.87 * size; // eslint-disable-line no-magic-numbers
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
var x0 = x - baseSize;
|
|
9
|
+
var y1 = y + baseSize;
|
|
10
|
+
var distance = x + baseSize - x0;
|
|
11
|
+
return "M ".concat(x0, ", ").concat(y1, "\n h").concat(distance, "\n v-").concat(distance, "\n h-").concat(distance, "\n z");
|
|
12
|
+
}
|
|
13
|
+
export function diamond(x, y, size) {
|
|
14
|
+
var baseSize = 0.87 * size; // eslint-disable-line no-magic-numbers
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
16
|
+
var length = Math.sqrt(2 * (baseSize * baseSize));
|
|
17
|
+
return "M ".concat(x, ", ").concat(y + length, "\n l ").concat(length, ", -").concat(length, "\n l -").concat(length, ", -").concat(length, "\n l -").concat(length, ", ").concat(length, "\n l ").concat(length, ", ").concat(length, "\n z");
|
|
18
|
+
}
|
|
19
|
+
export function triangleDown(x, y, size) {
|
|
20
|
+
var height = size / 2 * Math.sqrt(3);
|
|
21
|
+
var x0 = x - size;
|
|
22
|
+
var x1 = x + size;
|
|
23
|
+
var y0 = y - size;
|
|
24
|
+
var y1 = y + height;
|
|
25
|
+
return "M ".concat(x0, ", ").concat(y0, "\n L ").concat(x1, ", ").concat(y0, "\n L ").concat(x, ", ").concat(y1, "\n z");
|
|
26
|
+
}
|
|
27
|
+
export function triangleUp(x, y, size) {
|
|
28
|
+
var height = size / 2 * Math.sqrt(3);
|
|
29
|
+
var x0 = x - size;
|
|
30
|
+
var x1 = x + size;
|
|
31
|
+
var y0 = y - height;
|
|
32
|
+
var y1 = y + size;
|
|
33
|
+
return "M ".concat(x0, ", ").concat(y1, "\n L ").concat(x1, ", ").concat(y1, "\n L ").concat(x, ", ").concat(y0, "\n z");
|
|
34
|
+
}
|
|
35
|
+
export function plus(x, y, size) {
|
|
36
|
+
var baseSize = 1.1 * size; // eslint-disable-line no-magic-numbers
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
var distance = baseSize / 1.5; // eslint-disable-line no-magic-numbers
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
return "\n M ".concat(x - distance / 2, ", ").concat(y + baseSize, "\n v-").concat(distance, "\n h-").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h-").concat(distance, "\n v").concat(distance, "\n z");
|
|
41
|
+
}
|
|
42
|
+
export function cross(x, y, size) {
|
|
43
|
+
var baseSize = 0.8 * size; // eslint-disable-line no-magic-numbers
|
|
45
44
|
|
|
46
|
-
|
|
45
|
+
var distance = baseSize / 1.5; // eslint-disable-line no-magic-numbers
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
return "\n M ".concat(x - distance / 2, ", ").concat(y + baseSize + distance, "\n v-").concat(distance * 2, "\n h-").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h-").concat(distance, "\n v").concat(distance * 2, "\n z");
|
|
48
|
+
}
|
|
49
|
+
export function minus(x, y, size) {
|
|
50
|
+
var baseSize = 1.1 * size; // eslint-disable-line no-magic-numbers
|
|
52
51
|
|
|
53
|
-
|
|
52
|
+
var lineHeight = baseSize - baseSize * 0.3; // eslint-disable-line no-magic-numbers
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
var x0 = x - baseSize;
|
|
55
|
+
var y1 = y + lineHeight / 2;
|
|
56
|
+
var distance = x + baseSize - x0;
|
|
57
|
+
return "M ".concat(x0, ", ").concat(y1, "\n h").concat(distance, "\n v-").concat(lineHeight, "\n h-").concat(distance, "\n z");
|
|
58
|
+
}
|
|
59
|
+
export function star(x, y, size) {
|
|
60
|
+
var baseSize = 1.35 * size; // eslint-disable-line no-magic-numbers
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
var angle = Math.PI / 5; // eslint-disable-line no-magic-numbers
|
|
63
|
+
// eslint-disable-next-line no-magic-numbers
|
|
65
64
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
var starCoords = _range(10).map(function (index) {
|
|
66
|
+
var length = index % 2 === 0 ? baseSize : baseSize / 2;
|
|
67
|
+
return "".concat(length * Math.sin(angle * (index + 1)) + x, ",\n ").concat(length * Math.cos(angle * (index + 1)) + y);
|
|
68
|
+
});
|
|
70
69
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
};
|
|
70
|
+
return "M ".concat(starCoords.join("L"), " z");
|
|
71
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DomainPropType, ScalePropType, SVGCoordinateType } from "./types";
|
|
3
|
+
|
|
4
|
+
export function getParentSVG(evt: React.SyntheticEvent): string;
|
|
5
|
+
|
|
6
|
+
export function getSVGEventCoordinates(
|
|
7
|
+
evt: React.SyntheticEvent,
|
|
8
|
+
svg?: SVGElement
|
|
9
|
+
): SVGCoordinateType;
|
|
10
|
+
|
|
11
|
+
export function getDomainCoordinates(
|
|
12
|
+
props: any,
|
|
13
|
+
domain?: DomainPropType
|
|
14
|
+
): DomainPropType;
|
|
15
|
+
|
|
16
|
+
export function getDataCoordinates(
|
|
17
|
+
props: any,
|
|
18
|
+
scale: ScalePropType,
|
|
19
|
+
x: number,
|
|
20
|
+
y: number
|
|
21
|
+
): SVGCoordinateType;
|
|
22
|
+
|
|
23
|
+
export function getBounds(props: any): SVGCoordinateType;
|
package/es/victory-util/style.js
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Timer from "./timer";
|
|
3
|
+
/**
|
|
4
|
+
* The React context object consumers may use to access or override the global
|
|
5
|
+
* timer.
|
|
6
|
+
*/
|
|
7
|
+
declare const TimerContext: React.Context<{
|
|
8
|
+
transitionTimer: Timer;
|
|
9
|
+
animationTimer: Timer;
|
|
10
|
+
}>;
|
|
11
|
+
export default TimerContext;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare type Callback = (elapsed: number, duration: number) => void;
|
|
2
|
+
export default class Timer {
|
|
3
|
+
private shouldAnimate;
|
|
4
|
+
private readonly subscribers;
|
|
5
|
+
private activeSubscriptions;
|
|
6
|
+
private timer;
|
|
7
|
+
constructor();
|
|
8
|
+
bypassAnimation(): void;
|
|
9
|
+
resumeAnimation(): void;
|
|
10
|
+
loop: () => void;
|
|
11
|
+
start(): void;
|
|
12
|
+
stop(): void;
|
|
13
|
+
subscribe(callback: Callback, duration: number): number;
|
|
14
|
+
unsubscribe(id: any): void;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
package/es/victory-util/timer.js
CHANGED
|
@@ -8,11 +8,23 @@ import { timer, now } from "victory-vendor/d3-timer";
|
|
|
8
8
|
|
|
9
9
|
var Timer = /*#__PURE__*/function () {
|
|
10
10
|
function Timer() {
|
|
11
|
+
var _this = this;
|
|
12
|
+
|
|
11
13
|
_classCallCheck(this, Timer);
|
|
12
14
|
|
|
15
|
+
this.shouldAnimate = void 0;
|
|
16
|
+
this.subscribers = void 0;
|
|
17
|
+
this.activeSubscriptions = void 0;
|
|
18
|
+
this.timer = void 0;
|
|
19
|
+
|
|
20
|
+
this.loop = function () {
|
|
21
|
+
_this.subscribers.forEach(function (s) {
|
|
22
|
+
s.callback(now() - s.startTime, s.duration);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
13
26
|
this.shouldAnimate = true;
|
|
14
27
|
this.subscribers = [];
|
|
15
|
-
this.loop = this.loop.bind(this);
|
|
16
28
|
this.timer = null;
|
|
17
29
|
this.activeSubscriptions = 0;
|
|
18
30
|
}
|
|
@@ -27,13 +39,6 @@ var Timer = /*#__PURE__*/function () {
|
|
|
27
39
|
value: function resumeAnimation() {
|
|
28
40
|
this.shouldAnimate = true;
|
|
29
41
|
}
|
|
30
|
-
}, {
|
|
31
|
-
key: "loop",
|
|
32
|
-
value: function loop() {
|
|
33
|
-
this.subscribers.forEach(function (s) {
|
|
34
|
-
s.callback(now() - s.startTime, s.duration);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
42
|
}, {
|
|
38
43
|
key: "start",
|
|
39
44
|
value: function start() {
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { OriginType } from "../victory-label/victory-label";
|
|
3
|
+
import { NumberOrCallback, PaddingProps, VictoryThemeDefinition } from "../victory-theme/victory-theme";
|
|
4
|
+
import { StringOrCallback, StringOrNumberOrCallback } from "../types";
|
|
5
|
+
import { AnimationEasing, AnimationStyle } from "../victory-animation/victory-animation";
|
|
6
|
+
export declare type StringOrNumberOrList = string | number | (string | number)[];
|
|
7
|
+
export interface AnimatePropTypeInterface {
|
|
8
|
+
duration?: number;
|
|
9
|
+
onEnd?: () => void;
|
|
10
|
+
onExit?: {
|
|
11
|
+
duration?: number;
|
|
12
|
+
before?: (datum: any) => AnimationStyle;
|
|
13
|
+
};
|
|
14
|
+
onEnter?: {
|
|
15
|
+
duration?: number;
|
|
16
|
+
before?: (datum: any) => AnimationStyle;
|
|
17
|
+
after?: (datum: any) => AnimationStyle;
|
|
18
|
+
};
|
|
19
|
+
onLoad?: {
|
|
20
|
+
duration?: number;
|
|
21
|
+
before?: (datum: any) => AnimationStyle;
|
|
22
|
+
after?: (datum: any) => AnimationStyle;
|
|
23
|
+
};
|
|
24
|
+
easing?: AnimationEasing;
|
|
25
|
+
animationWhitelist?: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface EventCallbackInterface<TTarget, TEventKey> {
|
|
28
|
+
childName?: string | string[];
|
|
29
|
+
target?: TTarget;
|
|
30
|
+
eventKey?: TEventKey;
|
|
31
|
+
mutation: (props: any) => any;
|
|
32
|
+
callback?: (props: any) => any;
|
|
33
|
+
}
|
|
34
|
+
export interface EventPropTypeInterface<TTarget, TEventKey> {
|
|
35
|
+
childName?: string | Array<StringOrNumberOrCallback>;
|
|
36
|
+
target: TTarget;
|
|
37
|
+
eventKey?: TEventKey;
|
|
38
|
+
eventHandlers: {
|
|
39
|
+
[key: string]: {
|
|
40
|
+
(event: React.SyntheticEvent<any>, props?: any): EventCallbackInterface<TTarget, TEventKey>;
|
|
41
|
+
} | {
|
|
42
|
+
(event: React.SyntheticEvent<any>, props?: any): EventCallbackInterface<TTarget, TEventKey>[];
|
|
43
|
+
} | {
|
|
44
|
+
(event: React.SyntheticEvent<any>, props?: any): void;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export declare type DomainTuple = [number, number] | [Date, Date];
|
|
49
|
+
export declare type DomainPropObjectType = {
|
|
50
|
+
x?: DomainTuple;
|
|
51
|
+
y: DomainTuple;
|
|
52
|
+
} | {
|
|
53
|
+
x: DomainTuple;
|
|
54
|
+
y?: DomainTuple;
|
|
55
|
+
};
|
|
56
|
+
export declare type DomainPropType = DomainPropObjectType | DomainTuple;
|
|
57
|
+
export declare type PaddingType = number | [number, number];
|
|
58
|
+
export declare type DomainPaddingPropType = PaddingType | {
|
|
59
|
+
x?: PaddingType;
|
|
60
|
+
y?: PaddingType;
|
|
61
|
+
};
|
|
62
|
+
export declare type RangeTuple = [number, number];
|
|
63
|
+
export declare type RangePropType = RangeTuple | {
|
|
64
|
+
x?: RangeTuple;
|
|
65
|
+
y?: RangeTuple;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* D3 scale function shape. Don"t want to introduce typing dependency to d3
|
|
69
|
+
*/
|
|
70
|
+
export interface D3Scale {
|
|
71
|
+
(input: string | number): number;
|
|
72
|
+
domain: () => any;
|
|
73
|
+
range: () => any;
|
|
74
|
+
copy: () => any;
|
|
75
|
+
}
|
|
76
|
+
export declare type ScalePropType = "linear" | "time" | "log" | "sqrt";
|
|
77
|
+
export declare type CategoryPropType = string[] | {
|
|
78
|
+
x: string[];
|
|
79
|
+
} | {
|
|
80
|
+
y: string[];
|
|
81
|
+
} | {
|
|
82
|
+
x: string[];
|
|
83
|
+
y: string[];
|
|
84
|
+
};
|
|
85
|
+
export declare type DataGetterPropType = number | string | string[] | {
|
|
86
|
+
(data: any): number | string | string[];
|
|
87
|
+
} | Function;
|
|
88
|
+
export declare type InterpolationPropType = "basis" | "basisClosed" | "basisOpen" | "bundle" | "cardinal" | "cardinalClosed" | "cardinalOpen" | "catmullRom" | "catmullRomClosed" | "catmullRomOpen" | "linear" | "linearClosed" | "monotoneX" | "monotoneY" | "natural" | "radial" | "step" | "stepAfter" | "stepBefore";
|
|
89
|
+
export declare type ColorScalePropType = "grayscale" | "qualitative" | "heatmap" | "warm" | "cool" | "red" | "green" | "blue" | string[];
|
|
90
|
+
export declare type SortOrderPropType = "ascending" | "descending";
|
|
91
|
+
export declare type SVGCoordinateType = {
|
|
92
|
+
x: number;
|
|
93
|
+
y: number;
|
|
94
|
+
};
|
|
95
|
+
export interface VictoryCommonThemeProps {
|
|
96
|
+
animate?: boolean | AnimatePropTypeInterface;
|
|
97
|
+
colorScale?: ColorScalePropType;
|
|
98
|
+
containerComponent?: React.ReactElement;
|
|
99
|
+
domainPadding?: DomainPaddingPropType;
|
|
100
|
+
externalEventMutations?: EventCallbackInterface<string | string[], StringOrNumberOrList>[];
|
|
101
|
+
groupComponent?: React.ReactElement;
|
|
102
|
+
height?: number;
|
|
103
|
+
horizontal?: boolean;
|
|
104
|
+
maxDomain?: number | {
|
|
105
|
+
x?: number;
|
|
106
|
+
y?: number;
|
|
107
|
+
};
|
|
108
|
+
minDomain?: number | {
|
|
109
|
+
x?: number;
|
|
110
|
+
y?: number;
|
|
111
|
+
};
|
|
112
|
+
name?: string;
|
|
113
|
+
origin?: OriginType;
|
|
114
|
+
padding?: PaddingProps;
|
|
115
|
+
polar?: boolean;
|
|
116
|
+
range?: RangePropType;
|
|
117
|
+
scale?: ScalePropType | D3Scale | {
|
|
118
|
+
x?: ScalePropType | D3Scale;
|
|
119
|
+
y?: ScalePropType | D3Scale;
|
|
120
|
+
};
|
|
121
|
+
sharedEvents?: {
|
|
122
|
+
events: any[];
|
|
123
|
+
getEventState: Function;
|
|
124
|
+
};
|
|
125
|
+
singleQuadrantDomainPadding?: boolean | {
|
|
126
|
+
x?: boolean;
|
|
127
|
+
y?: boolean;
|
|
128
|
+
};
|
|
129
|
+
standalone?: boolean;
|
|
130
|
+
width?: number;
|
|
131
|
+
}
|
|
132
|
+
export interface VictoryCommonProps extends VictoryCommonThemeProps {
|
|
133
|
+
theme?: VictoryThemeDefinition;
|
|
134
|
+
}
|
|
135
|
+
export interface VictoryCommonPrimitiveProps {
|
|
136
|
+
active?: boolean;
|
|
137
|
+
ariaLabel?: StringOrCallback;
|
|
138
|
+
className?: string;
|
|
139
|
+
clipPath?: string;
|
|
140
|
+
data?: any;
|
|
141
|
+
desc?: string | Function;
|
|
142
|
+
disableInlineStyles?: boolean;
|
|
143
|
+
events?: object;
|
|
144
|
+
id?: number | string | Function;
|
|
145
|
+
index?: number | string;
|
|
146
|
+
origin?: OriginType;
|
|
147
|
+
polar?: boolean;
|
|
148
|
+
role?: string;
|
|
149
|
+
scale?: any;
|
|
150
|
+
shapeRendering?: string;
|
|
151
|
+
style?: any;
|
|
152
|
+
tabIndex?: NumberOrCallback;
|
|
153
|
+
transform?: string;
|
|
154
|
+
}
|
|
155
|
+
export interface VictoryDatableProps {
|
|
156
|
+
categories?: CategoryPropType;
|
|
157
|
+
data?: any[];
|
|
158
|
+
dataComponent?: React.ReactElement;
|
|
159
|
+
domain?: DomainPropType;
|
|
160
|
+
domainPadding?: DomainPaddingPropType;
|
|
161
|
+
samples?: number;
|
|
162
|
+
sortKey?: DataGetterPropType;
|
|
163
|
+
sortOrder?: SortOrderPropType;
|
|
164
|
+
x?: DataGetterPropType;
|
|
165
|
+
y?: DataGetterPropType;
|
|
166
|
+
y0?: DataGetterPropType;
|
|
167
|
+
}
|
|
168
|
+
export interface VictoryLabelableProps {
|
|
169
|
+
labelComponent?: React.ReactElement;
|
|
170
|
+
}
|
|
171
|
+
export interface VictoryMultiLabelableProps extends VictoryLabelableProps {
|
|
172
|
+
labels?: string[] | number[] | {
|
|
173
|
+
(data: any): string | string[] | number | number[] | null;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
export interface VictorySingleLabelableProps extends VictoryLabelableProps {
|
|
177
|
+
label?: string | {
|
|
178
|
+
(data: any): string | number | null;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
export interface TextSizeStyleInterface {
|
|
182
|
+
angle?: number;
|
|
183
|
+
characterConstant?: string;
|
|
184
|
+
fontFamily?: string;
|
|
185
|
+
fontSize?: number | string;
|
|
186
|
+
letterSpacing?: string;
|
|
187
|
+
lineHeight?: number;
|
|
188
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|