Toggle line plot(s)

Hi guys,

Is there already a way to make a multi line plot and have a way to toggle which line is to be shown ?

like a nice

LINE 1
LINE 2

checkbox stuff ?

The final idea would be to make some kind of a dashboard where users can define which data they want to appear…

Cheers

Tom

We recently introduce the concept of widgets inside Bokeh.
Essentially to do what you want.
You will need to use the nightly build or the git master to use them, but they will be available in the next release 5.0 (in a few days) too.
You can see some examples in the example directory: population_server.py, taylor_server.py, etc.
You have also the app folder, where you will find some (dashboard-like) bokeh-based apps examples.
All these examples are server-based.

Cheers.

Hi guys,

Is there already a way to make a multi line plot and have a way to toggle which line is to be shown ?

like a nice

LINE 1
LINE 2

checkbox stuff ?

The final idea would be to make some kind of a dashboard where users can define which data they want to appear…

Cheers

Tom

···

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/d4f0d6fb-f31a-4bfc-9c8a-0870fdff92d7%40continuum.io.

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

I would just add to this that currently using the widgets does require using a bokeh-server. We'd like to expose a "function" interface from python so that some use of widgets could happened in standalone apps as well. But in the mean time, if you want standalone page without a bokeh-server, what you describe could probably be accomplished by creating your plots in python, and then adding a small amount of JS ui code to the page that fiddles with the renderers by hand to turn them on or off. This kind of "hybrid" development has been used before by a few folks on the list. Also this kind of checkbox selection might make a nice tool addition to Bokeh.

Bryan

···

On Jun 23, 2014, at 8:14 AM, Damian Avila <[email protected]> wrote:

We recently introduce the concept of widgets inside Bokeh.
Essentially to do what you want.
You will need to use the nightly build or the git master to use them, but they will be available in the next release 5.0 (in a few days) too.
You can see some examples in the example directory: population_server.py, taylor_server.py, etc.
You have also the app folder, where you will find some (dashboard-like) bokeh-based apps examples.
All these examples are server-based.

Cheers.
Hi guys,

Is there already a way to make a multi line plot and have a way to toggle which line is to be shown ?

like a nice

LINE 1
LINE 2
...

checkbox stuff ?

The final idea would be to make some kind of a dashboard where users can define which data they want to appear..

Cheers

Tom

--
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/d4f0d6fb-f31a-4bfc-9c8a-0870fdff92d7%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/CAM9Ly3EA4FmZGZb3GaNhiVN0h74vtrzGa-j5buJUD1EsuBK%3DMw%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

I have built two JS applications around bokeh that include this functionality. I do think that this should be a widget or a tool. As a widget, we should be able to specify a css selector that the widget will attach itself to in the DOM. The widget implimentation would also be helpful to show how to add and remove renderers from a plot. I have found it’s quite tricky to remove renderers from a plot. With my latest app that I’m building around bokehJS, I just completely recreate the plot for every renderer change because that is reliable.

Paddy

···

On Mon, Jun 23, 2014 at 9:35 AM, Bryan Van de Ven [email protected] wrote:

I would just add to this that currently using the widgets does require using a bokeh-server. We’d like to expose a “function” interface from python so that some use of widgets could happened in standalone apps as well. But in the mean time, if you want standalone page without a bokeh-server, what you describe could probably be accomplished by creating your plots in python, and then adding a small amount of JS ui code to the page that fiddles with the renderers by hand to turn them on or off. This kind of “hybrid” development has been used before by a few folks on the list. Also this kind of checkbox selection might make a nice tool addition to Bokeh.

Bryan

On Jun 23, 2014, at 8:14 AM, Damian Avila [email protected] wrote:

We recently introduce the concept of widgets inside Bokeh.

Essentially to do what you want.

You will need to use the nightly build or the git master to use them, but they will be available in the next release 5.0 (in a few days) too.

You can see some examples in the example directory: population_server.py, taylor_server.py, etc.

You have also the app folder, where you will find some (dashboard-like) bokeh-based apps examples.

All these examples are server-based.

Cheers.

Hi guys,

Is there already a way to make a multi line plot and have a way to toggle which line is to be shown ?

like a nice

LINE 1

LINE 2

checkbox stuff ?

The final idea would be to make some kind of a dashboard where users can define which data they want to appear…

Cheers

Tom

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/d4f0d6fb-f31a-4bfc-9c8a-0870fdff92d7%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/CAM9Ly3EA4FmZGZb3GaNhiVN0h74vtrzGa-j5buJUD1EsuBK%3DMw%40mail.gmail.com.

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/AADBF0C5-4B02-4A08-AB74-3DCC8694F7EC%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

What were some of the issues you ran into while trying to remove renderers from a plot? Were they related to other things holding on to refs, or were they related to knowing all the things that needed to have their renderer references updated, or…?

Thanks,

Peter

···

On Monday, June 23, 2014 9:46:00 AM UTC-5, Paddy Mullen wrote:

I have built two JS applications around bokeh that include this functionality. I do think that this should be a widget or a tool. As a widget, we should be able to specify a css selector that the widget will attach itself to in the DOM. The widget implimentation would also be helpful to show how to add and remove renderers from a plot. I have found it’s quite tricky to remove renderers from a plot.

