victory-core 36.3.2 → 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 +15084 -15018
- 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 +35 -45
- package/es/victory-animation/util.d.ts +66 -0
- package/es/victory-animation/util.js +3 -2
- package/es/victory-animation/victory-animation.d.ts +69 -0
- package/es/victory-animation/victory-animation.js +92 -102
- package/es/victory-clip-container/victory-clip-container.d.ts +76 -0
- package/es/victory-clip-container/victory-clip-container.js +75 -82
- package/es/victory-container/victory-container.d.ts +99 -0
- package/es/victory-container/victory-container.js +97 -107
- package/es/victory-label/victory-label.d.ts +61 -0
- package/es/victory-label/victory-label.js +43 -31
- 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 +44 -50
- package/es/victory-portal/victory-portal.d.ts +31 -0
- package/es/victory-portal/victory-portal.js +38 -47
- package/es/victory-primitives/arc.d.ts +21 -0
- package/es/victory-primitives/arc.js +9 -9
- package/es/victory-primitives/background.d.ts +22 -0
- package/es/victory-primitives/background.js +12 -12
- package/es/victory-primitives/border.d.ts +18 -0
- package/es/victory-primitives/border.js +9 -9
- package/es/victory-primitives/circle.d.ts +2 -0
- package/es/victory-primitives/circle.js +17 -10
- 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 +9 -9
- package/es/victory-primitives/line.d.ts +2 -0
- package/es/victory-primitives/line.js +17 -10
- package/es/victory-primitives/path.d.ts +2 -0
- package/es/victory-primitives/path.js +15 -8
- package/es/victory-primitives/point.d.ts +21 -0
- package/es/victory-primitives/point.js +15 -23
- package/es/victory-primitives/rect.d.ts +2 -0
- package/es/victory-primitives/rect.js +17 -10
- package/es/victory-primitives/text.d.ts +16 -0
- package/es/victory-primitives/text.js +13 -8
- 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 +12 -12
- 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 +38 -44
- package/es/victory-util/add-events.js +328 -319
- package/es/victory-util/axis.js +12 -6
- package/es/victory-util/collection.js +7 -5
- package/es/victory-util/common-props.js +2 -2
- package/es/victory-util/data.js +8 -6
- package/es/victory-util/default-transitions.js +0 -1
- package/es/victory-util/domain.js +7 -5
- package/es/victory-util/events.js +8 -4
- package/es/victory-util/helpers.js +1 -3
- package/es/victory-util/hooks/use-animation-state.js +11 -5
- package/es/victory-util/immutable.js +0 -1
- package/es/victory-util/label-helpers.js +0 -2
- package/es/victory-util/line-helpers.js +1 -1
- 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/scale.js +19 -19
- 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/textsize.js +11 -7
- package/es/victory-util/timer-context.d.ts +11 -0
- package/es/victory-util/timer-context.js +1 -1
- package/es/victory-util/timer.d.ts +16 -0
- package/es/victory-util/timer.js +16 -13
- package/es/victory-util/types.d.ts +188 -0
- package/es/victory-util/types.js +1 -0
- package/es/victory-util/user-props.js +44 -4
- package/es/victory-util/wrapper.js +18 -12
- package/lib/index.d.ts +38 -941
- package/lib/index.js +201 -189
- 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 +37 -45
- package/lib/victory-animation/util.d.ts +66 -0
- package/lib/victory-animation/util.js +4 -3
- package/lib/victory-animation/victory-animation.d.ts +69 -0
- package/lib/victory-animation/victory-animation.js +97 -102
- package/lib/victory-clip-container/victory-clip-container.d.ts +76 -0
- package/lib/victory-clip-container/victory-clip-container.js +81 -82
- package/lib/victory-container/victory-container.d.ts +99 -0
- package/lib/victory-container/victory-container.js +102 -107
- package/lib/victory-label/victory-label.d.ts +61 -0
- package/lib/victory-label/victory-label.js +49 -32
- package/lib/victory-portal/portal-context.d.ts +11 -0
- package/lib/victory-portal/portal-context.js +4 -5
- package/lib/victory-portal/portal.d.ts +28 -0
- package/lib/victory-portal/portal.js +49 -50
- package/lib/victory-portal/victory-portal.d.ts +31 -0
- package/lib/victory-portal/victory-portal.js +43 -47
- package/lib/victory-primitives/arc.d.ts +21 -0
- package/lib/victory-primitives/arc.js +13 -10
- package/lib/victory-primitives/background.d.ts +22 -0
- package/lib/victory-primitives/background.js +16 -13
- package/lib/victory-primitives/border.d.ts +18 -0
- package/lib/victory-primitives/border.js +13 -10
- package/lib/victory-primitives/circle.d.ts +2 -0
- package/lib/victory-primitives/circle.js +17 -8
- 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 +13 -10
- package/lib/victory-primitives/line.d.ts +2 -0
- package/lib/victory-primitives/line.js +17 -8
- package/lib/victory-primitives/path.d.ts +2 -0
- package/lib/victory-primitives/path.js +15 -6
- package/lib/victory-primitives/point.d.ts +21 -0
- package/lib/victory-primitives/point.js +21 -25
- package/lib/victory-primitives/rect.d.ts +2 -0
- package/lib/victory-primitives/rect.js +17 -8
- package/lib/victory-primitives/text.d.ts +16 -0
- package/lib/victory-primitives/text.js +14 -7
- 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 +16 -13
- 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 +43 -45
- package/lib/victory-util/add-events.js +326 -316
- package/lib/victory-util/axis.js +20 -11
- package/lib/victory-util/collection.js +10 -8
- package/lib/victory-util/common-props.js +6 -4
- package/lib/victory-util/data.js +13 -7
- package/lib/victory-util/default-transitions.js +1 -2
- package/lib/victory-util/domain.js +11 -5
- package/lib/victory-util/events.js +17 -11
- package/lib/victory-util/helpers.js +14 -16
- package/lib/victory-util/hooks/index.js +4 -4
- package/lib/victory-util/hooks/use-animation-state.js +14 -6
- package/lib/victory-util/immutable.js +3 -5
- package/lib/victory-util/label-helpers.js +6 -6
- package/lib/victory-util/line-helpers.js +4 -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/prop-types.js +5 -3
- package/lib/victory-util/scale.js +24 -21
- package/lib/victory-util/selection.d.ts +23 -0
- package/lib/victory-util/selection.js +5 -5
- package/lib/victory-util/style.js +0 -2
- package/lib/victory-util/textsize.d.ts +8 -0
- package/lib/victory-util/textsize.js +12 -8
- package/lib/victory-util/timer-context.d.ts +11 -0
- package/lib/victory-util/timer-context.js +1 -1
- package/lib/victory-util/timer.d.ts +16 -0
- package/lib/victory-util/timer.js +16 -13
- package/lib/victory-util/types.d.ts +188 -0
- package/lib/victory-util/types.js +1 -0
- package/lib/victory-util/user-props.js +53 -6
- package/lib/victory-util/wrapper.js +31 -23
- package/package.json +6 -13
- 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} +5 -4
- package/src/victory-animation/{victory-animation.js → victory-animation.tsx} +90 -13
- package/src/victory-clip-container/{victory-clip-container.js → victory-clip-container.tsx} +32 -6
- package/src/victory-container/{victory-container.js → victory-container.tsx} +70 -26
- package/src/victory-label/{victory-label.js → victory-label.tsx} +80 -19
- 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 +7 -5
- package/src/victory-util/axis.js +3 -1
- package/src/victory-util/collection.js +0 -1
- package/src/victory-util/common-props.js +2 -2
- 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/line-helpers.js +1 -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 +18 -10
- 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} +20 -5
- package/src/victory-util/transitions.js +0 -1
- package/src/victory-util/types.ts +247 -0
- package/src/victory-util/user-props.js +31 -1
- 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,244 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { VictoryCommonThemeProps, VictoryDatableProps } from "../index";
|
|
3
|
+
import { CallbackArgs, StringOrNumberOrCallback } from "../types";
|
|
4
|
+
export declare type BlockProps = {
|
|
5
|
+
top?: number;
|
|
6
|
+
bottom?: number;
|
|
7
|
+
left?: number;
|
|
8
|
+
right?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare type PaddingProps = number | BlockProps;
|
|
11
|
+
export declare type OrientationTypes = "top" | "bottom" | "left" | "right";
|
|
12
|
+
export declare type VictoryNumberCallback = (args: CallbackArgs) => number;
|
|
13
|
+
export declare type VictoryPaddingCallback = (args: CallbackArgs) => number | BlockProps;
|
|
14
|
+
export declare type VictoryOrientationCallback = (args: CallbackArgs) => OrientationTypes;
|
|
15
|
+
export declare type NumberOrCallback = number | VictoryNumberCallback;
|
|
16
|
+
export declare type PaddingOrCallback = number | BlockProps | VictoryPaddingCallback;
|
|
17
|
+
export declare type OrientationOrCallback = OrientationTypes | VictoryOrientationCallback;
|
|
18
|
+
export declare type VictoryStyleObject = {
|
|
19
|
+
[K in keyof React.CSSProperties]: StringOrNumberOrCallback;
|
|
20
|
+
};
|
|
21
|
+
export declare type LabelProps = React.CSSProperties & {
|
|
22
|
+
angle?: number;
|
|
23
|
+
verticalAnchor?: VerticalAnchorType;
|
|
24
|
+
};
|
|
25
|
+
export declare type VictoryLabelStyleObject = {
|
|
26
|
+
[K in keyof LabelProps]: StringOrNumberOrCallback;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Style interface used in components/themeing
|
|
30
|
+
*/
|
|
31
|
+
export interface VictoryStyleInterface {
|
|
32
|
+
parent?: VictoryStyleObject;
|
|
33
|
+
data?: VictoryStyleObject;
|
|
34
|
+
labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
35
|
+
border?: VictoryStyleObject;
|
|
36
|
+
}
|
|
37
|
+
export declare type TickProps = React.CSSProperties & {
|
|
38
|
+
size?: number;
|
|
39
|
+
};
|
|
40
|
+
export declare type VictoryTickStyleObject = {
|
|
41
|
+
[K in keyof TickProps]: StringOrNumberOrCallback;
|
|
42
|
+
};
|
|
43
|
+
export interface VictoryAxisCommonProps {
|
|
44
|
+
axisComponent?: React.ReactElement;
|
|
45
|
+
axisLabelComponent?: React.ReactElement;
|
|
46
|
+
axisValue?: number | string | object | Date;
|
|
47
|
+
dependentAxis?: boolean;
|
|
48
|
+
disableInlineStyles?: boolean;
|
|
49
|
+
gridComponent?: React.ReactElement;
|
|
50
|
+
invertAxis?: boolean;
|
|
51
|
+
style?: {
|
|
52
|
+
parent?: VictoryStyleObject;
|
|
53
|
+
axis?: VictoryStyleObject;
|
|
54
|
+
axisLabel?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
55
|
+
grid?: VictoryStyleObject;
|
|
56
|
+
ticks?: VictoryTickStyleObject;
|
|
57
|
+
tickLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
58
|
+
};
|
|
59
|
+
tickComponent?: React.ReactElement;
|
|
60
|
+
tickCount?: number;
|
|
61
|
+
tickLabelComponent?: React.ReactElement;
|
|
62
|
+
tickFormat?: any[] | {
|
|
63
|
+
(tick: any, index: number, ticks: any[]): string | number;
|
|
64
|
+
};
|
|
65
|
+
tickValues?: any[];
|
|
66
|
+
}
|
|
67
|
+
export declare type VerticalAnchorType = "start" | "middle" | "end";
|
|
68
|
+
export interface VictoryThemeDefinition {
|
|
69
|
+
area?: {
|
|
70
|
+
style?: {
|
|
71
|
+
data?: VictoryStyleObject;
|
|
72
|
+
labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
73
|
+
};
|
|
74
|
+
} & VictoryCommonThemeProps & VictoryDatableProps;
|
|
75
|
+
axis?: {
|
|
76
|
+
style?: {
|
|
77
|
+
axis?: VictoryStyleObject;
|
|
78
|
+
axisLabel?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
79
|
+
grid?: VictoryStyleObject;
|
|
80
|
+
ticks?: VictoryTickStyleObject;
|
|
81
|
+
tickLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
82
|
+
};
|
|
83
|
+
offsetX?: number;
|
|
84
|
+
offsetY?: number;
|
|
85
|
+
} & VictoryCommonThemeProps;
|
|
86
|
+
bar?: {
|
|
87
|
+
style?: {
|
|
88
|
+
data?: VictoryStyleObject;
|
|
89
|
+
labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
90
|
+
};
|
|
91
|
+
} & VictoryCommonThemeProps & VictoryDatableProps;
|
|
92
|
+
boxplot?: {
|
|
93
|
+
style?: {
|
|
94
|
+
max?: VictoryStyleObject;
|
|
95
|
+
maxLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
96
|
+
median?: VictoryStyleObject;
|
|
97
|
+
medianLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
98
|
+
min?: VictoryStyleObject;
|
|
99
|
+
minLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
100
|
+
q1?: VictoryStyleObject;
|
|
101
|
+
q1Labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
102
|
+
q3?: VictoryStyleObject;
|
|
103
|
+
q3Labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
104
|
+
};
|
|
105
|
+
boxWidth?: number;
|
|
106
|
+
} & VictoryCommonThemeProps;
|
|
107
|
+
candlestick?: {
|
|
108
|
+
style?: {
|
|
109
|
+
data?: VictoryStyleObject;
|
|
110
|
+
labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
111
|
+
};
|
|
112
|
+
candleColors?: {
|
|
113
|
+
positive?: string;
|
|
114
|
+
negative?: string;
|
|
115
|
+
};
|
|
116
|
+
} & VictoryCommonThemeProps;
|
|
117
|
+
chart?: VictoryCommonThemeProps;
|
|
118
|
+
dependentAxis?: {
|
|
119
|
+
style?: {
|
|
120
|
+
axis?: VictoryStyleObject;
|
|
121
|
+
axisLabel?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
122
|
+
grid?: VictoryStyleObject;
|
|
123
|
+
ticks?: VictoryTickStyleObject;
|
|
124
|
+
tickLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
125
|
+
};
|
|
126
|
+
offsetX?: number;
|
|
127
|
+
offsetY?: number;
|
|
128
|
+
orientation?: OrientationTypes;
|
|
129
|
+
} & VictoryCommonThemeProps;
|
|
130
|
+
errorbar?: {
|
|
131
|
+
borderWidth?: number;
|
|
132
|
+
style?: {
|
|
133
|
+
data?: VictoryStyleObject;
|
|
134
|
+
labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
135
|
+
};
|
|
136
|
+
} & VictoryCommonThemeProps;
|
|
137
|
+
group?: {
|
|
138
|
+
style?: {
|
|
139
|
+
data?: VictoryStyleObject;
|
|
140
|
+
labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
141
|
+
};
|
|
142
|
+
} & VictoryCommonThemeProps;
|
|
143
|
+
histogram?: {
|
|
144
|
+
style?: {
|
|
145
|
+
data?: VictoryStyleObject;
|
|
146
|
+
labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
147
|
+
};
|
|
148
|
+
} & VictoryCommonThemeProps;
|
|
149
|
+
independentAxis?: {
|
|
150
|
+
style?: {
|
|
151
|
+
axis?: VictoryStyleObject;
|
|
152
|
+
axisLabel?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
153
|
+
grid?: VictoryStyleObject;
|
|
154
|
+
ticks?: VictoryTickStyleObject;
|
|
155
|
+
tickLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
156
|
+
};
|
|
157
|
+
offsetX?: number;
|
|
158
|
+
offsetY?: number;
|
|
159
|
+
orientation?: OrientationTypes;
|
|
160
|
+
} & VictoryCommonThemeProps;
|
|
161
|
+
legend?: {
|
|
162
|
+
gutter?: number | BlockProps;
|
|
163
|
+
rowGutter?: number | BlockProps;
|
|
164
|
+
orientation?: string;
|
|
165
|
+
titleOrientation?: string;
|
|
166
|
+
style?: {
|
|
167
|
+
data?: VictoryStyleObject & {
|
|
168
|
+
type?: string;
|
|
169
|
+
};
|
|
170
|
+
border?: VictoryStyleObject;
|
|
171
|
+
labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
172
|
+
title?: VictoryLabelStyleObject;
|
|
173
|
+
};
|
|
174
|
+
itemsPerRow?: number;
|
|
175
|
+
x?: number;
|
|
176
|
+
y?: number;
|
|
177
|
+
centerTitle?: boolean;
|
|
178
|
+
borderPadding?: number | BlockProps;
|
|
179
|
+
} & VictoryCommonThemeProps;
|
|
180
|
+
line?: {
|
|
181
|
+
style?: {
|
|
182
|
+
data?: VictoryStyleObject;
|
|
183
|
+
labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
184
|
+
};
|
|
185
|
+
} & VictoryCommonThemeProps & VictoryDatableProps;
|
|
186
|
+
pie?: {
|
|
187
|
+
style?: {
|
|
188
|
+
data?: VictoryStyleObject;
|
|
189
|
+
labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
190
|
+
};
|
|
191
|
+
} & VictoryCommonThemeProps & VictoryDatableProps;
|
|
192
|
+
polarAxis?: {
|
|
193
|
+
style?: {
|
|
194
|
+
axis?: VictoryStyleObject;
|
|
195
|
+
axisLabel?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
196
|
+
grid?: VictoryStyleObject;
|
|
197
|
+
ticks?: VictoryTickStyleObject;
|
|
198
|
+
tickLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
199
|
+
};
|
|
200
|
+
} & VictoryCommonThemeProps;
|
|
201
|
+
polarDependentAxis?: {
|
|
202
|
+
style?: {
|
|
203
|
+
axis?: VictoryStyleObject;
|
|
204
|
+
axisLabel?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
205
|
+
grid?: VictoryStyleObject;
|
|
206
|
+
ticks?: VictoryTickStyleObject;
|
|
207
|
+
tickLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
208
|
+
};
|
|
209
|
+
} & VictoryCommonThemeProps;
|
|
210
|
+
polarIndependentAxis?: {
|
|
211
|
+
style?: {
|
|
212
|
+
axis?: VictoryStyleObject;
|
|
213
|
+
axisLabel?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
214
|
+
grid?: VictoryStyleObject;
|
|
215
|
+
ticks?: VictoryTickStyleObject;
|
|
216
|
+
tickLabels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
217
|
+
};
|
|
218
|
+
} & VictoryCommonThemeProps;
|
|
219
|
+
scatter?: {
|
|
220
|
+
style?: {
|
|
221
|
+
data?: VictoryStyleObject;
|
|
222
|
+
labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
223
|
+
};
|
|
224
|
+
} & VictoryCommonThemeProps & VictoryDatableProps;
|
|
225
|
+
stack?: VictoryCommonThemeProps;
|
|
226
|
+
tooltip?: {
|
|
227
|
+
style?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
228
|
+
flyoutStyle?: VictoryStyleObject;
|
|
229
|
+
cornerRadius?: NumberOrCallback;
|
|
230
|
+
pointerLength?: NumberOrCallback;
|
|
231
|
+
flyoutPadding?: PaddingOrCallback;
|
|
232
|
+
flyoutWidth?: NumberOrCallback;
|
|
233
|
+
flyoutHeight?: NumberOrCallback;
|
|
234
|
+
orientation?: OrientationOrCallback;
|
|
235
|
+
pointerOrientation?: OrientationOrCallback;
|
|
236
|
+
};
|
|
237
|
+
voronoi?: {
|
|
238
|
+
style?: {
|
|
239
|
+
data?: VictoryStyleObject;
|
|
240
|
+
labels?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
241
|
+
flyout?: VictoryStyleObject;
|
|
242
|
+
};
|
|
243
|
+
} & VictoryCommonThemeProps & VictoryDatableProps;
|
|
244
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
grayscale:
|
|
1
|
+
import { grayscale } from "./grayscale";
|
|
2
|
+
import { material } from "./material";
|
|
3
|
+
export * from "./victory-theme-definition";
|
|
4
|
+
export var VictoryTheme = {
|
|
5
|
+
grayscale: grayscale,
|
|
6
|
+
material: material
|
|
6
7
|
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import TimerContext from "../victory-util/timer-context";
|
|
4
|
+
import Timer from "../victory-util/timer";
|
|
5
|
+
declare type VictoryTransitionChild = React.ReactElement<{
|
|
6
|
+
polar?: boolean;
|
|
7
|
+
domain?: number[] | {
|
|
8
|
+
x: number[];
|
|
9
|
+
y: number[];
|
|
10
|
+
};
|
|
11
|
+
groupComponent?: React.ReactElement;
|
|
12
|
+
}, {
|
|
13
|
+
new (props: any): React.Component<any, any>;
|
|
14
|
+
continuous?: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
interface VictoryTransitionProps {
|
|
17
|
+
animate?: boolean | any;
|
|
18
|
+
animationWhitelist?: string[];
|
|
19
|
+
children: VictoryTransitionChild;
|
|
20
|
+
}
|
|
21
|
+
interface VictoryTransitionState {
|
|
22
|
+
oldProps?: VictoryTransitionProps | null;
|
|
23
|
+
nextProps?: VictoryTransitionProps;
|
|
24
|
+
nodesShouldLoad?: boolean;
|
|
25
|
+
nodesDoneLoad?: boolean;
|
|
26
|
+
nodesWillExit?: boolean;
|
|
27
|
+
nodesWillEnter?: boolean;
|
|
28
|
+
nodesShouldEnter?: boolean;
|
|
29
|
+
childrenTransitions?: unknown;
|
|
30
|
+
}
|
|
31
|
+
export interface VictoryTransition {
|
|
32
|
+
context: React.ContextType<typeof TimerContext>;
|
|
33
|
+
}
|
|
34
|
+
export declare class VictoryTransition extends React.Component<VictoryTransitionProps, VictoryTransitionState> {
|
|
35
|
+
static displayName: string;
|
|
36
|
+
static propTypes: {
|
|
37
|
+
animate: PropTypes.Requireable<boolean | object>;
|
|
38
|
+
animationWhitelist: PropTypes.Requireable<any[]>;
|
|
39
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
40
|
+
};
|
|
41
|
+
static contextType: React.Context<{
|
|
42
|
+
transitionTimer: Timer;
|
|
43
|
+
animationTimer: Timer;
|
|
44
|
+
}>;
|
|
45
|
+
private continuous;
|
|
46
|
+
private timer;
|
|
47
|
+
private transitionProps;
|
|
48
|
+
constructor(props: any, context: any);
|
|
49
|
+
componentDidMount(): void;
|
|
50
|
+
shouldComponentUpdate(nextProps: VictoryTransitionProps): boolean;
|
|
51
|
+
componentWillUnmount(): void;
|
|
52
|
+
private getTransitionState;
|
|
53
|
+
private getDomainFromChildren;
|
|
54
|
+
pickProps(): Readonly<VictoryTransitionProps>;
|
|
55
|
+
private pickDomainProps;
|
|
56
|
+
getClipWidth(props: any, child: any): any;
|
|
57
|
+
render(): JSX.Element;
|
|
58
|
+
}
|
|
59
|
+
export {};
|
|
@@ -1,42 +1,51 @@
|
|
|
1
|
-
import _isObject from "lodash/isObject";
|
|
2
1
|
import _pick from "lodash/pick";
|
|
3
2
|
import _isFunction from "lodash/isFunction";
|
|
4
3
|
import _defaults from "lodash/defaults";
|
|
5
4
|
|
|
6
|
-
function _extends() { _extends = Object.assign
|
|
5
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
7
6
|
|
|
8
7
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
8
|
|
|
10
9
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
11
10
|
|
|
12
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
11
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
12
|
|
|
14
|
-
function
|
|
13
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
15
14
|
|
|
16
|
-
function
|
|
15
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
+
|
|
17
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
+
|
|
19
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
17
20
|
|
|
18
21
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
19
22
|
|
|
23
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
+
|
|
25
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
|
+
|
|
20
27
|
import React from "react";
|
|
21
28
|
import PropTypes from "prop-types";
|
|
22
|
-
import VictoryAnimation from "../victory-animation/victory-animation";
|
|
29
|
+
import { VictoryAnimation } from "../victory-animation/victory-animation";
|
|
23
30
|
import * as Collection from "../victory-util/collection";
|
|
24
31
|
import * as Helpers from "../victory-util/helpers";
|
|
25
32
|
import TimerContext from "../victory-util/timer-context";
|
|
26
33
|
import * as Transitions from "../victory-util/transitions";
|
|
27
34
|
import isEqual from "react-fast-compare";
|
|
28
|
-
|
|
29
|
-
var VictoryTransition =
|
|
30
|
-
/*#__PURE__*/
|
|
31
|
-
function (_React$Component) {
|
|
35
|
+
export var VictoryTransition = /*#__PURE__*/function (_React$Component) {
|
|
32
36
|
_inherits(VictoryTransition, _React$Component);
|
|
33
37
|
|
|
38
|
+
var _super = _createSuper(VictoryTransition);
|
|
39
|
+
|
|
34
40
|
function VictoryTransition(props, context) {
|
|
35
41
|
var _this;
|
|
36
42
|
|
|
37
43
|
_classCallCheck(this, VictoryTransition);
|
|
38
44
|
|
|
39
|
-
_this =
|
|
45
|
+
_this = _super.call(this, props, context);
|
|
46
|
+
_this.continuous = void 0;
|
|
47
|
+
_this.timer = void 0;
|
|
48
|
+
_this.transitionProps = void 0;
|
|
40
49
|
_this.state = {
|
|
41
50
|
nodesShouldLoad: false,
|
|
42
51
|
nodesDoneLoad: false
|
|
@@ -44,7 +53,6 @@ function (_React$Component) {
|
|
|
44
53
|
var child = _this.props.children;
|
|
45
54
|
var polar = child.props.polar;
|
|
46
55
|
_this.continuous = !polar && child.type && child.type.continuous === true;
|
|
47
|
-
_this.getTransitionState = _this.getTransitionState.bind(_assertThisInitialized(_this));
|
|
48
56
|
_this.timer = _this.context.transitionTimer;
|
|
49
57
|
return _this;
|
|
50
58
|
}
|
|
@@ -148,10 +156,12 @@ function (_React$Component) {
|
|
|
148
156
|
}, {
|
|
149
157
|
key: "pickDomainProps",
|
|
150
158
|
value: function pickDomainProps(props) {
|
|
151
|
-
var
|
|
159
|
+
var _props$animate;
|
|
160
|
+
|
|
161
|
+
var parentState = (_props$animate = props.animate) === null || _props$animate === void 0 ? void 0 : _props$animate.parentState;
|
|
152
162
|
|
|
153
163
|
if (parentState && parentState.nodesWillExit) {
|
|
154
|
-
return this.
|
|
164
|
+
return this.continuous || parentState.continuous ? parentState.nextProps || this.state.nextProps || props : props;
|
|
155
165
|
}
|
|
156
166
|
|
|
157
167
|
return this.continuous && this.state.nodesWillExit ? this.state.nextProps || props : props;
|
|
@@ -170,10 +180,11 @@ function (_React$Component) {
|
|
|
170
180
|
}, {
|
|
171
181
|
key: "render",
|
|
172
182
|
value: function render() {
|
|
173
|
-
var
|
|
183
|
+
var _this$props$animate,
|
|
184
|
+
_this3 = this;
|
|
174
185
|
|
|
175
186
|
var props = this.pickProps();
|
|
176
|
-
var getTransitionProps =
|
|
187
|
+
var getTransitionProps = (_this$props$animate = this.props.animate) !== null && _this$props$animate !== void 0 && _this$props$animate.getTransitions ? this.props.animate.getTransitions : Transitions.getTransitionPropsFactory(props, this.state, function (newState) {
|
|
177
188
|
return _this3.setState(newState);
|
|
178
189
|
});
|
|
179
190
|
var child = React.Children.toArray(props.children)[0];
|
|
@@ -193,21 +204,21 @@ function (_React$Component) {
|
|
|
193
204
|
var animationWhitelist = props.animationWhitelist || [];
|
|
194
205
|
var whitelist = animationWhitelist.concat(["clipWidth"]);
|
|
195
206
|
var propsToAnimate = whitelist.length ? _pick(combinedProps, whitelist) : combinedProps;
|
|
196
|
-
return React.createElement(VictoryAnimation, _extends({}, combinedProps.animate, {
|
|
207
|
+
return /*#__PURE__*/React.createElement(VictoryAnimation, _extends({}, combinedProps.animate, {
|
|
197
208
|
data: propsToAnimate
|
|
198
209
|
}), function (newProps) {
|
|
199
210
|
if (child.props.groupComponent) {
|
|
200
|
-
var groupComponent = _this3.continuous ? React.cloneElement(child.props.groupComponent, {
|
|
211
|
+
var groupComponent = _this3.continuous ? /*#__PURE__*/React.cloneElement(child.props.groupComponent, {
|
|
201
212
|
clipWidth: newProps.clipWidth || 0
|
|
202
213
|
}) : child.props.groupComponent;
|
|
203
|
-
return React.cloneElement(child, _defaults({
|
|
214
|
+
return /*#__PURE__*/React.cloneElement(child, _defaults({
|
|
204
215
|
animate: null,
|
|
205
216
|
animating: true,
|
|
206
217
|
groupComponent: groupComponent
|
|
207
218
|
}, newProps, combinedProps));
|
|
208
219
|
}
|
|
209
220
|
|
|
210
|
-
return React.cloneElement(child, _defaults({
|
|
221
|
+
return /*#__PURE__*/React.cloneElement(child, _defaults({
|
|
211
222
|
animate: null,
|
|
212
223
|
animating: true
|
|
213
224
|
}, newProps, combinedProps));
|
|
@@ -217,27 +228,10 @@ function (_React$Component) {
|
|
|
217
228
|
|
|
218
229
|
return VictoryTransition;
|
|
219
230
|
}(React.Component);
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
Object.defineProperty(VictoryTransition, "propTypes", {
|
|
228
|
-
configurable: true,
|
|
229
|
-
enumerable: true,
|
|
230
|
-
writable: true,
|
|
231
|
-
value: {
|
|
232
|
-
animate: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
|
|
233
|
-
animationWhitelist: PropTypes.array,
|
|
234
|
-
children: PropTypes.node
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
Object.defineProperty(VictoryTransition, "contextType", {
|
|
238
|
-
configurable: true,
|
|
239
|
-
enumerable: true,
|
|
240
|
-
writable: true,
|
|
241
|
-
value: TimerContext
|
|
242
|
-
});
|
|
243
|
-
export { VictoryTransition as default };
|
|
231
|
+
VictoryTransition.displayName = "VictoryTransition";
|
|
232
|
+
VictoryTransition.propTypes = {
|
|
233
|
+
animate: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
|
|
234
|
+
animationWhitelist: PropTypes.array,
|
|
235
|
+
children: PropTypes.node
|
|
236
|
+
};
|
|
237
|
+
VictoryTransition.contextType = TimerContext;
|