Skip to content

Commit 1957061

Browse files
author
Martin Journois
committed
Apply @ocefpaf's corrections
1 parent add5f86 commit 1957061

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

folium/element.py

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def get_bounds(self):
6767
return bounds
6868

6969
def add_children(self, child, name=None, index=None):
70-
"""Add a children."""
70+
"""Add a child."""
7171
if name is None:
7272
name = child.get_name()
7373
if index is None:
@@ -107,9 +107,7 @@ def get_root(self):
107107
return self._parent.get_root()
108108

109109
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."""
113111
return self._template.render(this=self, kwargs=kwargs)
114112

115113
def save(self, outfile, close_file=True, **kwargs):
@@ -327,7 +325,7 @@ def get_root(self):
327325
return self
328326

329327
def render(self, **kwargs):
330-
"""Renders the Element into an HTML representation."""
328+
"""Renders the HTML representation of the element."""
331329
for name, child in self._children.items():
332330
child.render(**kwargs)
333331
return self._template.render(this=self, kwargs=kwargs)
@@ -380,8 +378,7 @@ def add_subplot(self, x, y, n, margin=0.05):
380378

381379

382380
class Html(Element):
383-
"""A basic Element for embedding HTML.
384-
"""
381+
"""A basic Element for embedding HTML."""
385382
def __init__(self, data, width="100%", height="100%"):
386383
"""Create an HTML div object for embedding data.
387384
@@ -390,11 +387,11 @@ def __init__(self, data, width="100%", height="100%"):
390387
data : str
391388
The HTML data to be embedded.
392389
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%'
395392
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%'
398395
"""
399396
super(Html, self).__init__()
400397
self._name = 'Html'
@@ -457,7 +454,7 @@ def get_root(self):
457454
return self
458455

459456
def render(self, **kwargs):
460-
"""Renders the Element into an HTML representation."""
457+
"""Renders the HTML representation of the element."""
461458
figure = self._parent
462459
assert isinstance(figure, Figure), ("You cannot render this Element "
463460
"if it's not in a Figure.")
@@ -535,12 +532,7 @@ def __init__(self, html=None, width="100%", height=None, ratio="60%", figsize=No
535532
self.add_children(html)
536533

537534
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."""
544536
html = super(IFrame,self).render(**kwargs)
545537
html = "data:text/html;base64," + base64.b64encode(html.encode('utf8')).decode('utf8') # noqa
546538

@@ -586,7 +578,7 @@ def __init__(self):
586578
self._template = Template(u"")
587579

588580
def render(self, **kwargs):
589-
"""Renders the Element into an HTML representation."""
581+
"""Renders the HTML representation of the element."""
590582
figure = self.get_root()
591583
assert isinstance(figure, Figure), ("You cannot render this Element "
592584
"if it's not in a Figure.")

0 commit comments

Comments
 (0)