-
Notifications
You must be signed in to change notification settings - Fork 680
Expand file tree
/
Copy pathHelperTypes.ts
More file actions
183 lines (160 loc) · 4.9 KB
/
Copy pathHelperTypes.ts
File metadata and controls
183 lines (160 loc) · 4.9 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
import { TextStyle, ViewStyle } from "react-native";
import { CircleProps, TextProps } from "react-native-svg";
export interface Dataset {
/** The data corresponding to the x-axis label. */
data: number[];
/** A function returning the color of the stroke given an input opacity value. */
color?: (opacity: number, index: number) => string;
/** A function returning array of the colors of the stroke given an input opacity value for each data value. */
colors?: Array<(opacity: number) => string>;
/** The width of the stroke. Defaults to 2. */
strokeWidth?: number;
/** A boolean indicating whether to render dots for this line */
withDots?: boolean;
/** Override of LineChart's withScrollableDot property just for this dataset */
withScrollableDot?: boolean;
/** Unique key **/
key?: string | number;
/** Stroke Dash Array */
strokeDashArray?: number[];
/** Stroke Dash Offset */
strokeDashOffset?: number;
}
export interface ChartData {
/** The x-axis labels */
labels: string[];
datasets: Dataset[];
}
export interface ChartConfig {
backgroundColor?: string;
/**
* Defines the first color in the linear gradient of a chart's background
*/
backgroundGradientFrom?: string;
/**
* Defines the first color opacity in the linear gradient of a chart's background
*/
backgroundGradientFromOpacity?: number;
/**
* Defines the second color in the linear gradient of a chart's background
*/
backgroundGradientTo?: string;
/**
* Defines the second color opacity in the linear gradient of a chart's background
*/
backgroundGradientToOpacity?: number;
/**
* Defines the previous options to maintain backwards compatibility
*/
fillShadowGradient?: string;
fillShadowGradientOpacity?: number;
/**
* Defines the first color in the linear gradient of the area under data
*/
fillShadowGradientFrom?: string;
/**
* Defines the first color opacity in the linear gradient of the area under data
*/
fillShadowGradientFromOpacity?: number;
/**
* Defines the first color offset in the linear gradient of the area under data
*/
fillShadowGradientFromOffset?: number;
/**
* Defines the second color in the linear gradient of the area under data
*/
fillShadowGradientTo?: string;
/**
* Defines the second color opacity in the linear gradient of the area under data
*/
fillShadowGradientToOpacity?: number;
/**
* Defines the second color offset in the linear gradient of the area under data
*/
fillShadowGradientToOffset?: number;
/**
* Defines the option to use color from dataset to each chart data
*/
useShadowColorFromDataset?: boolean;
/**
* Defines the base color function that is used to calculate colors of labels and sectors used in a chart
*/
color?: (opacity: number, index: number) => string;
/**
* Defines the function that is used to calculate the color of the labels used in a chart.
*/
labelColor?: (opacity: number) => string;
/**
* Defines the base stroke width in a chart
*/
strokeWidth?: number;
/**
* Defines the percent (0-1) of the available width each bar width in a chart
*/
barPercentage?: number;
barRadius?: number;
/**
* Override styles of the background lines, refer to react-native-svg's Line documentation
*/
propsForBackgroundLines?: object;
/**
* Override styles of the labels, refer to react-native-svg's Text documentation
*/
propsForLabels?: TextProps;
/**
* Override styles of vertical labels, refer to react-native-svg's Text documentation
*/
propsForVerticalLabels?: TextProps;
/**
* Override styles of horizontal labels, refer to react-native-svg's Text documentation
*/
propsForHorizontalLabels?: TextProps;
/**
* Override styles of the dots, refer to react-native-svg's Text documentation
*/
propsForDots?: CircleProps;
decimalPlaces?: number;
style?: Partial<ViewStyle>;
/**
* Define stroke line join type
*/
linejoinType?: "miter" | "bevel" | "round";
/**
* Define fill color for scrollable dot
*/
scrollableDotFill?: string;
/**
* Define stroke color for scrollable dot
*/
scrollableDotStrokeColor?: string;
/**
* Define stroke width for scrollable dot
*/
scrollableDotStrokeWidth?: number;
/**
* Define radius for scrollable dot
*/
scrollableDotRadius?: number;
/**
* Override style for additional info view upper scrollable dot
*/
scrollableInfoViewStyle?: Partial<ViewStyle>;
/**
* Override text style for additional info view upper scrollable dot
*/
scrollableInfoTextStyle?: Partial<TextStyle>;
scrollableInfoTextDecorator?: (value: number) => string;
/**
* Set Info View offset
*/
scrollableInfoOffset?: number;
/**
* Set Info View size
*/
scrollableInfoSize?: Size;
}
export interface Size {
width: number;
height: number;
}
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;