module jspy.render_nb_js

Inheritance diagram of jyquickhelper.jspy.render_nb_js

Short summary

module jyquickhelper.jspy.render_nb_js

Helpers around JSON

source on GitHub

Classes

class

truncated documentation

JavascriptScriptError

Raised when the class does not find what it expects.

RenderJS

Renders javascript, only outputs HTML.

RenderJSObj

Renders JS using javascript.

RenderJSRaw

Adds javascript into a noteboook.

UrlNotFoundError

Raised when a url does not exist.

Functions

function

truncated documentation

check_url

Checks urls.

Methods

method

truncated documentation

__init__

__init__

__init__

__init__

_copy_local

If self.local, copies javascript dependencies in the local folder.

_copy_local

If self.local, copies javascript dependencies in the local folder.

_copy_local

If self.local, copies javascript dependencies in the local folder.

_ipython_display_

overloads method _ipython_display_. …

_repr_html_

Overloads method _repr_html_.

generate_html

Overloads method _ipython_display_. …

generate_html

Overloads method _ipython_display_. …

generate_html

Overloads method _ipython_display_. …

Documentation

Helpers around JSON

source on GitHub

exception jyquickhelper.jspy.render_nb_js.JavascriptScriptError

Bases: ValueError

Raised when the class does not find what it expects.

source on GitHub

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.

source on GitHub

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 javascript

  • check_urls – (bool) by default, check url exists

  • local – (bool|False) use local javascript files

source on GitHub

_repr_html_()

Overloads method _repr_html_.

source on GitHub

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.

source on GitHub

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 javascript

  • check_urls – (bool) by default, check url exists

  • local – (bool|False) use local javascript files

source on GitHub

_ipython_display_()

overloads method _ipython_display_.

source on GitHub

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.

source on GitHub

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 javascript

  • check_urls – (bool) by default, check url exists

  • local – (bool|False) use local javascript files

source on GitHub

__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 javascript

  • check_urls – (bool) by default, check url exists

  • local – (bool|False) use local javascript files

source on GitHub

_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)

source on GitHub

generate_html()

Overloads method _ipython_display_.

Returns:

HTML text, Javascript text

source on GitHub

exception jyquickhelper.jspy.render_nb_js.UrlNotFoundError(url, code)

Bases: Exception

Raised when a url does not exist.

source on GitHub

__init__(url, code)
jyquickhelper.jspy.render_nb_js.check_url(url)

Checks urls.