module jspy.render_nb_js
¶
Short summary¶
module jyquickhelper.jspy.render_nb_js
Helpers around JSON
Classes¶
class |
truncated documentation |
---|---|
Raised when the class does not find what it expects. |
|
Renders javascript, only outputs HTML. |
|
Renders JS using javascript. |
|
Adds javascript into a noteboook. |
|
Raised when a url does not exist. |
Functions¶
function |
truncated documentation |
---|---|
Checks urls. |
Methods¶
method |
truncated documentation |
---|---|
|
|
|
|
|
If self.local, copies javascript dependencies in the local folder. |
|
If self.local, copies javascript dependencies in the local folder. |
If self.local, copies javascript dependencies in the local folder. |
|
overloads method _ipython_display_. … |
|
Overloads method _repr_html_. |
|
|
Overloads method _ipython_display_. … |
|
Overloads method _ipython_display_. … |
Overloads method _ipython_display_. … |
Documentation¶
Helpers around JSON
- exception jyquickhelper.jspy.render_nb_js.JavascriptScriptError¶
Bases:
ValueError
Raised when the class does not find what it expects.
- class jyquickhelper.jspy.render_nb_js.RenderJS(script, width='100%', height='100%', divid=None, css=None, libs=None, style=None, only_html=False, div_class=None, check_urls=True, local=False)¶
Bases:
RenderJSRaw
Renders javascript, only outputs HTML.
- Parameters:
script – (str) script
width – (str) width
height – (str) height
style – (str) style (added in
<style>...</style>
)divid – (str|None) id of the div
css – (list) list of css
libs – (list) list of dependencies
only_html – (bool) use only function display_html and not display_javascript to add javascript to the page.
div_class – (str) class of the section
div
which will host the results of the javascriptcheck_urls – (bool) by default, check url exists
local – (bool|False) use local javascript files
- _repr_html_()¶
Overloads method _repr_html_.
- class jyquickhelper.jspy.render_nb_js.RenderJSObj(script, width='100%', height='100%', divid=None, css=None, libs=None, style=None, only_html=False, div_class=None, check_urls=True, local=False)¶
Bases:
RenderJSRaw
Renders JS using javascript.
- Parameters:
script – (str) script
width – (str) width
height – (str) height
style – (str) style (added in
<style>...</style>
)divid – (str|None) id of the div
css – (list) list of css
libs – (list) list of dependencies
only_html –
(bool) use only function display_html and not display_javascript to add javascript to the page.
div_class – (str) class of the section
div
which will host the results of the javascriptcheck_urls – (bool) by default, check url exists
local – (bool|False) use local javascript files
- _ipython_display_()¶
overloads method _ipython_display_.
- class jyquickhelper.jspy.render_nb_js.RenderJSRaw(script, width='100%', height='100%', divid=None, css=None, libs=None, style=None, only_html=False, div_class=None, check_urls=True, local=False)¶
Bases:
object
Adds javascript into a noteboook.
- Parameters:
script – (str) script
width – (str) width
height – (str) height
style – (str) style (added in
<style>...</style>
)divid – (str|None) id of the div
css – (list) list of css
libs – (list) list of dependencies
only_html –
(bool) use only function display_html and not display_javascript to add javascript to the page.
div_class – (str) class of the section
div
which will host the results of the javascriptcheck_urls – (bool) by default, check url exists
local – (bool|False) use local javascript files
- __init__(script, width='100%', height='100%', divid=None, css=None, libs=None, style=None, only_html=False, div_class=None, check_urls=True, local=False)¶
- Parameters:
script – (str) script
width – (str) width
height – (str) height
style – (str) style (added in
<style>...</style>
)divid – (str|None) id of the div
css – (list) list of css
libs – (list) list of dependencies
only_html –
(bool) use only function display_html and not display_javascript to add javascript to the page.
div_class – (str) class of the section
div
which will host the results of the javascriptcheck_urls – (bool) by default, check url exists
local – (bool|False) use local javascript files
- _copy_local(css, libs, local)¶
If self.local, copies javascript dependencies in the local folder.
- Parameters:
css – list of css
libs – list of libraries
local – boolean or new location
- Returns:
tuple (css, libs)
- generate_html()¶
Overloads method _ipython_display_.
- Returns:
HTML text, Javascript text
- exception jyquickhelper.jspy.render_nb_js.UrlNotFoundError(url, code)¶
Bases:
Exception
Raised when a url does not exist.
- __init__(url, code)¶
- jyquickhelper.jspy.render_nb_js.check_url(url)¶
Checks urls.