Skip to content

Commit dd9b57c

Browse files
authored
Merge pull request #10 from pysimone/master
Animate Transform example
2 parents 0e71090 + 280b0e7 commit dd9b57c

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

examples/animateTransform.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"""
2+
Tutorial:
3+
https://developer.mozilla.org/en-US/docs/Web/SVG/Element/animateTransform
4+
5+
Usage:
6+
python3 examples/animateTransform.py > examples/animateTransform.svg
7+
chromium examples/animateTransform.svg
8+
"""
9+
import svg
10+
11+
12+
def draw() -> svg.SVG:
13+
return svg.SVG(
14+
x=0, y=0,
15+
width=120, height=120,
16+
elements=[svg.Polygon(points=[60, 30, 90, 90, 30, 90],
17+
elements=[svg.AnimateTransform(
18+
attributeName="transform",
19+
type="rotate",
20+
from_="0 60 70",
21+
to="360 60 70",
22+
dur="10s",
23+
repeatCount="indefinite")]
24+
)]
25+
)
26+
27+
28+
if __name__ == '__main__':
29+
print(draw())

examples/animateTransform.svg

+1
Loading

0 commit comments

Comments
 (0)