react-native-gifted-charts 1.3.33 → 1.4.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.
- package/README.md +9 -2
- package/package.json +2 -1
- package/src/BarChart/Animated2DWithGradient.tsx +13 -154
- package/src/BarChart/RenderBars.tsx +29 -179
- package/src/BarChart/RenderStackBars.tsx +22 -104
- package/src/BarChart/index.tsx +87 -686
- package/src/Components/AnimatedThreeDBar/index.tsx +16 -48
- package/src/Components/BarAndLineChartsWrapper/index.tsx +38 -283
- package/src/Components/BarAndLineChartsWrapper/renderHorizSections.tsx +17 -339
- package/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/index.tsx +147 -0
- package/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderDataPoints.tsx +157 -0
- package/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificDataPoints.tsx +86 -0
- package/src/Components/BarAndLineChartsWrapper/renderLineInBarChart/renderSpecificVerticalLines.tsx +42 -0
- package/src/Components/BarAndLineChartsWrapper/renderVerticalLines.tsx +1 -1
- package/src/Components/BarSpecificComponents/cap.tsx +1 -1
- package/src/Components/common/StripAndLabel.tsx +3 -56
- package/src/Components/lineSvg.tsx +1 -1
- package/src/LineChart/LineChartBicolor.tsx +80 -516
- package/src/LineChart/index.tsx +266 -1778
- package/src/PieChart/index.tsx +20 -84
- package/src/PieChart/main.tsx +47 -119
- package/src/PopulationPyramid/index.tsx +90 -203
- package/src/index.tsx +2 -14
- package/src/BarChart/types.ts +0 -394
- package/src/Components/BarAndLineChartsWrapper/renderLineInBarChart.tsx +0 -402
- package/src/LineChart/types.ts +0 -575
- package/src/PieChart/types.ts +0 -77
- package/src/PopulationPyramid/types.ts +0 -200
- package/src/utils/constants.ts +0 -333
- package/src/utils/index.tsx +0 -1137
- package/src/utils/types.ts +0 -360
package/src/BarChart/types.ts
DELETED
|
@@ -1,394 +0,0 @@
|
|
|
1
|
-
import {ColorValue, GestureResponderEvent} from 'react-native';
|
|
2
|
-
import {yAxisSides} from '../utils/constants';
|
|
3
|
-
import {
|
|
4
|
-
CurveType,
|
|
5
|
-
Pointer,
|
|
6
|
-
RuleType,
|
|
7
|
-
RulesConfig,
|
|
8
|
-
referenceConfigType,
|
|
9
|
-
secondaryYAxisType,
|
|
10
|
-
} from '../utils/types';
|
|
11
|
-
import {Component, ReactNode} from 'react';
|
|
12
|
-
|
|
13
|
-
export type stackDataItem = {
|
|
14
|
-
onPress?: any;
|
|
15
|
-
label?: String;
|
|
16
|
-
barWidth?: number;
|
|
17
|
-
spacing?: number;
|
|
18
|
-
labelTextStyle?: any;
|
|
19
|
-
topLabelComponent?: Function;
|
|
20
|
-
topLabelContainerStyle?: any;
|
|
21
|
-
topLabelTextStyle?: any;
|
|
22
|
-
disablePress?: any;
|
|
23
|
-
color?: ColorValue;
|
|
24
|
-
showGradient?: boolean;
|
|
25
|
-
gradientColor?: any;
|
|
26
|
-
capThickness?: number;
|
|
27
|
-
capColor?: ColorValue;
|
|
28
|
-
capRadius?: number;
|
|
29
|
-
labelComponent?: Function;
|
|
30
|
-
stacks: Array<{
|
|
31
|
-
value: number;
|
|
32
|
-
color?: ColorValue;
|
|
33
|
-
onPress?: (event: GestureResponderEvent) => void;
|
|
34
|
-
marginBottom?: number;
|
|
35
|
-
borderRadius?: number;
|
|
36
|
-
borderTopLeftRadius?: number;
|
|
37
|
-
borderTopRightRadius?: number;
|
|
38
|
-
borderBottomLeftRadius?: number;
|
|
39
|
-
borderBottomRightRadius?: number;
|
|
40
|
-
showGradient?: boolean;
|
|
41
|
-
gradientColor?: ColorValue;
|
|
42
|
-
barWidth?: number;
|
|
43
|
-
innerBarComponent?: Function;
|
|
44
|
-
}>;
|
|
45
|
-
barBackgroundPattern?: Function;
|
|
46
|
-
borderRadius?: number;
|
|
47
|
-
borderTopLeftRadius?: number;
|
|
48
|
-
borderTopRightRadius?: number;
|
|
49
|
-
borderBottomLeftRadius?: number;
|
|
50
|
-
borderBottomRightRadius?: number;
|
|
51
|
-
barInnerComponent?: (item?: stackDataItem, index?: number) => ReactNode;
|
|
52
|
-
patternId?: String;
|
|
53
|
-
leftShiftForTooltip?: number;
|
|
54
|
-
showXAxisIndex?: boolean;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export type StackedBarChartPropsType = {
|
|
58
|
-
style?: any;
|
|
59
|
-
width?: number;
|
|
60
|
-
height?: number;
|
|
61
|
-
color?: ColorValue;
|
|
62
|
-
topLabelComponent?: Component;
|
|
63
|
-
topLabelContainerStyle?: any;
|
|
64
|
-
opacity?: number;
|
|
65
|
-
label: String;
|
|
66
|
-
labelTextStyle?: any;
|
|
67
|
-
disablePress?: boolean;
|
|
68
|
-
|
|
69
|
-
item: stackDataItem;
|
|
70
|
-
index: number;
|
|
71
|
-
containerHeight?: number;
|
|
72
|
-
maxValue: number;
|
|
73
|
-
spacing: number;
|
|
74
|
-
propSpacing?: number;
|
|
75
|
-
data?: any;
|
|
76
|
-
barWidth?: number;
|
|
77
|
-
onPress?: Function;
|
|
78
|
-
|
|
79
|
-
rotateLabel?: boolean;
|
|
80
|
-
showXAxisIndices: boolean;
|
|
81
|
-
xAxisIndicesHeight: number;
|
|
82
|
-
xAxisIndicesWidth: number;
|
|
83
|
-
xAxisIndicesColor: ColorValue;
|
|
84
|
-
horizontal: boolean;
|
|
85
|
-
intactTopLabel: boolean;
|
|
86
|
-
barBorderWidth?: number;
|
|
87
|
-
barBorderColor: ColorValue;
|
|
88
|
-
barBorderRadius?: number;
|
|
89
|
-
barBorderTopLeftRadius?: number;
|
|
90
|
-
barBorderTopRightRadius?: number;
|
|
91
|
-
barBorderBottomLeftRadius?: number;
|
|
92
|
-
barBorderBottomRightRadius?: number;
|
|
93
|
-
barInnerComponent?: (item?: barDataItem | stackDataItem, index?: number) => ReactNode;
|
|
94
|
-
stackBorderRadius?: number;
|
|
95
|
-
stackBorderTopLeftRadius?: number;
|
|
96
|
-
stackBorderTopRightRadius?: number;
|
|
97
|
-
stackBorderBottomLeftRadius?: number;
|
|
98
|
-
stackBorderBottomRightRadius?: number;
|
|
99
|
-
xAxisThickness: number;
|
|
100
|
-
barBackgroundPattern?: Function;
|
|
101
|
-
patternId?: String;
|
|
102
|
-
xAxisTextNumberOfLines: number;
|
|
103
|
-
xAxisLabelsHeight?: number;
|
|
104
|
-
xAxisLabelsVerticalShift: number;
|
|
105
|
-
renderTooltip: Function | undefined;
|
|
106
|
-
leftShiftForTooltip?: number;
|
|
107
|
-
leftShiftForLastIndexTooltip: number;
|
|
108
|
-
initialSpacing: number;
|
|
109
|
-
selectedIndex: number;
|
|
110
|
-
setSelectedIndex: Function;
|
|
111
|
-
activeOpacity: number;
|
|
112
|
-
showGradient?: boolean;
|
|
113
|
-
gradientColor?: any;
|
|
114
|
-
stackData: Array<stackDataItem>;
|
|
115
|
-
isAnimated?: boolean;
|
|
116
|
-
animationDuration?: number;
|
|
117
|
-
pointerConfig?: Pointer;
|
|
118
|
-
showValuesAsTopLabel?: boolean;
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export type BarChartPropsType = {
|
|
122
|
-
width?: number;
|
|
123
|
-
height?: number;
|
|
124
|
-
overflowTop?: number;
|
|
125
|
-
minHeight?: number;
|
|
126
|
-
noOfSections?: number;
|
|
127
|
-
noOfSectionsBelowXAxis?: number;
|
|
128
|
-
maxValue?: number;
|
|
129
|
-
mostNegativeValue?: number;
|
|
130
|
-
stepHeight?: number;
|
|
131
|
-
stepValue?: number;
|
|
132
|
-
spacing?: number;
|
|
133
|
-
data?: Array<barDataItem>;
|
|
134
|
-
stackData?: Array<stackDataItem>;
|
|
135
|
-
side?: String;
|
|
136
|
-
rotateLabel?: boolean;
|
|
137
|
-
isAnimated?: boolean;
|
|
138
|
-
animationDuration?: number;
|
|
139
|
-
// animationEasing?: any;
|
|
140
|
-
opacity?: number;
|
|
141
|
-
isThreeD?: boolean;
|
|
142
|
-
xAxisLength?: number;
|
|
143
|
-
xAxisThickness?: number;
|
|
144
|
-
xAxisColor?: ColorValue;
|
|
145
|
-
yAxisThickness?: number;
|
|
146
|
-
yAxisColor?: ColorValue;
|
|
147
|
-
yAxisExtraHeight?: number;
|
|
148
|
-
trimYAxisAtTop?: boolean;
|
|
149
|
-
xAxisType?: RuleType;
|
|
150
|
-
yAxisLabelContainerStyle?: any;
|
|
151
|
-
horizontalRulesStyle?: any;
|
|
152
|
-
yAxisTextStyle?: any;
|
|
153
|
-
yAxisTextNumberOfLines?: number;
|
|
154
|
-
xAxisTextNumberOfLines?: number;
|
|
155
|
-
xAxisLabelsHeight?: number;
|
|
156
|
-
xAxisLabelsVerticalShift?: number;
|
|
157
|
-
yAxisLabelWidth?: number;
|
|
158
|
-
hideYAxisText?: boolean;
|
|
159
|
-
rotateYAxisTexts?: number;
|
|
160
|
-
yAxisSide?: yAxisSides;
|
|
161
|
-
yAxisOffset?: number;
|
|
162
|
-
initialSpacing?: number;
|
|
163
|
-
endSpacing?: number;
|
|
164
|
-
barWidth?: number;
|
|
165
|
-
sideWidth?: number;
|
|
166
|
-
showLine?: boolean;
|
|
167
|
-
lineData?: any;
|
|
168
|
-
lineData2?: any;
|
|
169
|
-
lineConfig?: lineConfigType;
|
|
170
|
-
lineConfig2?: lineConfigType;
|
|
171
|
-
lineBehindBars?: boolean;
|
|
172
|
-
|
|
173
|
-
cappedBars?: boolean;
|
|
174
|
-
capThickness?: number;
|
|
175
|
-
capColor?: ColorValue;
|
|
176
|
-
capRadius?: number;
|
|
177
|
-
|
|
178
|
-
hideAxesAndRules?: boolean;
|
|
179
|
-
hideRules?: boolean;
|
|
180
|
-
rulesLength?: number;
|
|
181
|
-
rulesColor?: ColorValue;
|
|
182
|
-
rulesThickness?: number;
|
|
183
|
-
rulesType?: RuleType;
|
|
184
|
-
dashWidth?: number;
|
|
185
|
-
dashGap?: number;
|
|
186
|
-
rulesConfigArray?: Array<RulesConfig>;
|
|
187
|
-
showReferenceLine1?: boolean;
|
|
188
|
-
referenceLine1Config?: referenceConfigType;
|
|
189
|
-
referenceLine1Position?: number;
|
|
190
|
-
showReferenceLine2?: boolean;
|
|
191
|
-
referenceLine2Config?: referenceConfigType;
|
|
192
|
-
referenceLine2Position?: number;
|
|
193
|
-
showReferenceLine3?: boolean;
|
|
194
|
-
referenceLine3Config?: referenceConfigType;
|
|
195
|
-
referenceLine3Position?: number;
|
|
196
|
-
referenceLinesOverChartContent?: boolean;
|
|
197
|
-
showVerticalLines?: boolean;
|
|
198
|
-
verticalLinesThickness?: number;
|
|
199
|
-
verticalLinesHeight?: number;
|
|
200
|
-
verticalLinesColor?: ColorValue;
|
|
201
|
-
verticalLinesStrokeDashArray?: Array<number>;
|
|
202
|
-
verticalLinesShift?: number;
|
|
203
|
-
verticalLinesZIndex?: number;
|
|
204
|
-
noOfVerticalLines?: number;
|
|
205
|
-
verticalLinesSpacing?: number;
|
|
206
|
-
|
|
207
|
-
showYAxisIndices?: boolean;
|
|
208
|
-
showXAxisIndices?: boolean;
|
|
209
|
-
yAxisIndicesHeight?: number;
|
|
210
|
-
xAxisIndicesHeight?: number;
|
|
211
|
-
yAxisIndicesWidth?: number;
|
|
212
|
-
xAxisIndicesWidth?: number;
|
|
213
|
-
xAxisIndicesColor?: ColorValue;
|
|
214
|
-
yAxisIndicesColor?: ColorValue;
|
|
215
|
-
|
|
216
|
-
showFractionalValues?: boolean;
|
|
217
|
-
roundToDigits?: number;
|
|
218
|
-
backgroundColor?: ColorValue;
|
|
219
|
-
|
|
220
|
-
disableScroll?: boolean;
|
|
221
|
-
showScrollIndicator?: boolean;
|
|
222
|
-
indicatorColor?: 'black' | 'default' | 'white';
|
|
223
|
-
roundedTop?: boolean;
|
|
224
|
-
roundedBottom?: boolean;
|
|
225
|
-
disablePress?: boolean;
|
|
226
|
-
|
|
227
|
-
frontColor?: ColorValue;
|
|
228
|
-
color?: ColorValue;
|
|
229
|
-
sideColor?: ColorValue;
|
|
230
|
-
topColor?: ColorValue;
|
|
231
|
-
gradientColor?: ColorValue;
|
|
232
|
-
showGradient?: boolean;
|
|
233
|
-
activeOpacity?: number;
|
|
234
|
-
|
|
235
|
-
horizontal?: boolean;
|
|
236
|
-
rtl?: boolean;
|
|
237
|
-
shiftX?: number;
|
|
238
|
-
shiftY?: number;
|
|
239
|
-
yAxisAtTop?: boolean;
|
|
240
|
-
|
|
241
|
-
intactTopLabel?: boolean;
|
|
242
|
-
showValuesAsTopLabel?: boolean;
|
|
243
|
-
topLabelContainerStyle?: any;
|
|
244
|
-
topLabelTextStyle?: any;
|
|
245
|
-
|
|
246
|
-
horizSections?: Array<sectionType>;
|
|
247
|
-
barBorderWidth?: number;
|
|
248
|
-
barBorderColor?: ColorValue;
|
|
249
|
-
barBorderRadius?: number;
|
|
250
|
-
barBorderTopLeftRadius?: number;
|
|
251
|
-
barBorderTopRightRadius?: number;
|
|
252
|
-
barBorderBottomLeftRadius?: number;
|
|
253
|
-
barBorderBottomRightRadius?: number;
|
|
254
|
-
stackBorderRadius?: number;
|
|
255
|
-
stackBorderTopLeftRadius?: number;
|
|
256
|
-
stackBorderTopRightRadius?: number;
|
|
257
|
-
stackBorderBottomLeftRadius?: number;
|
|
258
|
-
stackBorderBottomRightRadius?: number;
|
|
259
|
-
hideOrigin?: boolean;
|
|
260
|
-
labelWidth?: number;
|
|
261
|
-
yAxisLabelTexts?: Array<string>;
|
|
262
|
-
xAxisLabelTexts?: Array<string>;
|
|
263
|
-
xAxisLabelTextStyle?: any;
|
|
264
|
-
yAxisLabelPrefix?: String;
|
|
265
|
-
yAxisLabelSuffix?: String;
|
|
266
|
-
autoShiftLabels?: boolean;
|
|
267
|
-
scrollRef?: any;
|
|
268
|
-
scrollToEnd?: boolean;
|
|
269
|
-
scrollToIndex?: number;
|
|
270
|
-
scrollAnimation?: boolean;
|
|
271
|
-
scrollEventThrottle?: number;
|
|
272
|
-
labelsExtraHeight?: number;
|
|
273
|
-
barBackgroundPattern?: Function;
|
|
274
|
-
patternId?: String;
|
|
275
|
-
barMarginBottom?: number;
|
|
276
|
-
onPress?: Function;
|
|
277
|
-
renderTooltip?: Function;
|
|
278
|
-
leftShiftForTooltip?: number;
|
|
279
|
-
leftShiftForLastIndexTooltip?: number;
|
|
280
|
-
barStyle?: object;
|
|
281
|
-
barInnerComponent?: (item?: stackDataItem | barDataItem, index?: number) => ReactNode;
|
|
282
|
-
|
|
283
|
-
secondaryData?: Array<barDataItem>;
|
|
284
|
-
secondaryYAxis?: secondaryYAxisType | boolean;
|
|
285
|
-
pointerConfig?: Pointer;
|
|
286
|
-
getPointerProps?: Function;
|
|
287
|
-
formatYLabel?: (label: string) => string;
|
|
288
|
-
};
|
|
289
|
-
type lineConfigType = {
|
|
290
|
-
initialSpacing?: number;
|
|
291
|
-
spacing?: number;
|
|
292
|
-
curved?: boolean;
|
|
293
|
-
curvature?: number;
|
|
294
|
-
curveType?: CurveType;
|
|
295
|
-
isAnimated?: boolean;
|
|
296
|
-
animationDuration?: number;
|
|
297
|
-
delay?: number;
|
|
298
|
-
thickness?: number;
|
|
299
|
-
color?: ColorValue | String | any;
|
|
300
|
-
hideDataPoints?: boolean;
|
|
301
|
-
dataPointsShape?: String;
|
|
302
|
-
dataPointsWidth?: number;
|
|
303
|
-
dataPointsHeight?: number;
|
|
304
|
-
dataPointsColor?: ColorValue | String | any;
|
|
305
|
-
dataPointsRadius?: number;
|
|
306
|
-
textColor?: ColorValue | String | any;
|
|
307
|
-
textFontSize?: number;
|
|
308
|
-
textShiftX?: number;
|
|
309
|
-
textShiftY?: number;
|
|
310
|
-
shiftX?: number;
|
|
311
|
-
shiftY?: number;
|
|
312
|
-
startIndex?: number;
|
|
313
|
-
endIndex?: number;
|
|
314
|
-
showArrow?: boolean;
|
|
315
|
-
arrowConfig?: arrowType;
|
|
316
|
-
customDataPoint?: Function;
|
|
317
|
-
isSecondary?: boolean;
|
|
318
|
-
};
|
|
319
|
-
export type defaultLineConfigType = {
|
|
320
|
-
initialSpacing: number;
|
|
321
|
-
curved: boolean;
|
|
322
|
-
curvature: number;
|
|
323
|
-
curveType: CurveType;
|
|
324
|
-
isAnimated: boolean;
|
|
325
|
-
animationDuration: number;
|
|
326
|
-
delay: number;
|
|
327
|
-
thickness: number;
|
|
328
|
-
color: ColorValue | String | any;
|
|
329
|
-
hideDataPoints: boolean;
|
|
330
|
-
dataPointsShape: String;
|
|
331
|
-
dataPointsWidth: number;
|
|
332
|
-
dataPointsHeight: number;
|
|
333
|
-
dataPointsColor: ColorValue | String | any;
|
|
334
|
-
dataPointsRadius: number;
|
|
335
|
-
textColor: ColorValue | String | any;
|
|
336
|
-
textFontSize: number;
|
|
337
|
-
textShiftX: number;
|
|
338
|
-
textShiftY: number;
|
|
339
|
-
shiftX: number;
|
|
340
|
-
shiftY: number;
|
|
341
|
-
startIndex: number;
|
|
342
|
-
endIndex: number;
|
|
343
|
-
showArrow: boolean;
|
|
344
|
-
arrowConfig: arrowType;
|
|
345
|
-
customDataPoint?: Function;
|
|
346
|
-
isSecondary: boolean;
|
|
347
|
-
};
|
|
348
|
-
type arrowType = {
|
|
349
|
-
length?: number;
|
|
350
|
-
width?: number;
|
|
351
|
-
strokeWidth?: number;
|
|
352
|
-
strokeColor?: string;
|
|
353
|
-
fillColor?: string;
|
|
354
|
-
showArrowBase?: boolean;
|
|
355
|
-
};
|
|
356
|
-
|
|
357
|
-
type sectionType = {
|
|
358
|
-
value: string;
|
|
359
|
-
};
|
|
360
|
-
export type barDataItem = {
|
|
361
|
-
value: number;
|
|
362
|
-
onPress?: any;
|
|
363
|
-
frontColor?: ColorValue;
|
|
364
|
-
sideColor?: ColorValue;
|
|
365
|
-
topColor?: ColorValue;
|
|
366
|
-
showGradient?: boolean;
|
|
367
|
-
gradientColor?: any;
|
|
368
|
-
label?: String;
|
|
369
|
-
barWidth?: number;
|
|
370
|
-
sideWidth?: number;
|
|
371
|
-
labelTextStyle?: any;
|
|
372
|
-
topLabelComponent?: Function;
|
|
373
|
-
topLabelContainerStyle?: any;
|
|
374
|
-
disablePress?: any;
|
|
375
|
-
capThickness?: number;
|
|
376
|
-
capColor?: ColorValue;
|
|
377
|
-
capRadius?: number;
|
|
378
|
-
labelComponent?: Function;
|
|
379
|
-
barBorderRadius?: number;
|
|
380
|
-
barBorderTopLeftRadius?: number;
|
|
381
|
-
barBorderTopRightRadius?: number;
|
|
382
|
-
barBorderBottomLeftRadius?: number;
|
|
383
|
-
barBorderBottomRightRadius?: number;
|
|
384
|
-
topLabelComponentHeight?: number;
|
|
385
|
-
spacing?: number;
|
|
386
|
-
labelWidth?: number;
|
|
387
|
-
barBackgroundPattern?: Function;
|
|
388
|
-
patternId?: String;
|
|
389
|
-
barMarginBottom?: number;
|
|
390
|
-
leftShiftForTooltip?: number;
|
|
391
|
-
barStyle?: object;
|
|
392
|
-
barInnerComponent?: (item?: barDataItem, index?: number) => ReactNode;
|
|
393
|
-
showXAxisIndex?: boolean;
|
|
394
|
-
};
|