It is difficult to get a reference to the renderer that you want. This would be easier with an object query system.

There should be a remove_renderer method on plot. I have updated the model by taking the raw list of renderers and removing the one that I no longer wanted there, but that is tricky.

Once the renderer is removed, I have run into issues, especially with legends if I remember properly. I had to completely recreate the Legend object each time I added or removed a renderer because it had stale references.

I think a standalone column on/off tool would expose a lot of these issues pretty quickly. For the next set of bugs, have the tool change the color of renderers.

Paddy

···

On Mon, Jun 23, 2014 at 11:57 AM, pwang [email protected] wrote:

On Monday, June 23, 2014 9:46:00 AM UTC-5, Paddy Mullen wrote:

I have built two JS applications around bokeh that include this functionality. I do think that this should be a widget or a tool. As a widget, we should be able to specify a css selector that the widget will attach itself to in the DOM. The widget implimentation would also be helpful to show how to add and remove renderers from a plot. I have found it’s quite tricky to remove renderers from a plot.

What were some of the issues you ran into while trying to remove renderers from a plot? Were they related to other things holding on to refs, or were they related to knowing all the things that needed to have their renderer references updated, or…?

Thanks,

Peter

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/285d8257-d258-4486-89de-fd89ba857c7c%40continuum.io.

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

Was this checkbox to add/remove lines feature ever implemented? If so, is there an example?

···

On Monday, 23 June 2014 12:08:53 UTC-4, Paddy Mullen wrote:

It is difficult to get a reference to the renderer that you want. This would be easier with an object query system.

There should be a remove_renderer method on plot. I have updated the model by taking the raw list of renderers and removing the one that I no longer wanted there, but that is tricky.

Once the renderer is removed, I have run into issues, especially with legends if I remember properly. I had to completely recreate the Legend object each time I added or removed a renderer because it had stale references.

I think a standalone column on/off tool would expose a lot of these issues pretty quickly. For the next set of bugs, have the tool change the color of renderers.

Paddy

On Mon, Jun 23, 2014 at 11:57 AM, pwang [email protected] wrote:

On Monday, June 23, 2014 9:46:00 AM UTC-5, Paddy Mullen wrote:

I have built two JS applications around bokeh that include this functionality. I do think that this should be a widget or a tool. As a widget, we should be able to specify a css selector that the widget will attach itself to in the DOM. The widget implimentation would also be helpful to show how to add and remove renderers from a plot. I have found it’s quite tricky to remove renderers from a plot.

What were some of the issues you ran into while trying to remove renderers from a plot? Were they related to other things holding on to refs, or were they related to knowing all the things that needed to have their renderer references updated, or…?

Thanks,

Peter

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/285d8257-d258-4486-89de-fd89ba857c7c%40continuum.io.

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

I am interested in this option is well. Has there been any progress in implementing this option?
Example?

Thx

···

On Friday, March 6, 2015 at 1:31:35 PM UTC-8, KK wrote:

Was this checkbox to add/remove lines feature ever implemented? If so, is there an example?

On Monday, 23 June 2014 12:08:53 UTC-4, Paddy Mullen wrote:

It is difficult to get a reference to the renderer that you want. This would be easier with an object query system.

There should be a remove_renderer method on plot. I have updated the model by taking the raw list of renderers and removing the one that I no longer wanted there, but that is tricky.

Once the renderer is removed, I have run into issues, especially with legends if I remember properly. I had to completely recreate the Legend object each time I added or removed a renderer because it had stale references.

I think a standalone column on/off tool would expose a lot of these issues pretty quickly. For the next set of bugs, have the tool change the color of renderers.

Paddy

On Mon, Jun 23, 2014 at 11:57 AM, pwang [email protected] wrote:

On Monday, June 23, 2014 9:46:00 AM UTC-5, Paddy Mullen wrote:

I have built two JS applications around bokeh that include this functionality. I do think that this should be a widget or a tool. As a widget, we should be able to specify a css selector that the widget will attach itself to in the DOM. The widget implimentation would also be helpful to show how to add and remove renderers from a plot. I have found it’s quite tricky to remove renderers from a plot.

What were some of the issues you ran into while trying to remove renderers from a plot? Were they related to other things holding on to refs, or were they related to knowing all the things that needed to have their renderer references updated, or…?

Thanks,

Peter

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/285d8257-d258-4486-89de-fd89ba857c7c%40continuum.io.

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

if i were doing this i think i would use the “selection/nonselection” properties of a glyph - unless i’m misunderstanding the problem.

···

On Mon, Jun 8, 2015 at 10:40 PM, Andrew Joros [email protected] wrote:

I am interested in this option is well. Has there been any progress in implementing this option?
Example?

Thx

On Friday, March 6, 2015 at 1:31:35 PM UTC-8, KK wrote:

Was this checkbox to add/remove lines feature ever implemented? If so, is there an example?

On Monday, 23 June 2014 12:08:53 UTC-4, Paddy Mullen wrote:

It is difficult to get a reference to the renderer that you want. This would be easier with an object query system.

There should be a remove_renderer method on plot. I have updated the model by taking the raw list of renderers and removing the one that I no longer wanted there, but that is tricky.

