2121
2222class Element (object ):
2323 """Basic Element object that does nothing.
24- Other Elements may inherit from this one."""
24+ Other Elements may inherit from this one.
25+
26+ Parameters
27+ ----------
28+ TODO: docstring.
29+ """
2530 def __init__ (self , template = None , template_name = None ):
26- """Creates a Element."""
2731 self ._name = 'Element'
2832 self ._id = uuid4 ().hex
2933 self ._env = ENV
@@ -144,6 +148,8 @@ def save(self, outfile, close_file=True, **kwargs):
144148class Link (Element ):
145149 """Link
146150 ----
151+
152+ TODO: docstring.
147153 """
148154 def get_code (self ):
149155 """TODO : docstring."""
@@ -159,16 +165,15 @@ def to_dict(self, depth=-1, **kwargs):
159165
160166
161167class JavascriptLink (Link ):
162- """TODO: docstring."""
168+ """Create a JavascriptLink object based on a url.
169+ Parameters
170+ ----------
171+ url : str
172+ The url to be linked
173+ download : bool, default False
174+ Whether the target document shall be loaded right now.
175+ """
163176 def __init__ (self , url , download = False ):
164- """Create a JavascriptLink object based on a url.
165- Parameters
166- ----------
167- url : str
168- The url to be linked
169- download : bool, default False
170- Whether the target document shall be loaded right now.
171- """
172177 super (JavascriptLink , self ).__init__ ()
173178 self ._name = 'JavascriptLink'
174179 self .url = url
@@ -186,16 +191,15 @@ def __init__(self, url, download=False):
186191
187192
188193class CssLink (Link ):
189- """TODO: docstring."""
194+ """Create a CssLink object based on a url.
195+ Parameters
196+ ----------
197+ url : str
198+ The url to be linked
199+ download : bool, default False
200+ Whether the target document shall be loaded right now.
201+ """
190202 def __init__ (self , url , download = False ):
191- """Create a CssLink object based on a url.
192- Parameters
193- ----------
194- url : str
195- The url to be linked
196- download : bool, default False
197- Whether the target document shall be loaded right now.
198- """
199203 super (CssLink , self ).__init__ ()
200204 self ._name = 'CssLink'
201205 self .url = url
@@ -247,27 +251,26 @@ def __init__(self, url, download=False):
247251
248252
249253class Figure (Element ):
250- """TODO: docstring."""
254+ """Create a Figure object, to plot things into it.
255+
256+ Parameters
257+ ----------
258+ width : str, default "100%"
259+ The width of the Figure.
260+ It may be a percentage or pixel value (like "300px").
261+ height : str, default None
262+ The height of the Figure.
263+ It may be a percentage or a pixel value (like "300px").
264+ ratio : str, default "60%"
265+ A percentage defining the aspect ratio of the Figure.
266+ It will be ignored if height is not None.
267+ figsize : tuple of two int, default None
268+ If you're a matplotlib addict, you can overwrite width and
269+ height. Values will be converted into pixels in using 60 dpi.
270+ For example figsize=(10, 5) will result in
271+ width="600px", height="300px".
272+ """
251273 def __init__ (self , width = "100%" , height = None , ratio = "60%" , figsize = None ):
252- """Create a Figure object, to plot things into it.
253-
254- Parameters
255- ----------
256- width : str, default "100%"
257- The width of the Figure.
258- It may be a percentage or pixel value (like "300px").
259- height : str, default None
260- The height of the Figure.
261- It may be a percentage or a pixel value (like "300px").
262- ratio : str, default "60%"
263- A percentage defining the aspect ratio of the Figure.
264- It will be ignored if height is not None.
265- figsize : tuple of two int, default None
266- If you're a matplotlib addict, you can overwrite width and
267- height. Values will be converted into pixels in using 60 dpi.
268- For example figsize=(10, 5) will result in
269- width="600px", height="300px".
270- """
271274 super (Figure , self ).__init__ ()
272275 self ._name = 'Figure'
273276 self .header = Element ()
@@ -398,21 +401,21 @@ def add_subplot(self, x, y, n, margin=0.05):
398401
399402
400403class Html (Element ):
401- """A basic Element for embedding HTML."""
402- def __init__ (self , data , width = "100%" , height = "100%" ):
403- """Create an HTML div object for embedding data.
404+ """Create an HTML div object for embedding data.
405+
406+ Parameters
407+ ----------
408+ data : str
409+ The HTML data to be embedded.
410+ width : int or str, default '100%'
411+ The width of the output div element.
412+ Ex: 120 , '120px', '80%'
413+ height : int or str, default '100%'
414+ The height of the output div element.
415+ Ex: 120 , '120px', '80%'
416+ """
404417
405- Parameters
406- ----------
407- data : str
408- The HTML data to be embedded.
409- width : int or str, default '100%'
410- The width of the output div element.
411- Ex: 120 , '120px', '80%'
412- height : int or str, default '100%'
413- The height of the output div element.
414- Ex: 120 , '120px', '80%'
415- """
418+ def __init__ (self , data , width = "100%" , height = "100%" ):
416419 super (Html , self ).__init__ ()
417420 self ._name = 'Html'
418421 self .data = data
@@ -428,10 +431,14 @@ def __init__(self, data, width="100%", height="100%"):
428431
429432
430433class Div (Figure ):
431- """TODO: docstring."""
434+ """Create a Map with Folium and Leaflet.js.
435+
436+ Parameters
437+ ----------
438+ TODO: docstring.
439+ """
432440 def __init__ (self , width = '100%' , height = '100%' ,
433441 left = "0%" , top = "0%" , position = 'relative' ):
434- """Create a Map with Folium and Leaflet.js."""
435442 super (Figure , self ).__init__ ()
436443 self ._name = 'Div'
437444
@@ -517,30 +524,29 @@ def _repr_html_(self, **kwargs):
517524
518525
519526class IFrame (Element ):
520- """TODO: docstring."""
527+ """Create a Figure object, to plot things into it.
528+
529+ Parameters
530+ ----------
531+ html : str, default None
532+ Eventual HTML code that you want to put in the frame.
533+ width : str, default "100%"
534+ The width of the Figure.
535+ It may be a percentage or pixel value (like "300px").
536+ height : str, default None
537+ The height of the Figure.
538+ It may be a percentage or a pixel value (like "300px").
539+ ratio : str, default "60%"
540+ A percentage defining the aspect ratio of the Figure.
541+ It will be ignored if height is not None.
542+ figsize : tuple of two int, default None
543+ If you're a matplotlib addict, you can overwrite width and
544+ height. Values will be converted into pixels in using 60 dpi.
545+ For example figsize=(10, 5) will result in
546+ width="600px", height="300px".
547+ """
521548 def __init__ (self , html = None , width = "100%" , height = None , ratio = "60%" ,
522549 figsize = None ):
523- """Create a Figure object, to plot things into it.
524-
525- Parameters
526- ----------
527- html : str, default None
528- Eventual HTML code that you want to put in the frame.
529- width : str, default "100%"
530- The width of the Figure.
531- It may be a percentage or pixel value (like "300px").
532- height : str, default None
533- The height of the Figure.
534- It may be a percentage or a pixel value (like "300px").
535- ratio : str, default "60%"
536- A percentage defining the aspect ratio of the Figure.
537- It will be ignored if height is not None.
538- figsize : tuple of two int, default None
539- If you're a matplotlib addict, you can overwrite width and
540- height. Values will be converted into pixels in using 60 dpi.
541- For example figsize=(10, 5) will result in
542- width="600px", height="300px".
543- """
544550 super (IFrame , self ).__init__ ()
545551 self ._name = 'IFrame'
546552
@@ -597,7 +603,6 @@ class MacroElement(Element):
597603 {% endmacro %}
598604 """
599605 def __init__ (self ):
600- """Creates a MacroElement object."""
601606 super (MacroElement , self ).__init__ ()
602607 self ._name = 'MacroElement'
603608
0 commit comments