Skip to content

Commit

Permalink
Merge pull request #17997 from apache/fix-polar-animation
Browse files Browse the repository at this point in the history
fix(polar): polar bar animation should start from r0 rather than 0
  • Loading branch information
Ovilia authored Dec 1, 2022
2 parents f68e1f1 + 4fad608 commit 02d11cd
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/chart/bar/BarView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ const elementCreator: {
const sectorShape = sector.shape;
const animateProperty = isRadial ? 'r' : 'endAngle' as 'r' | 'endAngle';
const animateTarget = {} as SectorShape;
sectorShape[animateProperty] = isRadial ? 0 : layout.startAngle;
sectorShape[animateProperty] = isRadial ? layout.r0 : layout.startAngle;
animateTarget[animateProperty] = layout[animateProperty];
(isUpdate ? updateProps : initProps)(sector, {
shape: animateTarget
Expand Down
2 changes: 1 addition & 1 deletion src/chart/sunburst/SunburstPiece.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class SunburstPiece extends graphic.Sector {
if (firstCreate) {
sector.setShape(sectorShape);
sector.shape.r = layout.r0;
graphic.updateProps(
graphic.initProps(
sector,
{
shape: {
Expand Down
131 changes: 131 additions & 0 deletions test/bar-polar-animation.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test/runTest/actions/__meta__.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test/runTest/actions/bar-polar-animation.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 02d11cd

Please sign in to comment.