running a python function in bokeh when clicking on a button

Hello,

I would like to know if it is possible to use a button in bokeh to call a python scrip i.e. to run a function in python that would generate an excel without having to use CustomJS in callback ?

If you have any example to I could look at, that would be great.

Thanks a lot for your help !!

Best,

Patrick

Hi Patrick,

A lot depends on the context you are running Bokeh in. If you are rendering a visualization as an html page your options are limited to Javascript. If you are running Bokeh in a server, you have many more options obviously. Check out the documentation on the Bokeh server for details on server side callbacks:

http://bokeh.pydata.org/en/latest/docs/user_guide/server.html#callbacks-and-events

And if you are running Bokeh as a stateless app in Flask or Django (or any others) you can always define an endpoint that collects the results of your data viz (filters, sliders, datatables, etc.) and creates an excel file on the Python end.

If you can provide more details on your project I’m sure someone can help steer you in the right direction.

cheers,

Dennis

···

On Thu, Nov 24, 2016 at 11:21 AM PH [email protected] wrote:

Hello,

I would like to know if it is possible to use a button in bokeh to call a python scrip i.e. to run a function in python that would generate an excel without having to use CustomJS in callback ?

If you have any example to I could look at, that would be great.

Thanks a lot for your help !!

Best,

Patrick

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/128841ed-b27a-4ef6-920e-1f26f710815d%40continuum.io.

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

Thanks a lot for that Dennis.
I am running the code inside a bokeh server.

I am using a drop-down widget menu to select a value that I am getting back using the widget_menu.value.

I would like to have a button that will trigger a python function when I press it.

That function is running a scrip on its own with one parameter being the widget_menu.value.

That function will generate an excel outside of the bokeh server.

Cheers,

Patrick

···

On Fri, Nov 25, 2016 at 5:15 AM, Dennis O’Brien [email protected] wrote:

Hi Patrick,

A lot depends on the context you are running Bokeh in. If you are rendering a visualization as an html page your options are limited to Javascript. If you are running Bokeh in a server, you have many more options obviously. Check out the documentation on the Bokeh server for details on server side callbacks:

http://bokeh.pydata.org/en/latest/docs/user_guide/server.html#callbacks-and-events

And if you are running Bokeh as a stateless app in Flask or Django (or any others) you can always define an endpoint that collects the results of your data viz (filters, sliders, datatables, etc.) and creates an excel file on the Python end.

If you can provide more details on your project I’m sure someone can help steer you in the right direction.

cheers,

Dennis

On Thu, Nov 24, 2016 at 11:21 AM PH [email protected] wrote:

Hello,

I would like to know if it is possible to use a button in bokeh to call a python scrip i.e. to run a function in python that would generate an excel without having to use CustomJS in callback ?

If you have any example to I could look at, that would be great.

Thanks a lot for your help !!

Best,

Patrick

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/128841ed-b27a-4ef6-920e-1f26f710815d%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/CAPUwX3P52Tp4tamfeXjWRK6ZkC%2B0aME-zdFRdHsbuRx1MUqV1A%40mail.gmail.com.

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


Patrick Houel

96, Kensington High Street
London, W8 4SG

W London : +44-203-66-78763

W New-York :+1- 646-979-4838

M: +44-753-02-12963

[email protected]

Hi,
I found a way creating a button and button.on_click(update_button) where update_button is a function containing the function I wanted to run.

Problem solved.

Thanks.

···

On Friday, November 25, 2016 at 9:37:24 AM UTC, PH wrote:

Thanks a lot for that Dennis.
I am running the code inside a bokeh server.

I am using a drop-down widget menu to select a value that I am getting back using the widget_menu.value.

I would like to have a button that will trigger a python function when I press it.

That function is running a scrip on its own with one parameter being the widget_menu.value.

That function will generate an excel outside of the bokeh server.

Cheers,

Patrick

On Fri, Nov 25, 2016 at 5:15 AM, Dennis O’Brien [email protected] wrote:

Hi Patrick,

A lot depends on the context you are running Bokeh in. If you are rendering a visualization as an html page your options are limited to Javascript. If you are running Bokeh in a server, you have many more options obviously. Check out the documentation on the Bokeh server for details on server side callbacks:

http://bokeh.pydata.org/en/latest/docs/user_guide/server.html#callbacks-and-events

And if you are running Bokeh as a stateless app in Flask or Django (or any others) you can always define an endpoint that collects the results of your data viz (filters, sliders, datatables, etc.) and creates an excel file on the Python end.

If you can provide more details on your project I’m sure someone can help steer you in the right direction.

cheers,

Dennis

On Thu, Nov 24, 2016 at 11:21 AM PH [email protected] wrote:

Hello,

I would like to know if it is possible to use a button in bokeh to call a python scrip i.e. to run a function in python that would generate an excel without having to use CustomJS in callback ?

If you have any example to I could look at, that would be great.

Thanks a lot for your help !!

Best,

Patrick

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/128841ed-b27a-4ef6-920e-1f26f710815d%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/CAPUwX3P52Tp4tamfeXjWRK6ZkC%2B0aME-zdFRdHsbuRx1MUqV1A%40mail.gmail.com.

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

Patrick Houel

96, Kensington High Street
London, W8 4SG

W London : +44-203-66-78763

W New-York :+1- 646-979-4838

M: +44-753-02-12963

[email protected]

Hi!
Is it possible for you to upload your code? I have the same problem and cant figure it out…

fredag 25. november 2016 15.47.35 UTC+1 skrev PH følgende:

···

Hi,
I found a way creating a button and button.on_click(update_button) where update_button is a function containing the function I wanted to run.

Problem solved.

Thanks.

On Friday, November 25, 2016 at 9:37:24 AM UTC, PH wrote:

Thanks a lot for that Dennis.
I am running the code inside a bokeh server.

I am using a drop-down widget menu to select a value that I am getting back using the widget_menu.value.

I would like to have a button that will trigger a python function when I press it.

That function is running a scrip on its own with one parameter being the widget_menu.value.

That function will generate an excel outside of the bokeh server.

Cheers,

Patrick

On Fri, Nov 25, 2016 at 5:15 AM, Dennis O’Brien [email protected] wrote:

Hi Patrick,

A lot depends on the context you are running Bokeh in. If you are rendering a visualization as an html page your options are limited to Javascript. If you are running Bokeh in a server, you have many more options obviously. Check out the documentation on the Bokeh server for details on server side callbacks:

http://bokeh.pydata.org/en/latest/docs/user_guide/server.html#callbacks-and-events

And if you are running Bokeh as a stateless app in Flask or Django (or any others) you can always define an endpoint that collects the results of your data viz (filters, sliders, datatables, etc.) and creates an excel file on the Python end.

If you can provide more details on your project I’m sure someone can help steer you in the right direction.

cheers,

Dennis

On Thu, Nov 24, 2016 at 11:21 AM PH [email protected] wrote:

Hello,

I would like to know if it is possible to use a button in bokeh to call a python scrip i.e. to run a function in python that would generate an excel without having to use CustomJS in callback ?

If you have any example to I could look at, that would be great.

Thanks a lot for your help !!

Best,

Patrick

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/128841ed-b27a-4ef6-920e-1f26f710815d%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/CAPUwX3P52Tp4tamfeXjWRK6ZkC%2B0aME-zdFRdHsbuRx1MUqV1A%40mail.gmail.com.

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

Patrick Houel

96, Kensington High Street
London, W8 4SG

W London : +44-203-66-78763

W New-York :+1- 646-979-4838

M: +44-753-02-12963

[email protected]