pymor.discretizers.builtin.gui.jupyter.threejs

Module Contents

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(freeze=True)[source]
goto(idx)[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])
freeze_camera(freeze=True)[source]
goto(idx)[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])

Methods

finish_loading

async finish_loading()[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 2D 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