Once the renderer is removed, I have run into issues, especially with legends if I remember properly. I had to completely recreate the Legend object each time I added or removed a renderer because it had stale references.

I think a standalone column on/off tool would expose a lot of these issues pretty quickly. For the next set of bugs, have the tool change the color of renderers.

Paddy

On Mon, Jun 23, 2014 at 11:57 AM, pwang [email protected] wrote:

On Monday, June 23, 2014 9:46:00 AM UTC-5, Paddy Mullen wrote:

I have built two JS applications around bokeh that include this functionality. I do think that this should be a widget or a tool. As a widget, we should be able to specify a css selector that the widget will attach itself to in the DOM. The widget implimentation would also be helpful to show how to add and remove renderers from a plot. I have found it’s quite tricky to remove renderers from a plot.

What were some of the issues you ran into while trying to remove renderers from a plot? Were they related to other things holding on to refs, or were they related to knowing all the things that needed to have their renderer references updated, or…?

Thanks,

Peter

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/285d8257-d258-4486-89de-fd89ba857c7c%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/fb83453a-ba99-4246-bd54-05f960e334d0%40continuum.io.

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

Hi Andrew

Try this:

http://stackoverflow.com/questions/30720511/checkboxes-to-show-hide-lines-in-bokeh-stock-data-moving-average/30720512#30720512

I have used the slider example from the Bokeh website.

···

On Mon, Jun 8, 2015 at 5:40 PM, Andrew Joros [email protected] wrote:

I am interested in this option is well. Has there been any progress in implementing this option?
Example?

Thx

On Friday, March 6, 2015 at 1:31:35 PM UTC-8, KK wrote:

Was this checkbox to add/remove lines feature ever implemented? If so, is there an example?

On Monday, 23 June 2014 12:08:53 UTC-4, Paddy Mullen wrote:

It is difficult to get a reference to the renderer that you want. This would be easier with an object query system.

There should be a remove_renderer method on plot. I have updated the model by taking the raw list of renderers and removing the one that I no longer wanted there, but that is tricky.

Once the renderer is removed, I have run into issues, especially with legends if I remember properly. I had to completely recreate the Legend object each time I added or removed a renderer because it had stale references.

I think a standalone column on/off tool would expose a lot of these issues pretty quickly. For the next set of bugs, have the tool change the color of renderers.

Paddy

On Mon, Jun 23, 2014 at 11:57 AM, pwang [email protected] wrote:

On Monday, June 23, 2014 9:46:00 AM UTC-5, Paddy Mullen wrote:

I have built two JS applications around bokeh that include this functionality. I do think that this should be a widget or a tool. As a widget, we should be able to specify a css selector that the widget will attach itself to in the DOM. The widget implimentation would also be helpful to show how to add and remove renderers from a plot. I have found it’s quite tricky to remove renderers from a plot.

What were some of the issues you ran into while trying to remove renderers from a plot? Were they related to other things holding on to refs, or were they related to knowing all the things that needed to have their renderer references updated, or…?

Thanks,

Peter

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/285d8257-d258-4486-89de-fd89ba857c7c%40continuum.io.

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

Thanks for the input Khalid and Sarah

Question for you both and anyone else: Have you seen a good example of, let’s say, a multi-line timseries (with check boxes similar to what you made), and various statistical plots (e.g. Corr Coef, histograms, scatter plots, distributions, etc.) below the time series that are created using the Bokeh Server with respect to the “checked off” multi-line timeseries.

I am currently digging around to find an example of this but haven’t found one.

Let me know if this doesn’t make sense and I can clear it up for you.

···

On Monday, June 8, 2015 at 4:15:38 PM UTC-7, Khalid Khan wrote:

Hi Andrew

Try this:

http://stackoverflow.com/questions/30720511/checkboxes-to-show-hide-lines-in-bokeh-stock-data-moving-average/30720512#30720512

I have used the slider example from the Bokeh website.

On Mon, Jun 8, 2015 at 5:40 PM, Andrew Joros [email protected] wrote:

I am interested in this option is well. Has there been any progress in implementing this option?
Example?

Thx

On Friday, March 6, 2015 at 1:31:35 PM UTC-8, KK wrote:

Was this checkbox to add/remove lines feature ever implemented? If so, is there an example?

On Monday, 23 June 2014 12:08:53 UTC-4, Paddy Mullen wrote:

It is difficult to get a reference to the renderer that you want. This would be easier with an object query system.

There should be a remove_renderer method on plot. I have updated the model by taking the raw list of renderers and removing the one that I no longer wanted there, but that is tricky.

Once the renderer is removed, I have run into issues, especially with legends if I remember properly. I had to completely recreate the Legend object each time I added or removed a renderer because it had stale references.

I think a standalone column on/off tool would expose a lot of these issues pretty quickly. For the next set of bugs, have the tool change the color of renderers.

Paddy

On Mon, Jun 23, 2014 at 11:57 AM, pwang [email protected] wrote:

On Monday, June 23, 2014 9:46:00 AM UTC-5, Paddy Mullen wrote:

I have built two JS applications around bokeh that include this functionality. I do think that this should be a widget or a tool. As a widget, we should be able to specify a css selector that the widget will attach itself to in the DOM. The widget implimentation would also be helpful to show how to add and remove renderers from a plot. I have found it’s quite tricky to remove renderers from a plot.

