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 but not for a CheckboxButtonGroup
.
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)
Is there a way to achieve this?
Edit:
I also posted this question on StackOverflow.