CheckboxGroup widget on bokeh-sever mode

On bokeh-server mode, is there any example of using CheckboxGroup

I am aware of this post and the posted python code works fine in notebook but I can not make it work at the bokeh-server mode.

https://groups.google.com/a/continuum.io/forum/#!searchin/bokeh/checkbox/bokeh/RYZvt6Pc01I/uyCj-2kPZbQJ

It seems like nothing happens when it calls out checkbox_button_group_handler

def checkbox_button_group_handler(active):

print(“checkbox_button_group_handler: %s” % active)

select_item= CheckboxGroup(labels=[‘item1’, ‘item2’, ‘item3’,‘item4’,‘item5’,‘ALL’], active=[0])

select_item.on_click(checkbox_button_group_handler)

The code has been attached to describe better the problem.

TJ

google_map_app_simple_checkbox.py (24.3 KB)

Hi TJ

Any progress on it?

Now I also need to use CheckboxButtonGroup or CheckboxGroup to control my plots in Bokeh like following, however, I cannot make it work either. Nothing happens when I click the checkboxes.

Create the widget

checkbox_group=CheckboxGroup(labels=my_ylabels,active=[0,1])

# Set up the callback

def update_fig1(attrname, old, new):

            for n,nm in enumerate(['last_data','avg_data']):

sel=fig1.select(dict(name=nm))

sel[0].glyph.line_alpha= 1 if n in checkbox_group.active else 0

logging.debug(nm,“is”, “plotted” if n in checkbox_group.active else “hidden” )

checkbox_group.on_change(‘active’,update_fig1)

``

If you have some progress, would you like to share with me?

Thanks

B. R.

Gongming

···

On Sunday, August 9, 2015 at 2:38:32 PM UTC+8, TJ wrote:

On bokeh-server mode, is there any example of using CheckboxGroup

I am aware of this post and the posted python code works fine in notebook but I can not make it work at the bokeh-server mode.

https://groups.google.com/a/continuum.io/forum/#!searchin/bokeh/checkbox/bokeh/RYZvt6Pc01I/uyCj-2kPZbQJ

It seems like nothing happens when it calls out checkbox_button_group_handler

def checkbox_button_group_handler(active):

print(“checkbox_button_group_handler: %s” % active)

select_item= CheckboxGroup(labels=[‘item1’, ‘item2’, ‘item3’,‘item4’,‘item5’,‘ALL’], active=[0])

select_item.on_click(checkbox_button_group_handler)

TJ,

What is your server update time? This looks very much to the issue that I’m having here: Redirecting to Google Groups

It looks like the button state is not read below about 200ms - and this depends on your computer speed. Could be much slower for you.

I am very interested in finding a solution to this, please post if you find one.

···

On Sunday, 9 August 2015 02:38:32 UTC-4, TJ wrote:

On bokeh-server mode, is there any example of using CheckboxGroup

I am aware of this post and the posted python code works fine in notebook but I can not make it work at the bokeh-server mode.

https://groups.google.com/a/continuum.io/forum/#!searchin/bokeh/checkbox/bokeh/RYZvt6Pc01I/uyCj-2kPZbQJ

It seems like nothing happens when it calls out checkbox_button_group_handler

def checkbox_button_group_handler(active):

print(“checkbox_button_group_handler: %s” % active)

select_item= CheckboxGroup(labels=[‘item1’, ‘item2’, ‘item3’,‘item4’,‘item5’,‘ALL’], active=[0])

select_item.on_click(checkbox_button_group_handler)