Commit c096165d authored by Romain Casati's avatar Romain Casati
Browse files

Add SVG support to IPython.display.

parent bd0db544
......@@ -2,7 +2,7 @@ import basthon
from binascii import b2a_base64
__all__ = ["display", "clear_output", "Image", "display_image", "HTML", "IFrame"]
__all__ = ["display", "clear_output", "Image", "display_image", "HTML", "IFrame", "SVG"]
display = basthon.display
......@@ -51,6 +51,15 @@ class HTML:
return self._html
class SVG:
""" Sending svg string to IPython notebook. """
def __init__(self, svg):
self._svg = svg
def _repr_svg_(self):
return self._svg
class IFrame(HTML):
""" Embed an iframe in IPython notebook. """
def __init__(self, src, width, height):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment