gifted-charts-core 0.0.44 → 0.0.46
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 +1 -1
- package/src/PieChart/index.js +4 -2
- package/src/PieChart/index.ts +4 -2
package/package.json
CHANGED
package/src/PieChart/index.js
CHANGED
|
@@ -64,7 +64,8 @@ export var usePieChart = function (props) {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}, [selectedIndex]);
|
|
67
|
-
var pro = props.pro, data = props.data, donut = props.donut, isThreeD = props.isThreeD, semiCircle = props.semiCircle, _0 = props.inwardExtraLengthForFocused, inwardExtraLengthForFocused = _0 === void 0 ? 0 : _0, _1 = props.isAnimated, isAnimated = _1 === void 0 ? false : _1, edgesRadius = props.edgesRadius
|
|
67
|
+
var pro = props.pro, data = props.data, donut = props.donut, isThreeD = props.isThreeD, semiCircle = props.semiCircle, _0 = props.inwardExtraLengthForFocused, inwardExtraLengthForFocused = _0 === void 0 ? 0 : _0, _1 = props.isAnimated, isAnimated = _1 === void 0 ? false : _1, edgesRadius = props.edgesRadius;
|
|
68
|
+
var endAngle = (_e = props.endAngle) !== null && _e !== void 0 ? _e : startAngle + Math.PI * (semiCircle ? 1 : 2);
|
|
68
69
|
var canvasWidth = radius * 2;
|
|
69
70
|
var canvasHeight = isThreeD ? radius * 2.3 : radius * 2;
|
|
70
71
|
var strokeWidth = (_f = props.strokeWidth) !== null && _f !== void 0 ? _f : 0;
|
|
@@ -90,8 +91,9 @@ export var usePieChart = function (props) {
|
|
|
90
91
|
: 0;
|
|
91
92
|
/********************************** PRO **********************/
|
|
92
93
|
var startAngleForPro = (_v = props.startAngle) !== null && _v !== void 0 ? _v : 0;
|
|
94
|
+
endAngle = endAngle - startAngle + startAngleForPro;
|
|
93
95
|
var animationDuration = (_w = props.animationDuration) !== null && _w !== void 0 ? _w : defaultAnimationDuration;
|
|
94
|
-
var
|
|
96
|
+
var _2 = __read(useState(isAnimated), 2), isAnimating = _2[0], setIsAnimating = _2[1];
|
|
95
97
|
useEffect(function () {
|
|
96
98
|
if (isAnimated) {
|
|
97
99
|
setIsAnimating(true);
|
package/src/PieChart/index.ts
CHANGED
|
@@ -116,10 +116,11 @@ export const usePieChart = (props: IPieChartPropsType): IusePieChart => {
|
|
|
116
116
|
semiCircle,
|
|
117
117
|
inwardExtraLengthForFocused = 0,
|
|
118
118
|
isAnimated = false,
|
|
119
|
-
edgesRadius
|
|
120
|
-
endAngle = props.endAngle ?? startAngle + Math.PI * (semiCircle ? 1 : 2)
|
|
119
|
+
edgesRadius
|
|
121
120
|
} = props
|
|
122
121
|
|
|
122
|
+
let endAngle = props.endAngle ?? startAngle + Math.PI * (semiCircle ? 1 : 2)
|
|
123
|
+
|
|
123
124
|
const canvasWidth = radius * 2
|
|
124
125
|
const canvasHeight = isThreeD ? radius * 2.3 : radius * 2
|
|
125
126
|
|
|
@@ -157,6 +158,7 @@ export const usePieChart = (props: IPieChartPropsType): IusePieChart => {
|
|
|
157
158
|
/********************************** PRO **********************/
|
|
158
159
|
|
|
159
160
|
const startAngleForPro = props.startAngle ?? 0
|
|
161
|
+
endAngle = endAngle - startAngle + startAngleForPro
|
|
160
162
|
const animationDuration = props.animationDuration ?? defaultAnimationDuration
|
|
161
163
|
|
|
162
164
|
const [isAnimating, setIsAnimating] = useState(isAnimated)
|