What were some of the issues you ran into while trying to remove renderers from a plot? Were they related to other things holding on to refs, or were they related to knowing all the things that needed to have their renderer references updated, or…?

Thanks,

Peter

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/285d8257-d258-4486-89de-fd89ba857c7c%40continuum.io.

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

Khalid, is something like this possible without starting the bokeh-server?

···

On Monday, June 8, 2015 at 4:15:38 PM UTC-7, Khalid Khan wrote:

Hi Andrew

Try this:

http://stackoverflow.com/questions/30720511/checkboxes-to-show-hide-lines-in-bokeh-stock-data-moving-average/30720512#30720512

I have used the slider example from the Bokeh website.

On Mon, Jun 8, 2015 at 5:40 PM, Andrew Joros [email protected] wrote:

I am interested in this option is well. Has there been any progress in implementing this option?
Example?

Thx

On Friday, March 6, 2015 at 1:31:35 PM UTC-8, KK wrote:

Was this checkbox to add/remove lines feature ever implemented? If so, is there an example?

On Monday, 23 June 2014 12:08:53 UTC-4, Paddy Mullen wrote:

It is difficult to get a reference to the renderer that you want. This would be easier with an object query system.

There should be a remove_renderer method on plot. I have updated the model by taking the raw list of renderers and removing the one that I no longer wanted there, but that is tricky.

Once the renderer is removed, I have run into issues, especially with legends if I remember properly. I had to completely recreate the Legend object each time I added or removed a renderer because it had stale references.

I think a standalone column on/off tool would expose a lot of these issues pretty quickly. For the next set of bugs, have the tool change the color of renderers.

Paddy

On Mon, Jun 23, 2014 at 11:57 AM, pwang [email protected] wrote:

On Monday, June 23, 2014 9:46:00 AM UTC-5, Paddy Mullen wrote:

I have built two JS applications around bokeh that include this functionality. I do think that this should be a widget or a tool. As a widget, we should be able to specify a css selector that the widget will attach itself to in the DOM. The widget implimentation would also be helpful to show how to add and remove renderers from a plot. I have found it’s quite tricky to remove renderers from a plot.

What were some of the issues you ran into while trying to remove renderers from a plot? Were they related to other things holding on to refs, or were they related to knowing all the things that needed to have their renderer references updated, or…?

Thanks,

Peter

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/285d8257-d258-4486-89de-fd89ba857c7c%40continuum.io.

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

Hi Andrew

I don’t think it is possible - at least I couldn’t figure out a way. My rough understanding is that for these fancier charts, where there is a interactive element, there needs to be a server.

If there is a way I would be also keen to see it also.

Kind regards.

···

Sent from my BlackBerry


From: Andrew Joros [email protected]

Date: Thu, 25 Jun 2015 14:40:14 -0700 (PDT)

To: [email protected]

Cc: [email protected]

Subject: Re: [bokeh] Toggle line plot(s)

Khalid, is something like this possible without starting the bokeh-server?

On Monday, June 8, 2015 at 4:15:38 PM UTC-7, Khalid Khan wrote:

Hi Andrew

Try this:

http://stackoverflow.com/questions/30720511/checkboxes-to-show-hide-lines-in-bokeh-stock-data-moving-average/30720512#30720512

I have used the slider example from the Bokeh website.

On Mon, Jun 8, 2015 at 5:40 PM, Andrew Joros [email protected] wrote:

I am interested in this option is well. Has there been any progress in implementing this option?
Example?

Thx

On Friday, March 6, 2015 at 1:31:35 PM UTC-8, KK wrote:

Was this checkbox to add/remove lines feature ever implemented? If so, is there an example?

On Monday, 23 June 2014 12:08:53 UTC-4, Paddy Mullen wrote:

It is difficult to get a reference to the renderer that you want. This would be easier with an object query system.

There should be a remove_renderer method on plot. I have updated the model by taking the raw list of renderers and removing the one that I no longer wanted there, but that is tricky.

Once the renderer is removed, I have run into issues, especially with legends if I remember properly. I had to completely recreate the Legend object each time I added or removed a renderer because it had stale references.

I think a standalone column on/off tool would expose a lot of these issues pretty quickly. For the next set of bugs, have the tool change the color of renderers.

Paddy

On Mon, Jun 23, 2014 at 11:57 AM, pwang [email protected] wrote:

On Monday, June 23, 2014 9:46:00 AM UTC-5, Paddy Mullen wrote:

I have built two JS applications around bokeh that include this functionality. I do think that this should be a widget or a tool. As a widget, we should be able to specify a css selector that the widget will attach itself to in the DOM. The widget implimentation would also be helpful to show how to add and remove renderers from a plot. I have found it’s quite tricky to remove renderers from a plot.

What were some of the issues you ran into while trying to remove renderers from a plot? Were they related to other things holding on to refs, or were they related to knowing all the things that needed to have their renderer references updated, or…?

Thanks,

Peter

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/285d8257-d258-4486-89de-fd89ba857c7c%40continuum.io.

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

I do believe this could be done with a new JS callback, however I do not know when I would have time to make a stab at an example.

