gifted-charts-core 0.0.34 → 0.0.36
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
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type LineChartBicolorPropsType, type bicolorLineDataItem } from './types';
|
|
3
3
|
import { type BarAndLineChartsWrapperTypes } from '../utils/types';
|
|
4
|
-
import { type Animated } from 'react-native';
|
|
5
4
|
interface Points {
|
|
6
5
|
points: string;
|
|
7
6
|
color: string;
|
|
8
7
|
}
|
|
9
|
-
|
|
10
|
-
heightValue: Animated.Value;
|
|
11
|
-
widthValue: Animated.Value;
|
|
12
|
-
opacValue: Animated.Value;
|
|
13
|
-
}
|
|
14
|
-
export declare const useLineChartBiColor: (props: extendedLineChartBicolorPropsType) => {
|
|
8
|
+
export declare const useLineChartBiColor: (props: LineChartBicolorPropsType) => {
|
|
15
9
|
toggle: boolean;
|
|
16
10
|
setToggle: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
17
11
|
pointsArray: Points[];
|
|
@@ -19,13 +19,7 @@ interface Points {
|
|
|
19
19
|
color: string
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
heightValue: Animated.Value
|
|
24
|
-
widthValue: Animated.Value
|
|
25
|
-
opacValue: Animated.Value
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export const useLineChartBiColor = (props: extendedLineChartBicolorPropsType) => {
|
|
22
|
+
export const useLineChartBiColor = (props: LineChartBicolorPropsType) => {
|
|
29
23
|
const [toggle, setToggle] = useState(false)
|
|
30
24
|
const [pointsArray, setPointsArray] = useState<Points[]>([])
|
|
31
25
|
const [fillPointsArray, setFillPointsArray] = useState<Points[]>([])
|
package/src/LineChart/index.d.ts
CHANGED
|
@@ -160,6 +160,7 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
|
|
|
160
160
|
areaChart4: boolean;
|
|
161
161
|
areaChart5: boolean;
|
|
162
162
|
atLeastOneAreaChart: boolean;
|
|
163
|
+
getIsNthAreaChart: (n: number) => boolean;
|
|
163
164
|
stepChart: boolean;
|
|
164
165
|
stepChart1: boolean;
|
|
165
166
|
stepChart2: boolean;
|
package/src/LineChart/index.js
CHANGED
|
@@ -192,6 +192,25 @@ export var useLineChart = function (props) {
|
|
|
192
192
|
var areaChart4 = (_62 = props.areaChart4) !== null && _62 !== void 0 ? _62 : false;
|
|
193
193
|
var areaChart5 = (_63 = props.areaChart5) !== null && _63 !== void 0 ? _63 : false;
|
|
194
194
|
var atLeastOneAreaChart = (_69 = (_68 = (_67 = (_66 = (_65 = (_64 = dataSet === null || dataSet === void 0 ? void 0 : dataSet.some(function (set) { return set.areaChart; })) !== null && _64 !== void 0 ? _64 : areaChart) !== null && _65 !== void 0 ? _65 : areaChart1) !== null && _66 !== void 0 ? _66 : areaChart2) !== null && _67 !== void 0 ? _67 : areaChart3) !== null && _68 !== void 0 ? _68 : areaChart4) !== null && _69 !== void 0 ? _69 : areaChart5;
|
|
195
|
+
var getIsNthAreaChart = function (n) {
|
|
196
|
+
if (areaChart)
|
|
197
|
+
return true;
|
|
198
|
+
if (!(dataSet === null || dataSet === void 0 ? void 0 : dataSet.length)) {
|
|
199
|
+
switch (n) {
|
|
200
|
+
case 0:
|
|
201
|
+
return areaChart1;
|
|
202
|
+
case 1:
|
|
203
|
+
return areaChart2;
|
|
204
|
+
case 2:
|
|
205
|
+
return areaChart3;
|
|
206
|
+
case 3:
|
|
207
|
+
return areaChart4;
|
|
208
|
+
case 4:
|
|
209
|
+
return areaChart5;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return false;
|
|
213
|
+
};
|
|
195
214
|
var stepChart = (_70 = props.stepChart) !== null && _70 !== void 0 ? _70 : false;
|
|
196
215
|
var stepChart1 = (_71 = props.stepChart1) !== null && _71 !== void 0 ? _71 : false;
|
|
197
216
|
var stepChart2 = (_72 = props.stepChart2) !== null && _72 !== void 0 ? _72 : false;
|
|
@@ -1208,6 +1227,7 @@ export var useLineChart = function (props) {
|
|
|
1208
1227
|
areaChart4: areaChart4,
|
|
1209
1228
|
areaChart5: areaChart5,
|
|
1210
1229
|
atLeastOneAreaChart: atLeastOneAreaChart,
|
|
1230
|
+
getIsNthAreaChart: getIsNthAreaChart,
|
|
1211
1231
|
stepChart: stepChart,
|
|
1212
1232
|
stepChart1: stepChart1,
|
|
1213
1233
|
stepChart2: stepChart2,
|
package/src/LineChart/index.ts
CHANGED
|
@@ -372,6 +372,25 @@ export const useLineChart = (props: extendedLineChartPropsType) => {
|
|
|
372
372
|
areaChart4 ??
|
|
373
373
|
areaChart5
|
|
374
374
|
|
|
375
|
+
const getIsNthAreaChart = (n: number): boolean => {
|
|
376
|
+
if (areaChart) return true
|
|
377
|
+
if (!dataSet?.length) {
|
|
378
|
+
switch (n) {
|
|
379
|
+
case 0:
|
|
380
|
+
return areaChart1
|
|
381
|
+
case 1:
|
|
382
|
+
return areaChart2
|
|
383
|
+
case 2:
|
|
384
|
+
return areaChart3
|
|
385
|
+
case 3:
|
|
386
|
+
return areaChart4
|
|
387
|
+
case 4:
|
|
388
|
+
return areaChart5
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
return false
|
|
392
|
+
}
|
|
393
|
+
|
|
375
394
|
const stepChart = props.stepChart ?? false
|
|
376
395
|
const stepChart1 = props.stepChart1 ?? false
|
|
377
396
|
const stepChart2 = props.stepChart2 ?? false
|
|
@@ -638,7 +657,7 @@ export const useLineChart = (props: extendedLineChartPropsType) => {
|
|
|
638
657
|
showArrow: props.secondaryLineConfig?.showArrow ?? props.showArrows,
|
|
639
658
|
arrowConfig: props.secondaryLineConfig?.arrowConfig ?? props.arrowConfig
|
|
640
659
|
}
|
|
641
|
-
|
|
660
|
+
|
|
642
661
|
const yAxisExtraHeightAtTop = props.trimYAxisAtTop
|
|
643
662
|
? 0
|
|
644
663
|
: props.yAxisExtraHeight ?? containerHeight / 20
|
|
@@ -1918,6 +1937,7 @@ export const useLineChart = (props: extendedLineChartPropsType) => {
|
|
|
1918
1937
|
areaChart4,
|
|
1919
1938
|
areaChart5,
|
|
1920
1939
|
atLeastOneAreaChart,
|
|
1940
|
+
getIsNthAreaChart,
|
|
1921
1941
|
stepChart,
|
|
1922
1942
|
stepChart1,
|
|
1923
1943
|
stepChart2,
|