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.
Files changed (227) hide show
  1. package/dist/victory-core.js +874 -879
  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 +8 -16
  9. package/es/victory-animation/util.d.ts +66 -0
  10. package/es/victory-animation/util.js +2 -1
  11. package/es/victory-animation/victory-animation.d.ts +69 -0
  12. package/es/victory-animation/victory-animation.js +59 -67
  13. package/es/victory-clip-container/victory-clip-container.d.ts +76 -0
  14. package/es/victory-clip-container/victory-clip-container.js +15 -21
  15. package/es/victory-container/victory-container.d.ts +99 -0
  16. package/es/victory-container/victory-container.js +31 -31
  17. package/es/victory-label/victory-label.d.ts +61 -0
  18. package/es/victory-label/victory-label.js +13 -8
  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 +25 -33
  23. package/es/victory-portal/victory-portal.d.ts +31 -0
  24. package/es/victory-portal/victory-portal.js +23 -22
  25. package/es/victory-primitives/arc.d.ts +21 -0
  26. package/es/victory-primitives/arc.js +3 -5
  27. package/es/victory-primitives/background.d.ts +22 -0
  28. package/es/victory-primitives/background.js +4 -6
  29. package/es/victory-primitives/border.d.ts +18 -0
  30. package/es/victory-primitives/border.js +3 -5
  31. package/es/victory-primitives/circle.d.ts +2 -0
  32. package/es/victory-primitives/circle.js +11 -8
  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 +3 -5
  39. package/es/victory-primitives/line.d.ts +2 -0
  40. package/es/victory-primitives/line.js +11 -8
  41. package/es/victory-primitives/path.d.ts +2 -0
  42. package/es/victory-primitives/path.js +9 -6
  43. package/es/victory-primitives/point.d.ts +21 -0
  44. package/es/victory-primitives/point.js +9 -19
  45. package/es/victory-primitives/rect.d.ts +2 -0
  46. package/es/victory-primitives/rect.js +11 -8
  47. package/es/victory-primitives/text.d.ts +16 -0
  48. package/es/victory-primitives/text.js +7 -6
  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 +3 -5
  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 +19 -23
  65. package/es/victory-util/add-events.js +6 -3
  66. package/es/victory-util/axis.js +0 -1
  67. package/es/victory-util/collection.js +0 -2
  68. package/es/victory-util/data.js +0 -2
  69. package/es/victory-util/default-transitions.js +0 -1
  70. package/es/victory-util/domain.js +0 -2
  71. package/es/victory-util/helpers.js +0 -2
  72. package/es/victory-util/immutable.js +0 -1
  73. package/es/victory-util/label-helpers.js +0 -2
  74. package/es/victory-util/log.js +0 -1
  75. package/es/victory-util/point-path-helpers.d.ts +9 -0
  76. package/es/victory-util/point-path-helpers.js +59 -61
  77. package/es/victory-util/selection.d.ts +23 -0
  78. package/es/victory-util/selection.js +0 -2
  79. package/es/victory-util/style.js +0 -2
  80. package/es/victory-util/textsize.d.ts +8 -0
  81. package/es/victory-util/timer-context.d.ts +11 -0
  82. package/es/victory-util/timer.d.ts +16 -0
  83. package/es/victory-util/timer.js +13 -8
  84. package/es/victory-util/types.d.ts +188 -0
  85. package/es/victory-util/types.js +1 -0
  86. package/lib/index.d.ts +38 -941
  87. package/lib/index.js +195 -193
  88. package/lib/types.d.ts +33 -0
  89. package/lib/types.js +1 -0
  90. package/lib/victory-accessible-group/victory-accessible-group.d.ts +25 -0
  91. package/lib/victory-accessible-group/victory-accessible-group.js +9 -15
  92. package/lib/victory-animation/util.d.ts +66 -0
  93. package/lib/victory-animation/util.js +2 -1
  94. package/lib/victory-animation/victory-animation.d.ts +69 -0
  95. package/lib/victory-animation/victory-animation.js +60 -65
  96. package/lib/victory-clip-container/victory-clip-container.d.ts +76 -0
  97. package/lib/victory-clip-container/victory-clip-container.js +19 -22
  98. package/lib/victory-container/victory-container.d.ts +99 -0
  99. package/lib/victory-container/victory-container.js +34 -31
  100. package/lib/victory-label/victory-label.d.ts +61 -0
  101. package/lib/victory-label/victory-label.js +19 -13
  102. package/lib/victory-portal/portal-context.d.ts +11 -0
  103. package/lib/victory-portal/portal-context.js +3 -4
  104. package/lib/victory-portal/portal.d.ts +28 -0
  105. package/lib/victory-portal/portal.js +26 -31
  106. package/lib/victory-portal/victory-portal.d.ts +31 -0
  107. package/lib/victory-portal/victory-portal.js +24 -20
  108. package/lib/victory-primitives/arc.d.ts +21 -0
  109. package/lib/victory-primitives/arc.js +5 -6
  110. package/lib/victory-primitives/background.d.ts +22 -0
  111. package/lib/victory-primitives/background.js +7 -8
  112. package/lib/victory-primitives/border.d.ts +18 -0
  113. package/lib/victory-primitives/border.js +5 -6
  114. package/lib/victory-primitives/circle.d.ts +2 -0
  115. package/lib/victory-primitives/circle.js +11 -6
  116. package/lib/victory-primitives/clip-path.d.ts +14 -0
  117. package/lib/victory-primitives/clip-path.js +7 -5
  118. package/lib/victory-primitives/index.d.ts +14 -0
  119. package/lib/victory-primitives/index.js +187 -0
  120. package/lib/victory-primitives/line-segment.d.ts +19 -0
  121. package/lib/victory-primitives/line-segment.js +5 -6
  122. package/lib/victory-primitives/line.d.ts +2 -0
  123. package/lib/victory-primitives/line.js +11 -6
  124. package/lib/victory-primitives/path.d.ts +2 -0
  125. package/lib/victory-primitives/path.js +9 -4
  126. package/lib/victory-primitives/point.d.ts +21 -0
  127. package/lib/victory-primitives/point.js +13 -21
  128. package/lib/victory-primitives/rect.d.ts +2 -0
  129. package/lib/victory-primitives/rect.js +11 -6
  130. package/lib/victory-primitives/text.d.ts +16 -0
  131. package/lib/victory-primitives/text.js +8 -5
  132. package/lib/victory-primitives/tspan.d.ts +2 -0
  133. package/lib/victory-primitives/tspan.js +7 -4
  134. package/lib/victory-primitives/types.d.ts +7 -0
  135. package/lib/victory-primitives/types.js +1 -0
  136. package/lib/victory-primitives/whisker.d.ts +24 -0
  137. package/lib/victory-primitives/whisker.js +5 -6
  138. package/lib/victory-theme/grayscale.d.ts +2 -0
  139. package/lib/victory-theme/grayscale.js +3 -3
  140. package/lib/victory-theme/material.d.ts +2 -0
  141. package/lib/victory-theme/material.js +3 -3
  142. package/lib/victory-theme/victory-theme-definition.d.ts +244 -0
  143. package/lib/victory-theme/victory-theme-definition.js +1 -0
  144. package/lib/victory-theme/victory-theme.d.ts +5 -0
  145. package/lib/victory-theme/victory-theme.js +22 -8
  146. package/lib/victory-transition/victory-transition.d.ts +59 -0
  147. package/lib/victory-transition/victory-transition.js +21 -23
  148. package/lib/victory-util/add-events.js +8 -4
  149. package/lib/victory-util/collection.js +0 -2
  150. package/lib/victory-util/default-transitions.js +0 -1
  151. package/lib/victory-util/helpers.js +0 -2
  152. package/lib/victory-util/immutable.js +0 -2
  153. package/lib/victory-util/label-helpers.js +0 -2
  154. package/lib/victory-util/log.js +0 -1
  155. package/lib/victory-util/point-path-helpers.d.ts +9 -0
  156. package/lib/victory-util/point-path-helpers.js +86 -73
  157. package/lib/victory-util/selection.d.ts +23 -0
  158. package/lib/victory-util/selection.js +0 -2
  159. package/lib/victory-util/style.js +0 -2
  160. package/lib/victory-util/textsize.d.ts +8 -0
  161. package/lib/victory-util/timer-context.d.ts +11 -0
  162. package/lib/victory-util/timer.d.ts +16 -0
  163. package/lib/victory-util/timer.js +13 -8
  164. package/lib/victory-util/types.d.ts +188 -0
  165. package/lib/victory-util/types.js +1 -0
  166. package/package.json +4 -4
  167. package/src/index.ts +42 -0
  168. package/src/types.ts +45 -0
  169. package/src/victory-accessible-group/{victory-accessible-group.js → victory-accessible-group.tsx} +10 -3
  170. package/src/victory-animation/{util.js → util.ts} +4 -3
  171. package/src/victory-animation/{victory-animation.js → victory-animation.tsx} +89 -12
  172. package/src/victory-clip-container/{victory-clip-container.js → victory-clip-container.tsx} +29 -5
  173. package/src/victory-container/{victory-container.js → victory-container.tsx} +70 -26
  174. package/src/victory-label/{victory-label.js → victory-label.tsx} +71 -14
  175. package/src/victory-portal/portal-context.ts +14 -0
  176. package/src/victory-portal/{portal.js → portal.tsx} +23 -12
  177. package/src/victory-portal/{victory-portal.js → victory-portal.tsx} +21 -6
  178. package/src/victory-primitives/{arc.js → arc.tsx} +15 -5
  179. package/src/victory-primitives/{background.js → background.tsx} +17 -7
  180. package/src/victory-primitives/{border.js → border.tsx} +12 -5
  181. package/src/victory-primitives/{circle.js → circle.tsx} +4 -3
  182. package/src/victory-primitives/clip-path.tsx +25 -0
  183. package/src/victory-primitives/index.ts +14 -0
  184. package/src/victory-primitives/{line-segment.js → line-segment.tsx} +13 -5
  185. package/src/victory-primitives/{line.js → line.tsx} +4 -3
  186. package/src/victory-primitives/{path.js → path.tsx} +4 -3
  187. package/src/victory-primitives/{point.js → point.tsx} +25 -20
  188. package/src/victory-primitives/{rect.js → rect.tsx} +4 -2
  189. package/src/victory-primitives/{text.js → text.tsx} +9 -3
  190. package/src/victory-primitives/tspan.tsx +7 -0
  191. package/src/victory-primitives/types.ts +19 -0
  192. package/src/victory-primitives/{whisker.js → whisker.tsx} +20 -7
  193. package/src/victory-theme/{grayscale.js → grayscale.tsx} +2 -1
  194. package/src/victory-theme/{material.js → material.tsx} +2 -1
  195. package/src/victory-theme/victory-theme-definition.ts +261 -0
  196. package/src/victory-theme/victory-theme.tsx +5 -0
  197. package/src/victory-transition/{victory-transition.js → victory-transition.tsx} +68 -19
  198. package/src/victory-util/add-events.js +6 -1
  199. package/src/victory-util/axis.js +0 -1
  200. package/src/victory-util/collection.js +0 -1
  201. package/src/victory-util/data.js +0 -1
  202. package/src/victory-util/default-transitions.js +0 -1
  203. package/src/victory-util/domain.js +0 -1
  204. package/src/victory-util/events.js +1 -1
  205. package/src/victory-util/helpers.js +0 -1
  206. package/src/victory-util/immutable.js +0 -1
  207. package/src/victory-util/label-helpers.js +0 -1
  208. package/src/victory-util/log.js +0 -1
  209. package/src/victory-util/point-path-helpers.ts +119 -0
  210. package/src/victory-util/prop-types.js +0 -1
  211. package/src/victory-util/scale.js +0 -1
  212. package/src/victory-util/selection.d.ts +23 -0
  213. package/src/victory-util/selection.js +0 -1
  214. package/src/victory-util/style.js +0 -1
  215. package/src/victory-util/textsize.d.ts +8 -0
  216. package/src/victory-util/{timer-context.js → timer-context.ts} +0 -0
  217. package/src/victory-util/{timer.js → timer.ts} +19 -4
  218. package/src/victory-util/transitions.js +0 -1
  219. package/src/victory-util/types.ts +247 -0
  220. package/src/victory-util/wrapper.js +0 -1
  221. package/src/index.d.ts +0 -941
  222. package/src/index.js +0 -51
  223. package/src/victory-portal/portal-context.js +0 -10
  224. package/src/victory-primitives/clip-path.js +0 -18
  225. package/src/victory-primitives/tspan.js +0 -5
  226. package/src/victory-theme/victory-theme.js +0 -7
  227. package/src/victory-util/point-path-helpers.js +0 -121