Bryan

···

On Jun 25, 2015, at 4:47 PM, Khalid Khan <[email protected]> wrote:

Hi Andrew

I don't think it is possible - at least I couldn't figure out a way. My rough understanding is that for these fancier charts, where there is a interactive element, there needs to be a server.

If there is a way I would be also keen to see it also.

Kind regards.
Sent from my BlackBerry
From: Andrew Joros <[email protected]>
Date: Thu, 25 Jun 2015 14:40:14 -0700 (PDT)
To: <[email protected]>
Cc: <[email protected]>
Subject: Re: [bokeh] Toggle line plot(s)

Khalid, is something like this possible without starting the bokeh-server?

On Monday, June 8, 2015 at 4:15:38 PM UTC-7, Khalid Khan wrote:
Hi Andrew

Try this:

http://stackoverflow.com/questions/30720511/checkboxes-to-show-hide-lines-in-bokeh-stock-data-moving-average/30720512#30720512

I have used the slider example from the Bokeh website.

On Mon, Jun 8, 2015 at 5:40 PM, Andrew Joros <[email protected]> wrote:
I am interested in this option is well. Has there been any progress in implementing this option?
Example?

Thx

On Friday, March 6, 2015 at 1:31:35 PM UTC-8, KK wrote:
Was this checkbox to add/remove lines feature ever implemented? If so, is there an example?

On Monday, 23 June 2014 12:08:53 UTC-4, Paddy Mullen wrote:
It is difficult to get a reference to the renderer that you want. This would be easier with an object query system.

There should be a remove_renderer method on plot. I have updated the model by taking the raw list of renderers and removing the one that I no longer wanted there, but that is tricky.

Once the renderer is removed, I have run into issues, especially with legends if I remember properly. I had to completely recreate the Legend object each time I added or removed a renderer because it had stale references.

I think a standalone column on/off tool would expose a lot of these issues pretty quickly. For the next set of bugs, have the tool change the color of renderers.

Paddy

On Mon, Jun 23, 2014 at 11:57 AM, pwang <[email protected]> wrote:
On Monday, June 23, 2014 9:46:00 AM UTC-5, Paddy Mullen wrote:
I have built two JS applications around bokeh that include this functionality. I do think that this should be a widget or a tool. As a widget, we should be able to specify a css selector that the widget will attach itself to in the DOM. The widget implimentation would also be helpful to show how to add and remove renderers from a plot. I have found it's quite tricky to remove renderers from a plot.

What were some of the issues you ran into while trying to remove renderers from a plot? Were they related to other things holding on to refs, or were they related to knowing all the things that needed to have their renderer references updated, or...?

Thanks,
Peter

--
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/285d8257-d258-4486-89de-fd89ba857c7c%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/1299556890-1435268874-cardhu_decombobulator_blackberry.rim.net-1058057231-%40b18.c4.bise6.blackberry.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hmmmm, OK. I am not familiar with new JS callbacks. Can you link to a source talking about this new feature?

···

On Thu, Jun 25, 2015 at 4:09 PM, Bryan Van de Ven [email protected] wrote:

I do believe this could be done with a new JS callback, however I do not know when I would have time to make a stab at an example.

Bryan

On Jun 25, 2015, at 4:47 PM, Khalid Khan [email protected] wrote:

Hi Andrew

I don’t think it is possible - at least I couldn’t figure out a way. My rough understanding is that for these fancier charts, where there is a interactive element, there needs to be a server.

If there is a way I would be also keen to see it also.

Kind regards.

Sent from my BlackBerry

From: Andrew Joros [email protected]

Date: Thu, 25 Jun 2015 14:40:14 -0700 (PDT)

To: [email protected]

Cc: [email protected]

Subject: Re: [bokeh] Toggle line plot(s)

Khalid, is something like this possible without starting the bokeh-server?

On Monday, June 8, 2015 at 4:15:38 PM UTC-7, Khalid Khan wrote:

Hi Andrew

Try this:

http://stackoverflow.com/questions/30720511/checkboxes-to-show-hide-lines-in-bokeh-stock-data-moving-average/30720512#30720512

I have used the slider example from the Bokeh website.

On Mon, Jun 8, 2015 at 5:40 PM, Andrew Joros [email protected] wrote:

I am interested in this option is well. Has there been any progress in implementing this option?

Example?

Thx

On Friday, March 6, 2015 at 1:31:35 PM UTC-8, KK wrote:

Was this checkbox to add/remove lines feature ever implemented? If so, is there an example?

On Monday, 23 June 2014 12:08:53 UTC-4, Paddy Mullen wrote:

It is difficult to get a reference to the renderer that you want. This would be easier with an object query system.

There should be a remove_renderer method on plot. I have updated the model by taking the raw list of renderers and removing the one that I no longer wanted there, but that is tricky.

Once the renderer is removed, I have run into issues, especially with legends if I remember properly. I had to completely recreate the Legend object each time I added or removed a renderer because it had stale references.

I think a standalone column on/off tool would expose a lot of these issues pretty quickly. For the next set of bugs, have the tool change the color of renderers.

Paddy

On Mon, Jun 23, 2014 at 11:57 AM, pwang [email protected] wrote:

