gifted-charts-core 0.0.12 → 0.0.14
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
package/src/BarChart/index.ts
CHANGED
|
@@ -602,6 +602,7 @@ export const useBarChart = (props: extendedBarChartPropsType) => {
|
|
|
602
602
|
patternId: props.patternId,
|
|
603
603
|
onPress: props.onPress,
|
|
604
604
|
onLongPress: props.onLongPress,
|
|
605
|
+
onPressOut: props.onPressOut,
|
|
605
606
|
focusBarOnPress: props.focusBarOnPress,
|
|
606
607
|
focusedBarConfig: props.focusedBarConfig,
|
|
607
608
|
xAxisTextNumberOfLines: xAxisTextNumberOfLines,
|
|
@@ -613,6 +614,7 @@ export const useBarChart = (props: extendedBarChartPropsType) => {
|
|
|
613
614
|
selectedIndex: selectedIndex,
|
|
614
615
|
setSelectedIndex: setSelectedIndex,
|
|
615
616
|
activeOpacity: props.activeOpacity || 0.2,
|
|
617
|
+
noOfSectionsBelowXAxis,
|
|
616
618
|
|
|
617
619
|
leftShiftForLastIndexTooltip: props.leftShiftForLastIndexTooltip || 0,
|
|
618
620
|
label:
|
package/src/BarChart/types.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { Component, ReactNode } from "react";
|
|
|
13
13
|
export type stackDataItem = {
|
|
14
14
|
onPress?: any;
|
|
15
15
|
onLongPress?: any;
|
|
16
|
+
onPressOut?: any;
|
|
16
17
|
label?: String;
|
|
17
18
|
barWidth?: number;
|
|
18
19
|
spacing?: number;
|
|
@@ -77,6 +78,7 @@ export type StackedBarChartPropsType = {
|
|
|
77
78
|
barWidth?: number;
|
|
78
79
|
onPress?: Function;
|
|
79
80
|
onLongPress?: Function;
|
|
81
|
+
onPressOut?: Function;
|
|
80
82
|
|
|
81
83
|
rotateLabel?: boolean;
|
|
82
84
|
showXAxisIndices: boolean;
|
|
@@ -280,6 +282,7 @@ export type BarChartPropsType = {
|
|
|
280
282
|
barMarginBottom?: number;
|
|
281
283
|
onPress?: Function;
|
|
282
284
|
onLongPress?: Function;
|
|
285
|
+
onPressOut?: Function;
|
|
283
286
|
renderTooltip?: Function;
|
|
284
287
|
leftShiftForTooltip?: number;
|
|
285
288
|
leftShiftForLastIndexTooltip?: number;
|
|
@@ -392,6 +395,7 @@ export type barDataItem = {
|
|
|
392
395
|
value: number;
|
|
393
396
|
onPress?: any;
|
|
394
397
|
onLongPress?: any;
|
|
398
|
+
onPressOut?: any;
|
|
395
399
|
frontColor?: ColorValue;
|
|
396
400
|
sideColor?: ColorValue;
|
|
397
401
|
topColor?: ColorValue;
|
|
@@ -532,6 +536,7 @@ export type RenderBarsPropsType = {
|
|
|
532
536
|
barMarginBottom?: number;
|
|
533
537
|
onPress?: Function;
|
|
534
538
|
onLongPress?: Function;
|
|
539
|
+
onPressOut?: Function;
|
|
535
540
|
xAxisTextNumberOfLines: number;
|
|
536
541
|
xAxisLabelsHeight?: number;
|
|
537
542
|
xAxisLabelsVerticalShift: number;
|
|
@@ -545,6 +550,7 @@ export type RenderBarsPropsType = {
|
|
|
545
550
|
xAxisThickness?: number;
|
|
546
551
|
pointerConfig?: Pointer;
|
|
547
552
|
focusBarOnPress?: boolean;
|
|
553
|
+
noOfSectionsBelowXAxis?: number;
|
|
548
554
|
};
|
|
549
555
|
|
|
550
556
|
export type trianglePropTypes = {
|
package/src/LineChart/index.ts
CHANGED
|
@@ -1571,7 +1571,7 @@ export const useLineChart = (props: extendedLineChartPropsType) => {
|
|
|
1571
1571
|
const stepHeight = props.stepHeight || containerHeight / noOfSections;
|
|
1572
1572
|
const stepValue = props.stepValue || maxValue / noOfSections;
|
|
1573
1573
|
const noOfSectionsBelowXAxis =
|
|
1574
|
-
props.noOfSectionsBelowXAxis
|
|
1574
|
+
props.noOfSectionsBelowXAxis ?? -mostNegativeValue / (stepValue || 1);
|
|
1575
1575
|
|
|
1576
1576
|
const showXAxisIndices =
|
|
1577
1577
|
props.showXAxisIndices ?? AxesAndRulesDefaults.showXAxisIndices;
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
BarAndLineChartsWrapperTypes,
|
|
5
5
|
horizSectionPropTypes,
|
|
6
6
|
} from "../../utils/types";
|
|
7
|
+
import { I18nManager } from "react-native";
|
|
7
8
|
|
|
8
9
|
export const useBarAndLineChartsWrapper = (
|
|
9
10
|
props: BarAndLineChartsWrapperTypes
|
|
@@ -317,18 +318,25 @@ export const useBarAndLineChartsWrapper = (
|
|
|
317
318
|
const [canMomentum, setCanMomentum] = useState(false);
|
|
318
319
|
|
|
319
320
|
const isCloseToEnd = ({ layoutMeasurement, contentOffset, contentSize }) => {
|
|
320
|
-
return
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
321
|
+
return I18nManager.isRTL
|
|
322
|
+
? contentOffset.x <= initialSpacing
|
|
323
|
+
: layoutMeasurement.width + contentOffset.x >=
|
|
324
|
+
contentSize.width - initialSpacing - endReachedOffset;
|
|
324
325
|
};
|
|
325
326
|
|
|
326
327
|
// const isCloseToStart = ({ layoutMeasurement, contentOffset }) => {
|
|
327
328
|
// return layoutMeasurement.width + contentOffset.x <= initialSpacing;
|
|
328
329
|
// };
|
|
329
330
|
|
|
330
|
-
const isCloseToStart = ({
|
|
331
|
-
|
|
331
|
+
const isCloseToStart = ({
|
|
332
|
+
layoutMeasurement,
|
|
333
|
+
contentOffset,
|
|
334
|
+
contentSize,
|
|
335
|
+
}) => {
|
|
336
|
+
return I18nManager.isRTL
|
|
337
|
+
? layoutMeasurement.width + contentOffset.x >=
|
|
338
|
+
contentSize.width - initialSpacing - endReachedOffset
|
|
339
|
+
: contentOffset.x <= initialSpacing;
|
|
332
340
|
};
|
|
333
341
|
|
|
334
342
|
useEffect(() => {
|