@@ -107,7 +107,9 @@ def get_root(self):
107
107
return self ._parent .get_root ()
108
108
109
109
def render (self , ** kwargs ):
110
- """TODO : docstring here."""
110
+ """Renders the Element into an HTML representation, using the `_template`
111
+ attribute.
112
+ """
111
113
return self ._template .render (this = self , kwargs = kwargs )
112
114
113
115
def save (self , outfile , close_file = True , ** kwargs ):
@@ -325,7 +327,7 @@ def get_root(self):
325
327
return self
326
328
327
329
def render (self , ** kwargs ):
328
- """TODO : docstring here ."""
330
+ """Renders the Element into an HTML representation ."""
329
331
for name , child in self ._children .items ():
330
332
child .render (** kwargs )
331
333
return self ._template .render (this = self , kwargs = kwargs )
@@ -378,8 +380,22 @@ def add_subplot(self, x, y, n, margin=0.05):
378
380
379
381
380
382
class Html (Element ):
383
+ """A basic Element for embedding HTML.
384
+ """
381
385
def __init__ (self , data , width = "100%" , height = "100%" ):
382
- """TODO : docstring here"""
386
+ """Create an HTML div object for embedding data.
387
+
388
+ Parameters
389
+ ----------
390
+ data : str
391
+ The HTML data to be embedded.
392
+ width : int or str, default '100%'
393
+ The width of the output div.
394
+ Ex : 120 , '120px', '80%'
395
+ height : int or str, default '100%'
396
+ The height of the output div.
397
+ Ex : 120 , '120px', '80%'
398
+ """
383
399
super (Html , self ).__init__ ()
384
400
self ._name = 'Html'
385
401
self .data = data
@@ -441,7 +457,7 @@ def get_root(self):
441
457
return self
442
458
443
459
def render (self , ** kwargs ):
444
- """TODO : docstring here ."""
460
+ """Renders the Element into an HTML representation ."""
445
461
figure = self ._parent
446
462
assert isinstance (figure , Figure ), ("You cannot render this Element "
447
463
"if it's not in a Figure." )
@@ -563,13 +579,14 @@ class MacroElement(Element):
563
579
{% endmacro %}
564
580
"""
565
581
def __init__ (self ):
566
- """TODO : docstring here """
582
+ """Creates a MacroElement object. """
567
583
super (MacroElement , self ).__init__ ()
568
584
self ._name = 'MacroElement'
569
585
570
586
self ._template = Template (u"" )
571
587
572
588
def render (self , ** kwargs ):
589
+ """Renders the Element into an HTML representation."""
573
590
figure = self .get_root ()
574
591
assert isinstance (figure , Figure ), ("You cannot render this Element "
575
592
"if it's not in a Figure." )
0 commit comments