gifted-charts-core 0.1.49 → 0.1.50

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.
@@ -1,8 +1,8 @@
1
1
  import { type ColorValue, type ViewStyle } from 'react-native';
2
- import { type FocusedBarConfig, type BarChartPropsType, type CommonPropsFor2dand3dBarsType, type barDataItem, type stackDataItem } from './types';
2
+ import { type FocusedBarConfig, type BarChartPropsType, type CommonPropsFor2dand3dBarsType, type barDataItem, type stackDataItem, barDataItemNullSafe } from './types';
3
3
  import { type ReactNode } from 'react';
4
4
  interface Animated2dWithGradientPropsType extends BarChartPropsType {
5
- item: barDataItem;
5
+ item: barDataItemNullSafe;
6
6
  index: number;
7
7
  barHeight: number;
8
8
  selectedIndex: number;
@@ -1,4 +1,4 @@
1
- import { type lineConfigType, type barDataItem, type stackDataItem, BarChartPropsTypeForWeb } from './types';
1
+ import { type lineConfigType, type barDataItem, type stackDataItem, BarChartPropsTypeForWeb, barDataItemNullSafe } from './types';
2
2
  import { type BarAndLineChartsWrapperTypes, type secondaryYAxisType } from '../utils/types';
3
3
  import { type Animated } from 'react-native';
4
4
  export interface extendedBarChartPropsType extends BarChartPropsTypeForWeb {
@@ -41,7 +41,7 @@ export declare const useBarChart: (props: extendedBarChartPropsType) => {
41
41
  setPointerItem: import("react").Dispatch<import("react").SetStateAction<barDataItem | stackDataItem | undefined>>;
42
42
  initialSpacing: number;
43
43
  spacing: number;
44
- data: barDataItem[];
44
+ data: barDataItemNullSafe[];
45
45
  barWidth: number;
46
46
  setPointerX: import("react").Dispatch<import("react").SetStateAction<number>>;
47
47
  setPointerIndex: import("react").Dispatch<import("react").SetStateAction<number>>;
@@ -49,7 +49,10 @@ export var useBarChart = function (props) {
49
49
  return (__assign(__assign({}, item), { value: ((_a = item.value) !== null && _a !== void 0 ? _a : 0) - yAxisOffset }));
50
50
  });
51
51
  }
52
- return props.data;
52
+ return props.data.map(function (item) {
53
+ var _a;
54
+ return (__assign(__assign({}, item), { value: (_a = item.value) !== null && _a !== void 0 ? _a : 0 }));
55
+ });
53
56
  }, [yAxisOffset, props.data]);
54
57
  var stackData = useMemo(function () {
55
58
  if (!props.stackData) {
@@ -407,7 +407,7 @@ interface sectionType {
407
407
  value: string;
408
408
  }
409
409
  export interface barDataItem {
410
- value: number;
410
+ value?: number;
411
411
  onPress?: any;
412
412
  onLongPress?: any;
413
413
  onPressOut?: any;
@@ -454,8 +454,11 @@ export interface barDataItem {
454
454
  onMouseEnter?: Function;
455
455
  onMouseLeave?: Function;
456
456
  }
457
+ export interface barDataItemNullSafe extends barDataItem {
458
+ value: number;
459
+ }
457
460
  export interface Animated2DWithGradientPropsType {
458
- item: barDataItem;
461
+ item: barDataItemNullSafe;
459
462
  index: number;
460
463
  height: number;
461
464
  minHeight: number;
@@ -513,7 +516,7 @@ export interface RenderBarsPropsType {
513
516
  side?: string;
514
517
  labelTextStyle?: any;
515
518
  secondaryLabelTextStyle?: any;
516
- item: barDataItem;
519
+ item: barDataItemNullSafe;
517
520
  index: number;
518
521
  label: string;
519
522
  secondaryLabel: string;
@@ -633,7 +636,7 @@ export interface CommonPropsFor2dand3dBarsType {
633
636
  patternId?: string;
634
637
  barWidth: number;
635
638
  barStyle?: object;
636
- item: barDataItem;
639
+ item: barDataItemNullSafe;
637
640
  index: number;
638
641
  frontColor: ColorValue;
639
642
  showGradient: boolean;
@@ -1,5 +1,5 @@
1
- import { type LineChartPropsType, type lineDataItem } from './types';
2
- import { type BarAndLineChartsWrapperTypes, EdgePosition, type LineSegment } from '../utils/types';
1
+ import { lineDataItemNullSafe, type LineChartPropsType, type lineDataItem } from './types';
2
+ import { type BarAndLineChartsWrapperTypes, EdgePosition, type LineSegment, DataSetNullSafe } from '../utils/types';
3
3
  export interface extendedLineChartPropsType extends LineChartPropsType {
4
4
  parentWidth: number;
5
5
  }
@@ -92,14 +92,14 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
92
92
  setSelectedIndex: import("react").Dispatch<import("react").SetStateAction<number>>;
93
93
  noOfSections: number;
94
94
  containerHeight: number;
95
- data: lineDataItem[];
96
- data2: lineDataItem[];
97
- data3: lineDataItem[];
98
- data4: lineDataItem[];
99
- data5: lineDataItem[];
100
- secondaryData: lineDataItem[] | import("..").barDataItem[];
101
- dataSet: import("../utils/types").DataSet[] | undefined;
102
- data0: lineDataItem[] | undefined;
95
+ data: lineDataItemNullSafe[];
96
+ data2: lineDataItemNullSafe[];
97
+ data3: lineDataItemNullSafe[];
98
+ data4: lineDataItemNullSafe[];
99
+ data5: lineDataItemNullSafe[];
100
+ secondaryData: lineDataItemNullSafe[] | import("..").barDataItemNullSafe[];
101
+ dataSet: DataSetNullSafe[] | undefined;
102
+ data0: lineDataItemNullSafe[] | undefined;
103
103
  scrollToEnd: boolean;
104
104
  scrollAnimation: boolean;
105
105
  scrollEventThrottle: number;
@@ -107,6 +107,7 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
107
107
  animationDuration: number;
108
108
  onDataChangeAnimationDuration: number;
109
109
  animateTogether: boolean;
110
+ renderDataPointsAfterAnimationEnds: boolean;
110
111
  animateOnDataChange: boolean;
111
112
  startIndex1: number;
112
113
  startIndex2: number;
@@ -307,9 +308,9 @@ export declare const useLineChart: (props: extendedLineChartPropsType) => {
307
308
  arrowConfig: import("../utils/types").arrowConfigType | undefined;
308
309
  };
309
310
  addLeadingAndTrailingPathForAreaFill: (initialPath: string, value: number, dataLength: number) => string;
310
- getNextPoint: (data: lineDataItem[], index: number, around: boolean, before: boolean, spacingArray: number[]) => string;
311
- getStepPath: (data: lineDataItem[], i: number, spacingArray: number[]) => string;
312
- getSegmentPath: (data: lineDataItem[], i: number, lineSegment: LineSegment[] | undefined, startIndex: number, endIndex: number, spacingArray: number[], isSecondary?: boolean) => string;
311
+ getNextPoint: (data: lineDataItemNullSafe[], index: number, around: boolean, before: boolean, spacingArray: number[]) => string;
312
+ getStepPath: (data: lineDataItemNullSafe[], i: number, spacingArray: number[]) => string;
313
+ getSegmentPath: (data: lineDataItemNullSafe[], i: number, lineSegment: LineSegment[] | undefined, startIndex: number, endIndex: number, spacingArray: number[], isSecondary?: boolean) => string;
313
314
  gradientDirection: string;
314
315
  horizSections: {
315
316
  value: string;