Nbplus

nbplusarrow-up-right (working title) is a collection of Callysto-made Python modules for Creators wanting greater interactivity and visual aesthetic in Jupyter notebooks. These tools reflect a desire for aggregation of reusable code and uniformity in how we develop interactive content.

Getting Started

Submodules are installed separately.

Use the following command, replacing <submodule> with the name of a subdirectory in nbplusarrow-up-right:

pip install --upgrade --force-reinstall --user git+git://github.com/callysto/nbplus.git#egg=<submodule>\&subdirectory=<submodule>

Once installed, import a submodule by referring to itself.

e.g.

from geogebra.ggb import *
from nbvis.classes import D3, MathBox, Vis

To contribute, see the repositoryarrow-up-right.

Submodules

GeoGebra is an interactive mathematics application for visualization and interaction with geometry, algebra, statistics and calculus. We have developed a Jupyter magic so that GeoGebra may be used within notebooks.

This is a Python wrapper libraryarrow-up-right for JavaScript-based visualizations in Jupyter, and provides a streamlined means of specifying and updating visualization code. We are actively supporting D3.jsarrow-up-right and MathBox.jsarrow-up-right.

A sample guide outlining the creation of a slider bar using nbvis is available herearrow-up-right.

class classes.D3(name, silent=True) [source]arrow-up-right

Containerizes D3 structures.

Parameters:

  • name (string) – a unique identifier for a class instance

  • silent (boolean) – toggles verbose output

Methods:

Returns:

  • D3 object class instance

Return type:

  • nbvis.classes.D3

Usage:

class classes.MathBox(name, silent=True) [source]arrow-up-right

Containerizes MathBox structures.

Parameters:

  • name (string) – a unique identifier for a class instance

  • silent (boolean) – toggles verbose output

Methods:

Returns:

  • MathBox object class instance

Return type:

  • nbvis.classes.MathBox

Usage:

class classes.Vis(*args, js="", silent=True) [source]arrow-up-right

Parameters:

  • *args (D3 or MathBox) – specifies object class instances to be displayed immediately

  • js (string) – prepends custom JavaScript before visualization code

  • silent (boolean) – toggles verbose output

Methods:

  • None

Returns:

  • Visualization object class instance

Return type:

  • nbvis.classes.Vis

Usage:

magic %%d3 [source]arrow-up-right

Creates a global variable d3_code and appends the content of the cell to it for later use in a D3 object class instance.

Flags:

  • to reset all code : --reset

  • to queue code for later execution : --queue or -q

Usage:

magic %%mathbox [source]arrow-up-right

Creates a global variable mathbox_code and appends the content of the cell to it for later use in a MathBox object class instance.

Flags:

  • to reset all code : --reset

  • to queue code for later execution : --queue or -q

Usage:

Last updated