control module¶
LavaVu python interface
Interactive HTML UI controls library These functions can be called from the ControlFactory provided on
lavavu.Viewer()
lavavu.Object()
lavavu.Properties()
Some work only on the viewer and some only to objects and some to both. Each will provide a control that allows modifying visualisation properties or executing commands interactively in an IPython notebook environment
Example¶
Create a Button control to execute a rotation command:
>>> lv = lavavu.Viewer()
>>> lv.control.Button('rotate x 1')
Create a Range control to adjust the pointsize property:
>>> lv = lavavu.Viewer()
>>> pts = lv.points()
>>> pts.control.Range('pointsize', range=[1, 10])
For convenience, controls to set visualisation properties can often be created by calling control directly with the property name This will create a control of the default type for for that property if one is defined, e.g.
>>> lv = lavavu.Viewer()
>>> pts = lv.points()
>>> pts.control('pointsize')
Module Summary¶
classes:¶
A push button control to execute a defined command |
|
A checkbox control for a boolean value |
|
A colour picker for setting colour properties |
|
A colourmap list selector, populated by the default colour maps |
|
A colourmap list selector, populated by the available colour maps, combined with a colourmap editor for the selected colour map |
|
A generic input control for executing command strings |
|
A divider element |
|
A set of two range slider controls for adjusting a minimum and maximum range |
|
A generic input control for string values |
|
A file picker control |
|
A set of two range slider controls for adjusting a minimum and maximum filter range |
|
A colourmap editor |
|
A list of predefined input values to set properties or run commands |
|
A basic numerical input control |
|
A set of two numeric controls for adjusting a 2D value |
|
A set of three numeric controls for adjusting a 3D value |
|
A set of checkbox controls for controlling visibility of all visualisation objects |
|
A list selector of all visualisation objects that can be used to choose the target of a set of controls |
|
Creates a control panel with an interactive viewer window and a set of controls placed to the left with the viewer aligned to the right |
|
A slider control for a range of values |
|
A set of two range slider controls for adjusting a 2D value |
|
A set of three range slider controls for adjusting a 3D value |
|
A set of six buttons for adjusting a 3D rotation |
|
Creates a group of controls with tabs that can be shown or hidden |
|
A time step selection range control with up/down buttons |
|
Creates an interaction window with an image of the viewer frame and webgl controller for rotation/translation |
Module Details¶
classes:¶
- class Button(target, command, label=None)[source]¶
Bases:
_Control
A push button control to execute a defined command
- class Checkbox(target, property=None, command=None, value=None, label=None, index=None, readproperty=None)[source]¶
Bases:
_Control
A checkbox control for a boolean value
- class Colour(*args, **kwargs)[source]¶
Bases:
_Control
A colour picker for setting colour properties
- class ColourMapList(target, selection=None, *args, **kwargs)[source]¶
Bases:
List
A colourmap list selector, populated by the default colour maps
- class ColourMaps(target, *args, **kwargs)[source]¶
Bases:
_MultiControl
A colourmap list selector, populated by the available colour maps, combined with a colourmap editor for the selected colour map
- class Command(*args, **kwargs)[source]¶
Bases:
_Control
A generic input control for executing command strings
- class Divider(target, property=None, command=None, value=None, label=None, index=None, readproperty=None)[source]¶
Bases:
_Control
A divider element
- class DualRange(target, properties, values=[None, None], label=None, range=(0.0, 1.0), step=None)[source]¶
Bases:
_MultiControl
A set of two range slider controls for adjusting a minimum and maximum range
- Parameters:
range (list or tuple) – Min/max values for the range
- class Entry(target, property=None, command=None, value=None, label=None, index=None, readproperty=None)[source]¶
Bases:
_Control
A generic input control for string values
- class File(command='file', directory=False, multiple=False, accept='', *args, **kwargs)[source]¶
Bases:
_Control
A file picker control
Unfortunately there is no way to get the file path
- class Filter(target, filteridx, label=None, range=None, step=None)[source]¶
Bases:
DualRange
A set of two range slider controls for adjusting a minimum and maximum filter range
- Parameters:
range (list or tuple) – Min/max values for the filter range
- class List(target, property=None, options=None, *args, **kwargs)[source]¶
Bases:
_Control
A list of predefined input values to set properties or run commands
- Parameters:
options (list) – List of the available value strings
- class Number(target=None, property=None, command=None, value=None, label=None, index=None, step=None, readproperty=None)[source]¶
Bases:
_Control
A basic numerical input control
- class Number2D(target, property, label=None, step=None, *args, **kwargs)[source]¶
Bases:
_MultiControl
A set of two numeric controls for adjusting a 2D value
- class Number3D(target, property, label=None, step=None, *args, **kwargs)[source]¶
Bases:
_MultiControl
A set of three numeric controls for adjusting a 3D value
- class ObjectList(viewer, *args, **kwargs)[source]¶
Bases:
_MultiControl
A set of checkbox controls for controlling visibility of all visualisation objects
- class ObjectSelect(viewer, objects=None, *args, **kwargs)[source]¶
Bases:
_Container
A list selector of all visualisation objects that can be used to choose the target of a set of controls
- Parameters:
objects (list) – A list of objects to display, by default all available objects are added
- class Panel(*args, **kwargs)[source]¶
Bases:
Window
Creates a control panel with an interactive viewer window and a set of controls placed to the left with the viewer aligned to the right
- class Range(target=None, property=None, command=None, value=None, label=None, index=None, range=None, step=None, readproperty=None)[source]¶
Bases:
_Control
A slider control for a range of values
- Parameters:
range (list or tuple) – Min/max values for the range
- class Range2D(target, property, label=None, value=None, range=(0.0, 1.0), step=None, *args, **kwargs)[source]¶
Bases:
_MultiControl
A set of two range slider controls for adjusting a 2D value
- Parameters:
range (list or tuple) – Min/max values for the ranges
- class Range3D(target, property, label=None, value=None, range=(0.0, 1.0), step=None, *args, **kwargs)[source]¶
Bases:
_MultiControl
A set of three range slider controls for adjusting a 3D value
- Parameters:
range (list or tuple) – Min/max values for the ranges
- class Rotation(target, *args, **kwargs)[source]¶
Bases:
_MultiControl
A set of six buttons for adjusting a 3D rotation
- class Tabs(target, buttons=True)[source]¶
Bases:
_Container
Creates a group of controls with tabs that can be shown or hidden
- Parameters:
buttons (boolean) – Display the tab buttons for switching tabs
- class TimeStepper(viewer, *args, **kwargs)[source]¶
Bases:
Range
A time step selection range control with up/down buttons
- class Window(viewer, resolution=None, align='left', wrapper='', fullscreen=False)[source]¶
Bases:
_Container
Creates an interaction window with an image of the viewer frame and webgl controller for rotation/translation
- Parameters:
align (str) – Set to “left/right” to align viewer window, default is left. Set to None to skip.
wrapper (str) – Set the style of the wrapper div, default is empty string so wrapper is enabled with no custom style Set to None to disable wrapper