SliderMapper¶
- class spectacoular.factory.SliderMapper(obj, traitname)¶
Bases:
TraitWidgetMapper
Factory that creates
Slider
widget from a class trait attribute.- create_widget(**kwargs)¶
creates a Bokeh
Slider
widget instance from class trait attribute.Currently, only attributes of type
Range
are supported.- Parameters:
- **kwargsargs of Slider
additional arguments of Slider widget. :attr:´value´, :attr:´start´ and :attr:´end´ are of type float
- Returns:
- instance(Slider).
- set_widget(widget)¶
connects a Bokeh Slider widget instance to a class trait attribute
- Parameters:
- widgetinstance(Slider)
instance of a Slider 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.