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.
Files changed (253) hide show
  1. package/dist/victory-core.js +15084 -15018
  2. package/dist/victory-core.min.js +1 -1
  3. package/es/index.d.ts +38 -941
  4. package/es/index.js +19 -28
  5. package/es/types.d.ts +33 -0
  6. package/es/types.js +1 -0
  7. package/es/victory-accessible-group/victory-accessible-group.d.ts +25 -0
  8. package/es/victory-accessible-group/victory-accessible-group.js +35 -45
  9. package/es/victory-animation/util.d.ts +66 -0
  10. package/es/victory-animation/util.js +3 -2
  11. package/es/victory-animation/victory-animation.d.ts +69 -0
  12. package/es/victory-animation/victory-animation.js +92 -102
  13. package/es/victory-clip-container/victory-clip-container.d.ts +76 -0
  14. package/es/victory-clip-container/victory-clip-container.js +75 -82
  15. package/es/victory-container/victory-container.d.ts +99 -0
  16. package/es/victory-container/victory-container.js +97 -107
  17. package/es/victory-label/victory-label.d.ts +61 -0
  18. package/es/victory-label/victory-label.js +43 -31
  19. package/es/victory-portal/portal-context.d.ts +11 -0
  20. package/es/victory-portal/portal-context.js +3 -4
  21. package/es/victory-portal/portal.d.ts +28 -0
  22. package/es/victory-portal/portal.js +44 -50
  23. package/es/victory-portal/victory-portal.d.ts +31 -0
  24. package/es/victory-portal/victory-portal.js +38 -47
  25. package/es/victory-primitives/arc.d.ts +21 -0
  26. package/es/victory-primitives/arc.js +9 -9
  27. package/es/victory-primitives/background.d.ts +22 -0
  28. package/es/victory-primitives/background.js +12 -12
  29. package/es/victory-primitives/border.d.ts +18 -0
  30. package/es/victory-primitives/border.js +9 -9
  31. package/es/victory-primitives/circle.d.ts +2 -0
  32. package/es/victory-primitives/circle.js +17 -10
  33. package/es/victory-primitives/clip-path.d.ts +14 -0
  34. package/es/victory-primitives/clip-path.js +6 -6
  35. package/es/victory-primitives/index.d.ts +14 -0
  36. package/es/victory-primitives/index.js +14 -0
  37. package/es/victory-primitives/line-segment.d.ts +19 -0
  38. package/es/victory-primitives/line-segment.js +9 -9
  39. package/es/victory-primitives/line.d.ts +2 -0
  40. package/es/victory-primitives/line.js +17 -10
  41. package/es/victory-primitives/path.d.ts +2 -0
  42. package/es/victory-primitives/path.js +15 -8
  43. package/es/victory-primitives/point.d.ts +21 -0
  44. package/es/victory-primitives/point.js +15 -23
  45. package/es/victory-primitives/rect.d.ts +2 -0
  46. package/es/victory-primitives/rect.js +17 -10
  47. package/es/victory-primitives/text.d.ts +16 -0
  48. package/es/victory-primitives/text.js +13 -8
  49. package/es/victory-primitives/tspan.d.ts +2 -0
  50. package/es/victory-primitives/tspan.js +7 -6
  51. package/es/victory-primitives/types.d.ts +7 -0
  52. package/es/victory-primitives/types.js +1 -0
  53. package/es/victory-primitives/whisker.d.ts +24 -0
  54. package/es/victory-primitives/whisker.js +12 -12
  55. package/es/victory-theme/grayscale.d.ts +2 -0
  56. package/es/victory-theme/grayscale.js +1 -1
  57. package/es/victory-theme/material.d.ts +2 -0
  58. package/es/victory-theme/material.js +1 -1
  59. package/es/victory-theme/victory-theme-definition.d.ts +244 -0
  60. package/es/victory-theme/victory-theme-definition.js +1 -0
  61. package/es/victory-theme/victory-theme.d.ts +5 -0
  62. package/es/victory-theme/victory-theme.js +6 -5
  63. package/es/victory-transition/victory-transition.d.ts +59 -0
  64. package/es/victory-transition/victory-transition.js +38 -44
  65. package/es/victory-util/add-events.js +328 -319
  66. package/es/victory-util/axis.js +12 -6
  67. package/es/victory-util/collection.js +7 -5
  68. package/es/victory-util/common-props.js +2 -2
  69. package/es/victory-util/data.js +8 -6
  70. package/es/victory-util/default-transitions.js +0 -1
  71. package/es/victory-util/domain.js +7 -5
  72. package/es/victory-util/events.js +8 -4
  73. package/es/victory-util/helpers.js +1 -3
  74. package/es/victory-util/hooks/use-animation-state.js +11 -5
  75. package/es/victory-util/immutable.js +0 -1
  76. package/es/victory-util/label-helpers.js +0 -2
  77. package/es/victory-util/line-helpers.js +1 -1
  78. package/es/victory-util/log.js +0 -1
  79. package/es/victory-util/point-path-helpers.d.ts +9 -0
  80. package/es/victory-util/point-path-helpers.js +59 -61
  81. package/es/victory-util/scale.js +19 -19
  82. package/es/victory-util/selection.d.ts +23 -0
  83. package/es/victory-util/selection.js +0 -2
  84. package/es/victory-util/style.js +0 -2
  85. package/es/victory-util/textsize.d.ts +8 -0
  86. package/es/victory-util/textsize.js +11 -7
  87. package/es/victory-util/timer-context.d.ts +11 -0
  88. package/es/victory-util/timer-context.js +1 -1
  89. package/es/victory-util/timer.d.ts +16 -0
  90. package/es/victory-util/timer.js +16 -13
  91. package/es/victory-util/types.d.ts +188 -0
  92. package/es/victory-util/types.js +1 -0
  93. package/es/victory-util/user-props.js +44 -4
  94. package/es/victory-util/wrapper.js +18 -12
  95. package/lib/index.d.ts +38 -941
  96. package/lib/index.js +201 -189
  97. package/lib/types.d.ts +33 -0
  98. package/lib/types.js +1 -0
  99. package/lib/victory-accessible-group/victory-accessible-group.d.ts +25 -0
  100. package/lib/victory-accessible-group/victory-accessible-group.js +37 -45
  101. package/lib/victory-animation/util.d.ts +66 -0
  102. package/lib/victory-animation/util.js +4 -3
  103. package/lib/victory-animation/victory-animation.d.ts +69 -0
  104. package/lib/victory-animation/victory-animation.js +97 -102
  105. package/lib/victory-clip-container/victory-clip-container.d.ts +76 -0
  106. package/lib/victory-clip-container/victory-clip-container.js +81 -82
  107. package/lib/victory-container/victory-container.d.ts +99 -0
  108. package/lib/victory-container/victory-container.js +102 -107
  109. package/lib/victory-label/victory-label.d.ts +61 -0
  110. package/lib/victory-label/victory-label.js +49 -32
  111. package/lib/victory-portal/portal-context.d.ts +11 -0
  112. package/lib/victory-portal/portal-context.js +4 -5
  113. package/lib/victory-portal/portal.d.ts +28 -0
  114. package/lib/victory-portal/portal.js +49 -50
  115. package/lib/victory-portal/victory-portal.d.ts +31 -0
  116. package/lib/victory-portal/victory-portal.js +43 -47
  117. package/lib/victory-primitives/arc.d.ts +21 -0
  118. package/lib/victory-primitives/arc.js +13 -10
  119. package/lib/victory-primitives/background.d.ts +22 -0
  120. package/lib/victory-primitives/background.js +16 -13
  121. package/lib/victory-primitives/border.d.ts +18 -0
  122. package/lib/victory-primitives/border.js +13 -10
  123. package/lib/victory-primitives/circle.d.ts +2 -0
  124. package/lib/victory-primitives/circle.js +17 -8
  125. package/lib/victory-primitives/clip-path.d.ts +14 -0
  126. package/lib/victory-primitives/clip-path.js +7 -5
  127. package/lib/victory-primitives/index.d.ts +14 -0
  128. package/lib/victory-primitives/index.js +187 -0
  129. package/lib/victory-primitives/line-segment.d.ts +19 -0
  130. package/lib/victory-primitives/line-segment.js +13 -10
  131. package/lib/victory-primitives/line.d.ts +2 -0
  132. package/lib/victory-primitives/line.js +17 -8
  133. package/lib/victory-primitives/path.d.ts +2 -0
  134. package/lib/victory-primitives/path.js +15 -6
  135. package/lib/victory-primitives/point.d.ts +21 -0
  136. package/lib/victory-primitives/point.js +21 -25
  137. package/lib/victory-primitives/rect.d.ts +2 -0
  138. package/lib/victory-primitives/rect.js +17 -8
  139. package/lib/victory-primitives/text.d.ts +16 -0
  140. package/lib/victory-primitives/text.js +14 -7
  141. package/lib/victory-primitives/tspan.d.ts +2 -0
  142. package/lib/victory-primitives/tspan.js +7 -4
  143. package/lib/victory-primitives/types.d.ts +7 -0
  144. package/lib/victory-primitives/types.js +1 -0
  145. package/lib/victory-primitives/whisker.d.ts +24 -0
  146. package/lib/victory-primitives/whisker.js +16 -13
  147. package/lib/victory-theme/grayscale.d.ts +2 -0
  148. package/lib/victory-theme/grayscale.js +3 -3
  149. package/lib/victory-theme/material.d.ts +2 -0
  150. package/lib/victory-theme/material.js +3 -3
  151. package/lib/victory-theme/victory-theme-definition.d.ts +244 -0
  152. package/lib/victory-theme/victory-theme-definition.js +1 -0
  153. package/lib/victory-theme/victory-theme.d.ts +5 -0
  154. package/lib/victory-theme/victory-theme.js +22 -8
  155. package/lib/victory-transition/victory-transition.d.ts +59 -0
  156. package/lib/victory-transition/victory-transition.js +43 -45
  157. package/lib/victory-util/add-events.js +326 -316
  158. package/lib/victory-util/axis.js +20 -11
  159. package/lib/victory-util/collection.js +10 -8
  160. package/lib/victory-util/common-props.js +6 -4
  161. package/lib/victory-util/data.js +13 -7
  162. package/lib/victory-util/default-transitions.js +1 -2
  163. package/lib/victory-util/domain.js +11 -5
  164. package/lib/victory-util/events.js +17 -11
  165. package/lib/victory-util/helpers.js +14 -16
  166. package/lib/victory-util/hooks/index.js +4 -4
  167. package/lib/victory-util/hooks/use-animation-state.js +14 -6
  168. package/lib/victory-util/immutable.js +3 -5
  169. package/lib/victory-util/label-helpers.js +6 -6
  170. package/lib/victory-util/line-helpers.js +4 -2
  171. package/lib/victory-util/log.js +0 -1
  172. package/lib/victory-util/point-path-helpers.d.ts +9 -0
  173. package/lib/victory-util/point-path-helpers.js +86 -73
  174. package/lib/victory-util/prop-types.js +5 -3
  175. package/lib/victory-util/scale.js +24 -21
  176. package/lib/victory-util/selection.d.ts +23 -0
  177. package/lib/victory-util/selection.js +5 -5
  178. package/lib/victory-util/style.js +0 -2
  179. package/lib/victory-util/textsize.d.ts +8 -0
  180. package/lib/victory-util/textsize.js +12 -8
  181. package/lib/victory-util/timer-context.d.ts +11 -0
  182. package/lib/victory-util/timer-context.js +1 -1
  183. package/lib/victory-util/timer.d.ts +16 -0
  184. package/lib/victory-util/timer.js +16 -13
  185. package/lib/victory-util/types.d.ts +188 -0
  186. package/lib/victory-util/types.js +1 -0
  187. package/lib/victory-util/user-props.js +53 -6
  188. package/lib/victory-util/wrapper.js +31 -23
  189. package/package.json +6 -13
  190. package/src/index.ts +42 -0
  191. package/src/types.ts +45 -0
  192. package/src/victory-accessible-group/{victory-accessible-group.js → victory-accessible-group.tsx} +10 -3
  193. package/src/victory-animation/{util.js → util.ts} +5 -4
  194. package/src/victory-animation/{victory-animation.js → victory-animation.tsx} +90 -13
  195. package/src/victory-clip-container/{victory-clip-container.js → victory-clip-container.tsx} +32 -6
  196. package/src/victory-container/{victory-container.js → victory-container.tsx} +70 -26
  197. package/src/victory-label/{victory-label.js → victory-label.tsx} +80 -19
  198. package/src/victory-portal/portal-context.ts +14 -0
  199. package/src/victory-portal/{portal.js → portal.tsx} +23 -12
  200. package/src/victory-portal/{victory-portal.js → victory-portal.tsx} +21 -6
  201. package/src/victory-primitives/{arc.js → arc.tsx} +15 -5
  202. package/src/victory-primitives/{background.js → background.tsx} +17 -7
  203. package/src/victory-primitives/{border.js → border.tsx} +12 -5
  204. package/src/victory-primitives/{circle.js → circle.tsx} +4 -3
  205. package/src/victory-primitives/clip-path.tsx +25 -0
  206. package/src/victory-primitives/index.ts +14 -0
  207. package/src/victory-primitives/{line-segment.js → line-segment.tsx} +13 -5
  208. package/src/victory-primitives/{line.js → line.tsx} +4 -3
  209. package/src/victory-primitives/{path.js → path.tsx} +4 -3
  210. package/src/victory-primitives/{point.js → point.tsx} +25 -20
  211. package/src/victory-primitives/{rect.js → rect.tsx} +4 -2
  212. package/src/victory-primitives/{text.js → text.tsx} +9 -3
  213. package/src/victory-primitives/tspan.tsx +7 -0
  214. package/src/victory-primitives/types.ts +19 -0
  215. package/src/victory-primitives/{whisker.js → whisker.tsx} +20 -7
  216. package/src/victory-theme/{grayscale.js → grayscale.tsx} +2 -1
  217. package/src/victory-theme/{material.js → material.tsx} +2 -1
  218. package/src/victory-theme/victory-theme-definition.ts +261 -0
  219. package/src/victory-theme/victory-theme.tsx +5 -0
  220. package/src/victory-transition/{victory-transition.js → victory-transition.tsx} +68 -19
  221. package/src/victory-util/add-events.js +7 -5
  222. package/src/victory-util/axis.js +3 -1
  223. package/src/victory-util/collection.js +0 -1
  224. package/src/victory-util/common-props.js +2 -2
  225. package/src/victory-util/data.js +0 -1
  226. package/src/victory-util/default-transitions.js +0 -1
  227. package/src/victory-util/domain.js +0 -1
  228. package/src/victory-util/events.js +1 -1
  229. package/src/victory-util/helpers.js +0 -1
  230. package/src/victory-util/immutable.js +0 -1
  231. package/src/victory-util/label-helpers.js +0 -1
  232. package/src/victory-util/line-helpers.js +1 -1
  233. package/src/victory-util/log.js +0 -1
  234. package/src/victory-util/point-path-helpers.ts +119 -0
  235. package/src/victory-util/prop-types.js +0 -1
  236. package/src/victory-util/scale.js +18 -10
  237. package/src/victory-util/selection.d.ts +23 -0
  238. package/src/victory-util/selection.js +0 -1
  239. package/src/victory-util/style.js +0 -1
  240. package/src/victory-util/textsize.d.ts +8 -0
  241. package/src/victory-util/{timer-context.js → timer-context.ts} +0 -0
  242. package/src/victory-util/{timer.js → timer.ts} +20 -5
  243. package/src/victory-util/transitions.js +0 -1
  244. package/src/victory-util/types.ts +247 -0
  245. package/src/victory-util/user-props.js +31 -1
  246. package/src/victory-util/wrapper.js +0 -1
  247. package/src/index.d.ts +0 -941
  248. package/src/index.js +0 -51
  249. package/src/victory-portal/portal-context.js +0 -10
  250. package/src/victory-primitives/clip-path.js +0 -18
  251. package/src/victory-primitives/tspan.js +0 -5
  252. package/src/victory-theme/victory-theme.js +0 -7
  253. 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 {};
