Frontend Container

================= container.js ================= JavaScript “frontend” counterpart of exa’s Container object for use within the Jupyter notebook interface. This “module” standardizes bidirectional communication logic for all container widget views.

The structure of the frontend is to generate an HTML widget (“container” - see create_container) and then populate its canvas with an application (“app”) appropriate to the type of container. If the (backend) container is empty, then populate the HTML widget with the test application. If the container is not empty but doesn’t have a dedicated application, the info application (info.js) is used.

ContainerView

Base view for creating data specific container widgets used within the Jupyter notebook. All logic related to communication (between Python and JavaScript) should be located here. This class provides a number of commonly used functions for such logic.

Warning:
Do not override the DOMWidgetView constructor (“initialize”).

render

Main entry point (called immediately after initialize) for (ipywidgets) DOMWidgetView objects.

Note:
This function can be overwritten by container specific code, but it is more common to overwrite the init function.
See Also:
init()

init

Container view classes that extend this class can overwrite this method to customize the behavior of their data specific view.

get_trait

Wrapper around the DOMWidgetView (Backbone.js) “model.get” function, that attempts to convert JSON strings to objects.

set_trait

Wrapper around the DOMWidgetView “model.set” function to correctly set json strings.

if_empty

If the (exa) container object is empty, render the test application widget.

default_listeners

Set up listeners for basic variables related to the window dimensions and system settings.

create_container

Create a resizable container.

create_canvas

Create a canvas for WebGL.