This repository has been archived by the owner on Oct 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
226 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './transition-1'; | ||
export * from './transition-2'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Group, Rect } from '@antv/g'; | ||
import { transition } from '../../../src/animation'; | ||
|
||
export function Transition1() { | ||
const group = new Group(); | ||
|
||
const rect = group.appendChild( | ||
new Rect({ | ||
style: { | ||
x: 0, | ||
y: 0, | ||
width: 100, | ||
height: 100, | ||
fill: 'red', | ||
}, | ||
}) | ||
); | ||
|
||
setTimeout(() => { | ||
transition(rect, { x: 100, y: 100, fill: 'green', width: 50, height: 50 }, { duration: 1000, fill: 'both' }); | ||
}); | ||
|
||
return group; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { Group, Rect, Circle, Text } from '@antv/g'; | ||
import { transitionShape } from '../../../src/animation'; | ||
|
||
export function Transition2() { | ||
const group = new Group(); | ||
|
||
const rect1 = group.appendChild( | ||
new Rect({ | ||
style: { | ||
x: 0, | ||
y: 0, | ||
width: 100, | ||
height: 100, | ||
fill: 'red', | ||
}, | ||
}) | ||
); | ||
|
||
const circle = group.appendChild( | ||
new Circle({ | ||
style: { | ||
cx: 200, | ||
cy: 50, | ||
r: 50, | ||
fill: 'green', | ||
}, | ||
}) | ||
); | ||
|
||
setTimeout(async () => { | ||
const animations1 = transitionShape(rect1, circle, { duration: 1000 }); | ||
await animations1.slice(-1)[0]!.finished; | ||
const rect2 = group.appendChild( | ||
new Rect({ | ||
style: { | ||
x: 150, | ||
y: 150, | ||
width: 100, | ||
height: 100, | ||
fill: 'blue', | ||
}, | ||
}) | ||
); | ||
const animations2 = transitionShape(circle, rect2, { duration: 1000 }); | ||
|
||
await animations2.slice(-1)[0]!.finished; | ||
|
||
const text = group.appendChild( | ||
new Text({ | ||
style: { | ||
x: 0, | ||
y: 150, | ||
text: 'Animation', | ||
fontSize: 20, | ||
}, | ||
}) | ||
); | ||
|
||
transitionShape(rect2, text, { duration: 1000 }); | ||
}); | ||
|
||
return group; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+251 Bytes
(100%)
__tests__/integration/snapshots/AxisLinearLabelOverlapMultiple.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters