UNPKG

30.4 kBTypeScriptView Raw
1import { AnimationEvent, AriaAttributes, ClipboardEvent, Component, CompositionEvent, DragEvent, FocusEvent, FormEvent, FunctionComponent, KeyboardEvent, MouseEvent, PointerEvent, ReactElement, ReactNode, SVGProps, SyntheticEvent, TouchEvent, TransitionEvent, UIEvent, WheelEvent, JSX } from 'react';
2import { ScaleContinuousNumeric as D3ScaleContinuousNumeric } from 'victory-vendor/d3-scale';
3import type { Props as XAxisProps } from '../cartesian/XAxis';
4import type { Props as YAxisProps } from '../cartesian/YAxis';
5/**
6 * Determines how values are stacked:
7 *
8 * - `none` is the default, it adds values on top of each other. No smarts. Negative values will overlap.
9 * - `expand` make it so that the values always add up to 1 - so the chart will look like a rectangle.
10 * - `wiggle` and `silhouette` tries to keep the chart centered.
11 * - `sign` stacks positive values above zero and negative values below zero. Similar to `none` but handles negatives.
12 * - `positive` ignores all negative values, and then behaves like \`none\`.
13 *
14 * Also see https://d3js.org/d3-shape/stack#stack-offsets
15 * (note that the `diverging` offset in d3 is named `sign` in recharts)
16 */
17export type StackOffsetType = 'sign' | 'expand' | 'none' | 'wiggle' | 'silhouette' | 'positive';
18export type LayoutType = 'horizontal' | 'vertical' | 'centric' | 'radial';
19export type PolarLayoutType = 'radial' | 'centric';
20export type AxisType = 'xAxis' | 'yAxis' | 'zAxis' | 'angleAxis' | 'radiusAxis';
21export type DataKey<T> = string | number | ((obj: T) => any);
22export type PresentationAttributesWithProps<P, T> = AriaAttributes & DOMAttributesWithProps<P, T> & Omit<SVGProps<T>, keyof DOMAttributesWithProps<P, T>>;
23export type PresentationAttributesAdaptChildEvent<P, T> = AriaAttributes & DOMAttributesAdaptChildEvent<P, T> & Omit<SVGProps<T>, keyof DOMAttributesAdaptChildEvent<P, T>>;
24export type SymbolType = 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye';
25export type LegendType = 'plainline' | 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' | 'none';
26export type TooltipType = 'none';
27export type AllowInDimension = {
28 x?: boolean;
29 y?: boolean;
30};
31export interface Coordinate {
32 x: number;
33 y: number;
34}
35export interface ChartCoordinate extends Coordinate {
36 xAxis?: any;
37 yAxis?: any;
38 width?: any;
39 height?: any;
40 offset?: ChartOffset;
41 angle?: number;
42 radius?: number;
43 cx?: number;
44 cy?: number;
45 startAngle?: number;
46 endAngle?: number;
47 innerRadius?: number;
48 outerRadius?: number;
49}
50export type ScaleType = 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold';
51type EventHandler<P, E extends SyntheticEvent<any>> = {
52 bivarianceHack(props: P, event: E): void;
53}['bivarianceHack'];
54type ReactEventHandler<P, T = Element> = EventHandler<P, SyntheticEvent<T>>;
55type ClipboardEventHandler<P, T = Element> = EventHandler<P, ClipboardEvent<T>>;
56type CompositionEventHandler<P, T = Element> = EventHandler<P, CompositionEvent<T>>;
57type DragEventHandler<P, T = Element> = EventHandler<P, DragEvent<T>>;
58type FocusEventHandler<P, T = Element> = EventHandler<P, FocusEvent<T>>;
59type FormEventHandler<P, T = Element> = EventHandler<P, FormEvent<T>>;
60type KeyboardEventHandler<P, T = Element> = EventHandler<P, KeyboardEvent<T>>;
61type MouseEventHandler<P, T = Element> = EventHandler<P, MouseEvent<T>>;
62type TouchEventHandler<P, T = Element> = EventHandler<P, TouchEvent<T>>;
63type PointerEventHandler<P, T = Element> = EventHandler<P, PointerEvent<T>>;
64type UIEventHandler<P, T = Element> = EventHandler<P, UIEvent<T>>;
65type WheelEventHandler<P, T = Element> = EventHandler<P, WheelEvent<T>>;
66type AnimationEventHandler<P, T = Element> = EventHandler<P, AnimationEvent<T>>;
67type TransitionEventHandler<P, T = Element> = EventHandler<P, TransitionEvent<T>>;
68export interface DOMAttributesWithProps<P, T> {
69 children?: ReactNode;
70 dangerouslySetInnerHTML?: {
71 __html: string;
72 };
73 onCopy?: ClipboardEventHandler<P, T>;
74 onCopyCapture?: ClipboardEventHandler<P, T>;
75 onCut?: ClipboardEventHandler<P, T>;
76 onCutCapture?: ClipboardEventHandler<P, T>;
77 onPaste?: ClipboardEventHandler<P, T>;
78 onPasteCapture?: ClipboardEventHandler<P, T>;
79 onCompositionEnd?: CompositionEventHandler<P, T>;
80 onCompositionEndCapture?: CompositionEventHandler<P, T>;
81 onCompositionStart?: CompositionEventHandler<P, T>;
82 onCompositionStartCapture?: CompositionEventHandler<P, T>;
83 onCompositionUpdate?: CompositionEventHandler<P, T>;
84 onCompositionUpdateCapture?: CompositionEventHandler<P, T>;
85 onFocus?: FocusEventHandler<P, T>;
86 onFocusCapture?: FocusEventHandler<P, T>;
87 onBlur?: FocusEventHandler<P, T>;
88 onBlurCapture?: FocusEventHandler<P, T>;
89 onChange?: FormEventHandler<P, T>;
90 onChangeCapture?: FormEventHandler<P, T>;
91 onBeforeInput?: FormEventHandler<P, T>;
92 onBeforeInputCapture?: FormEventHandler<P, T>;
93 onInput?: FormEventHandler<P, T>;
94 onInputCapture?: FormEventHandler<P, T>;
95 onReset?: FormEventHandler<P, T>;
96 onResetCapture?: FormEventHandler<P, T>;
97 onSubmit?: FormEventHandler<P, T>;
98 onSubmitCapture?: FormEventHandler<P, T>;
99 onInvalid?: FormEventHandler<P, T>;
100 onInvalidCapture?: FormEventHandler<P, T>;
101 onLoad?: ReactEventHandler<P, T>;
102 onLoadCapture?: ReactEventHandler<P, T>;
103 onError?: ReactEventHandler<P, T>;
104 onErrorCapture?: ReactEventHandler<P, T>;
105 onKeyDown?: KeyboardEventHandler<P, T>;
106 onKeyDownCapture?: KeyboardEventHandler<P, T>;
107 onKeyPress?: KeyboardEventHandler<P, T>;
108 onKeyPressCapture?: KeyboardEventHandler<P, T>;
109 onKeyUp?: KeyboardEventHandler<P, T>;
110 onKeyUpCapture?: KeyboardEventHandler<P, T>;
111 onAbort?: ReactEventHandler<P, T>;
112 onAbortCapture?: ReactEventHandler<P, T>;
113 onCanPlay?: ReactEventHandler<P, T>;
114 onCanPlayCapture?: ReactEventHandler<P, T>;
115 onCanPlayThrough?: ReactEventHandler<P, T>;
116 onCanPlayThroughCapture?: ReactEventHandler<P, T>;
117 onDurationChange?: ReactEventHandler<P, T>;
118 onDurationChangeCapture?: ReactEventHandler<P, T>;
119 onEmptied?: ReactEventHandler<P, T>;
120 onEmptiedCapture?: ReactEventHandler<P, T>;
121 onEncrypted?: ReactEventHandler<P, T>;
122 onEncryptedCapture?: ReactEventHandler<P, T>;
123 onEnded?: ReactEventHandler<P, T>;
124 onEndedCapture?: ReactEventHandler<P, T>;
125 onLoadedData?: ReactEventHandler<P, T>;
126 onLoadedDataCapture?: ReactEventHandler<P, T>;
127 onLoadedMetadata?: ReactEventHandler<P, T>;
128 onLoadedMetadataCapture?: ReactEventHandler<P, T>;
129 onLoadStart?: ReactEventHandler<P, T>;
130 onLoadStartCapture?: ReactEventHandler<P, T>;
131 onPause?: ReactEventHandler<P, T>;
132 onPauseCapture?: ReactEventHandler<P, T>;
133 onPlay?: ReactEventHandler<P, T>;
134 onPlayCapture?: ReactEventHandler<P, T>;
135 onPlaying?: ReactEventHandler<P, T>;
136 onPlayingCapture?: ReactEventHandler<P, T>;
137 onProgress?: ReactEventHandler<P, T>;
138 onProgressCapture?: ReactEventHandler<P, T>;
139 onRateChange?: ReactEventHandler<P, T>;
140 onRateChangeCapture?: ReactEventHandler<P, T>;
141 onSeeked?: ReactEventHandler<P, T>;
142 onSeekedCapture?: ReactEventHandler<P, T>;
143 onSeeking?: ReactEventHandler<P, T>;
144 onSeekingCapture?: ReactEventHandler<P, T>;
145 onStalled?: ReactEventHandler<P, T>;
146 onStalledCapture?: ReactEventHandler<P, T>;
147 onSuspend?: ReactEventHandler<P, T>;
148 onSuspendCapture?: ReactEventHandler<P, T>;
149 onTimeUpdate?: ReactEventHandler<P, T>;
150 onTimeUpdateCapture?: ReactEventHandler<P, T>;
151 onVolumeChange?: ReactEventHandler<P, T>;
152 onVolumeChangeCapture?: ReactEventHandler<P, T>;
153 onWaiting?: ReactEventHandler<P, T>;
154 onWaitingCapture?: ReactEventHandler<P, T>;
155 onAuxClick?: MouseEventHandler<P, T>;
156 onAuxClickCapture?: MouseEventHandler<P, T>;
157 onClick?: MouseEventHandler<P, T>;
158 onClickCapture?: MouseEventHandler<P, T>;
159 onContextMenu?: MouseEventHandler<P, T>;
160 onContextMenuCapture?: MouseEventHandler<P, T>;
161 onDoubleClick?: MouseEventHandler<P, T>;
162 onDoubleClickCapture?: MouseEventHandler<P, T>;
163 onDrag?: DragEventHandler<P, T>;
164 onDragCapture?: DragEventHandler<P, T>;
165 onDragEnd?: DragEventHandler<P, T>;
166 onDragEndCapture?: DragEventHandler<P, T>;
167 onDragEnter?: DragEventHandler<P, T>;
168 onDragEnterCapture?: DragEventHandler<P, T>;
169 onDragExit?: DragEventHandler<P, T>;
170 onDragExitCapture?: DragEventHandler<P, T>;
171 onDragLeave?: DragEventHandler<P, T>;
172 onDragLeaveCapture?: DragEventHandler<P, T>;
173 onDragOver?: DragEventHandler<P, T>;
174 onDragOverCapture?: DragEventHandler<P, T>;
175 onDragStart?: DragEventHandler<P, T>;
176 onDragStartCapture?: DragEventHandler<P, T>;
177 onDrop?: DragEventHandler<P, T>;
178 onDropCapture?: DragEventHandler<P, T>;
179 onMouseDown?: MouseEventHandler<P, T>;
180 onMouseDownCapture?: MouseEventHandler<P, T>;
181 onMouseEnter?: MouseEventHandler<P, T>;
182 onMouseLeave?: MouseEventHandler<P, T>;
183 onMouseMove?: MouseEventHandler<P, T>;
184 onMouseMoveCapture?: MouseEventHandler<P, T>;
185 onMouseOut?: MouseEventHandler<P, T>;
186 onMouseOutCapture?: MouseEventHandler<P, T>;
187 onMouseOver?: MouseEventHandler<P, T>;
188 onMouseOverCapture?: MouseEventHandler<P, T>;
189 onMouseUp?: MouseEventHandler<P, T>;
190 onMouseUpCapture?: MouseEventHandler<P, T>;
191 onSelect?: ReactEventHandler<P, T>;
192 onSelectCapture?: ReactEventHandler<P, T>;
193 onTouchCancel?: TouchEventHandler<P, T>;
194 onTouchCancelCapture?: TouchEventHandler<P, T>;
195 onTouchEnd?: TouchEventHandler<P, T>;
196 onTouchEndCapture?: TouchEventHandler<P, T>;
197 onTouchMove?: TouchEventHandler<P, T>;
198 onTouchMoveCapture?: TouchEventHandler<P, T>;
199 onTouchStart?: TouchEventHandler<P, T>;
200 onTouchStartCapture?: TouchEventHandler<P, T>;
201 onPointerDown?: PointerEventHandler<P, T>;
202 onPointerDownCapture?: PointerEventHandler<P, T>;
203 onPointerMove?: PointerEventHandler<P, T>;
204 onPointerMoveCapture?: PointerEventHandler<P, T>;
205 onPointerUp?: PointerEventHandler<P, T>;
206 onPointerUpCapture?: PointerEventHandler<P, T>;
207 onPointerCancel?: PointerEventHandler<P, T>;
208 onPointerCancelCapture?: PointerEventHandler<P, T>;
209 onPointerEnter?: PointerEventHandler<P, T>;
210 onPointerEnterCapture?: PointerEventHandler<P, T>;
211 onPointerLeave?: PointerEventHandler<P, T>;
212 onPointerLeaveCapture?: PointerEventHandler<P, T>;
213 onPointerOver?: PointerEventHandler<P, T>;
214 onPointerOverCapture?: PointerEventHandler<P, T>;
215 onPointerOut?: PointerEventHandler<P, T>;
216 onPointerOutCapture?: PointerEventHandler<P, T>;
217 onGotPointerCapture?: PointerEventHandler<P, T>;
218 onGotPointerCaptureCapture?: PointerEventHandler<P, T>;
219 onLostPointerCapture?: PointerEventHandler<P, T>;
220 onLostPointerCaptureCapture?: PointerEventHandler<P, T>;
221 onScroll?: UIEventHandler<P, T>;
222 onScrollCapture?: UIEventHandler<P, T>;
223 onWheel?: WheelEventHandler<P, T>;
224 onWheelCapture?: WheelEventHandler<P, T>;
225 onAnimationStart?: AnimationEventHandler<P, T>;
226 onAnimationStartCapture?: AnimationEventHandler<P, T>;
227 onAnimationEnd?: AnimationEventHandler<P, T>;
228 onAnimationEndCapture?: AnimationEventHandler<P, T>;
229 onAnimationIteration?: AnimationEventHandler<P, T>;
230 onAnimationIterationCapture?: AnimationEventHandler<P, T>;
231 onTransitionEnd?: TransitionEventHandler<P, T>;
232 onTransitionEndCapture?: TransitionEventHandler<P, T>;
233}
234type AdaptChildEventHandler<P, E extends SyntheticEvent<any>> = {
235 bivarianceHack(data: P, index: number, event: E): void;
236}['bivarianceHack'];
237type AdaptChildReactEventHandler<P, T = Element> = AdaptChildEventHandler<P, SyntheticEvent<T>>;
238type AdaptChildClipboardEventHandler<P, T = Element> = AdaptChildEventHandler<P, ClipboardEvent<T>>;
239type AdaptChildCompositionEventHandler<P, T = Element> = AdaptChildEventHandler<P, CompositionEvent<T>>;
240type AdaptChildDragEventHandler<P, T = Element> = AdaptChildEventHandler<P, DragEvent<T>>;
241type AdaptChildFocusEventHandler<P, T = Element> = AdaptChildEventHandler<P, FocusEvent<T>>;
242type AdaptChildFormEventHandler<P, T = Element> = AdaptChildEventHandler<P, FormEvent<T>>;
243type AdaptChildKeyboardEventHandler<P, T = Element> = AdaptChildEventHandler<P, KeyboardEvent<T>>;
244type AdaptChildMouseEventHandler<P, T = Element> = AdaptChildEventHandler<P, MouseEvent<T>>;
245type AdaptChildTouchEventHandler<P, T = Element> = AdaptChildEventHandler<P, TouchEvent<T>>;
246type AdaptChildPointerEventHandler<P, T = Element> = AdaptChildEventHandler<P, PointerEvent<T>>;
247type AdaptChildUIEventHandler<P, T = Element> = AdaptChildEventHandler<P, UIEvent<T>>;
248type AdaptChildWheelEventHandler<P, T = Element> = AdaptChildEventHandler<P, WheelEvent<T>>;
249type AdaptChildAnimationEventHandler<P, T = Element> = AdaptChildEventHandler<P, AnimationEvent<T>>;
250type AdaptChildTransitionEventHandler<P, T = Element> = AdaptChildEventHandler<P, TransitionEvent<T>>;
251export type DOMAttributesAdaptChildEvent<P, T> = {
252 children?: ReactNode;
253 dangerouslySetInnerHTML?: {
254 __html: string;
255 };
256 onCopy?: AdaptChildClipboardEventHandler<P, T>;
257 onCopyCapture?: AdaptChildClipboardEventHandler<P, T>;
258 onCut?: AdaptChildClipboardEventHandler<P, T>;
259 onCutCapture?: AdaptChildClipboardEventHandler<P, T>;
260 onPaste?: AdaptChildClipboardEventHandler<P, T>;
261 onPasteCapture?: AdaptChildClipboardEventHandler<P, T>;
262 onCompositionEnd?: AdaptChildCompositionEventHandler<P, T>;
263 onCompositionEndCapture?: AdaptChildCompositionEventHandler<P, T>;
264 onCompositionStart?: AdaptChildCompositionEventHandler<P, T>;
265 onCompositionStartCapture?: AdaptChildCompositionEventHandler<P, T>;
266 onCompositionUpdate?: AdaptChildCompositionEventHandler<P, T>;
267 onCompositionUpdateCapture?: AdaptChildCompositionEventHandler<P, T>;
268 onFocus?: AdaptChildFocusEventHandler<P, T>;
269 onFocusCapture?: AdaptChildFocusEventHandler<P, T>;
270 onBlur?: AdaptChildFocusEventHandler<P, T>;
271 onBlurCapture?: AdaptChildFocusEventHandler<P, T>;
272 onChange?: AdaptChildFormEventHandler<P, T>;
273 onChangeCapture?: AdaptChildFormEventHandler<P, T>;
274 onBeforeInput?: AdaptChildFormEventHandler<P, T>;
275 onBeforeInputCapture?: AdaptChildFormEventHandler<P, T>;
276 onInput?: AdaptChildFormEventHandler<P, T>;
277 onInputCapture?: AdaptChildFormEventHandler<P, T>;
278 onReset?: AdaptChildFormEventHandler<P, T>;
279 onResetCapture?: AdaptChildFormEventHandler<P, T>;
280 onSubmit?: AdaptChildFormEventHandler<P, T>;
281 onSubmitCapture?: AdaptChildFormEventHandler<P, T>;
282 onInvalid?: AdaptChildFormEventHandler<P, T>;
283 onInvalidCapture?: AdaptChildFormEventHandler<P, T>;
284 onLoad?: AdaptChildReactEventHandler<P, T>;
285 onLoadCapture?: AdaptChildReactEventHandler<P, T>;
286 onError?: AdaptChildReactEventHandler<P, T>;
287 onErrorCapture?: AdaptChildReactEventHandler<P, T>;
288 onKeyDown?: AdaptChildKeyboardEventHandler<P, T>;
289 onKeyDownCapture?: AdaptChildKeyboardEventHandler<P, T>;
290 onKeyPress?: AdaptChildKeyboardEventHandler<P, T>;
291 onKeyPressCapture?: AdaptChildKeyboardEventHandler<P, T>;
292 onKeyUp?: AdaptChildKeyboardEventHandler<P, T>;
293 onKeyUpCapture?: AdaptChildKeyboardEventHandler<P, T>;
294 onAbort?: AdaptChildReactEventHandler<P, T>;
295 onAbortCapture?: AdaptChildReactEventHandler<P, T>;
296 onCanPlay?: AdaptChildReactEventHandler<P, T>;
297 onCanPlayCapture?: AdaptChildReactEventHandler<P, T>;
298 onCanPlayThrough?: AdaptChildReactEventHandler<P, T>;
299 onCanPlayThroughCapture?: AdaptChildReactEventHandler<P, T>;
300 onDurationChange?: AdaptChildReactEventHandler<P, T>;
301 onDurationChangeCapture?: AdaptChildReactEventHandler<P, T>;
302 onEmptied?: AdaptChildReactEventHandler<P, T>;
303 onEmptiedCapture?: AdaptChildReactEventHandler<P, T>;
304 onEncrypted?: AdaptChildReactEventHandler<P, T>;
305 onEncryptedCapture?: AdaptChildReactEventHandler<P, T>;
306 onEnded?: AdaptChildReactEventHandler<P, T>;
307 onEndedCapture?: AdaptChildReactEventHandler<P, T>;
308 onLoadedData?: AdaptChildReactEventHandler<P, T>;
309 onLoadedDataCapture?: AdaptChildReactEventHandler<P, T>;
310 onLoadedMetadata?: AdaptChildReactEventHandler<P, T>;
311 onLoadedMetadataCapture?: AdaptChildReactEventHandler<P, T>;
312 onLoadStart?: AdaptChildReactEventHandler<P, T>;
313 onLoadStartCapture?: AdaptChildReactEventHandler<P, T>;
314 onPause?: AdaptChildReactEventHandler<P, T>;
315 onPauseCapture?: AdaptChildReactEventHandler<P, T>;
316 onPlay?: AdaptChildReactEventHandler<P, T>;
317 onPlayCapture?: AdaptChildReactEventHandler<P, T>;
318 onPlaying?: AdaptChildReactEventHandler<P, T>;
319 onPlayingCapture?: AdaptChildReactEventHandler<P, T>;
320 onProgress?: AdaptChildReactEventHandler<P, T>;
321 onProgressCapture?: AdaptChildReactEventHandler<P, T>;
322 onRateChange?: AdaptChildReactEventHandler<P, T>;
323 onRateChangeCapture?: AdaptChildReactEventHandler<P, T>;
324 onSeeked?: AdaptChildReactEventHandler<P, T>;
325 onSeekedCapture?: AdaptChildReactEventHandler<P, T>;
326 onSeeking?: AdaptChildReactEventHandler<P, T>;
327 onSeekingCapture?: AdaptChildReactEventHandler<P, T>;
328 onStalled?: AdaptChildReactEventHandler<P, T>;
329 onStalledCapture?: AdaptChildReactEventHandler<P, T>;
330 onSuspend?: AdaptChildReactEventHandler<P, T>;
331 onSuspendCapture?: AdaptChildReactEventHandler<P, T>;
332 onTimeUpdate?: AdaptChildReactEventHandler<P, T>;
333 onTimeUpdateCapture?: AdaptChildReactEventHandler<P, T>;
334 onVolumeChange?: AdaptChildReactEventHandler<P, T>;
335 onVolumeChangeCapture?: AdaptChildReactEventHandler<P, T>;
336 onWaiting?: AdaptChildReactEventHandler<P, T>;
337 onWaitingCapture?: AdaptChildReactEventHandler<P, T>;
338 onAuxClick?: AdaptChildMouseEventHandler<P, T>;
339 onAuxClickCapture?: AdaptChildMouseEventHandler<P, T>;
340 onClick?: AdaptChildMouseEventHandler<P, T>;
341 onClickCapture?: AdaptChildMouseEventHandler<P, T>;
342 onContextMenu?: AdaptChildMouseEventHandler<P, T>;
343 onContextMenuCapture?: AdaptChildMouseEventHandler<P, T>;
344 onDoubleClick?: AdaptChildMouseEventHandler<P, T>;
345 onDoubleClickCapture?: AdaptChildMouseEventHandler<P, T>;
346 onDrag?: AdaptChildDragEventHandler<P, T>;
347 onDragCapture?: AdaptChildDragEventHandler<P, T>;
348 onDragEnd?: AdaptChildDragEventHandler<P, T>;
349 onDragEndCapture?: AdaptChildDragEventHandler<P, T>;
350 onDragEnter?: AdaptChildDragEventHandler<P, T>;
351 onDragEnterCapture?: AdaptChildDragEventHandler<P, T>;
352 onDragExit?: AdaptChildDragEventHandler<P, T>;
353 onDragExitCapture?: AdaptChildDragEventHandler<P, T>;
354 onDragLeave?: AdaptChildDragEventHandler<P, T>;
355 onDragLeaveCapture?: AdaptChildDragEventHandler<P, T>;
356 onDragOver?: AdaptChildDragEventHandler<P, T>;
357 onDragOverCapture?: AdaptChildDragEventHandler<P, T>;
358 onDragStart?: AdaptChildDragEventHandler<P, T>;
359 onDragStartCapture?: AdaptChildDragEventHandler<P, T>;
360 onDrop?: AdaptChildDragEventHandler<P, T>;
361 onDropCapture?: AdaptChildDragEventHandler<P, T>;
362 onMouseDown?: AdaptChildMouseEventHandler<P, T>;
363 onMouseDownCapture?: AdaptChildMouseEventHandler<P, T>;
364 onMouseEnter?: AdaptChildMouseEventHandler<P, T>;
365 onMouseLeave?: AdaptChildMouseEventHandler<P, T>;
366 onMouseMove?: AdaptChildMouseEventHandler<P, T>;
367 onMouseMoveCapture?: AdaptChildMouseEventHandler<P, T>;
368 onMouseOut?: AdaptChildMouseEventHandler<P, T>;
369 onMouseOutCapture?: AdaptChildMouseEventHandler<P, T>;
370 onMouseOver?: AdaptChildMouseEventHandler<P, T>;
371 onMouseOverCapture?: AdaptChildMouseEventHandler<P, T>;
372 onMouseUp?: AdaptChildMouseEventHandler<P, T>;
373 onMouseUpCapture?: AdaptChildMouseEventHandler<P, T>;
374 onSelect?: AdaptChildReactEventHandler<P, T>;
375 onSelectCapture?: AdaptChildReactEventHandler<P, T>;
376 onTouchCancel?: AdaptChildTouchEventHandler<P, T>;
377 onTouchCancelCapture?: AdaptChildTouchEventHandler<P, T>;
378 onTouchEnd?: AdaptChildTouchEventHandler<P, T>;
379 onTouchEndCapture?: AdaptChildTouchEventHandler<P, T>;
380 onTouchMove?: AdaptChildTouchEventHandler<P, T>;
381 onTouchMoveCapture?: AdaptChildTouchEventHandler<P, T>;
382 onTouchStart?: AdaptChildTouchEventHandler<P, T>;
383 onTouchStartCapture?: AdaptChildTouchEventHandler<P, T>;
384 onPointerDown?: AdaptChildPointerEventHandler<P, T>;
385 onPointerDownCapture?: AdaptChildPointerEventHandler<P, T>;
386 onPointerMove?: AdaptChildPointerEventHandler<P, T>;
387 onPointerMoveCapture?: AdaptChildPointerEventHandler<P, T>;
388 onPointerUp?: AdaptChildPointerEventHandler<P, T>;
389 onPointerUpCapture?: AdaptChildPointerEventHandler<P, T>;
390 onPointerCancel?: AdaptChildPointerEventHandler<P, T>;
391 onPointerCancelCapture?: AdaptChildPointerEventHandler<P, T>;
392 onPointerEnter?: AdaptChildPointerEventHandler<P, T>;
393 onPointerEnterCapture?: AdaptChildPointerEventHandler<P, T>;
394 onPointerLeave?: AdaptChildPointerEventHandler<P, T>;
395 onPointerLeaveCapture?: AdaptChildPointerEventHandler<P, T>;
396 onPointerOver?: AdaptChildPointerEventHandler<P, T>;
397 onPointerOverCapture?: AdaptChildPointerEventHandler<P, T>;
398 onPointerOut?: AdaptChildPointerEventHandler<P, T>;
399 onPointerOutCapture?: AdaptChildPointerEventHandler<P, T>;
400 onGotPointerCapture?: AdaptChildPointerEventHandler<P, T>;
401 onGotPointerCaptureCapture?: AdaptChildPointerEventHandler<P, T>;
402 onLostPointerCapture?: AdaptChildPointerEventHandler<P, T>;
403 onLostPointerCaptureCapture?: AdaptChildPointerEventHandler<P, T>;
404 onScroll?: AdaptChildUIEventHandler<P, T>;
405 onScrollCapture?: AdaptChildUIEventHandler<P, T>;
406 onWheel?: AdaptChildWheelEventHandler<P, T>;
407 onWheelCapture?: AdaptChildWheelEventHandler<P, T>;
408 onAnimationStart?: AdaptChildAnimationEventHandler<P, T>;
409 onAnimationStartCapture?: AdaptChildAnimationEventHandler<P, T>;
410 onAnimationEnd?: AdaptChildAnimationEventHandler<P, T>;
411 onAnimationEndCapture?: AdaptChildAnimationEventHandler<P, T>;
412 onAnimationIteration?: AdaptChildAnimationEventHandler<P, T>;
413 onAnimationIterationCapture?: AdaptChildAnimationEventHandler<P, T>;
414 onTransitionEnd?: AdaptChildTransitionEventHandler<P, T>;
415 onTransitionEndCapture?: AdaptChildTransitionEventHandler<P, T>;
416};
417export declare const SVGElementPropKeys: string[];
418/** svg element types that have specific attribute filtration requirements */
419export type FilteredSvgElementType = 'svg' | 'polyline' | 'polygon';
420/** map of svg element types to unique svg attributes that belong to that element */
421export declare const FilteredElementKeyMap: Record<FilteredSvgElementType, string[]>;
422export declare const EventKeys: string[];
423/** The type of easing function to use for animations */
424export type AnimationTiming = 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear';
425/** Specifies the duration of animation, the unit of this option is ms. */
426export type AnimationDuration = number;
427/** the offset of a chart, which define the blank space all around */
428export interface ChartOffset {
429 top?: number;
430 bottom?: number;
431 left?: number;
432 right?: number;
433 width?: number;
434 height?: number;
435 brushBottom?: number;
436}
437export interface Padding {
438 top?: number;
439 bottom?: number;
440 left?: number;
441 right?: number;
442}
443export interface GeometrySector {
444 cx?: number;
445 cy?: number;
446 innerRadius?: number;
447 outerRadius?: number;
448 startAngle?: number;
449 endAngle?: number;
450 cornerRadius?: number;
451 forceCornerRadius?: boolean;
452 cornerIsExternal?: boolean;
453}
454export type D3Scale<T> = D3ScaleContinuousNumeric<T, number>;
455export type AxisDomainItem = string | number | Function | 'auto' | 'dataMin' | 'dataMax';
456/**
457 * The domain of axis.
458 * This is the definition
459 *
460 * Numeric domain is always defined by an array of exactly two values, for the min and the max of the axis.
461 * Categorical domain is defined as array of all possible values.
462 *
463 * Can be specified in many ways:
464 * - array of numbers
465 * - with special strings like 'dataMin' and 'dataMax'
466 * - with special string math like 'dataMin - 100'
467 * - with keyword 'auto'
468 * - or a function
469 * - array of functions
470 * - or a combination of the above
471 */
472export type AxisDomain = string[] | number[] | [AxisDomainItem, AxisDomainItem] | (([dataMin, dataMax]: [number, number], allowDataOverflow: boolean) => [number, number]);
473/**
474 * NumberDomain is an evaluated {@link AxisDomain}.
475 * Unlike {@link AxisDomain}, it has no variety - it's a tuple of two number.
476 * This is after all the keywords and functions were evaluated and what is left is [min, max].
477 *
478 * Know that the min, max values are not guaranteed to be nice numbers - values like -Infinity or NaN are possible.
479 *
480 * There are also `category` axes that have different things than numbers in their domain.
481 */
482export type NumberDomain = [min: number, max: number];
483export type CategoricalDomain = (number | string | Date)[];
484/** The props definition of base axis */
485export interface BaseAxisProps {
486 /** The type of axis */
487 type?: 'number' | 'category';
488 /** The key of data displayed in the axis */
489 dataKey?: DataKey<any>;
490 /** Whether or not display the axis */
491 hide?: boolean;
492 /** The scale type or functor of scale */
493 scale?: ScaleType | Function;
494 /** The option for tick */
495 tick?: SVGProps<SVGTextElement> | ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>) | boolean;
496 /** The count of ticks */
497 tickCount?: number;
498 /** The option for axisLine */
499 axisLine?: boolean | SVGProps<SVGLineElement>;
500 /** The option for tickLine */
501 tickLine?: boolean | SVGProps<SVGTextElement>;
502 /** The size of tick line */
503 tickSize?: number;
504 /** The formatter function of tick */
505 tickFormatter?: (value: any, index: number) => string;
506 /**
507 * When domain of the axis is specified and the type of the axis is 'number',
508 * if allowDataOverflow is set to be false,
509 * the domain will be adjusted when the minimum value of data is smaller than domain[0] or
510 * the maximum value of data is greater than domain[1] so that the axis displays all data values.
511 * If set to true, graphic elements (line, area, bars) will be clipped to conform to the specified domain.
512 */
513 allowDataOverflow?: boolean;
514 /**
515 * Allow the axis has duplicated categories or not when the type of axis is "category".
516 */
517 allowDuplicatedCategory?: boolean;
518 /**
519 * Allow the ticks of axis to be decimals or not.
520 */
521 allowDecimals?: boolean;
522 /** The domain of scale in this axis */
523 domain?: AxisDomain;
524 /** Consider hidden elements when computing the domain (defaults to false) */
525 includeHidden?: boolean;
526 /** The name of data displayed in the axis */
527 name?: string;
528 /** The unit of data displayed in the axis */
529 unit?: string | number;
530 /** The type of axis */
531 axisType?: AxisType;
532 range?: Array<number>;
533 /** axis react component */
534 AxisComp?: any;
535 /** Needed to allow usage of the label prop on the X and Y axis */
536 label?: string | number | ReactElement | object;
537 /** The HTML element's class name */
538 className?: string;
539}
540/** Defines how ticks are placed and whether / how tick collisions are handled.
541 * 'preserveStart' keeps the left tick on collision and ensures that the first tick is always shown.
542 * 'preserveEnd' keeps the right tick on collision and ensures that the last tick is always shown.
543 * 'preserveStartEnd' keeps the left tick on collision and ensures that the first and last ticks are always shown.
544 * 'equidistantPreserveStart' selects a number N such that every nTh tick will be shown without collision.
545 */
546export type AxisInterval = number | 'preserveStart' | 'preserveEnd' | 'preserveStartEnd' | 'equidistantPreserveStart';
547export interface TickItem {
548 value?: any;
549 coordinate: number;
550 index?: number;
551}
552export interface CartesianTickItem extends TickItem {
553 tickCoord?: number;
554 tickSize?: number;
555 isShow?: boolean;
556}
557export interface Margin {
558 top?: number;
559 right?: number;
560 bottom?: number;
561 left?: number;
562}
563export interface CartesianViewBox {
564 x?: number;
565 y?: number;
566 width?: number;
567 height?: number;
568}
569export interface PolarViewBox {
570 cx?: number;
571 cy?: number;
572 innerRadius?: number;
573 outerRadius?: number;
574 startAngle?: number;
575 endAngle?: number;
576 clockWise?: boolean;
577}
578export type ViewBox = CartesianViewBox | PolarViewBox;
579type RecordString<T> = Record<string, T>;
580type AdaptEventHandlersReturn = RecordString<(e?: Event) => any> | RecordString<(e: Event) => void> | null;
581export declare const adaptEventHandlers: (props: RecordString<any> | Component | FunctionComponent | boolean, newHandler?: (e?: Event) => any) => AdaptEventHandlersReturn;
582export declare const adaptEventsOfChild: (props: RecordString<any>, data: any, index: number) => RecordString<(e?: Event) => any>;
583export type TooltipEventType = 'axis' | 'item';
584export interface CategoricalChartOptions {
585 chartName?: string;
586 GraphicalChild?: any;
587 defaultTooltipEventType?: TooltipEventType;
588 validateTooltipEventTypes?: ReadonlyArray<TooltipEventType>;
589 axisComponents?: BaseAxisProps[];
590 legendContent?: 'children';
591 formatAxisMap?: any;
592 defaultProps?: any;
593}
594export interface TreemapNode {
595 x: number;
596 y: number;
597 width: number;
598 height: number;
599 depth: number;
600 index: number;
601 children?: any;
602 name: string;
603 value: number;
604 [k: string]: any;
605}
606export interface SankeyNode {
607 x: number;
608 y: number;
609 dx: number;
610 dy: number;
611 depth: number;
612 value: number;
613}
614export interface SankeyLink {
615 target: number;
616 source: number;
617 value: number;
618 sy: number;
619 dy: number;
620 ty: number;
621}
622export type Size = {
623 width: number;
624 height: number;
625};
626export type ActiveShape<PropsType = Record<string, any>, ElementType = SVGElement> = ReactElement<SVGProps<ElementType>> | ((props: PropsType) => ReactElement<SVGProps<ElementType>>) | ((props: unknown) => JSX.Element) | SVGProps<ElementType> | boolean;
627export type XAxisMap = {
628 [axisId: string]: XAxisProps;
629};
630export type YAxisMap = {
631 [axisId: string]: YAxisProps;
632};
633export {};
634
\No newline at end of file