This docs on this page refers to a PREVIOUS VERSION. For the latest stable release, go to https://docs.bokeh.org/

Archived docs for versions <= 1.0.4 have had to be modified from their original published configuration, and may be missing some features (e.g. source listing)

All users are encourage to update to version 1.1 or later, as soon as they are able.

bokeh.models.widgets.groups — Bokeh 1.0.2 documentation

Source code for bokeh.models.widgets.groups

'''

'''
from __future__ import absolute_import

from ...core.has_props import abstract
from ...core.properties import Bool, Instance, Int, List, String

from ..callbacks import Callback

from .buttons import ButtonLike
from .widget import Widget

[docs]@abstract class AbstractGroup(Widget): ''' Abstract base class for all kinds of groups. ''' labels = List(String, help=""" List of text labels contained in this group. """)
[docs] def on_click(self, handler): ''' Set up a handler for button check/radio box clicks including the selected indices. Args: handler (func) : handler function to call when button is clicked. Returns: None ''' self.on_change('active', lambda attr, old, new: handler(new))
[docs] def js_on_click(self, handler): ''' Set up a handler for button check/radio box clicks including the selected indices. ''' self.js_on_change('active', handler)
callback = Instance(Callback, help=""" A callback to run in the browser whenever a button group is manipulated. """)
[docs]@abstract class ButtonGroup(AbstractGroup, ButtonLike): ''' Abstract base class for groups with items rendered as buttons. '''
[docs]@abstract class Group(AbstractGroup): ''' Abstract base class for groups with items rendered as check/radio boxes. ''' inline = Bool(False, help=""" Should items be arrange vertically (``False``) or horizontally in-line (``True``). """)
[docs]class CheckboxGroup(Group): ''' A group of check boxes. ''' active = List(Int, help=""" The list of indices of selected check boxes. """)
[docs]class RadioGroup(Group): ''' A group of radio boxes. ''' active = Int(None, help=""" The index of the selected radio box, or ``None`` if nothing is selected. """)
[docs]class CheckboxButtonGroup(ButtonGroup): ''' A group of check boxes rendered as toggle buttons. ''' active = List(Int, help=""" The list of indices of selected check boxes. """)
[docs]class RadioButtonGroup(ButtonGroup): ''' A group of radio boxes rendered as toggle buttons. ''' active = Int(None, help=""" The index of the selected radio box, or ``None`` if nothing is selected. """)