On Monday, June 23, 2014 9:46:00 AM UTC-5, Paddy Mullen wrote:

I have built two JS applications around bokeh that include this functionality. I do think that this should be a widget or a tool. As a widget, we should be able to specify a css selector that the widget will attach itself to in the DOM. The widget implimentation would also be helpful to show how to add and remove renderers from a plot. I have found it’s quite tricky to remove renderers from a plot.

What were some of the issues you ran into while trying to remove renderers from a plot? Were they related to other things holding on to refs, or were they related to knowing all the things that needed to have their renderer references updated, or…?

Thanks,

Peter

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/285d8257-d258-4486-89de-fd89ba857c7c%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/1299556890-1435268874-cardhu_decombobulator_blackberry.rim.net-1058057231-%40b18.c4.bise6.blackberry.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Andrew Joros

Assistant Research Scientist

Applied Innovation Center

Division of Earth and Ecosystem Sciences

Desert Research Institute, 2215 Raggio Parkway Reno, NV 89512

Office: 775.674.7112

Bryan and I gave a tutorial last weekend where we covered it.

The video isn’t up yet, but will be. https://www.youtube.com/user/PyDataTV/videos

The tutorial notebooks are available now:
https://github.com/bokeh/bokeh-notebooks/tree/master/tutorial
http://nbviewer.ipython.org/github/bokeh/bokeh-notebooks/blob/master/tutorial/06%20-%20interactions.ipynb

···

On Fri, Jun 26, 2015 at 1:12 AM, Andrew Joros [email protected] wrote:

Hmmmm, OK. I am not familiar with new JS callbacks. Can you link to a source talking about this new feature?

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/CAMU1Jh%3DRq_%2B_gDbd-bRJUaQ7Tzekc%2B5bE2S7FyoQxBeHGD%2BJ3w%40mail.gmail.com.

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

Andrew Joros

Assistant Research Scientist

Applied Innovation Center

Division of Earth and Ecosystem Sciences

Desert Research Institute, 2215 Raggio Parkway Reno, NV 89512

Office: 775.674.7112

On Thu, Jun 25, 2015 at 4:09 PM, Bryan Van de Ven [email protected] wrote:

I do believe this could be done with a new JS callback, however I do not know when I would have time to make a stab at an example.

Bryan

On Jun 25, 2015, at 4:47 PM, Khalid Khan [email protected] wrote:

Hi Andrew

I don’t think it is possible - at least I couldn’t figure out a way. My rough understanding is that for these fancier charts, where there is a interactive element, there needs to be a server.

If there is a way I would be also keen to see it also.

Kind regards.

Sent from my BlackBerry

From: Andrew Joros [email protected]

Date: Thu, 25 Jun 2015 14:40:14 -0700 (PDT)

To: [email protected]

Cc: [email protected]

Subject: Re: [bokeh] Toggle line plot(s)

Khalid, is something like this possible without starting the bokeh-server?

On Monday, June 8, 2015 at 4:15:38 PM UTC-7, Khalid Khan wrote:

Hi Andrew

Try this:

http://stackoverflow.com/questions/30720511/checkboxes-to-show-hide-lines-in-bokeh-stock-data-moving-average/30720512#30720512

I have used the slider example from the Bokeh website.

On Mon, Jun 8, 2015 at 5:40 PM, Andrew Joros [email protected] wrote:

I am interested in this option is well. Has there been any progress in implementing this option?

Example?

Thx

On Friday, March 6, 2015 at 1:31:35 PM UTC-8, KK wrote:

Was this checkbox to add/remove lines feature ever implemented? If so, is there an example?

On Monday, 23 June 2014 12:08:53 UTC-4, Paddy Mullen wrote:

It is difficult to get a reference to the renderer that you want. This would be easier with an object query system.

There should be a remove_renderer method on plot. I have updated the model by taking the raw list of renderers and removing the one that I no longer wanted there, but that is tricky.

Once the renderer is removed, I have run into issues, especially with legends if I remember properly. I had to completely recreate the Legend object each time I added or removed a renderer because it had stale references.

I think a standalone column on/off tool would expose a lot of these issues pretty quickly. For the next set of bugs, have the tool change the color of renderers.

Paddy

On Mon, Jun 23, 2014 at 11:57 AM, pwang [email protected] wrote:

On Monday, June 23, 2014 9:46:00 AM UTC-5, Paddy Mullen wrote:

I have built two JS applications around bokeh that include this functionality. I do think that this should be a widget or a tool. As a widget, we should be able to specify a css selector that the widget will attach itself to in the DOM. The widget implimentation would also be helpful to show how to add and remove renderers from a plot. I have found it’s quite tricky to remove renderers from a plot.

What were some of the issues you ran into while trying to remove renderers from a plot? Were they related to other things holding on to refs, or were they related to knowing all the things that needed to have their renderer references updated, or…?

Thanks,

Peter

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/285d8257-d258-4486-89de-fd89ba857c7c%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/1299556890-1435268874-cardhu_decombobulator_blackberry.rim.net-1058057231-%40b18.c4.bise6.blackberry.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Sarah, Bryan,

Thanks for all of your hard work!

