@@ -67,7 +67,7 @@ def get_bounds(self):
67
67
return bounds
68
68
69
69
def add_children (self , child , name = None , index = None ):
70
- """Add a children ."""
70
+ """Add a child ."""
71
71
if name is None :
72
72
name = child .get_name ()
73
73
if index is None :
@@ -107,9 +107,7 @@ def get_root(self):
107
107
return self ._parent .get_root ()
108
108
109
109
def render (self , ** kwargs ):
110
- """Renders the Element into an HTML representation, using the `_template`
111
- attribute.
112
- """
110
+ """Renders the HTML representation of the element."""
113
111
return self ._template .render (this = self , kwargs = kwargs )
114
112
115
113
def save (self , outfile , close_file = True , ** kwargs ):
@@ -327,7 +325,7 @@ def get_root(self):
327
325
return self
328
326
329
327
def render (self , ** kwargs ):
330
- """Renders the Element into an HTML representation ."""
328
+ """Renders the HTML representation of the element ."""
331
329
for name , child in self ._children .items ():
332
330
child .render (** kwargs )
333
331
return self ._template .render (this = self , kwargs = kwargs )
@@ -380,8 +378,7 @@ def add_subplot(self, x, y, n, margin=0.05):
380
378
381
379
382
380
class Html (Element ):
383
- """A basic Element for embedding HTML.
384
- """
381
+ """A basic Element for embedding HTML."""
385
382
def __init__ (self , data , width = "100%" , height = "100%" ):
386
383
"""Create an HTML div object for embedding data.
387
384
@@ -390,11 +387,11 @@ def __init__(self, data, width="100%", height="100%"):
390
387
data : str
391
388
The HTML data to be embedded.
392
389
width : int or str, default '100%'
393
- The width of the output div.
394
- Ex : 120 , '120px', '80%'
390
+ The width of the output div element .
391
+ Ex: 120 , '120px', '80%'
395
392
height : int or str, default '100%'
396
- The height of the output div.
397
- Ex : 120 , '120px', '80%'
393
+ The height of the output div element .
394
+ Ex: 120 , '120px', '80%'
398
395
"""
399
396
super (Html , self ).__init__ ()
400
397
self ._name = 'Html'
@@ -457,7 +454,7 @@ def get_root(self):
457
454
return self
458
455
459
456
def render (self , ** kwargs ):
460
- """Renders the Element into an HTML representation ."""
457
+ """Renders the HTML representation of the element ."""
461
458
figure = self ._parent
462
459
assert isinstance (figure , Figure ), ("You cannot render this Element "
463
460
"if it's not in a Figure." )
@@ -535,12 +532,7 @@ def __init__(self, html=None, width="100%", height=None, ratio="60%", figsize=No
535
532
self .add_children (html )
536
533
537
534
def render (self , ** kwargs ):
538
- """Displays the Figure in a Jupyter notebook.
539
-
540
- Parameters
541
- ----------
542
-
543
- """
535
+ """Renders the HTML representation of the element."""
544
536
html = super (IFrame ,self ).render (** kwargs )
545
537
html = "data:text/html;base64," + base64 .b64encode (html .encode ('utf8' )).decode ('utf8' ) # noqa
546
538
@@ -586,7 +578,7 @@ def __init__(self):
586
578
self ._template = Template (u"" )
587
579
588
580
def render (self , ** kwargs ):
589
- """Renders the Element into an HTML representation ."""
581
+ """Renders the HTML representation of the element ."""
590
582
figure = self .get_root ()
591
583
assert isinstance (figure , Figure ), ("You cannot render this Element "
592
584
"if it's not in a Figure." )
0 commit comments