@@ -0,0 +1,5 @@
1
+ export * from "./victory-theme-definition";
2
+ export declare const VictoryTheme: {
3
+ grayscale: import("./victory-theme-definition").VictoryThemeDefinition;
4
+ material: import("./victory-theme-definition").VictoryThemeDefinition;
5
+ };
@@ -1,6 +1,7 @@
1
- import materialTheme from "./material";
2
- import grayscaleTheme from "./grayscale";
3
- export default {
4
- material: materialTheme,
5
- grayscale: grayscaleTheme
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 || 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); }
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 _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
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 _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, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
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 = _possibleConstructorReturn(this, (VictoryTransition.__proto__ || Object.getPrototypeOf(VictoryTransition)).call(this, props, context));
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 parentState = _isObject(props.animate) && props.animate.parentState;
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.continous || parentState.continuous ? parentState.nextProps || this.state.nextProps || props : props;
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 _this3 = this;
183
+ var _this$props$animate,
184
+ _this3 = this;
174
185
 
175
186
  var props = this.pickProps();
176
- var getTransitionProps = _isObject(this.props.animate) && this.props.animate.getTransitions ? this.props.animate.getTransitions : Transitions.getTransitionPropsFactory(props, this.state, function (newState) {
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
- Object.defineProperty(VictoryTransition, "displayName", {
222
- configurable: true,
223
- enumerable: true,
224
- writable: true,
225
- value: "VictoryTransition"
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;