Sarah - could you drop a few more hints on how you might link the selection/nonselection properties to the CustomJS of a toggle? The tutorials for using the select tools like lasso, box, hover, etc show this functionality quite well, but I’m not seeing my way through to linking it to a button or slider.

Bryan - Am I reading you correctly in saying a new Callback feature needs to be added to Bokeh, or are you thinking it is possible within the current package with some crafty JS in a currently supported interaction? If it must be added, tying it in with a CheckboxGroup or the Legend would be nice. Should I log this on GitHub?

Is the state of a toggle passed into the CustomJS via the cb_ob with something like this: var f = cb_obj.get(‘active’) ?

Again, many thanks,

Gus

Finally had a good thought and tried using the multiline vs line. Sort of got something along the lines that I’m looking for, although I’m going to have to spend a lot of time working on making it pretty and presentable.

The sliders take the line width down to .01, so the curve disappears. This is a clunky way to do it to say the least, so any feedback or better ideas much appreciated. Code below (started with the multi-line example and modified):

import numpy as np

from bokeh.document import Document

from bokeh.models import ColumnDataSource, DataRange1d, Plot, LinearAxis, Grid, Slider, CustomJS

from bokeh.models.glyphs import MultiLine

from bokeh.plotting import show, output_file

from bokeh.io import vplot, hplot, vform, gridplot

output_file(“mline.html”)

N = 9

x = np.linspace(-2, 2, N)

y = x**2

xpts = np.array([-.09, -.12, .0, .12, .09])

ypts = np.array([-.1, .02, .1, .02, -.1])

source = ColumnDataSource(dict(

xs=[xpts*(1+i/10.0)+xx for i, xx in enumerate(x)],

ys=[ypts*(1+i/10.0)+yy for i, yy in enumerate(y)],

color=[“red”, “blue”, “green”,“red”, “blue”, “green”,“red”, “blue”, “green”],

lw=[1,2,3,4,5,6,7,8,9]

)

)

xdr = DataRange1d()

ydr = DataRange1d()

