Skip to content

Commit

Permalink
fix: area point 没透传 animation (#1365)
Browse files Browse the repository at this point in the history
  • Loading branch information
zengyue authored Feb 15, 2022
1 parent 6bb9ce9 commit 8af4614
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 23 deletions.
13 changes: 12 additions & 1 deletion packages/f2/src/components/area/areaView.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { jsx } from '../../jsx';
import { deepMix } from '@antv/util';
import { Smooth, BBox } from '@antv/f2-graphic';

export default (props) => {
const { records, shape } = props;
const { records, shape, animation } = props;
const isSmooth = shape === 'smooth';
return (
<group>
Expand Down Expand Up @@ -58,6 +59,16 @@ export default (props) => {
fill: color,
...shape,
}}
animation={deepMix(
{
update: {
easing: 'linear',
duration: 450,
property: ['points'],
},
},
animation
)}
/>
);
})}
Expand Down
50 changes: 28 additions & 22 deletions packages/f2/src/components/point/pointView.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { jsx } from '../../jsx';
import { isNil } from '@antv/util';
import { isNil, deepMix } from '@antv/util';

export default (props) => {
const { records } = props;
const { records, animation } = props;
return (
<group>
{records.map((record) => {
Expand All @@ -24,17 +24,20 @@ export default (props) => {
width: rectSize * 2,
height: rectSize * 2,
}}
animation={{
appear: {
easing: 'linear',
duration: 450,
animation={deepMix(
{
appear: {
easing: 'linear',
duration: 450,
},
update: {
easing: 'linear',
duration: 450,
property: ['x', 'y', 'width', 'height', 'fill'],
},
},
update: {
easing: 'linear',
duration: 450,
property: ['x', 'y', 'width', 'height', 'fill'],
},
}}
animation
)}
/>
);
}
Expand All @@ -48,17 +51,20 @@ export default (props) => {
...shape,
r: isNil(size) ? shape.size : size,
}}
animation={{
appear: {
easing: 'linear',
duration: 450,
},
update: {
easing: 'linear',
duration: 450,
property: ['x', 'y', 'r', 'fill'],
animation={deepMix(
{
appear: {
easing: 'linear',
duration: 450,
},
update: {
easing: 'linear',
duration: 450,
property: ['x', 'y', 'r', 'fill'],
},
},
}}
animation
)}
/>
);
})}
Expand Down

0 comments on commit 8af4614

Please sign in to comment.