1

Is there a way to style the individual buttons of a ButtonGroup (e.g CheckboxButtonGroup) in bokeh 2.3.0 server application? By styling, I mean giving different colors to each of the options.
My first question is, if this is generally possible by using a .css file? I only found information on styling one single button using a css-class.
Additionally, I would like to style them dynamically based on conditions in a callback like the following:

def change_color_of_button(attrname, old, new):
    if 0 in new:
        # MAKE THE BUTTON 0 DARK GREEN
        ...
    elif:
        # MAKE THE BUTTON 0 LIGHT GREEN
        ...
    if 1 in new:
        # MAKE THE BUTTON 1 DARK ORANGE
        ...
    elif:
        # MAKE THE BUTTON 1 LIGHT ORANGE
        ...
    ...

label_list = ['Option 1', 'Option 2', 'Option 3']
buttons = CheckboxButtonGroup(labels=label_list, active=[0])
buttons.on_change('active', change_color_of_button)

Thanks for any suggentsions.

EDIT:
Posted this question also on Bokeh Discourse.

Crysers
  • 455
  • 2
  • 13

0 Answers0