callback = CustomJS(args=dict(source=source), code="""

var data = source.get(‘data’);

var f = cb_obj.get(‘value’)

lw = data[‘lw’]

lw[4]=f

// trigger update of data source

source.trigger(‘change’);

“”")

callback2 = CustomJS(args=dict(source=source), code="""

var data = source.get(‘data’);

var f = cb_obj.get(‘value’)

lw = data[‘lw’]

lw[6]=f

// trigger update of data source

source.trigger(‘change’);

“”")

slider = Slider(start=0.01, end=4.01, value=4.01, step=4, title=“Curve 4”, callback=callback)

slider2 = Slider(start=0.01, end=4.01, value=4.01, step=4, title=“Curve 6”, callback=callback2)

plot = Plot(

title=None, x_range=xdr, y_range=ydr, plot_width=800, plot_height=800,

h_symmetry=False, v_symmetry=False, min_border=0, toolbar_location=None)

glyph = MultiLine(xs=“xs”, ys=“ys”, line_color=“color”, line_width=“lw”)

plot.add_glyph(source, glyph)

xaxis = LinearAxis()

plot.add_layout(xaxis, ‘below’)

yaxis = LinearAxis()

plot.add_layout(yaxis, ‘left’)

plot.add_layout(Grid(dimension=0, ticker=xaxis.ticker))

plot.add_layout(Grid(dimension=1, ticker=yaxis.ticker))

layout = vform(slider,slider2)

superlayout=hplot(plot,layout)

show(superlayout)

I think this thread addresses exactly what I want to do and I was wondering if there has been any progress on this since last year.

In particular, I would like my plot with multiple lines to have a “selectable” legend so that I can choose to show or not show any of the series that are plotted.

I don’t want to reload the data but other than that I don’t care how it works underneath, although if I have to implement it myself I guess simpler is better.

thanks greatly

John Muller

···

On Tuesday, October 27, 2015 at 12:46:31 AM UTC-4, Angus Morison wrote:

Finally had a good thought and tried using the multiline vs line. Sort of got something along the lines that I’m looking for, although I’m going to have to spend a lot of time working on making it pretty and presentable.

The sliders take the line width down to .01, so the curve disappears. This is a clunky way to do it to say the least, so any feedback or better ideas much appreciated. Code below (started with the multi-line example and modified):

import numpy as np

from bokeh.document import Document

from bokeh.models import ColumnDataSource, DataRange1d, Plot, LinearAxis, Grid, Slider, CustomJS

from bokeh.models.glyphs import MultiLine

from bokeh.plotting import show, output_file

from bokeh.io import vplot, hplot, vform, gridplot

output_file(“mline.html”)

N = 9

x = np.linspace(-2, 2, N)

y = x**2

xpts = np.array([-.09, -.12, .0, .12, .09])

ypts = np.array([-.1, .02, .1, .02, -.1])

source = ColumnDataSource(dict(

xs=[xpts*(1+i/10.0)+xx for i, xx in enumerate(x)],

ys=[ypts*(1+i/10.0)+yy for i, yy in enumerate(y)],

color=[“red”, “blue”, “green”,“red”, “blue”, “green”,“red”, “blue”, “green”],

lw=[1,2,3,4,5,6,7,8,9]

)

)

xdr = DataRange1d()

ydr = DataRange1d()

callback = CustomJS(args=dict(source=source), code="""

var data = source.get(‘data’);

var f = cb_obj.get(‘value’)

lw = data[‘lw’]

lw[4]=f

// trigger update of data source

source.trigger(‘change’);

“”")

callback2 = CustomJS(args=dict(source=source), code="""

var data = source.get(‘data’);

var f = cb_obj.get(‘value’)

lw = data[‘lw’]

lw[6]=f

// trigger update of data source

source.trigger(‘change’);

“”")

slider = Slider(start=0.01, end=4.01, value=4.01, step=4, title=“Curve 4”, callback=callback)

slider2 = Slider(start=0.01, end=4.01, value=4.01, step=4, title=“Curve 6”, callback=callback2)

plot = Plot(

title=None, x_range=xdr, y_range=ydr, plot_width=800, plot_height=800,

h_symmetry=False, v_symmetry=False, min_border=0, toolbar_location=None)

glyph = MultiLine(xs=“xs”, ys=“ys”, line_color=“color”, line_width=“lw”)

plot.add_glyph(source, glyph)

xaxis = LinearAxis()

plot.add_layout(xaxis, ‘below’)

yaxis = LinearAxis()

plot.add_layout(yaxis, ‘left’)

plot.add_layout(Grid(dimension=0, ticker=xaxis.ticker))

plot.add_layout(Grid(dimension=1, ticker=yaxis.ticker))

layout = vform(slider,slider2)

superlayout=hplot(plot,layout)

show(superlayout)

Hi,

Yes, there is an open PR with this feature.

  It's currently scheduled for 0.12.5 (which will come out in

early 2017)

  I have played with it and am excited. Haven't got any code lying

around to share unfortunately.

Best,

Bird

···

https://github.com/bokeh/bokeh/pull/5349
On 12/14/16 3:35 PM,
wrote:

[email protected]

    I think this thread addresses exactly what I want

to do and I was wondering if there has been any progress on this
since last year.

      In particular, I would like my plot with multiple lines to

have a “selectable” legend so that I can choose to show or not
show any of the series that are plotted.

      I don't want to reload the data but other than that I don't

care how it works underneath, although if I have to implement
it myself I guess simpler is better.

thanks greatly

John Muller

      On Tuesday, October 27, 2015 at 12:46:31 AM UTC-4, Angus

Morison wrote:

          Finally had a good thought and tried using

the multiline vs line. Sort of got something along the
lines that I’m looking for, although I’m going to have to
spend a lot of time working on making it pretty and
presentable.

            The sliders take the line width down to .01, so the

curve disappears. This is a clunky way to do it to say
the least, so any feedback or better ideas much
appreciated. Code below (started with the multi-line
example and modified):

import numpy as np

from bokeh.document import Document

              from bokeh.models import ColumnDataSource,

DataRange1d, Plot, LinearAxis, Grid, Slider, CustomJS

from bokeh.models.glyphs import MultiLine

from bokeh.plotting import show, output_file

from bokeh.io import vplot, hplot, vform,
gridplot

output_file(“mline.html”)

N = 9

x = np.linspace(-2, 2, N)

y = x**2

xpts = np.array([-.09, -.12, .0, .12, .09])

ypts = np.array([-.1, .02, .1, .02, -.1])

source = ColumnDataSource(dict(

              xs=[xpts*(1+i/10.0)+xx for i, xx in

enumerate(x)],

              ys=[ypts*(1+i/10.0)+yy for i, yy in

enumerate(y)],

              color=["red", "blue", "green","red",

“blue”, “green”,“red”, “blue”, “green”],

lw=[1,2,3,4,5,6,7,8,9]

)

)

xdr = DataRange1d()

ydr = DataRange1d()

callback = CustomJS(args=dict(source= source),
code="""

var data = source.get(‘data’);

var f = cb_obj.get(‘value’)

lw = data[‘lw’]

lw[4]=f

// trigger update of data source

source.trigger(‘change’);

“”")

callback2 = CustomJS(args=dict(source= source),
code="""

var data = source.get(‘data’);

var f = cb_obj.get(‘value’)

lw = data[‘lw’]

lw[6]=f

// trigger update of data source

source.trigger(‘change’);

“”")

              slider = Slider(start=0.01, end=4.01, value=4.01,

step=4, title=“Curve 4”, callback=callback)

              slider2 = Slider(start=0.01, end=4.01, value=4.01,

step=4, title=“Curve 6”, callback=callback2)

plot = Plot(

              title=None, x_range=xdr, y_range=ydr,

plot_width=800, plot_height=800,

              h_symmetry=False, v_symmetry=False,

min_border=0, toolbar_location=None)

              glyph = MultiLine(xs="xs", ys="ys",

line_color=“color”, line_width=“lw”)

plot.add_glyph(source, glyph)

xaxis = LinearAxis()

plot.add_layout(xaxis, ‘below’)

yaxis = LinearAxis()

plot.add_layout(yaxis, ‘left’)

plot.add_layout(Grid( dimension=0,
ticker=xaxis.ticker))

plot.add_layout(Grid( dimension=1,
ticker=yaxis.ticker))

layout = vform(slider,slider2)

superlayout=hplot(plot,layout)

show(superlayout)