Button disable

I have a button and when I set it to disable it will “gray” out and be disabled, but when I set the disable property to False it will not be enabled again.

button = Toggle(label=“Update Graph”, type=“success”)

button.disabled=True # this works

button.disabled=False # this does not work.

What I am doing is having a form where I select data from a database. Then the button graphs the data. Since I have three graphs with 200k points it takes a long time to draw graphs. So I disable the button until the data is plotted, then renable the button, however this does not appear to work.

This might be a bug then, I'd suggest you post a GH issue with as much information as possible, versions, platform, etc. and especially a minimum complete example that duplicates the problem.

Thanks,

Bryan

···

On Jun 20, 2016, at 7:23 AM, Trampas Stern <[email protected]> wrote:

I have a button and when I set it to disable it will "gray" out and be disabled, but when I set the disable property to False it will not be enabled again.

button = Toggle(label="Update Graph", type="success")
button.disabled=True # this works
button.disabled=False # this does not work.

What I am doing is having a form where I select data from a database. Then the button graphs the data. Since I have three graphs with 200k points it takes a long time to draw graphs. So I disable the button until the data is plotted, then renable the button, however this does not appear to work.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CADqjcygNjpBUH6Z-9eyXng%3D-XP-qu15AhF6h%3DTBxMG7z%2BqmepA%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

@Tra mpas I definitely encourage you to
submit an issue.

This may be fixed in 0.12.

···

On 6/20/16 6:36 AM, Bryan Van de Ven
wrote:


This might be a bug then, I'd suggest you post a GH issue with as much information as possible, versions, platform, etc. and especially a minimum complete example that duplicates the problem.
Thanks,
Bryan

On Jun 20, 2016, at 7:23 AM, Trampas Stern wrote:
I have a button and when I set it to disable it will "gray" out and be disabled, but when I set the disable property to False it will not be enabled again. button = Toggle(label="Update Graph", type="success")
button.disabled=True # this works
button.disabled=False # this does not work. What I am doing is having a form where I select data from a database. Then the button graphs the data. Since I have three graphs with 200k points it takes a long time to draw graphs. So I disable the button until the data is plotted, then renable the button, however this does not appear to work. -- You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to .
To post to this group, send email to .
To view this discussion on the web visit .
For more options, visit .


