In [1]:
from IPython.display import HTML
In [2]:
HTML("""
""")
Out[2]:
In [3]:
HTML("""
<></>
""")
Out[3]:
In [4]:
HTML("""
<svg></svg>
""")
Out[4]:
In [5]:
HTML("""
<svg width="500" height="100">
</svg>
""")
Out[5]:
In [6]:
HTML("""
<svg width="500" height="100">
<circle></circle>
</svg>
""")
Out[6]:
The cx and cy attributes define the x and y coordinates of the center of the circle. If cx and cy are omitted, the circle's center is set to (0,0).
The r attribute defines the radius of the circle
In [7]:
HTML("""
<svg width="500" height="100">
<circle r = "30" fill = "orange"></circle>
</svg>
""")
Out[7]:
In [8]:
HTML("""
<svg width="500" height="100">
<circle r = "30" cx="50" fill = "orange"></circle>
</svg>
""")
Out[8]:
In [9]:
HTML("""
<svg width="500" height="100">
<circle r = "30" cx="50" cy = "50" fill = "orange"></circle>
</svg>
""")
Out[9]:
In [10]:
HTML("""
<svg width="500" height="100">
<circle r = "10" cx="50" cy = "50" fill = "orange"></circle>
</svg>
""")
Out[10]:
In [11]:
HTML("""
<svg width="500" height="100">
<circle r = "10" cx="50" cy = "50" fill = "blue" stroke = "red" stroke-width = "3"></circle>
</svg>
""")
Out[11]:
In [12]:
HTML("""
<svg width="500" height="100">
<circle r = "30" cx="50" cy = "50" fill = "orange" stroke = "red" stroke-width = "2"></circle>
<circle r = "10" cx="50" cy = "50" fill = "blue" stroke = "red" stroke-width = "3"></circle>
</svg>
""")
Out[12]:
In [13]:
HTML("""
<svg width="500" height="100" >
<circle r = "30" cx="50" cy = "50" fill = "orange"></circle>
<circle r = "10" cx="50" cy = "50" fill = "blue"></circle>
<circle r = "10" cx="300" cy = "50" fill = "pink"></circle>
</svg>
""")
Out[13]:
In [ ]:
The SVG "\
In [14]:
HTML("""
<svg width="500" height="100">
<circle r="30" cx="50" cy="50" fill="orange">
<animate></animate>
</circle>
</svg>
""")
Out[14]:
In [15]:
HTML("""
<svg width="500" height="100">
<circle r="30" cx="50" cy="50" fill="orange">
<animate
attributeName = "cx"
from = "50"
to = "450"
dur = "1s"
begin = "click"
>
</animate>
</circle>
</svg>
""")
Out[15]:
In [16]:
HTML("""
<svg width="500" height="100">
<circle r="30" cx="50" cy="50" fill="orange">
<animate
attributeName = "cx"
from = "50"
to = "450"
dur = "1s"
begin = "click"
fill = "freeze"
>
</animate>
</circle>
</svg>
""")
Out[16]:
In [17]:
HTML("""
<svg width="500" height="100">
<circle r="30" cx="50" cy="50" fill="orange">
<animate
attributeName = "cx"
from = "50"
to = "450"
dur = "1s"
begin = "click"
repeatCount="indefinite"
>
</animate>
</circle>
</svg>
""")
Out[17]:
In [18]:
HTML("""
<svg width="500" height="100">
<circle r="30" cx="50" cy="50" fill="orange">
<animate
attributeName = "cx"
from = "50"
to = "450"
dur = "1s"
begin = "click"
repeatCount="indefinite"
>
</animate>
</circle>
<circle r="30" cx="50" cy="75" fill="green">
<animate
attributeName = "cx"
from = "50"
to = "450"
dur = "1s"
begin = "click"
repeatCount="indefinite"
>
</animate>
</circle>
</svg>
""")
Out[18]: