gifted-charts-core 0.0.40 → 0.0.41

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.40",
3
+ "version": "0.0.41",
4
4
  "description": "Mathematical and logical utilities used by react-gifted-charts and react-native-gifted-charts",
5
5
  "main": "./src/index.js",
6
6
  "files": [
@@ -94,7 +94,7 @@ export var usePieChart = function (props) {
94
94
  selectedIndex: selectedIndex,
95
95
  setSelectedIndex: setSelectedIndex,
96
96
  startAngle: pro ? (_u = props.startAngle) !== null && _u !== void 0 ? _u : 0 : startAngle,
97
- endAngle: (_v = props.endAngle) !== null && _v !== void 0 ? _v : Math.PI * 2,
97
+ endAngle: (_v = props.endAngle) !== null && _v !== void 0 ? _v : startAngle + (semiCircle ? Math.PI : Math.PI * 2),
98
98
  setStartAngle: setStartAngle,
99
99
  total: total,
100
100
  setTotal: setTotal,
@@ -144,7 +144,8 @@ export const usePieChart = (props: IPieChartPropsType): IusePieChart => {
144
144
  selectedIndex,
145
145
  setSelectedIndex,
146
146
  startAngle: pro ? props.startAngle ?? 0 : startAngle,
147
- endAngle: props.endAngle ?? Math.PI * 2,
147
+ endAngle:
148
+ props.endAngle ?? startAngle + (semiCircle ? Math.PI : Math.PI * 2),
148
149
  setStartAngle,
149
150
  total,
150
151
  setTotal,
@@ -24,7 +24,7 @@ export declare const getPieChartMainProps: (props: PieChartMainProps) => {
24
24
  textColor: string;
25
25
  textSize: number;
26
26
  tiltAngle: string;
27
- labelsPosition: "onBorder" | "outward" | "inward" | "mid";
27
+ labelsPosition: import("../utils/types").LabelsPosition;
28
28
  showTextBackground: boolean;
29
29
  textBackgroundColor: string;
30
30
  showValuesAsLabels: boolean;
@@ -1,5 +1,6 @@
1
1
  import { type ColorValue } from 'react-native';
2
2
  import { type FontStyle } from 'react-native-svg';
3
+ import { LabelsPosition } from '../utils/types';
3
4
  export interface PieChartPropsType {
4
5
  radius?: number;
5
6
  isThreeD?: boolean;
@@ -31,7 +32,7 @@ export interface PieChartPropsType {
31
32
  centerLabelComponent?: Function;
32
33
  tiltAngle?: string;
33
34
  initialAngle?: number;
34
- labelsPosition?: 'onBorder' | 'outward' | 'inward' | 'mid';
35
+ labelsPosition?: LabelsPosition;
35
36
  showGradient?: boolean;
36
37
  gradientCenterColor?: string;
37
38
  onPress?: Function;
@@ -1,5 +1,6 @@
1
1
  import { type ColorValue } from 'react-native'
2
2
  import { type FontStyle } from 'react-native-svg'
3
+ import { LabelsPosition } from '../utils/types'
3
4
 
4
5
  export interface PieChartPropsType {
5
6
  radius?: number
@@ -34,7 +35,7 @@ export interface PieChartPropsType {
34
35
  centerLabelComponent?: Function
35
36
  tiltAngle?: string
36
37
  initialAngle?: number
37
- labelsPosition?: 'onBorder' | 'outward' | 'inward' | 'mid'
38
+ labelsPosition?: LabelsPosition
38
39
  showGradient?: boolean
39
40
  gradientCenterColor?: string
40
41
  onPress?: Function
@@ -7,6 +7,7 @@ export declare enum Framework {
7
7
  reactNative = 1
8
8
  }
9
9
  export type RuleType = 'solid' | 'dashed' | 'dotted' | string;
10
+ export type LabelsPosition = 'onBorder' | 'outward' | 'inward' | 'mid';
10
11
  export interface RuleTypes {
11
12
  SOLID: RuleType;
12
13
  DASHED: RuleType;
@@ -10,6 +10,8 @@ export enum Framework {
10
10
 
11
11
  export type RuleType = 'solid' | 'dashed' | 'dotted' | string
12
12
 
13
+ export type LabelsPosition = 'onBorder' | 'outward' | 'inward' | 'mid'
14
+
13
15
  export interface RuleTypes {
14
16
  SOLID: RuleType
15
17
  DASHED: RuleType