gifted-charts-core 0.0.23 → 0.0.24

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,6 +1,6 @@
1
1
  {
2
2
  "name": "gifted-charts-core",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "description": "Mathematical and logical utilities used by react-gifted-charts and react-native-gifted-charts",
5
5
  "main": "index.ts",
6
6
  "files": [
@@ -9,18 +9,18 @@ import {
9
9
  } from './types'
10
10
  import { type ReactNode } from 'react'
11
11
 
12
- interface Animated2dWithFradientPropsType extends BarChartPropsType {
12
+ interface Animated2dWithGradientPropsType extends BarChartPropsType {
13
13
  item: barDataItem
14
14
  index: number
15
15
  barHeight: number
16
16
  selectedIndex: number
17
- barBackgroundPattern: () => ReactNode
18
- barInnerComponent: (
17
+ barBackgroundPattern?: () => ReactNode
18
+ barInnerComponent?: (
19
19
  item?: stackDataItem | barDataItem,
20
20
  index?: number
21
21
  ) => ReactNode
22
- patternId: string
23
- barStyle: object
22
+ patternId?: string
23
+ barStyle?: object
24
24
  intactTopLabel: boolean
25
25
  }
26
26
 
@@ -34,7 +34,7 @@ interface IgetPropsForAnimated2DWithGradientReturnType {
34
34
  }
35
35
 
36
36
  export const getPropsForAnimated2DWithGradient = (
37
- props: Animated2dWithFradientPropsType
37
+ props: Animated2dWithGradientPropsType
38
38
  ): IgetPropsForAnimated2DWithGradientReturnType => {
39
39
  const {
40
40
  barBorderWidth,
@@ -593,7 +593,7 @@ export const useBarChart = (props: extendedBarChartPropsType) => {
593
593
  })
594
594
 
595
595
  const getPropsCommonForBarAndStack = (
596
- item: stackDataItem | barDataItem,
596
+ item: any,
597
597
  index: number
598
598
  ) => {
599
599
  return {
@@ -532,7 +532,7 @@ export interface RenderBarsPropsType {
532
532
  barBorderTopRightRadius?: number
533
533
  barBorderBottomLeftRadius?: number
534
534
  barBorderBottomRightRadius?: number
535
- barInnerComponent?: (item?: barDataItem, index?: number) => ReactNode
535
+ barInnerComponent?: (item?: barDataItem | stackDataItem, index?: number) => ReactNode
536
536
  autoShiftLabels?: boolean
537
537
  barBackgroundPattern?: () => ReactNode
538
538
  patternId?: string
@@ -592,11 +592,11 @@ export interface animatedBarPropTypes {
592
592
  }
593
593
 
594
594
  export interface CommonPropsFor2Dand3DbarsType {
595
- barBackgroundPattern: () => ReactNode
596
- barInnerComponent: (item?: barDataItem, index?: number) => ReactNode
597
- patternId: string
595
+ barBackgroundPattern?: () => ReactNode
596
+ barInnerComponent?: (item?: barDataItem, index?: number) => ReactNode
597
+ patternId?: string
598
598
  barWidth: number
599
- barStyle: object
599
+ barStyle?: object
600
600
  item: barDataItem
601
601
  index: number
602
602
 
@@ -1362,7 +1362,7 @@ export const getInterpolatedData = (
1362
1362
  const post: lineDataItem[] = data.slice(index + 1, n)
1363
1363
 
1364
1364
  const preValidIndex = pre.findLastIndex(
1365
- (item) => typeof item.value === 'number'
1365
+ (item: lineDataItem) => typeof item.value === 'number'
1366
1366
  )
1367
1367
  const postValidInd = post.findIndex(
1368
1368
  (item) => typeof item.value === 'number'
@@ -1384,7 +1384,7 @@ export const getInterpolatedData = (
1384
1384
  // 2. There are more than valid values in pre
1385
1385
  const secondPre: lineDataItem[] = data.slice(0, preValidIndex)
1386
1386
  const secondPreIndex = secondPre.findLastIndex(
1387
- (item) => typeof item.value === 'number'
1387
+ (item: lineDataItem) => typeof item.value === 'number'
1388
1388
  )
1389
1389
 
1390
1390
  count = preValidIndex - secondPreIndex