-
Notifications
You must be signed in to change notification settings - Fork 620
/
types.ts
75 lines (70 loc) · 1.75 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { CSSProperties } from 'react';
export type EChartsOption = any;
export type EChartsInstance = any;
export type Opts = {
readonly devicePixelRatio?: number;
readonly renderer?: 'canvas' | 'svg';
readonly width?: number | null | undefined | 'auto';
readonly height?: number | null | undefined | 'auto';
readonly locale?: string;
};
export type EChartsReactProps = {
/**
* echarts library entry, use it for import necessary.
*/
readonly echarts?: any;
/**
* `className` for container
*/
readonly className?: string;
/**
* `style` for container
*/
readonly style?: CSSProperties;
/**
* echarts option
*/
readonly option: EChartsOption;
/**
* echarts theme config, can be:
* 1. theme name string
* 2. theme object
*/
readonly theme?: string | Record<string, any>;
/**
* notMerge config for echarts, default is `false`
*/
readonly notMerge?: boolean;
/**
* lazyUpdate config for echarts, default is `false`
*/
readonly lazyUpdate?: boolean;
/**
* showLoading config for echarts, default is `false`
*/
readonly showLoading?: boolean;
/**
* loadingOption config for echarts, default is `null`
*/
readonly loadingOption?: any;
/**
* echarts opts config, default is `{}`
*/
readonly opts?: Opts;
/**
* when after chart reander, do the callback with echarts instance
*/
readonly onChartReady?: (instance: EChartsInstance) => void;
/**
* bind events, default is `{}`
*/
readonly onEvents?: Record<string, Function>;
/**
* should update echarts options
*/
readonly shouldSetOption?: (prevProps: EChartsReactProps, props: EChartsReactProps) => boolean;
/**
* should trigger resize when window resize
*/
readonly autoResize?: boolean;
};