@@ -0,0 +1,247 @@
1
+ import * as React from "react";
2
+ import { OriginType } from "../victory-label/victory-label";
3
+ import {
4
+ NumberOrCallback,
5
+ PaddingProps,
6
+ VictoryThemeDefinition
7
+ } from "../victory-theme/victory-theme";
8
+ import { StringOrCallback, StringOrNumberOrCallback } from "../types";
9
+ import {
10
+ AnimationEasing,
11
+ AnimationStyle
12
+ } from "../victory-animation/victory-animation";
13
+
14
+ export type StringOrNumberOrList = string | number | (string | number)[];
15
+
16
+ export interface AnimatePropTypeInterface {
17
+ duration?: number;
18
+ onEnd?: () => void;
19
+ onExit?: {
20
+ duration?: number;
21
+ before?: (datum: any) => AnimationStyle;
22
+ };
23
+ onEnter?: {
24
+ duration?: number;
25
+ before?: (datum: any) => AnimationStyle;
26
+ after?: (datum: any) => AnimationStyle;
27
+ };
28
+ onLoad?: {
29
+ duration?: number;
30
+ before?: (datum: any) => AnimationStyle;
31
+ after?: (datum: any) => AnimationStyle;
32
+ };
33
+ easing?: AnimationEasing;
34
+ animationWhitelist?: string[];
35
+ }
36
+
37
+ export interface EventCallbackInterface<TTarget, TEventKey> {
38
+ childName?: string | string[];
39
+ target?: TTarget;
40
+ eventKey?: TEventKey;
41
+ mutation: (props: any) => any;
42
+ callback?: (props: any) => any;
43
+ }
44
+
45
+ export interface EventPropTypeInterface<TTarget, TEventKey> {
46
+ childName?: string | Array<StringOrNumberOrCallback>;
47
+ target: TTarget;
48
+ eventKey?: TEventKey;
49
+ eventHandlers: {
50
+ [key: string]:
51
+ | {
52
+ (
53
+ event: React.SyntheticEvent<any>,
54
+ props?: any
55
+ ): EventCallbackInterface<TTarget, TEventKey>;
56
+ }
57
+ | {
58
+ (
59
+ event: React.SyntheticEvent<any>,
60
+ props?: any
61
+ ): EventCallbackInterface<TTarget, TEventKey>[];
62
+ }
63
+ | {
64
+ (event: React.SyntheticEvent<any>, props?: any): void;
65
+ };
66
+ };
67
+ }
68
+
69
+ export type DomainTuple = [number, number] | [Date, Date];
70
+ export type DomainPropObjectType =
71
+ | { x?: DomainTuple; y: DomainTuple }
72
+ | { x: DomainTuple; y?: DomainTuple };
73
+ export type DomainPropType = DomainPropObjectType | DomainTuple;
74
+
75
+ export type PaddingType = number | [number, number];
76
+ export type DomainPaddingPropType =
77
+ | PaddingType
78
+ | {
79
+ x?: PaddingType;
80
+ y?: PaddingType;
81
+ };
82
+
83
+ export type RangeTuple = [number, number];
84
+ export type RangePropType = RangeTuple | { x?: RangeTuple; y?: RangeTuple };
85
+
86
+ /**
87
+ * D3 scale function shape. Don"t want to introduce typing dependency to d3
88
+ */
89
+ export interface D3Scale {
90
+ (input: string | number): number;
91
+ domain: () => any;
92
+ range: () => any;
93
+ copy: () => any;
94
+ }
95
+
96
+ export type ScalePropType = "linear" | "time" | "log" | "sqrt";
97
+
98
+ export type CategoryPropType =
99
+ | string[]
100
+ | { x: string[] }
101
+ | { y: string[] }
102
+ | {
103
+ x: string[];
104
+ y: string[];
105
+ };
106
+
107
+ export type DataGetterPropType =
108
+ | number
109
+ | string
110
+ | string[]
111
+ | { (data: any): number | string | string[] }
112
+ // eslint-disable-next-line @typescript-eslint/ban-types
113
+ | Function;
114
+
115
+ export type InterpolationPropType =
116
+ | "basis"
117
+ | "basisClosed"
118
+ | "basisOpen"
119
+ | "bundle"
120
+ | "cardinal"
121
+ | "cardinalClosed"
122
+ | "cardinalOpen"
123
+ | "catmullRom"
124
+ | "catmullRomClosed"
125
+ | "catmullRomOpen"
126
+ | "linear"
127
+ | "linearClosed"
128
+ | "monotoneX"
129
+ | "monotoneY"
130
+ | "natural"
131
+ | "radial"
132
+ | "step"
133
+ | "stepAfter"
134
+ | "stepBefore";
135
+
136
+ export type ColorScalePropType =
137
+ | "grayscale"
138
+ | "qualitative"
139
+ | "heatmap"
140
+ | "warm"
141
+ | "cool"
142
+ | "red"
143
+ | "green"
144
+ | "blue"
145
+ | string[];
146
+
147
+ export type SortOrderPropType = "ascending" | "descending";
148
+
149
+ export type SVGCoordinateType = { x: number; y: number };
150
+
151
+ export interface VictoryCommonThemeProps {
152
+ animate?: boolean | AnimatePropTypeInterface;
153
+ colorScale?: ColorScalePropType;
154
+ containerComponent?: React.ReactElement;
155
+ domainPadding?: DomainPaddingPropType;
156
+ externalEventMutations?: EventCallbackInterface<
157
+ string | string[],
158
+ StringOrNumberOrList
159
+ >[];
160
+ groupComponent?: React.ReactElement;
161
+ height?: number;
162
+ horizontal?: boolean;
163
+ maxDomain?: number | { x?: number; y?: number };
164
+ minDomain?: number | { x?: number; y?: number };
165
+ name?: string;
166
+ origin?: OriginType;
167
+ padding?: PaddingProps;
168
+ polar?: boolean;
169
+ range?: RangePropType;
170
+ scale?:
171
+ | ScalePropType
172
+ | D3Scale
173
+ | {
174
+ x?: ScalePropType | D3Scale;
175
+ y?: ScalePropType | D3Scale;
176
+ };
177
+ // eslint-disable-next-line @typescript-eslint/ban-types
178
+ sharedEvents?: { events: any[]; getEventState: Function };
179
+ singleQuadrantDomainPadding?: boolean | { x?: boolean; y?: boolean };
180
+ standalone?: boolean;
181
+ width?: number;
182
+ }
183
+
184
+ export interface VictoryCommonProps extends VictoryCommonThemeProps {
185
+ theme?: VictoryThemeDefinition;
186
+ }
187
+
188
+ export interface VictoryCommonPrimitiveProps {
189
+ active?: boolean;
190
+ ariaLabel?: StringOrCallback;
191
+ className?: string;
192
+ clipPath?: string;
193
+ data?: any;
194
+ // eslint-disable-next-line @typescript-eslint/ban-types
195
+ desc?: string | Function;
196
+ disableInlineStyles?: boolean;
197
+ events?: object;
198
+ // eslint-disable-next-line @typescript-eslint/ban-types
199
+ id?: number | string | Function;
200
+ index?: number | string;
201
+ origin?: OriginType;
202
+ polar?: boolean;
203
+ role?: string;
204
+ scale?: any;
205
+ shapeRendering?: string;
206
+ style?: any;
207
+ tabIndex?: NumberOrCallback;
208
+ transform?: string;
209
+ }
210
+
211
+ export interface VictoryDatableProps {
212
+ categories?: CategoryPropType;
213
+ data?: any[];
214
+ dataComponent?: React.ReactElement;
215
+ domain?: DomainPropType;
216
+ domainPadding?: DomainPaddingPropType;
217
+ samples?: number;
218
+ sortKey?: DataGetterPropType;
219
+ sortOrder?: SortOrderPropType;
220
+ x?: DataGetterPropType;
221
+ y?: DataGetterPropType;
222
+ y0?: DataGetterPropType;
223
+ }
224
+
225
+ export interface VictoryLabelableProps {
226
+ labelComponent?: React.ReactElement;
227
+ }
228
+
229
+ export interface VictoryMultiLabelableProps extends VictoryLabelableProps {
230
+ labels?:
231
+ | string[]
232
+ | number[]
233
+ | { (data: any): string | string[] | number | number[] | null };
234
+ }
235
+
236
+ export interface VictorySingleLabelableProps extends VictoryLabelableProps {
237
+ label?: string | { (data: any): string | number | null };
238
+ }
239
+
240
+ export interface TextSizeStyleInterface {
241
+ angle?: number;
242
+ characterConstant?: string;
243
+ fontFamily?: string;
244
+ fontSize?: number | string;
245
+ letterSpacing?: string;
246
+ lineHeight?: number;
247
+ }
@@ -1,4 +1,3 @@
1
- /* eslint-disable func-style */
2
1
  import {
3
2
  assign,
4
3
  defaults,