gifted-charts-core 0.0.25 → 0.0.26
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.
- package/package.json +6 -2
- package/src/BarChart/Animated2DWithGradient.d.ts +24 -0
- package/src/BarChart/Animated2DWithGradient.js +108 -0
- package/src/BarChart/RenderStackBars.d.ts +27 -0
- package/src/BarChart/RenderStackBars.js +99 -0
- package/src/BarChart/index.d.ts +175 -0
- package/src/BarChart/index.js +611 -0
- package/src/BarChart/types.d.ts +570 -0
- package/src/BarChart/types.js +1 -0
- package/src/LineChart/LineChartBiColor.d.ts +104 -0
- package/src/LineChart/LineChartBiColor.js +520 -0
- package/src/LineChart/index.d.ts +383 -0
- package/src/LineChart/index.js +1397 -0
- package/src/LineChart/index.ts +4 -3
- package/src/LineChart/types.d.ts +531 -0
- package/src/LineChart/types.js +1 -0
- package/src/PieChart/index.d.ts +33 -0
- package/src/PieChart/index.js +119 -0
- package/src/PieChart/main.d.ts +49 -0
- package/src/PieChart/main.js +185 -0
- package/src/PieChart/types.d.ts +85 -0
- package/src/PieChart/types.js +1 -0
- package/src/PopulationPyramid/index.d.ts +137 -0
- package/src/PopulationPyramid/index.js +233 -0
- package/src/PopulationPyramid/index.ts +3 -3
- package/src/PopulationPyramid/types.d.ts +235 -0
- package/src/PopulationPyramid/types.js +1 -0
- package/src/PopulationPyramid/types.ts +4 -0
- package/src/components/AnimatedThreeDBar/index.d.ts +12 -0
- package/src/components/AnimatedThreeDBar/index.js +53 -0
- package/src/components/BarAndLineChartsWrapper/getHorizSectionsVals.d.ts +20 -0
- package/src/components/BarAndLineChartsWrapper/getHorizSectionsVals.js +217 -0
- package/src/components/BarAndLineChartsWrapper/index.d.ts +97 -0
- package/src/components/BarAndLineChartsWrapper/index.js +266 -0
- package/src/components/BarAndLineChartsWrapper/index.ts +5 -4
- package/src/components/common/StripAndLabel.d.ts +7 -0
- package/src/components/common/StripAndLabel.js +53 -0
- package/src/components/common/StripAndLabel.ts +2 -2
- package/src/components/common/types.d.ts +31 -0
- package/src/components/common/types.js +1 -0
- package/src/components/common/types.ts +1 -0
- package/src/index.d.ts +37 -0
- package/src/index.js +32 -0
- package/src/index.ts +146 -0
- package/src/utils/constants.d.ts +248 -0
- package/src/utils/constants.js +299 -0
- package/src/utils/constants.ts +0 -4
- package/src/utils/index.d.ts +89 -0
- package/src/utils/index.js +1008 -0
- package/src/utils/types.d.ts +337 -0
- package/src/utils/types.js +16 -0
- package/src/utils/types.ts +1 -0
- package/index.ts +0 -141
|
@@ -0,0 +1,570 @@
|
|
|
1
|
+
import { type ColorValue, type GestureResponderEvent, type ViewStyle } from 'react-native';
|
|
2
|
+
import { type yAxisSides } from '../utils/constants';
|
|
3
|
+
import { type CurveType, type Pointer, type RuleType, type RulesConfig, type referenceConfigType, type secondaryYAxisType } from '../utils/types';
|
|
4
|
+
import { type Component, type ReactNode } from 'react';
|
|
5
|
+
import { type lineDataItem } from '../LineChart/types';
|
|
6
|
+
export interface stackDataItem {
|
|
7
|
+
value?: number;
|
|
8
|
+
onPress?: any;
|
|
9
|
+
onLongPress?: any;
|
|
10
|
+
onPressOut?: any;
|
|
11
|
+
label?: string;
|
|
12
|
+
barWidth?: number;
|
|
13
|
+
spacing?: number;
|
|
14
|
+
labelTextStyle?: any;
|
|
15
|
+
topLabelComponent?: Function;
|
|
16
|
+
topLabelContainerStyle?: any;
|
|
17
|
+
topLabelTextStyle?: any;
|
|
18
|
+
disablePress?: any;
|
|
19
|
+
color?: ColorValue;
|
|
20
|
+
showGradient?: boolean;
|
|
21
|
+
gradientColor?: any;
|
|
22
|
+
capThickness?: number;
|
|
23
|
+
capColor?: ColorValue;
|
|
24
|
+
capRadius?: number;
|
|
25
|
+
labelComponent?: Function;
|
|
26
|
+
stacks: Array<{
|
|
27
|
+
value: number;
|
|
28
|
+
color?: ColorValue;
|
|
29
|
+
onPress?: (event: GestureResponderEvent) => void;
|
|
30
|
+
marginBottom?: number;
|
|
31
|
+
borderRadius?: number;
|
|
32
|
+
borderTopLeftRadius?: number;
|
|
33
|
+
borderTopRightRadius?: number;
|
|
34
|
+
borderBottomLeftRadius?: number;
|
|
35
|
+
borderBottomRightRadius?: number;
|
|
36
|
+
showGradient?: boolean;
|
|
37
|
+
gradientColor?: ColorValue;
|
|
38
|
+
barWidth?: number;
|
|
39
|
+
innerBarComponent?: Function;
|
|
40
|
+
}>;
|
|
41
|
+
barBackgroundPattern?: () => ReactNode;
|
|
42
|
+
borderRadius?: number;
|
|
43
|
+
borderTopLeftRadius?: number;
|
|
44
|
+
borderTopRightRadius?: number;
|
|
45
|
+
borderBottomLeftRadius?: number;
|
|
46
|
+
borderBottomRightRadius?: number;
|
|
47
|
+
barInnerComponent?: (item?: stackDataItem, index?: number) => ReactNode;
|
|
48
|
+
patternId?: string;
|
|
49
|
+
leftShiftForTooltip?: number;
|
|
50
|
+
showXAxisIndex?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface StackedBarChartPropsType {
|
|
53
|
+
style?: any;
|
|
54
|
+
width?: number;
|
|
55
|
+
height?: number;
|
|
56
|
+
color?: ColorValue;
|
|
57
|
+
topLabelComponent?: Component;
|
|
58
|
+
topLabelContainerStyle?: any;
|
|
59
|
+
opacity?: number;
|
|
60
|
+
label: string;
|
|
61
|
+
labelTextStyle?: any;
|
|
62
|
+
disablePress?: boolean;
|
|
63
|
+
item: stackDataItem;
|
|
64
|
+
index: number;
|
|
65
|
+
containerHeight?: number;
|
|
66
|
+
maxValue: number;
|
|
67
|
+
spacing: number;
|
|
68
|
+
propSpacing?: number;
|
|
69
|
+
data?: any;
|
|
70
|
+
barWidth?: number;
|
|
71
|
+
onPress?: Function;
|
|
72
|
+
onLongPress?: Function;
|
|
73
|
+
onPressOut?: Function;
|
|
74
|
+
rotateLabel?: boolean;
|
|
75
|
+
showXAxisIndices: boolean;
|
|
76
|
+
xAxisIndicesHeight: number;
|
|
77
|
+
xAxisIndicesWidth: number;
|
|
78
|
+
xAxisIndicesColor: ColorValue;
|
|
79
|
+
horizontal: boolean;
|
|
80
|
+
intactTopLabel: boolean;
|
|
81
|
+
barBorderWidth?: number;
|
|
82
|
+
barBorderColor: ColorValue;
|
|
83
|
+
barBorderRadius?: number;
|
|
84
|
+
barBorderTopLeftRadius?: number;
|
|
85
|
+
barBorderTopRightRadius?: number;
|
|
86
|
+
barBorderBottomLeftRadius?: number;
|
|
87
|
+
barBorderBottomRightRadius?: number;
|
|
88
|
+
barInnerComponent?: (item?: barDataItem | stackDataItem, index?: number) => ReactNode;
|
|
89
|
+
stackBorderRadius?: number;
|
|
90
|
+
stackBorderTopLeftRadius?: number;
|
|
91
|
+
stackBorderTopRightRadius?: number;
|
|
92
|
+
stackBorderBottomLeftRadius?: number;
|
|
93
|
+
stackBorderBottomRightRadius?: number;
|
|
94
|
+
xAxisThickness: number;
|
|
95
|
+
barBackgroundPattern?: () => ReactNode;
|
|
96
|
+
patternId?: string;
|
|
97
|
+
xAxisTextNumberOfLines: number;
|
|
98
|
+
xAxisLabelsHeight?: number;
|
|
99
|
+
xAxisLabelsVerticalShift: number;
|
|
100
|
+
renderTooltip: Function | undefined;
|
|
101
|
+
leftShiftForTooltip?: number;
|
|
102
|
+
leftShiftForLastIndexTooltip: number;
|
|
103
|
+
initialSpacing: number;
|
|
104
|
+
selectedIndex: number;
|
|
105
|
+
setSelectedIndex: Function;
|
|
106
|
+
activeOpacity: number;
|
|
107
|
+
showGradient?: boolean;
|
|
108
|
+
gradientColor?: any;
|
|
109
|
+
stackData: stackDataItem[];
|
|
110
|
+
isAnimated?: boolean;
|
|
111
|
+
animationDuration?: number;
|
|
112
|
+
pointerConfig?: Pointer;
|
|
113
|
+
showValuesAsTopLabel?: boolean;
|
|
114
|
+
}
|
|
115
|
+
export interface BarChartPropsType {
|
|
116
|
+
width?: number;
|
|
117
|
+
height?: number;
|
|
118
|
+
overflowTop?: number;
|
|
119
|
+
minHeight?: number;
|
|
120
|
+
noOfSections?: number;
|
|
121
|
+
noOfSectionsBelowXAxis?: number;
|
|
122
|
+
maxValue?: number;
|
|
123
|
+
mostNegativeValue?: number;
|
|
124
|
+
stepHeight?: number;
|
|
125
|
+
stepValue?: number;
|
|
126
|
+
spacing?: number;
|
|
127
|
+
data?: barDataItem[];
|
|
128
|
+
stackData?: stackDataItem[];
|
|
129
|
+
side?: string;
|
|
130
|
+
rotateLabel?: boolean;
|
|
131
|
+
isAnimated?: boolean;
|
|
132
|
+
animationDuration?: number;
|
|
133
|
+
opacity?: number;
|
|
134
|
+
isThreeD?: boolean;
|
|
135
|
+
xAxisLength?: number;
|
|
136
|
+
xAxisThickness?: number;
|
|
137
|
+
xAxisColor?: ColorValue;
|
|
138
|
+
yAxisThickness?: number;
|
|
139
|
+
yAxisColor?: ColorValue;
|
|
140
|
+
yAxisExtraHeight?: number;
|
|
141
|
+
trimYAxisAtTop?: boolean;
|
|
142
|
+
xAxisType?: RuleType;
|
|
143
|
+
yAxisLabelContainerStyle?: any;
|
|
144
|
+
horizontalRulesStyle?: any;
|
|
145
|
+
yAxisTextStyle?: any;
|
|
146
|
+
yAxisTextNumberOfLines?: number;
|
|
147
|
+
xAxisTextNumberOfLines?: number;
|
|
148
|
+
xAxisLabelsHeight?: number;
|
|
149
|
+
xAxisLabelsVerticalShift?: number;
|
|
150
|
+
yAxisLabelWidth?: number;
|
|
151
|
+
hideYAxisText?: boolean;
|
|
152
|
+
rotateYAxisTexts?: number;
|
|
153
|
+
yAxisSide?: yAxisSides;
|
|
154
|
+
yAxisOffset?: number;
|
|
155
|
+
initialSpacing?: number;
|
|
156
|
+
endSpacing?: number;
|
|
157
|
+
barWidth?: number;
|
|
158
|
+
sideWidth?: number;
|
|
159
|
+
showLine?: boolean;
|
|
160
|
+
lineData?: Array<lineDataItem | barDataItem | stackDataItem>;
|
|
161
|
+
lineData2?: Array<lineDataItem | barDataItem | stackDataItem>;
|
|
162
|
+
lineConfig?: lineConfigType;
|
|
163
|
+
lineConfig2?: lineConfigType;
|
|
164
|
+
lineBehindBars?: boolean;
|
|
165
|
+
cappedBars?: boolean;
|
|
166
|
+
capThickness?: number;
|
|
167
|
+
capColor?: ColorValue;
|
|
168
|
+
capRadius?: number;
|
|
169
|
+
hideAxesAndRules?: boolean;
|
|
170
|
+
hideRules?: boolean;
|
|
171
|
+
rulesLength?: number;
|
|
172
|
+
rulesColor?: ColorValue;
|
|
173
|
+
rulesThickness?: number;
|
|
174
|
+
rulesType?: RuleType;
|
|
175
|
+
dashWidth?: number;
|
|
176
|
+
dashGap?: number;
|
|
177
|
+
rulesConfigArray?: RulesConfig[];
|
|
178
|
+
showReferenceLine1?: boolean;
|
|
179
|
+
referenceLine1Config?: referenceConfigType;
|
|
180
|
+
referenceLine1Position?: number;
|
|
181
|
+
showReferenceLine2?: boolean;
|
|
182
|
+
referenceLine2Config?: referenceConfigType;
|
|
183
|
+
referenceLine2Position?: number;
|
|
184
|
+
showReferenceLine3?: boolean;
|
|
185
|
+
referenceLine3Config?: referenceConfigType;
|
|
186
|
+
referenceLine3Position?: number;
|
|
187
|
+
referenceLinesOverChartContent?: boolean;
|
|
188
|
+
showVerticalLines?: boolean;
|
|
189
|
+
verticalLinesThickness?: number;
|
|
190
|
+
verticalLinesHeight?: number;
|
|
191
|
+
verticalLinesColor?: ColorValue;
|
|
192
|
+
verticalLinesStrokeDashArray?: number[];
|
|
193
|
+
verticalLinesShift?: number;
|
|
194
|
+
verticalLinesZIndex?: number;
|
|
195
|
+
noOfVerticalLines?: number;
|
|
196
|
+
verticalLinesSpacing?: number;
|
|
197
|
+
showYAxisIndices?: boolean;
|
|
198
|
+
showXAxisIndices?: boolean;
|
|
199
|
+
yAxisIndicesHeight?: number;
|
|
200
|
+
xAxisIndicesHeight?: number;
|
|
201
|
+
yAxisIndicesWidth?: number;
|
|
202
|
+
xAxisIndicesWidth?: number;
|
|
203
|
+
xAxisIndicesColor?: ColorValue;
|
|
204
|
+
yAxisIndicesColor?: ColorValue;
|
|
205
|
+
showFractionalValues?: boolean;
|
|
206
|
+
roundToDigits?: number;
|
|
207
|
+
backgroundColor?: ColorValue;
|
|
208
|
+
disableScroll?: boolean;
|
|
209
|
+
showScrollIndicator?: boolean;
|
|
210
|
+
indicatorColor?: 'black' | 'default' | 'white';
|
|
211
|
+
roundedTop?: boolean;
|
|
212
|
+
roundedBottom?: boolean;
|
|
213
|
+
disablePress?: boolean;
|
|
214
|
+
frontColor?: ColorValue;
|
|
215
|
+
color?: ColorValue;
|
|
216
|
+
sideColor?: ColorValue;
|
|
217
|
+
topColor?: ColorValue;
|
|
218
|
+
gradientColor?: ColorValue;
|
|
219
|
+
showGradient?: boolean;
|
|
220
|
+
activeOpacity?: number;
|
|
221
|
+
horizontal?: boolean;
|
|
222
|
+
rtl?: boolean;
|
|
223
|
+
shiftX?: number;
|
|
224
|
+
shiftY?: number;
|
|
225
|
+
yAxisAtTop?: boolean;
|
|
226
|
+
intactTopLabel?: boolean;
|
|
227
|
+
showValuesAsTopLabel?: boolean;
|
|
228
|
+
topLabelContainerStyle?: any;
|
|
229
|
+
topLabelTextStyle?: any;
|
|
230
|
+
horizSections?: sectionType[];
|
|
231
|
+
barBorderWidth?: number;
|
|
232
|
+
barBorderColor?: ColorValue;
|
|
233
|
+
barBorderRadius?: number;
|
|
234
|
+
barBorderTopLeftRadius?: number;
|
|
235
|
+
barBorderTopRightRadius?: number;
|
|
236
|
+
barBorderBottomLeftRadius?: number;
|
|
237
|
+
barBorderBottomRightRadius?: number;
|
|
238
|
+
stackBorderRadius?: number;
|
|
239
|
+
stackBorderTopLeftRadius?: number;
|
|
240
|
+
stackBorderTopRightRadius?: number;
|
|
241
|
+
stackBorderBottomLeftRadius?: number;
|
|
242
|
+
stackBorderBottomRightRadius?: number;
|
|
243
|
+
hideOrigin?: boolean;
|
|
244
|
+
labelWidth?: number;
|
|
245
|
+
yAxisLabelTexts?: string[];
|
|
246
|
+
xAxisLabelTexts?: string[];
|
|
247
|
+
xAxisLabelTextStyle?: any;
|
|
248
|
+
yAxisLabelPrefix?: string;
|
|
249
|
+
yAxisLabelSuffix?: string;
|
|
250
|
+
autoShiftLabels?: boolean;
|
|
251
|
+
scrollRef?: any;
|
|
252
|
+
scrollToEnd?: boolean;
|
|
253
|
+
scrollToIndex?: number;
|
|
254
|
+
scrollAnimation?: boolean;
|
|
255
|
+
scrollEventThrottle?: number;
|
|
256
|
+
labelsExtraHeight?: number;
|
|
257
|
+
barBackgroundPattern?: () => ReactNode;
|
|
258
|
+
patternId?: string;
|
|
259
|
+
barMarginBottom?: number;
|
|
260
|
+
onPress?: Function;
|
|
261
|
+
onLongPress?: Function;
|
|
262
|
+
onPressOut?: Function;
|
|
263
|
+
renderTooltip?: Function;
|
|
264
|
+
leftShiftForTooltip?: number;
|
|
265
|
+
leftShiftForLastIndexTooltip?: number;
|
|
266
|
+
barStyle?: object;
|
|
267
|
+
barInnerComponent?: (item?: stackDataItem | barDataItem, index?: number) => ReactNode;
|
|
268
|
+
secondaryData?: barDataItem[];
|
|
269
|
+
secondaryYAxis?: secondaryYAxisType | boolean;
|
|
270
|
+
pointerConfig?: Pointer;
|
|
271
|
+
getPointerProps?: Function;
|
|
272
|
+
formatYLabel?: (label: string) => string;
|
|
273
|
+
onEndReached?: () => void;
|
|
274
|
+
onStartReached?: () => void;
|
|
275
|
+
endReachedOffset?: number;
|
|
276
|
+
onScroll?: Function;
|
|
277
|
+
focusBarOnPress?: boolean;
|
|
278
|
+
focusedBarConfig?: FocusedBarConfig;
|
|
279
|
+
}
|
|
280
|
+
export interface FocusedBarConfig {
|
|
281
|
+
color?: ColorValue;
|
|
282
|
+
sideColor?: ColorValue;
|
|
283
|
+
topColor?: ColorValue;
|
|
284
|
+
gradientColor?: ColorValue;
|
|
285
|
+
width?: number;
|
|
286
|
+
borderRadius?: number;
|
|
287
|
+
roundedTop?: boolean;
|
|
288
|
+
roundedBottom?: boolean;
|
|
289
|
+
opacity?: number;
|
|
290
|
+
barInnerComponent?: (item?: barDataItem, index?: number) => ReactNode;
|
|
291
|
+
}
|
|
292
|
+
export interface lineConfigType {
|
|
293
|
+
initialSpacing?: number;
|
|
294
|
+
spacing?: number;
|
|
295
|
+
curved?: boolean;
|
|
296
|
+
curvature?: number;
|
|
297
|
+
curveType?: CurveType;
|
|
298
|
+
isAnimated?: boolean;
|
|
299
|
+
animationDuration?: number;
|
|
300
|
+
delay?: number;
|
|
301
|
+
thickness?: number;
|
|
302
|
+
color?: ColorValue | string | any;
|
|
303
|
+
hideDataPoints?: boolean;
|
|
304
|
+
dataPointsShape?: string;
|
|
305
|
+
dataPointsWidth?: number;
|
|
306
|
+
dataPointsHeight?: number;
|
|
307
|
+
dataPointsColor?: ColorValue | string | any;
|
|
308
|
+
dataPointsRadius?: number;
|
|
309
|
+
textColor?: ColorValue | string | any;
|
|
310
|
+
textFontSize?: number;
|
|
311
|
+
textShiftX?: number;
|
|
312
|
+
textShiftY?: number;
|
|
313
|
+
shiftX?: number;
|
|
314
|
+
shiftY?: number;
|
|
315
|
+
startIndex?: number;
|
|
316
|
+
endIndex?: number;
|
|
317
|
+
showArrow?: boolean;
|
|
318
|
+
arrowConfig?: arrowType;
|
|
319
|
+
customDataPoint?: Function;
|
|
320
|
+
isSecondary?: boolean;
|
|
321
|
+
}
|
|
322
|
+
export interface defaultLineConfigType {
|
|
323
|
+
initialSpacing: number;
|
|
324
|
+
curved: boolean;
|
|
325
|
+
curvature: number;
|
|
326
|
+
curveType: CurveType;
|
|
327
|
+
isAnimated: boolean;
|
|
328
|
+
animationDuration: number;
|
|
329
|
+
delay: number;
|
|
330
|
+
thickness: number;
|
|
331
|
+
color: ColorValue | string | any;
|
|
332
|
+
hideDataPoints: boolean;
|
|
333
|
+
dataPointsShape: string;
|
|
334
|
+
dataPointsWidth: number;
|
|
335
|
+
dataPointsHeight: number;
|
|
336
|
+
dataPointsColor: ColorValue | string | any;
|
|
337
|
+
dataPointsRadius: number;
|
|
338
|
+
textColor: ColorValue | string | any;
|
|
339
|
+
textFontSize: number;
|
|
340
|
+
textShiftX: number;
|
|
341
|
+
textShiftY: number;
|
|
342
|
+
shiftX: number;
|
|
343
|
+
shiftY: number;
|
|
344
|
+
startIndex: number;
|
|
345
|
+
endIndex: number;
|
|
346
|
+
showArrow: boolean;
|
|
347
|
+
arrowConfig: arrowType;
|
|
348
|
+
customDataPoint?: Function;
|
|
349
|
+
isSecondary: boolean;
|
|
350
|
+
}
|
|
351
|
+
interface arrowType {
|
|
352
|
+
length?: number;
|
|
353
|
+
width?: number;
|
|
354
|
+
strokeWidth?: number;
|
|
355
|
+
strokeColor?: string;
|
|
356
|
+
fillColor?: string;
|
|
357
|
+
showArrowBase?: boolean;
|
|
358
|
+
}
|
|
359
|
+
interface sectionType {
|
|
360
|
+
value: string;
|
|
361
|
+
}
|
|
362
|
+
export interface barDataItem {
|
|
363
|
+
value: number;
|
|
364
|
+
onPress?: any;
|
|
365
|
+
onLongPress?: any;
|
|
366
|
+
onPressOut?: any;
|
|
367
|
+
frontColor?: ColorValue;
|
|
368
|
+
sideColor?: ColorValue;
|
|
369
|
+
topColor?: ColorValue;
|
|
370
|
+
showGradient?: boolean;
|
|
371
|
+
gradientColor?: any;
|
|
372
|
+
label?: string;
|
|
373
|
+
barWidth?: number;
|
|
374
|
+
sideWidth?: number;
|
|
375
|
+
labelTextStyle?: any;
|
|
376
|
+
topLabelComponent?: Function;
|
|
377
|
+
topLabelContainerStyle?: any;
|
|
378
|
+
disablePress?: any;
|
|
379
|
+
capThickness?: number;
|
|
380
|
+
capColor?: ColorValue;
|
|
381
|
+
capRadius?: number;
|
|
382
|
+
labelComponent?: Function;
|
|
383
|
+
barBorderRadius?: number;
|
|
384
|
+
barBorderTopLeftRadius?: number;
|
|
385
|
+
barBorderTopRightRadius?: number;
|
|
386
|
+
barBorderBottomLeftRadius?: number;
|
|
387
|
+
barBorderBottomRightRadius?: number;
|
|
388
|
+
topLabelComponentHeight?: number;
|
|
389
|
+
spacing?: number;
|
|
390
|
+
labelWidth?: number;
|
|
391
|
+
barBackgroundPattern?: () => ReactNode;
|
|
392
|
+
patternId?: string;
|
|
393
|
+
barMarginBottom?: number;
|
|
394
|
+
leftShiftForTooltip?: number;
|
|
395
|
+
barStyle?: object;
|
|
396
|
+
barInnerComponent?: (item?: barDataItem, index?: number) => ReactNode;
|
|
397
|
+
showXAxisIndex?: boolean;
|
|
398
|
+
}
|
|
399
|
+
export interface Animated2DWithGradientPropsType {
|
|
400
|
+
item: barDataItem;
|
|
401
|
+
index: number;
|
|
402
|
+
height: number;
|
|
403
|
+
minHeight: number;
|
|
404
|
+
opacity?: number;
|
|
405
|
+
animationDuration: number;
|
|
406
|
+
roundedTop: boolean;
|
|
407
|
+
roundedBottom: boolean;
|
|
408
|
+
barWidth: number;
|
|
409
|
+
gradientColor: ColorValue;
|
|
410
|
+
frontColor: ColorValue;
|
|
411
|
+
noGradient?: boolean;
|
|
412
|
+
noAnimation?: boolean;
|
|
413
|
+
cappedBars?: boolean;
|
|
414
|
+
capThickness?: number;
|
|
415
|
+
capColor?: ColorValue;
|
|
416
|
+
capRadius?: number;
|
|
417
|
+
horizontal: boolean;
|
|
418
|
+
intactTopLabel: boolean;
|
|
419
|
+
showValuesAsTopLabel: boolean;
|
|
420
|
+
topLabelContainerStyle?: any;
|
|
421
|
+
topLabelTextStyle?: any;
|
|
422
|
+
barBorderWidth?: number;
|
|
423
|
+
barBorderColor: ColorValue;
|
|
424
|
+
barBorderRadius?: number;
|
|
425
|
+
barBorderTopLeftRadius?: number;
|
|
426
|
+
barBorderTopRightRadius?: number;
|
|
427
|
+
barBorderBottomLeftRadius?: number;
|
|
428
|
+
barBorderBottomRightRadius?: number;
|
|
429
|
+
containerHeight?: number;
|
|
430
|
+
maxValue?: number;
|
|
431
|
+
barBackgroundPattern?: () => ReactNode;
|
|
432
|
+
patternId?: string;
|
|
433
|
+
barMarginBottom?: number;
|
|
434
|
+
barStyle?: object;
|
|
435
|
+
barInnerComponent?: (item?: barDataItem, index?: number) => ReactNode;
|
|
436
|
+
commonStyleForBar?: ViewStyle[];
|
|
437
|
+
barStyleWithBackground?: ViewStyle[];
|
|
438
|
+
}
|
|
439
|
+
export interface RenderBarsPropsType {
|
|
440
|
+
style?: any;
|
|
441
|
+
width?: number;
|
|
442
|
+
height?: number;
|
|
443
|
+
minHeight: number;
|
|
444
|
+
color?: ColorValue;
|
|
445
|
+
showGradient?: boolean;
|
|
446
|
+
gradientColor?: any;
|
|
447
|
+
frontColor?: ColorValue;
|
|
448
|
+
sideColor?: ColorValue;
|
|
449
|
+
topColor?: ColorValue;
|
|
450
|
+
topLabelComponent?: Component;
|
|
451
|
+
topLabelContainerStyle?: any;
|
|
452
|
+
topLabelTextStyle?: any;
|
|
453
|
+
opacity?: number;
|
|
454
|
+
side?: string;
|
|
455
|
+
labelTextStyle?: any;
|
|
456
|
+
item: barDataItem;
|
|
457
|
+
index: number;
|
|
458
|
+
label: string;
|
|
459
|
+
containerHeight?: number;
|
|
460
|
+
maxValue: number;
|
|
461
|
+
spacing: number;
|
|
462
|
+
propSpacing?: number;
|
|
463
|
+
data?: any;
|
|
464
|
+
barWidth?: number;
|
|
465
|
+
sideWidth?: number;
|
|
466
|
+
labelWidth?: number;
|
|
467
|
+
isThreeD?: boolean;
|
|
468
|
+
isAnimated?: boolean;
|
|
469
|
+
rotateLabel?: boolean;
|
|
470
|
+
animatedHeight?: any;
|
|
471
|
+
appearingOpacity?: any;
|
|
472
|
+
animationDuration?: number;
|
|
473
|
+
roundedTop?: boolean;
|
|
474
|
+
roundedBottom?: boolean;
|
|
475
|
+
disablePress?: boolean;
|
|
476
|
+
activeOpacity?: number;
|
|
477
|
+
cappedBars?: boolean;
|
|
478
|
+
capThickness?: number;
|
|
479
|
+
capColor?: ColorValue;
|
|
480
|
+
capRadius?: number;
|
|
481
|
+
showXAxisIndices: boolean;
|
|
482
|
+
xAxisIndicesHeight: number;
|
|
483
|
+
xAxisIndicesWidth: number;
|
|
484
|
+
xAxisIndicesColor: ColorValue;
|
|
485
|
+
horizontal: boolean;
|
|
486
|
+
rtl: boolean;
|
|
487
|
+
intactTopLabel: boolean;
|
|
488
|
+
showValuesAsTopLabel?: boolean;
|
|
489
|
+
barBorderWidth?: number;
|
|
490
|
+
barBorderColor: ColorValue;
|
|
491
|
+
barBorderRadius?: number;
|
|
492
|
+
barBorderTopLeftRadius?: number;
|
|
493
|
+
barBorderTopRightRadius?: number;
|
|
494
|
+
barBorderBottomLeftRadius?: number;
|
|
495
|
+
barBorderBottomRightRadius?: number;
|
|
496
|
+
barInnerComponent?: (item?: barDataItem | stackDataItem, index?: number) => ReactNode;
|
|
497
|
+
autoShiftLabels?: boolean;
|
|
498
|
+
barBackgroundPattern?: () => ReactNode;
|
|
499
|
+
patternId?: string;
|
|
500
|
+
barMarginBottom?: number;
|
|
501
|
+
onPress?: Function;
|
|
502
|
+
onLongPress?: Function;
|
|
503
|
+
onPressOut?: Function;
|
|
504
|
+
xAxisTextNumberOfLines: number;
|
|
505
|
+
xAxisLabelsHeight?: number;
|
|
506
|
+
xAxisLabelsVerticalShift: number;
|
|
507
|
+
renderTooltip: Function | undefined;
|
|
508
|
+
leftShiftForTooltip?: number;
|
|
509
|
+
leftShiftForLastIndexTooltip: number;
|
|
510
|
+
initialSpacing: number;
|
|
511
|
+
selectedIndex: number;
|
|
512
|
+
setSelectedIndex: Function;
|
|
513
|
+
barStyle?: object;
|
|
514
|
+
xAxisThickness?: number;
|
|
515
|
+
pointerConfig?: Pointer;
|
|
516
|
+
focusBarOnPress?: boolean;
|
|
517
|
+
noOfSectionsBelowXAxis?: number;
|
|
518
|
+
}
|
|
519
|
+
export interface trianglePropTypes {
|
|
520
|
+
style: any;
|
|
521
|
+
width: number;
|
|
522
|
+
color: ColorValue;
|
|
523
|
+
}
|
|
524
|
+
export interface animatedBarPropTypes {
|
|
525
|
+
isAnimated?: boolean;
|
|
526
|
+
animationDuration: number;
|
|
527
|
+
barWidth: number;
|
|
528
|
+
sideWidth: number;
|
|
529
|
+
height: number;
|
|
530
|
+
showGradient: boolean;
|
|
531
|
+
gradientColor: any;
|
|
532
|
+
frontColor: ColorValue;
|
|
533
|
+
sideColor: ColorValue;
|
|
534
|
+
topColor: ColorValue;
|
|
535
|
+
opacity: number;
|
|
536
|
+
side: string;
|
|
537
|
+
horizontal: boolean;
|
|
538
|
+
intactTopLabel: boolean;
|
|
539
|
+
showValuesAsTopLabel: boolean;
|
|
540
|
+
topLabelContainerStyle?: any;
|
|
541
|
+
topLabelTextStyle?: any;
|
|
542
|
+
barBackgroundPattern?: () => ReactNode;
|
|
543
|
+
barInnerComponent?: (item?: barDataItem, index?: number) => ReactNode;
|
|
544
|
+
patternId?: string;
|
|
545
|
+
barStyle?: object;
|
|
546
|
+
item: barDataItem;
|
|
547
|
+
index: number;
|
|
548
|
+
selectedIndex: number;
|
|
549
|
+
focusBarOnPress?: boolean;
|
|
550
|
+
focusedBarConfig?: FocusedBarConfig;
|
|
551
|
+
}
|
|
552
|
+
export interface CommonPropsFor2Dand3DbarsType {
|
|
553
|
+
barBackgroundPattern?: () => ReactNode;
|
|
554
|
+
barInnerComponent?: (item?: barDataItem, index?: number) => ReactNode;
|
|
555
|
+
patternId?: string;
|
|
556
|
+
barWidth: number;
|
|
557
|
+
barStyle?: object;
|
|
558
|
+
item: barDataItem;
|
|
559
|
+
index: number;
|
|
560
|
+
frontColor: ColorValue;
|
|
561
|
+
showGradient: boolean;
|
|
562
|
+
gradientColor: ColorValue;
|
|
563
|
+
opacity: number;
|
|
564
|
+
height: number;
|
|
565
|
+
intactTopLabel: boolean;
|
|
566
|
+
showValuesAsTopLabel: boolean;
|
|
567
|
+
topLabelContainerStyle: any;
|
|
568
|
+
topLabelTextStyle: any;
|
|
569
|
+
}
|
|
570
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type LineChartBicolorPropsType, type bicolorLineDataItem } from './types';
|
|
3
|
+
import { type BarAndLineChartsWrapperTypes } from '../utils/types';
|
|
4
|
+
import { type Animated } from 'react-native';
|
|
5
|
+
interface Points {
|
|
6
|
+
points: string;
|
|
7
|
+
color: string;
|
|
8
|
+
}
|
|
9
|
+
interface extendedLineChartBicolorPropsType extends LineChartBicolorPropsType {
|
|
10
|
+
heightValue: Animated.Value;
|
|
11
|
+
widthValue: Animated.Value;
|
|
12
|
+
opacValue: Animated.Value;
|
|
13
|
+
}
|
|
14
|
+
export declare const useLineChartBiColor: (props: extendedLineChartBicolorPropsType) => {
|
|
15
|
+
toggle: boolean;
|
|
16
|
+
setToggle: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
17
|
+
pointsArray: Points[];
|
|
18
|
+
setPointsArray: import("react").Dispatch<import("react").SetStateAction<Points[]>>;
|
|
19
|
+
fillPointsArray: Points[];
|
|
20
|
+
setFillPointsArray: import("react").Dispatch<import("react").SetStateAction<Points[]>>;
|
|
21
|
+
selectedIndex: number;
|
|
22
|
+
setSelectedIndex: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
23
|
+
containerHeight: number;
|
|
24
|
+
noOfSections: number;
|
|
25
|
+
data: bicolorLineDataItem[];
|
|
26
|
+
scrollToEnd: boolean;
|
|
27
|
+
scrollAnimation: boolean;
|
|
28
|
+
scrollEventThrottle: number;
|
|
29
|
+
labelsExtraHeight: number;
|
|
30
|
+
animationDuration: number;
|
|
31
|
+
startIndex1: number;
|
|
32
|
+
endIndex1: number;
|
|
33
|
+
initialData: bicolorLineDataItem[];
|
|
34
|
+
adjustToWidth: boolean;
|
|
35
|
+
initialSpacing: number;
|
|
36
|
+
endSpacing: number;
|
|
37
|
+
thickness: number;
|
|
38
|
+
spacing: number;
|
|
39
|
+
xAxisThickness: number;
|
|
40
|
+
dataPointsHeight1: number;
|
|
41
|
+
dataPointsWidth1: number;
|
|
42
|
+
dataPointsRadius1: number;
|
|
43
|
+
dataPointsColor1: string;
|
|
44
|
+
dataPointsShape1: string;
|
|
45
|
+
areaChart: boolean;
|
|
46
|
+
textFontSize1: number;
|
|
47
|
+
textColor1: string;
|
|
48
|
+
totalWidth: number;
|
|
49
|
+
maxItem: number;
|
|
50
|
+
minItem: number;
|
|
51
|
+
maxValue: number;
|
|
52
|
+
mostNegativeValue: number;
|
|
53
|
+
extendedContainerHeight: number;
|
|
54
|
+
getX: (index: number) => number;
|
|
55
|
+
getY: (index: number) => number;
|
|
56
|
+
yAtxAxis: number;
|
|
57
|
+
stepHeight: number;
|
|
58
|
+
stepValue: number;
|
|
59
|
+
noOfSectionsBelowXAxis: number;
|
|
60
|
+
thickness1: number;
|
|
61
|
+
zIndex: number;
|
|
62
|
+
strokeDashArray1: number[] | undefined;
|
|
63
|
+
rotateLabel: boolean;
|
|
64
|
+
isAnimated: boolean;
|
|
65
|
+
hideDataPoints1: boolean;
|
|
66
|
+
color: string;
|
|
67
|
+
colorNegative: string;
|
|
68
|
+
startFillColor: string;
|
|
69
|
+
endFillColor: string;
|
|
70
|
+
startOpacity: number;
|
|
71
|
+
endOpacity: number;
|
|
72
|
+
startFillColorNegative: string;
|
|
73
|
+
endFillColorNegative: string;
|
|
74
|
+
startOpacityNegative: number;
|
|
75
|
+
endOpacityNegative: number;
|
|
76
|
+
gradientDirection: string;
|
|
77
|
+
showXAxisIndices: boolean;
|
|
78
|
+
xAxisIndicesHeight: number;
|
|
79
|
+
xAxisIndicesWidth: number;
|
|
80
|
+
xAxisIndicesColor: import("react-native").ColorValue;
|
|
81
|
+
xAxisTextNumberOfLines: number;
|
|
82
|
+
horizontalRulesStyle: any;
|
|
83
|
+
showFractionalValues: boolean;
|
|
84
|
+
yAxisLabelWidth: number;
|
|
85
|
+
horizontal: boolean;
|
|
86
|
+
yAxisAtTop: boolean;
|
|
87
|
+
disableScroll: boolean;
|
|
88
|
+
showScrollIndicator: boolean;
|
|
89
|
+
focusEnabled: boolean;
|
|
90
|
+
showDataPointOnFocus: boolean;
|
|
91
|
+
showStripOnFocus: boolean;
|
|
92
|
+
showTextOnFocus: boolean;
|
|
93
|
+
stripHeight: number | undefined;
|
|
94
|
+
stripWidth: number;
|
|
95
|
+
stripColor: any;
|
|
96
|
+
stripOpacity: number;
|
|
97
|
+
unFocusOnPressOut: boolean;
|
|
98
|
+
delayBeforeUnFocus: number;
|
|
99
|
+
horizSections: {
|
|
100
|
+
value: string;
|
|
101
|
+
}[];
|
|
102
|
+
barAndLineChartsWrapperProps: BarAndLineChartsWrapperTypes;
|
|
103
|
+
};
|
|
104
|
+
export {};
|