Sarah Bird
Developer, Bokeh

    [
      ![Continuum Analytics](http://docs.continuum.io/_static/img/ContinuumWordmark.png)
    ](http://continuum.io)

[email protected][email protected]@continuum.iohttps://groups.google.com/a/continuum.io/d/msgid/bokeh/CADqjcygNjpBUH6Z-9eyXng%3D-XP-qu15AhF6h%3DTBxMG7z%2BqmepA%40mail.gmail.comhttps://groups.google.com/a/continuum.io/d/optout

I am not sure how to create an issue. However below is an example of the problem for using the toggle button example:

The relevant code is the following:

def toggle_handler(active):

toggle.disabled=True

print(“toggle_handler: %s” % active)

toggle.disabled=False

What I am personally doing with Bokeh is graphing a large set of data three graphs with 500k points each. So Bokeh is very slow to update the graphs so I created a button to update graphs (as opposed to periodic updates). I wanted it such that when you press button it would update graphs but disable button until graph is done.

I am considering going back to matplotlib as that the graphing is way too slow on bokeh.

from future import print_function

from bokeh.client import push_session

from bokeh.document import Document

from bokeh.models import VBox

from bokeh.models.widgets import (

Icon, Button, Toggle, Dropdown, CheckboxGroup, RadioGroup,

CheckboxButtonGroup, RadioButtonGroup,

)

def button_handler():

print(“button_handler: click”)

def toggle_handler(active):

toggle.disabled=True

print(“toggle_handler: %s” % active)

toggle.disabled=False

def dropdown_handler(value):

print(“dropdown_handler: %s” % value)

def split_handler(value):

print(“split_handler: %s” % value)

def checkbox_group_handler(active):

print(“checkbox_group_handler: %s” % active)

def radio_group_handler(active):

print(“radio_group_handler: %s” % active)

def checkbox_button_group_handler(active):

print(“checkbox_button_group_handler: %s” % active)

def radio_button_group_handler(active):

print(“radio_button_group_handler: %s” % active)

button = Button(label=“Push button”, icon=Icon(icon_name=“check”), type=“primary”)

button.on_click(button_handler)

toggle = Toggle(label=“Toggle button”, type=“success”)

toggle.on_click(toggle_handler)

menu = [(“Item 1”, “item_1”), (“Item 2”, “item_2”), None, (“Item 3”, “item_3”)]

dropdown = Dropdown(label=“Dropdown button”, type=“warning”, menu=menu)

dropdown.on_click(dropdown_handler)

menu = [(“Item 1”, “foo”), (“Item 2”, “bar”), None, (“Item 3”, “baz”)]

split = Dropdown(label=“Split button”, type=“danger”, menu=menu, default_value=“baz”)

split.on_click(split_handler)

checkbox_group = CheckboxGroup(labels=[“Option 1”, “Option 2”, “Option 3”], active=[0, 1])

checkbox_group.on_click(checkbox_group_handler)

radio_group = RadioGroup(labels=[“Option 1”, “Option 2”, “Option 3”], active=0)

radio_group.on_click(radio_group_handler)

checkbox_button_group = CheckboxButtonGroup(labels=[“Option 1”, “Option 2”, “Option 3”], active=[0, 1])

checkbox_button_group.on_click(checkbox_button_group_handler)

radio_button_group = RadioButtonGroup(labels=[“Option 1”, “Option 2”, “Option 3”], active=0)

radio_button_group.on_click(radio_button_group_handler)

vbox = VBox(children=[button, toggle, dropdown, split, checkbox_group, radio_group, checkbox_button_group, radio_button_group])

document = Document()

document.add_root(vbox)

session = push_session(document)

session.show()

if name == “main”:

session.loop_until_closed()

···

On Thu, Jun 23, 2016 at 5:27 AM, Sarah Bird - Continuum [email protected] wrote:

@Tra mpas I definitely encourage you to
submit an issue.

This may be fixed in 0.12.

  On 6/20/16 6:36 AM, Bryan Van de Ven

wrote:


This might be a bug then, I'd suggest you post a GH issue with as much information as possible, versions, platform, etc. and especially a minimum complete example that duplicates the problem.
Thanks,
Bryan
On Jun 20, 2016, at 7:23 AM, Trampas Stern <[email protected]> wrote:
I have a button and when I set it to disable it will "gray" out and be disabled, but when I set the disable property to False it will not be enabled again. button = Toggle(label="Update Graph", type="success")
button.disabled=True # this works
button.disabled=False # this does not work. What I am doing is having a form where I select data from a database. Then the button graphs the data. Since I have three graphs with 200k points it takes a long time to draw graphs. So I disable the button until the data is plotted, then renable the button, however this does not appear to work. -- You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/CADqjcygNjpBUH6Z-9eyXng%3D-XP-qu15AhF6h%3DTBxMG7z%2BqmepA%40mail.gmail.com](https://groups.google.com/a/continuum.io/d/msgid/bokeh/CADqjcygNjpBUH6Z-9eyXng%3D-XP-qu15AhF6h%3DTBxMG7z%2BqmepA%40mail.gmail.com).
For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).


Sarah Bird
Developer, Bokeh

    [
      ![Continuum Analytics](http://docs.continuum.io/_static/img/ContinuumWordmark.png)
    ](http://continuum.io)

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ef29056b-e07f-ff09-09d1-45e3d1251130%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Sending 500k points to the browser will be slow, there is really nothing Bokeh can do about that. This is why the datashader project exists, to provide fast, perceptually accurate out-of-browser rendering of large datasets. It integrates very well with Bokeh, only needing to send the final results (which are much smaller), to the browser. It has been demonstrated interactively on hundreds of mllions of points, but can also do out of core operations on data sets up to billions of points.

  GitHub - holoviz/datashader: Quickly and accurately render even the largest data.

Thanks

Bryan

···

On Jun 23, 2016, at 6:17 AM, Trampas Stern <[email protected]> wrote:

I am not sure how to create an issue. However below is an example of the problem for using the toggle button example:

The relevant code is the following:

def toggle_handler(active):
    toggle.disabled=True
    print("toggle_handler: %s" % active)
    toggle.disabled=False

What I am personally doing with Bokeh is graphing a large set of data three graphs with 500k points each. So Bokeh is very slow to update the graphs so I created a button to update graphs (as opposed to periodic updates). I wanted it such that when you press button it would update graphs but disable button until graph is done.

I am considering going back to matplotlib as that the graphing is way too slow on bokeh.

from __future__ import print_function

from bokeh.client import push_session
from bokeh.document import Document
from bokeh.models import VBox
from bokeh.models.widgets import (
    Icon, Button, Toggle, Dropdown, CheckboxGroup, RadioGroup,
    CheckboxButtonGroup, RadioButtonGroup,
)

def button_handler():
    print("button_handler: click")

def toggle_handler(active):
    toggle.disabled=True
    print("toggle_handler: %s" % active)
    toggle.disabled=False

def dropdown_handler(value):
    print("dropdown_handler: %s" % value)

def split_handler(value):
    print("split_handler: %s" % value)

def checkbox_group_handler(active):
    print("checkbox_group_handler: %s" % active)

def radio_group_handler(active):
    print("radio_group_handler: %s" % active)

def checkbox_button_group_handler(active):
    print("checkbox_button_group_handler: %s" % active)

def radio_button_group_handler(active):
    print("radio_button_group_handler: %s" % active)

button = Button(label="Push button", icon=Icon(icon_name="check"), type="primary")
button.on_click(button_handler)

toggle = Toggle(label="Toggle button", type="success")
toggle.on_click(toggle_handler)

menu = [("Item 1", "item_1"), ("Item 2", "item_2"), None, ("Item 3", "item_3")]
dropdown = Dropdown(label="Dropdown button", type="warning", menu=menu)
dropdown.on_click(dropdown_handler)

menu = [("Item 1", "foo"), ("Item 2", "bar"), None, ("Item 3", "baz")]
split = Dropdown(label="Split button", type="danger", menu=menu, default_value="baz")
split.on_click(split_handler)

checkbox_group = CheckboxGroup(labels=["Option 1", "Option 2", "Option 3"], active=[0, 1])
checkbox_group.on_click(checkbox_group_handler)

radio_group = RadioGroup(labels=["Option 1", "Option 2", "Option 3"], active=0)
radio_group.on_click(radio_group_handler)

checkbox_button_group = CheckboxButtonGroup(labels=["Option 1", "Option 2", "Option 3"], active=[0, 1])
checkbox_button_group.on_click(checkbox_button_group_handler)

radio_button_group = RadioButtonGroup(labels=["Option 1", "Option 2", "Option 3"], active=0)
radio_button_group.on_click(radio_button_group_handler)

vbox = VBox(children=[button, toggle, dropdown, split, checkbox_group, radio_group, checkbox_button_group, radio_button_group])

document = Document()
document.add_root(vbox)
session = push_session(document)
session.show()

if __name__ == "__main__":
    session.loop_until_closed()

On Thu, Jun 23, 2016 at 5:27 AM, Sarah Bird - Continuum <[email protected]> wrote:
@Trampas I definitely encourage you to submit an issue.

This may be fixed in 0.12.

On 6/20/16 6:36 AM, Bryan Van de Ven wrote:

This might be a bug then, I'd suggest you post a GH issue with as much information as possible, versions, platform, etc. and especially a minimum complete example that duplicates the problem.

Thanks,

Bryan

On Jun 20, 2016, at 7:23 AM, Trampas Stern <[email protected]> >>> wrote:

I have a button and when I set it to disable it will "gray" out and be disabled, but when I set the disable property to False it will not be enabled again.

button = Toggle(label="Update Graph", type="success")
button.disabled=True # this works
button.disabled=False # this does not work.

What I am doing is having a form where I select data from a database. Then the button graphs the data. Since I have three graphs with 200k points it takes a long time to draw graphs. So I disable the button until the data is plotted, then renable the button, however this does not appear to work.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
[email protected]
.
To post to this group, send email to
[email protected]
.
To view this discussion on the web visit
https://groups.google.com/a/continuum.io/d/msgid/bokeh/CADqjcygNjpBUH6Z-9eyXng%3D-XP-qu15AhF6h%3DTBxMG7z%2BqmepA%40mail.gmail.com
.
For more options, visit
https://groups.google.com/a/continuum.io/d/optout
.

--
Sarah Bird
Developer, Bokeh

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ef29056b-e07f-ff09-09d1-45e3d1251130%40continuum.io\.

For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CADqjcyjwMWdx0KcsNkPK5RJ%3DH8V%3DxX5zMebCaY5DoNND0PzvOw%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.