pymor.discretizers.builtin.gui.jupyter.kthreed

Module Contents

class pymor.discretizers.builtin.gui.jupyter.kthreed.VectorArrayPlot(grid, U, codim, color_range, color_map, warp, bounding_box, show_mesh, *args, **kwargs)[source]

Bases: k3d.plot.Plot

Main K3D widget.

antialias[source]

int: Enable antialiasing in WebGL renderer, changes have no effect after displaying.

logarithmic_depth_buffer[source]

bool. Enables logarithmic_depth_buffer in WebGL renderer.

height[source]

int: Height of the Widget in pixels, changes have no effect after displaying.

background_color[source]

int. Packed RGB color of the plot background (0xff0000 is red, 0xff is blue), -1 is for transparent.

camera_auto_fit[source]

bool. Enable automatic camera setting after adding, removing or changing a plot object.

grid_auto_fit[source]

bool. Enable automatic adjustment of the plot grid to contained objects.

grid_color[source]

int. Packed RGB color of the plot grids (0xff0000 is red, 0xff is blue).

grid_visible[source]

bool. Enable or disable grid.

screenshot_scale[source]

Float. Multiplier to screenshot resolution.

voxel_paint_color[source]

int. The (initial) integer value to be inserted when editing voxels.

label_color[source]

int. Packed RGB color of the labels (0xff0000 is red, 0xff is blue).

lighting[source]

Float. Lighting factor.

grid[source]

array_like. 6-element tuple specifying the bounds of the plot grid (x0, y0, z0, x1, y1, z1).

camera[source]

array_like. 9-element list or array specifying camera position.

camera_no_rotate[source]

Bool. Lock for camera rotation.

camera_no_zoom[source]

Bool. Lock for camera zoom.

camera_no_pan[source]

Bool. Lock for camera pan.

camera_rotate_speed[source]

Float. Speed of camera rotation.

camera_zoom_speed[source]

Float. Speed of camera zoom.

camera_pan_speed[source]

Float. Speed of camera pan.

camera_fov[source]

Float. Camera Field of View.

camera_damping_factor[source]

Float. Defines the intensity of damping. Default is 0 (disabled).

camera_up_axis[source]

str. Fixed up axis for camera.

Legal values are:

X:

x axis,

Y:

y axis,

Z:

z axis,

None:

Handling click_callback and hover_callback on some type of objects.

snapshot_type[source]

string. Can be ‘full’, ‘online’ or ‘inline’.

axes[source]

list. Axes labels for plot.

axes_helper[source]

Float. Axes helper size.

axes_helper_colors[source]

List. List of triple packed RGB color of the axes helper (0xff0000 is red, 0xff is blue).

time[source]

float. Time value (used in TimeSeries)

time_speed[source]

float. Time speed (used in TimeSeries)

name[source]

string. Name of the plot. Used to filenames of snapshot/screenshot etc.

mode[source]

str. Mode of K3D viewer.

Legal values are:

View:

No interaction with objects,

Add:

On voxels objects adding mode,

Change:

On voxels objects edit mode,

Callback:

Handling click_callback and hover_callback on some type of objects,

Manipulate:

Enable object transform widget.

camera_mode[source]

str. Mode of camera movement.

Legal values are:

Trackball:

orbit around point with dynamic up-vector of camera,

Orbit:

orbit around point with fixed up-vector of camera,

Fly:

orbit around point with dynamic up-vector of camera, mouse wheel also moves target point.

manipulate_mode[source]

str. Mode of manipulate widgets.

Legal values are:

Translate:

Translation widget,

Rotate:

Rotation widget,

Scale:

Scaling widget.

depth_peels[source]

int. Set the maximum number of peels to use. Disabled if zero.

auto_rendering[source]

Bool. State of auto rendering.

fps[source]

Float. Fps of animation.

minimum_fps[source]

Float. If negative then disabled. Set target FPS to adaptative resolution.

objects[source]

list. List of k3d.objects.Drawable currently included in the plot, not to be changed directly.

additional_js_code[source]

str. Additional Js code that will be run after plot is initialized

Methods

set

set(U, vmin, vmax, warp=None)[source]
pymor.discretizers.builtin.gui.jupyter.kthreed.visualize_k3d(grid, U, bounding_box=None, codim=2, title=None, legend=None, separate_colorbars=False, rescale_colorbars=False, columns=2, warp_by_scalar=True, scale_factor='auto', show_mesh=True, height=300, color_map=mpl.colormaps['viridis'], background_color=16777215, return_widget=True)[source]

Generate a k3d Plot 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.

  • UVectorArray 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.

  • warp_by_scalar – If True, visualize as a surface where the z-coordinate is determined by U.

  • scale_factor – If warp_by_scalar is enabled, the factor by which the values in U are scaled to obtain the z-coordinate. If set to 'auto', the scale factor is determined from the minimum/maximum values in U and the bounding_box.

  • show_mesh – If True and warp_by_scalar is enabled, additionally visualize the mesh in the (z=0)-plane.

  • height – Height of the subplots in pixels.

  • color_map – Matplotlib Colormap object or a K3D array((step, r, g, b)).

  • background_color – Background color of the plot.