SpectAcoular documentation

SelectMapper

«  TextInputMapper   ::   factory   ::   SliderMapper  »

SelectMapper

class spectacoular.factory.SelectMapper(obj, traitname)

Bases: TraitWidgetMapper

Factory that creates Select widget from a class trait attribute.

create_widget(**kwargs)

creates a Bokeh Select widget instance

Parameters:
**kwargsargs of Select

additional arguments of Select widget.

Returns:
instance(Select).
set_widget(widget)

connects a Bokeh Select widget instance to a class trait attribute

Parameters:
widgetinstance(Select)

instance of a Select widget.

Returns:
None.
create_trait_setter_func()

creates a function that casts the type of a widget value into the type of the class trait attribute.

the function is evoked every time the widget value changes. The value of a Select, :class: TextInput, …, widget is always type str. However, traitvalues can be of arbitrary type. Thus, widgetvalues need to be casted.

Returns:
callable.
create_widget_setter_func(widgetproperty='value')

creates a function that casts a variable new into a valid type to be set as the widget value.

Returns:
callable.

«  TextInputMapper   ::   factory   ::   SliderMapper  »