pymor.discretizers.builtin.gui.jupyter.threejs

Module Contents

Classes

Renderer

Displays multiple widgets vertically using the flexible box model.

ColorBarRenderer

Displays multiple widgets horizontally using the flexible box model.

ThreeJSPlot

Displays multiple widgets vertically using the flexible box model.

Functions

_normalize

visualize_py3js

Generate a pythreejs Plot and associated controls for scalar data associated to a

pymor.discretizers.builtin.gui.jupyter.threejs._normalize(u, vmin=None, vmax=None)[source]
class pymor.discretizers.builtin.gui.jupyter.threejs.Renderer(U, grid, render_size, color_map, title, bounding_box=([0, 0], [1, 1]), codim=2, vmin=None, vmax=None)[source]

Bases: ipywidgets.widgets.VBox

Displays multiple widgets vertically using the flexible box model.

Parameters

{box_params}

Examples

>>> import ipywidgets as widgets
>>> title_widget = widgets.HTML('<em>Vertical Box Example</em>')
>>> slider = widgets.IntSlider()
>>> widgets.VBox([title_widget, slider])
_get_mesh(self, i, u)[source]
async _async_load_data(self, data)[source]
_load_data(self, data)[source]
goto(self, idx)[source]
freeze_camera(self, freeze=True)[source]
_setup_scene(self, bounding_box, render_size)[source]
class pymor.discretizers.builtin.gui.jupyter.threejs.ColorBarRenderer(render_size, color_map, vmin=None, vmax=None)[source]

Bases: ipywidgets.widgets.HBox

Displays multiple widgets horizontally using the flexible box model.

Parameters

{box_params}

Examples

>>> import ipywidgets as widgets
>>> title_widget = widgets.HTML('<em>Horizontal Box Example</em>')
>>> slider = widgets.IntSlider()
>>> widgets.HBox([title_widget, slider])
freeze_camera(self, freeze=True)[source]
goto(self, idx)[source]
_gen_sprite(self)[source]
class pymor.discretizers.builtin.gui.jupyter.threejs.ThreeJSPlot(grid, color_map, title, bounding_box, codim, U, vmins, vmaxs, separate_colorbars, size)[source]

Bases: ipywidgets.widgets.VBox

Displays multiple widgets vertically using the flexible box model.

Parameters

{box_params}

Examples

>>> import ipywidgets as widgets
>>> title_widget = widgets.HTML('<em>Vertical Box Example</em>')
>>> slider = widgets.IntSlider()
>>> widgets.VBox([title_widget, slider])
async finish_loading(self)[source]
pymor.discretizers.builtin.gui.jupyter.threejs.visualize_py3js(grid, U, bounding_box=([0, 0], [1, 1]), codim=2, title=None, legend=None, separate_colorbars=False, rescale_colorbars=False, columns=2, color_map=get_cmap('viridis'))[source]

Generate a pythreejs Plot and associated controls for scalar data associated to a two-dimensional Grid.

The grid’s ReferenceElement must be the triangle or square. The data can either be attached to the faces or vertices of the grid.

Parameters

grid

The underlying Grid.

U

VectorArray of the data to visualize. If len(U) 1, the data is visualized as a time series of plots. Alternatively, a tuple of VectorArrays can be provided, in which case a subplot is created for each entry of the tuple. The lengths of all arrays have to agree.

bounding_box

A bounding box in which the grid is contained.

codim

The codimension of the entities the data in U is attached to (either 0 or 2).

title

Title of the plot.

legend

Description of the data that is plotted. Most useful if U is a tuple in which case legend has to be a tuple of strings of the same length.

separate_colorbars

If True, use separate colorbars for each subplot.

rescale_colorbars

If True, rescale colorbars to data in each frame.

columns

The number of columns in the visualizer GUI in case multiple plots are displayed at the same time.

color_map

a Matplotlib Colormap object