Bokeh Embedded in GUI

Hey Bokeh,

I am an active Data plotter and am very interested in Bokeh. Bokeh looks like a very good plotting tool.

Is it possible to embed a Bokeh plot in a Graphical User Interface? Specifically, I would like to make something like the GUI shown halfway down this page:

http://www.mathworks.com/help/matlab/ref/uicontrol.html

When the buttons are clicked, the plot responds accordingly. I know there are several packages available to make GUIs in Python but I am not sure if the issue would be embedding iPython or embedding a small browser in the GUI?

Would it be simpler/more appropriate to simply use a browser (Chrome/Firefox) with a plot in it and then put buttons around the plot?

If more appropriate, I can put this question on Stackoverflow.

Thanks.

···


Jeremy Patterson

Hi Jeremy,

First, here and Stack Overflow are both great places to ask questions, we try to be as responsive as we can to both.

Bokeh requires an HTML5 canvas to render on, but what you have described, embedding a HTML widget into a rich client app, is something that has occurred to me before, although I have not had the opportunity to try it yet. We try to make Bokeh flexible in the ways it can be embedded, so I can imagine a few different scenarios:

* App is written in python (PyQt, wxPython, etc)

This is probably the simplest case right now, you can just call out to Bokeh directly in your app. You can create "static" charts that have the data embedded in them (but still have interactive tools) based on the native app widget interactions. Or you can run bokeh-server and host the data there, and push data updates to the server (causing the plots to update). You can also get things like selections back from the plot to your python app code through the server.

* App is not written in python

If you rich client is written in some other language but you still have access to an HTML widget, you can create and export the JS required to plot your data in python, and then re-use it in your app. If you use the bokeh-server you can update the data with appropriate REST calls to the server, and the pots will update. Without the server, I think in this case you would be limited to "static" data plots.

* pure web-app

We are working on providing our own widget interface that can be used to develop "Bokeh Apps" or "Bokeh Dashboards". WE are still baking things out but will gladly help anyone that wants to try it out.

Can you describe your app a little more, what languages and toolkits, etc that you will be using? I would be interested in helping you develop this use-case and then augmenting our user guide and documentation with more step by step instructions on how to integrate Bokeh in this way.

Thanks for your interest in Bokeh!

Bryan

···

On Aug 8, 2014, at 12:10 AM, Jeremy Patterson <[email protected]> wrote:

Hey Bokeh,

I am an active Data plotter and am very interested in Bokeh. Bokeh looks like a very good plotting tool.

Is it possible to embed a Bokeh plot in a Graphical User Interface? Specifically, I would like to make something like the GUI shown halfway down this page:

Create user interface control - MATLAB uicontrol

When the buttons are clicked, the plot responds accordingly. I know there are several packages available to make GUIs in Python but I am not sure if the issue would be embedding iPython or embedding a small browser in the GUI?

Would it be simpler/more appropriate to simply use a browser (Chrome/Firefox) with a plot in it and then put buttons around the plot?

If more appropriate, I can put this question on Stackoverflow.

Thanks.

--
Jeremy Patterson

--
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/CACTwgNa_%3DuFTsYeZg2ea%2BzxSGj88x%3DBqt34THUkFjKcNip3Z7w%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hey Bryan,
I think my best option would be to write the app completely in Python (wxPython looks like a good option). Since I would be planning on updating the data/labels when buttons/dropdown menus are selected, I would either need to delete and remake the static plot or use the bokeh-server method. I am interested in both methods. I would like to keep the interactive tools that bokeh has (zoom, pan, etc.) beside the plot.

It would get me started if you would make a short example showing how to make a simple bokeh plot in a wxPython app and connect a drop-down box or listbox to the plot. (I am new to the GUI building tools in Python since I use Matlab.) Both the static plot and the bokeh-server method would be great to see.

Thanks,

Jeremy

···

On Friday, August 8, 2014 4:29:43 AM UTC-7, Bryan Van de ven wrote:

Hi Jeremy,

First, here and Stack Overflow are both great places to ask questions, we try to be as responsive as we can to both.

Bokeh requires an HTML5 canvas to render on, but what you have described, embedding a HTML widget into a rich client app, is something that has occurred to me before, although I have not had the opportunity to try it yet. We try to make Bokeh flexible in the ways it can be embedded, so I can imagine a few different scenarios:

  • App is written in python (PyQt, wxPython, etc)

This is probably the simplest case right now, you can just call out to Bokeh directly in your app. You can create “static” charts that have the data embedded in them (but still have interactive tools) based on the native app widget interactions. Or you can run bokeh-server and host the data there, and push data updates to the server (causing the plots to update). You can also get things like selections back from the plot to your python app code through the server.

  • App is not written in python

If you rich client is written in some other language but you still have access to an HTML widget, you can create and export the JS required to plot your data in python, and then re-use it in your app. If you use the bokeh-server you can update the data with appropriate REST calls to the server, and the pots will update. Without the server, I think in this case you would be limited to “static” data plots.

  • pure web-app

We are working on providing our own widget interface that can be used to develop “Bokeh Apps” or “Bokeh Dashboards”. WE are still baking things out but will gladly help anyone that wants to try it out.

Can you describe your app a little more, what languages and toolkits, etc that you will be using? I would be interested in helping you develop this use-case and then augmenting our user guide and documentation with more step by step instructions on how to integrate Bokeh in this way.

Thanks for your interest in Bokeh!

Bryan

On Aug 8, 2014, at 12:10 AM, Jeremy Patterson [email protected] wrote:

Hey Bokeh,

I am an active Data plotter and am very interested in Bokeh. Bokeh looks like a very good plotting tool.

Is it possible to embed a Bokeh plot in a Graphical User Interface? Specifically, I would like to make something like the GUI shown halfway down this page:

http://www.mathworks.com/help/matlab/ref/uicontrol.html

When the buttons are clicked, the plot responds accordingly. I know there are several packages available to make GUIs in Python but I am not sure if the issue would be embedding iPython or embedding a small browser in the GUI?

Would it be simpler/more appropriate to simply use a browser (Chrome/Firefox) with a plot in it and then put buttons around the plot?

If more appropriate, I can put this question on Stackoverflow.

Thanks.

Jeremy Patterson


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/CACTwgNa_%3DuFTsYeZg2ea%2BzxSGj88x%3DBqt34THUkFjKcNip3Z7w%40mail.gmail.com.

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

Hi Jeremy,

Unfortunately I don't have alot of time I can spend on working up examples for this right now, but here is a small static example I cribbed together from some Stack Overflow WX questions:

UPDATE: THE CODE BELOW IS ANCIENT AND NOT APPLICABLE TO ANY VERSION OF BOKEH AFTER 2014

from bokeh.embed import file_html
from bokeh.plotting import *
from bokeh.resources import INLINE
import numpy as np
import wx
import wx.html2

class PlotWidget(wx.Dialog):
  def __init__(self, *args, **kwds):
    wx.Dialog.__init__(self, *args, **kwds)
    sizer = wx.BoxSizer(wx.VERTICAL)
    self.browser = wx.html2.WebView.New(self)
    sizer.Add(self.browser, 1, wx.EXPAND, 10)
    self.SetSizer(sizer)
    self.SetSize((700, 700))

app = wx.App()
w = PlotWidget(None, -1)

N = 1000
x = np.random.random(size=N) * 100
y = np.random.random(size=N) * 100
radii = np.random.random(size=N) * 4.5
colors = ["#%02x%02x%02x" % (r, g, 150) for r, g in zip(np.floor(50+2*x), np.floor(30+2*y))]
scatter(
  x,y, radius=radii, fill_color=colors,
  fill_alpha=0.6, line_color=None,
)
html = file_html(curdoc(), INLINE, "WX Embed Example")

w.browser.SetPage(html, ".")

w.Show()

app.MainLoop()

Note: on OSX with Anaconda, you have to run this with python.app (WX needs a Framework build of python)

Working up an example using the server should not be too hard. You will probably want to use bokeh.embed.autoload_server to generate a script tag that will load your plot from the server, then you can put the script tag wherever you like in the HTML text you pass to the SetPage(...) method. Let me know if I can answer any questions.

Thanks,

Bryan

···

On Aug 14, 2014, at 10:24 AM, Jeremy Patterson <[email protected]> wrote:

Hey Bryan,
I think my best option would be to write the app completely in Python (wxPython looks like a good option). Since I would be planning on updating the data/labels when buttons/dropdown menus are selected, I would either need to delete and remake the static plot or use the bokeh-server method. I am interested in both methods. I would like to keep the interactive tools that bokeh has (zoom, pan, etc.) beside the plot.

It would get me started if you would make a short example showing how to make a simple bokeh plot in a wxPython app and connect a drop-down box or listbox to the plot. (I am new to the GUI building tools in Python since I use Matlab.) Both the static plot and the bokeh-server method would be great to see.

Thanks,
Jeremy

On Friday, August 8, 2014 4:29:43 AM UTC-7, Bryan Van de ven wrote:

Hi Jeremy,

First, here and Stack Overflow are both great places to ask questions, we try to be as responsive as we can to both.

Bokeh requires an HTML5 canvas to render on, but what you have described, embedding a HTML widget into a rich client app, is something that has occurred to me before, although I have not had the opportunity to try it yet. We try to make Bokeh flexible in the ways it can be embedded, so I can imagine a few different scenarios:

* App is written in python (PyQt, wxPython, etc)

This is probably the simplest case right now, you can just call out to Bokeh directly in your app. You can create "static" charts that have the data embedded in them (but still have interactive tools) based on the native app widget interactions. Or you can run bokeh-server and host the data there, and push data updates to the server (causing the plots to update). You can also get things like selections back from the plot to your python app code through the server.

* App is not written in python

If you rich client is written in some other language but you still have access to an HTML widget, you can create and export the JS required to plot your data in python, and then re-use it in your app. If you use the bokeh-server you can update the data with appropriate REST calls to the server, and the pots will update. Without the server, I think in this case you would be limited to "static" data plots.

* pure web-app

We are working on providing our own widget interface that can be used to develop "Bokeh Apps" or "Bokeh Dashboards". WE are still baking things out but will gladly help anyone that wants to try it out.

Can you describe your app a little more, what languages and toolkits, etc that you will be using? I would be interested in helping you develop this use-case and then augmenting our user guide and documentation with more step by step instructions on how to integrate Bokeh in this way.

Thanks for your interest in Bokeh!

Bryan

On Aug 8, 2014, at 12:10 AM, Jeremy Patterson <[email protected]> wrote:

> Hey Bokeh,
>
> I am an active Data plotter and am very interested in Bokeh. Bokeh looks like a very good plotting tool.
>
> Is it possible to embed a Bokeh plot in a Graphical User Interface? Specifically, I would like to make something like the GUI shown halfway down this page:
>
> Create user interface control - MATLAB uicontrol
>
> When the buttons are clicked, the plot responds accordingly. I know there are several packages available to make GUIs in Python but I am not sure if the issue would be embedding iPython or embedding a small browser in the GUI?
>
> Would it be simpler/more appropriate to simply use a browser (Chrome/Firefox) with a plot in it and then put buttons around the plot?
>
> If more appropriate, I can put this question on Stackoverflow.
>
> Thanks.
>
> --
> Jeremy Patterson
>
> --
> 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 bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CACTwgNa_%3DuFTsYeZg2ea%2BzxSGj88x%3DBqt34THUkFjKcNip3Z7w%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/9d68b891-94f3-4cf3-beb8-816f38c2176a%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hey Bryan,

Thanks for the help. I have been playing with this example but it does not seem to work with Bokeh 6.0. It generates an app with a figure but the figure is blank and does not have a title. Could you provide a bit more help to get this started?

Thanks.

···


Jeremy Patterson

On Sun, Aug 17, 2014 at 10:18 AM, Bryan Van de Ven [email protected] wrote:

Hi Jeremy,

Unfortunately I don’t have alot of time I can spend on working up examples for this right now, but here is a small static example I cribbed together from some Stack Overflow WX questions:

from bokeh.embed import file_html

from bokeh.plotting import *

from bokeh.resources import INLINE

import numpy as np

import wx

import wx.html2

class PlotWidget(wx.Dialog):

def init(self, *args, **kwds):

wx.Dialog.__init__(self, *args, **kwds)

sizer = wx.BoxSizer(wx.VERTICAL)

self.browser = wx.html2.WebView.New(self)

sizer.Add(self.browser, 1, wx.EXPAND, 10)

self.SetSizer(sizer)

self.SetSize((700, 700))

app = wx.App()

w = PlotWidget(None, -1)

N = 1000

x = np.random.random(size=N) * 100

y = np.random.random(size=N) * 100

radii = np.random.random(size=N) * 4.5

colors = [“#%02x%02x%02x” % (r, g, 150) for r, g in zip(np.floor(50+2x), np.floor(30+2y))]

scatter(

x,y, radius=radii, fill_color=colors,

fill_alpha=0.6, line_color=None,

)

html = file_html(curdoc(), INLINE, “WX Embed Example”)

w.browser.SetPage(html, “.”)

w.Show()

app.MainLoop()

Note: on OSX with Anaconda, you have to run this with python.app (WX needs a Framework build of python)

Working up an example using the server should not be too hard. You will probably want to use bokeh.embed.autoload_server to generate a script tag that will load your plot from the server, then you can put the script tag wherever you like in the HTML text you pass to the SetPage(…) method. Let me know if I can answer any questions.

Thanks,

Bryan

On Aug 14, 2014, at 10:24 AM, Jeremy Patterson [email protected] wrote:

Hey Bryan,

I think my best option would be to write the app completely in Python (wxPython looks like a good option). Since I would be planning on updating the data/labels when buttons/dropdown menus are selected, I would either need to delete and remake the static plot or use the bokeh-server method. I am interested in both methods. I would like to keep the interactive tools that bokeh has (zoom, pan, etc.) beside the plot.

It would get me started if you would make a short example showing how to make a simple bokeh plot in a wxPython app and connect a drop-down box or listbox to the plot. (I am new to the GUI building tools in Python since I use Matlab.) Both the static plot and the bokeh-server method would be great to see.

Thanks,

Jeremy

On Friday, August 8, 2014 4:29:43 AM UTC-7, Bryan Van de ven wrote:

Hi Jeremy,

First, here and Stack Overflow are both great places to ask questions, we try to be as responsive as we can to both.

Bokeh requires an HTML5 canvas to render on, but what you have described, embedding a HTML widget into a rich client app, is something that has occurred to me before, although I have not had the opportunity to try it yet. We try to make Bokeh flexible in the ways it can be embedded, so I can imagine a few different scenarios:

  • App is written in python (PyQt, wxPython, etc)

This is probably the simplest case right now, you can just call out to Bokeh directly in your app. You can create “static” charts that have the data embedded in them (but still have interactive tools) based on the native app widget interactions. Or you can run bokeh-server and host the data there, and push data updates to the server (causing the plots to update). You can also get things like selections back from the plot to your python app code through the server.

  • App is not written in python

If you rich client is written in some other language but you still have access to an HTML widget, you can create and export the JS required to plot your data in python, and then re-use it in your app. If you use the bokeh-server you can update the data with appropriate REST calls to the server, and the pots will update. Without the server, I think in this case you would be limited to “static” data plots.

  • pure web-app

We are working on providing our own widget interface that can be used to develop “Bokeh Apps” or “Bokeh Dashboards”. WE are still baking things out but will gladly help anyone that wants to try it out.

Can you describe your app a little more, what languages and toolkits, etc that you will be using? I would be interested in helping you develop this use-case and then augmenting our user guide and documentation with more step by step instructions on how to integrate Bokeh in this way.

Thanks for your interest in Bokeh!

Bryan

On Aug 8, 2014, at 12:10 AM, Jeremy Patterson [email protected] wrote:

Hey Bokeh,

I am an active Data plotter and am very interested in Bokeh. Bokeh looks like a very good plotting tool.

Is it possible to embed a Bokeh plot in a Graphical User Interface? Specifically, I would like to make something like the GUI shown halfway down this page:

http://www.mathworks.com/help/matlab/ref/uicontrol.html

When the buttons are clicked, the plot responds accordingly. I know there are several packages available to make GUIs in Python but I am not sure if the issue would be embedding iPython or embedding a small browser in the GUI?

Would it be simpler/more appropriate to simply use a browser (Chrome/Firefox) with a plot in it and then put buttons around the plot?

If more appropriate, I can put this question on Stackoverflow.

Thanks.

Jeremy Patterson

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/CACTwgNa_%3DuFTsYeZg2ea%2BzxSGj88x%3DBqt34THUkFjKcNip3Z7w%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/9d68b891-94f3-4cf3-beb8-816f38c2176a%40continuum.io.

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

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/8YqCZdRBgJs/unsubscribe.

To unsubscribe from this group and all its topics, 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/03B616AB-4C21-4FD2-9084-5A7AEDC42C99%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi Jeremy,

I just tried this again with both 0.6 and also current GH master (OSX/safari), and it works fine for me. Can you supply more information about your platform, browser, how you installed everything (conda, pip, source?). Also can you see if there is any interesting output in the browser JS console?

Bryan

···

On Sep 18, 2014, at 3:26 PM, Jeremy Patterson <[email protected]> wrote:

Hey Bryan,

Thanks for the help. I have been playing with this example but it does not seem to work with Bokeh 6.0. It generates an app with a figure but the figure is blank and does not have a title. Could you provide a bit more help to get this started?

Thanks.

--
Jeremy Patterson

On Sun, Aug 17, 2014 at 10:18 AM, Bryan Van de Ven <[email protected]> wrote:
Hi Jeremy,

Unfortunately I don't have alot of time I can spend on working up examples for this right now, but here is a small static example I cribbed together from some Stack Overflow WX questions:

from bokeh.embed import file_html
from bokeh.plotting import *
from bokeh.resources import INLINE
import numpy as np
import wx
import wx.html2

class PlotWidget(wx.Dialog):
  def __init__(self, *args, **kwds):
    wx.Dialog.__init__(self, *args, **kwds)
    sizer = wx.BoxSizer(wx.VERTICAL)
    self.browser = wx.html2.WebView.New(self)
    sizer.Add(self.browser, 1, wx.EXPAND, 10)
    self.SetSizer(sizer)
    self.SetSize((700, 700))

app = wx.App()
w = PlotWidget(None, -1)

N = 1000
x = np.random.random(size=N) * 100
y = np.random.random(size=N) * 100
radii = np.random.random(size=N) * 4.5
colors = ["#%02x%02x%02x" % (r, g, 150) for r, g in zip(np.floor(50+2*x), np.floor(30+2*y))]
scatter(
  x,y, radius=radii, fill_color=colors,
  fill_alpha=0.6, line_color=None,
)
html = file_html(curdoc(), INLINE, "WX Embed Example")

w.browser.SetPage(html, ".")

w.Show()

app.MainLoop()

Note: on OSX with Anaconda, you have to run this with python.app (WX needs a Framework build of python)

Working up an example using the server should not be too hard. You will probably want to use bokeh.embed.autoload_server to generate a script tag that will load your plot from the server, then you can put the script tag wherever you like in the HTML text you pass to the SetPage(...) method. Let me know if I can answer any questions.

Thanks,

Bryan

On Aug 14, 2014, at 10:24 AM, Jeremy Patterson <[email protected]> wrote:

> Hey Bryan,
> I think my best option would be to write the app completely in Python (wxPython looks like a good option). Since I would be planning on updating the data/labels when buttons/dropdown menus are selected, I would either need to delete and remake the static plot or use the bokeh-server method. I am interested in both methods. I would like to keep the interactive tools that bokeh has (zoom, pan, etc.) beside the plot.
>
> It would get me started if you would make a short example showing how to make a simple bokeh plot in a wxPython app and connect a drop-down box or listbox to the plot. (I am new to the GUI building tools in Python since I use Matlab.) Both the static plot and the bokeh-server method would be great to see.
>
> Thanks,
> Jeremy
>
> On Friday, August 8, 2014 4:29:43 AM UTC-7, Bryan Van de ven wrote:
>
> Hi Jeremy,
>
> First, here and Stack Overflow are both great places to ask questions, we try to be as responsive as we can to both.
>
> Bokeh requires an HTML5 canvas to render on, but what you have described, embedding a HTML widget into a rich client app, is something that has occurred to me before, although I have not had the opportunity to try it yet. We try to make Bokeh flexible in the ways it can be embedded, so I can imagine a few different scenarios:
>
> * App is written in python (PyQt, wxPython, etc)
>
> This is probably the simplest case right now, you can just call out to Bokeh directly in your app. You can create "static" charts that have the data embedded in them (but still have interactive tools) based on the native app widget interactions. Or you can run bokeh-server and host the data there, and push data updates to the server (causing the plots to update). You can also get things like selections back from the plot to your python app code through the server.
>
> * App is not written in python
>
> If you rich client is written in some other language but you still have access to an HTML widget, you can create and export the JS required to plot your data in python, and then re-use it in your app. If you use the bokeh-server you can update the data with appropriate REST calls to the server, and the pots will update. Without the server, I think in this case you would be limited to "static" data plots.
>
> * pure web-app
>
> We are working on providing our own widget interface that can be used to develop "Bokeh Apps" or "Bokeh Dashboards". WE are still baking things out but will gladly help anyone that wants to try it out.
>
> Can you describe your app a little more, what languages and toolkits, etc that you will be using? I would be interested in helping you develop this use-case and then augmenting our user guide and documentation with more step by step instructions on how to integrate Bokeh in this way.
>
> Thanks for your interest in Bokeh!
>
> Bryan
>
>
> On Aug 8, 2014, at 12:10 AM, Jeremy Patterson <[email protected]> wrote:
>
> > Hey Bokeh,
> >
> > I am an active Data plotter and am very interested in Bokeh. Bokeh looks like a very good plotting tool.
> >
> > Is it possible to embed a Bokeh plot in a Graphical User Interface? Specifically, I would like to make something like the GUI shown halfway down this page:
> >
> > Create user interface control - MATLAB uicontrol
> >
> > When the buttons are clicked, the plot responds accordingly. I know there are several packages available to make GUIs in Python but I am not sure if the issue would be embedding iPython or embedding a small browser in the GUI?
> >
> > Would it be simpler/more appropriate to simply use a browser (Chrome/Firefox) with a plot in it and then put buttons around the plot?
> >
> > If more appropriate, I can put this question on Stackoverflow.
> >
> > Thanks.
> >
> > --
> > Jeremy Patterson
> >
> > --
> > 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 bokeh+un...@continuum.io.
> > To post to this group, send email to bo...@continuum.io.
> > To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CACTwgNa_%3DuFTsYeZg2ea%2BzxSGj88x%3DBqt34THUkFjKcNip3Z7w%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/9d68b891-94f3-4cf3-beb8-816f38c2176a%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
You received this message because you are subscribed to a topic in the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/8YqCZdRBgJs/unsubscribe\.
To unsubscribe from this group and all its topics, 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/03B616AB-4C21-4FD2-9084-5A7AEDC42C99%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/CACTwgNY5MAJEHhLKxnZ1VAhrxwkNTPB2kf8SsoU2UA-T38PECQ%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Well, not browser in this case, of course... just platform. It's been a long day.

···

On Sep 18, 2014, at 4:03 PM, Bryan Van de Ven <[email protected]> wrote:

Hi Jeremy,

I just tried this again with both 0.6 and also current GH master (OSX/safari), and it works fine for me. Can you supply more information about your platform, browser, how you installed everything (conda, pip, source?). Also can you see if there is any interesting output in the browser JS console?

Bryan

On Sep 18, 2014, at 3:26 PM, Jeremy Patterson <[email protected]> wrote:

Hey Bryan,

Thanks for the help. I have been playing with this example but it does not seem to work with Bokeh 6.0. It generates an app with a figure but the figure is blank and does not have a title. Could you provide a bit more help to get this started?

Thanks.

--
Jeremy Patterson

On Sun, Aug 17, 2014 at 10:18 AM, Bryan Van de Ven <[email protected]> wrote:
Hi Jeremy,

Unfortunately I don't have alot of time I can spend on working up examples for this right now, but here is a small static example I cribbed together from some Stack Overflow WX questions:

from bokeh.embed import file_html
from bokeh.plotting import *
from bokeh.resources import INLINE
import numpy as np
import wx
import wx.html2

class PlotWidget(wx.Dialog):
def __init__(self, *args, **kwds):
   wx.Dialog.__init__(self, *args, **kwds)
   sizer = wx.BoxSizer(wx.VERTICAL)
   self.browser = wx.html2.WebView.New(self)
   sizer.Add(self.browser, 1, wx.EXPAND, 10)
   self.SetSizer(sizer)
   self.SetSize((700, 700))

app = wx.App()
w = PlotWidget(None, -1)

N = 1000
x = np.random.random(size=N) * 100
y = np.random.random(size=N) * 100
radii = np.random.random(size=N) * 4.5
colors = ["#%02x%02x%02x" % (r, g, 150) for r, g in zip(np.floor(50+2*x), np.floor(30+2*y))]
scatter(
x,y, radius=radii, fill_color=colors,
fill_alpha=0.6, line_color=None,
)
html = file_html(curdoc(), INLINE, "WX Embed Example")

w.browser.SetPage(html, ".")

w.Show()

app.MainLoop()

Note: on OSX with Anaconda, you have to run this with python.app (WX needs a Framework build of python)

Working up an example using the server should not be too hard. You will probably want to use bokeh.embed.autoload_server to generate a script tag that will load your plot from the server, then you can put the script tag wherever you like in the HTML text you pass to the SetPage(...) method. Let me know if I can answer any questions.

Thanks,

Bryan

On Aug 14, 2014, at 10:24 AM, Jeremy Patterson <[email protected]> wrote:

Hey Bryan,
I think my best option would be to write the app completely in Python (wxPython looks like a good option). Since I would be planning on updating the data/labels when buttons/dropdown menus are selected, I would either need to delete and remake the static plot or use the bokeh-server method. I am interested in both methods. I would like to keep the interactive tools that bokeh has (zoom, pan, etc.) beside the plot.

It would get me started if you would make a short example showing how to make a simple bokeh plot in a wxPython app and connect a drop-down box or listbox to the plot. (I am new to the GUI building tools in Python since I use Matlab.) Both the static plot and the bokeh-server method would be great to see.

Thanks,
Jeremy

On Friday, August 8, 2014 4:29:43 AM UTC-7, Bryan Van de ven wrote:

Hi Jeremy,

First, here and Stack Overflow are both great places to ask questions, we try to be as responsive as we can to both.

Bokeh requires an HTML5 canvas to render on, but what you have described, embedding a HTML widget into a rich client app, is something that has occurred to me before, although I have not had the opportunity to try it yet. We try to make Bokeh flexible in the ways it can be embedded, so I can imagine a few different scenarios:

* App is written in python (PyQt, wxPython, etc)

This is probably the simplest case right now, you can just call out to Bokeh directly in your app. You can create "static" charts that have the data embedded in them (but still have interactive tools) based on the native app widget interactions. Or you can run bokeh-server and host the data there, and push data updates to the server (causing the plots to update). You can also get things like selections back from the plot to your python app code through the server.

* App is not written in python

If you rich client is written in some other language but you still have access to an HTML widget, you can create and export the JS required to plot your data in python, and then re-use it in your app. If you use the bokeh-server you can update the data with appropriate REST calls to the server, and the pots will update. Without the server, I think in this case you would be limited to "static" data plots.

* pure web-app

We are working on providing our own widget interface that can be used to develop "Bokeh Apps" or "Bokeh Dashboards". WE are still baking things out but will gladly help anyone that wants to try it out.

Can you describe your app a little more, what languages and toolkits, etc that you will be using? I would be interested in helping you develop this use-case and then augmenting our user guide and documentation with more step by step instructions on how to integrate Bokeh in this way.

Thanks for your interest in Bokeh!

Bryan

On Aug 8, 2014, at 12:10 AM, Jeremy Patterson <[email protected]> wrote:

Hey Bokeh,

I am an active Data plotter and am very interested in Bokeh. Bokeh looks like a very good plotting tool.

Is it possible to embed a Bokeh plot in a Graphical User Interface? Specifically, I would like to make something like the GUI shown halfway down this page:

Create user interface control - MATLAB uicontrol

When the buttons are clicked, the plot responds accordingly. I know there are several packages available to make GUIs in Python but I am not sure if the issue would be embedding iPython or embedding a small browser in the GUI?

Would it be simpler/more appropriate to simply use a browser (Chrome/Firefox) with a plot in it and then put buttons around the plot?

If more appropriate, I can put this question on Stackoverflow.

Thanks.

--
Jeremy Patterson

--
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 bokeh+un...@continuum.io.
To post to this group, send email to bo...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CACTwgNa_%3DuFTsYeZg2ea%2BzxSGj88x%3DBqt34THUkFjKcNip3Z7w%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/9d68b891-94f3-4cf3-beb8-816f38c2176a%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
You received this message because you are subscribed to a topic in the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/8YqCZdRBgJs/unsubscribe\.
To unsubscribe from this group and all its topics, 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/03B616AB-4C21-4FD2-9084-5A7AEDC42C99%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/CACTwgNY5MAJEHhLKxnZ1VAhrxwkNTPB2kf8SsoU2UA-T38PECQ%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

I am on Windows 7 using Anaconda. I installed Bokeh 0.6 by executing the setup.py in the zip file found here:
https://pypi.python.org/pypi/bokeh/0.6.0

···


Jeremy Patterson

On Thu, Sep 18, 2014 at 2:03 PM, Bryan Van de Ven [email protected] wrote:

Well, not browser in this case, of course… just platform. It’s been a long day.

On Sep 18, 2014, at 4:03 PM, Bryan Van de Ven [email protected] wrote:

Hi Jeremy,

I just tried this again with both 0.6 and also current GH master (OSX/safari), and it works fine for me. Can you supply more information about your platform, browser, how you installed everything (conda, pip, source?). Also can you see if there is any interesting output in the browser JS console?

Bryan

On Sep 18, 2014, at 3:26 PM, Jeremy Patterson [email protected] wrote:

Hey Bryan,

Thanks for the help. I have been playing with this example but it does not seem to work with Bokeh 6.0. It generates an app with a figure but the figure is blank and does not have a title. Could you provide a bit more help to get this started?

Thanks.

Jeremy Patterson

On Sun, Aug 17, 2014 at 10:18 AM, Bryan Van de Ven [email protected] wrote:

Hi Jeremy,

Unfortunately I don’t have alot of time I can spend on working up examples for this right now, but here is a small static example I cribbed together from some Stack Overflow WX questions:

from bokeh.embed import file_html

from bokeh.plotting import *

from bokeh.resources import INLINE

import numpy as np

import wx

import wx.html2

class PlotWidget(wx.Dialog):

def init(self, *args, **kwds):

wx.Dialog.init(self, *args, **kwds)

sizer = wx.BoxSizer(wx.VERTICAL)

self.browser = wx.html2.WebView.New(self)

sizer.Add(self.browser, 1, wx.EXPAND, 10)

self.SetSizer(sizer)

self.SetSize((700, 700))

app = wx.App()

w = PlotWidget(None, -1)

N = 1000

x = np.random.random(size=N) * 100

y = np.random.random(size=N) * 100

radii = np.random.random(size=N) * 4.5

colors = [“#%02x%02x%02x” % (r, g, 150) for r, g in zip(np.floor(50+2x), np.floor(30+2y))]

scatter(

x,y, radius=radii, fill_color=colors,

fill_alpha=0.6, line_color=None,

)

html = file_html(curdoc(), INLINE, “WX Embed Example”)

w.browser.SetPage(html, “.”)

w.Show()

app.MainLoop()

Note: on OSX with Anaconda, you have to run this with python.app (WX needs a Framework build of python)

Working up an example using the server should not be too hard. You will probably want to use bokeh.embed.autoload_server to generate a script tag that will load your plot from the server, then you can put the script tag wherever you like in the HTML text you pass to the SetPage(…) method. Let me know if I can answer any questions.

Thanks,

Bryan

On Aug 14, 2014, at 10:24 AM, Jeremy Patterson [email protected] wrote:

Hey Bryan,

I think my best option would be to write the app completely in Python (wxPython looks like a good option). Since I would be planning on updating the data/labels when buttons/dropdown menus are selected, I would either need to delete and remake the static plot or use the bokeh-server method. I am interested in both methods. I would like to keep the interactive tools that bokeh has (zoom, pan, etc.) beside the plot.

It would get me started if you would make a short example showing how to make a simple bokeh plot in a wxPython app and connect a drop-down box or listbox to the plot. (I am new to the GUI building tools in Python since I use Matlab.) Both the static plot and the bokeh-server method would be great to see.

Thanks,

Jeremy

On Friday, August 8, 2014 4:29:43 AM UTC-7, Bryan Van de ven wrote:

Hi Jeremy,

First, here and Stack Overflow are both great places to ask questions, we try to be as responsive as we can to both.

Bokeh requires an HTML5 canvas to render on, but what you have described, embedding a HTML widget into a rich client app, is something that has occurred to me before, although I have not had the opportunity to try it yet. We try to make Bokeh flexible in the ways it can be embedded, so I can imagine a few different scenarios:

  • App is written in python (PyQt, wxPython, etc)

This is probably the simplest case right now, you can just call out to Bokeh directly in your app. You can create “static” charts that have the data embedded in them (but still have interactive tools) based on the native app widget interactions. Or you can run bokeh-server and host the data there, and push data updates to the server (causing the plots to update). You can also get things like selections back from the plot to your python app code through the server.

  • App is not written in python

If you rich client is written in some other language but you still have access to an HTML widget, you can create and export the JS required to plot your data in python, and then re-use it in your app. If you use the bokeh-server you can update the data with appropriate REST calls to the server, and the pots will update. Without the server, I think in this case you would be limited to “static” data plots.

  • pure web-app

We are working on providing our own widget interface that can be used to develop “Bokeh Apps” or “Bokeh Dashboards”. WE are still baking things out but will gladly help anyone that wants to try it out.

Can you describe your app a little more, what languages and toolkits, etc that you will be using? I would be interested in helping you develop this use-case and then augmenting our user guide and documentation with more step by step instructions on how to integrate Bokeh in this way.

Thanks for your interest in Bokeh!

Bryan

On Aug 8, 2014, at 12:10 AM, Jeremy Patterson [email protected] wrote:

Hey Bokeh,

I am an active Data plotter and am very interested in Bokeh. Bokeh looks like a very good plotting tool.

Is it possible to embed a Bokeh plot in a Graphical User Interface? Specifically, I would like to make something like the GUI shown halfway down this page:

http://www.mathworks.com/help/matlab/ref/uicontrol.html

When the buttons are clicked, the plot responds accordingly. I know there are several packages available to make GUIs in Python but I am not sure if the issue would be embedding iPython or embedding a small browser in the GUI?

Would it be simpler/more appropriate to simply use a browser (Chrome/Firefox) with a plot in it and then put buttons around the plot?

If more appropriate, I can put this question on Stackoverflow.

Thanks.

Jeremy Patterson

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/CACTwgNa_%3DuFTsYeZg2ea%2BzxSGj88x%3DBqt34THUkFjKcNip3Z7w%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/9d68b891-94f3-4cf3-beb8-816f38c2176a%40continuum.io.

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

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/8YqCZdRBgJs/unsubscribe.

To unsubscribe from this group and all its topics, 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/03B616AB-4C21-4FD2-9084-5A7AEDC42C99%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/CACTwgNY5MAJEHhLKxnZ1VAhrxwkNTPB2kf8SsoU2UA-T38PECQ%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 a topic in the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/8YqCZdRBgJs/unsubscribe.

To unsubscribe from this group and all its topics, 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/7170E3D3-B706-41B2-8D1A-7A675D779905%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

If you are using Anaconda, can you try installing/upating bokeh using conda?

  conda update bokeh

A version of Bokeh ships with Anaconda, I suppose it's possible that using the setup.py somehow creates a problem with the installation. You can also try deleting any thing "bokeh" related in your Anaconda site-packages.

Bryan

···

On Sep 18, 2014, at 4:18 PM, Jeremy Patterson <[email protected]> wrote:

I am on Windows 7 using Anaconda. I installed Bokeh 0.6 by executing the setup.py in the zip file found here:
bokeh · PyPI

--
Jeremy Patterson

On Thu, Sep 18, 2014 at 2:03 PM, Bryan Van de Ven <[email protected]> wrote:
Well, not browser in this case, of course... just platform. It's been a long day.

On Sep 18, 2014, at 4:03 PM, Bryan Van de Ven <[email protected]> wrote:

> Hi Jeremy,
>
> I just tried this again with both 0.6 and also current GH master (OSX/safari), and it works fine for me. Can you supply more information about your platform, browser, how you installed everything (conda, pip, source?). Also can you see if there is any interesting output in the browser JS console?
>
> Bryan
>
> On Sep 18, 2014, at 3:26 PM, Jeremy Patterson <[email protected]> wrote:
>
>> Hey Bryan,
>>
>> Thanks for the help. I have been playing with this example but it does not seem to work with Bokeh 6.0. It generates an app with a figure but the figure is blank and does not have a title. Could you provide a bit more help to get this started?
>>
>> Thanks.
>>
>>
>>
>>
>> --
>> Jeremy Patterson
>>
>> On Sun, Aug 17, 2014 at 10:18 AM, Bryan Van de Ven <[email protected]> wrote:
>> Hi Jeremy,
>>
>> Unfortunately I don't have alot of time I can spend on working up examples for this right now, but here is a small static example I cribbed together from some Stack Overflow WX questions:
>>
>>
>>
>> from bokeh.embed import file_html
>> from bokeh.plotting import *
>> from bokeh.resources import INLINE
>> import numpy as np
>> import wx
>> import wx.html2
>>
>> class PlotWidget(wx.Dialog):
>> def __init__(self, *args, **kwds):
>> wx.Dialog.__init__(self, *args, **kwds)
>> sizer = wx.BoxSizer(wx.VERTICAL)
>> self.browser = wx.html2.WebView.New(self)
>> sizer.Add(self.browser, 1, wx.EXPAND, 10)
>> self.SetSizer(sizer)
>> self.SetSize((700, 700))
>>
>> app = wx.App()
>> w = PlotWidget(None, -1)
>>
>> N = 1000
>> x = np.random.random(size=N) * 100
>> y = np.random.random(size=N) * 100
>> radii = np.random.random(size=N) * 4.5
>> colors = ["#%02x%02x%02x" % (r, g, 150) for r, g in zip(np.floor(50+2*x), np.floor(30+2*y))]
>> scatter(
>> x,y, radius=radii, fill_color=colors,
>> fill_alpha=0.6, line_color=None,
>> )
>> html = file_html(curdoc(), INLINE, "WX Embed Example")
>>
>> w.browser.SetPage(html, ".")
>>
>> w.Show()
>>
>> app.MainLoop()
>>
>>
>>
>> Note: on OSX with Anaconda, you have to run this with python.app (WX needs a Framework build of python)
>>
>> Working up an example using the server should not be too hard. You will probably want to use bokeh.embed.autoload_server to generate a script tag that will load your plot from the server, then you can put the script tag wherever you like in the HTML text you pass to the SetPage(...) method. Let me know if I can answer any questions.
>>
>> Thanks,
>>
>> Bryan
>>
>>
>> On Aug 14, 2014, at 10:24 AM, Jeremy Patterson <[email protected]> wrote:
>>
>>> Hey Bryan,
>>> I think my best option would be to write the app completely in Python (wxPython looks like a good option). Since I would be planning on updating the data/labels when buttons/dropdown menus are selected, I would either need to delete and remake the static plot or use the bokeh-server method. I am interested in both methods. I would like to keep the interactive tools that bokeh has (zoom, pan, etc.) beside the plot.
>>>
>>> It would get me started if you would make a short example showing how to make a simple bokeh plot in a wxPython app and connect a drop-down box or listbox to the plot. (I am new to the GUI building tools in Python since I use Matlab.) Both the static plot and the bokeh-server method would be great to see.
>>>
>>> Thanks,
>>> Jeremy
>>>
>>> On Friday, August 8, 2014 4:29:43 AM UTC-7, Bryan Van de ven wrote:
>>>
>>> Hi Jeremy,
>>>
>>> First, here and Stack Overflow are both great places to ask questions, we try to be as responsive as we can to both.
>>>
>>> Bokeh requires an HTML5 canvas to render on, but what you have described, embedding a HTML widget into a rich client app, is something that has occurred to me before, although I have not had the opportunity to try it yet. We try to make Bokeh flexible in the ways it can be embedded, so I can imagine a few different scenarios:
>>>
>>> * App is written in python (PyQt, wxPython, etc)
>>>
>>> This is probably the simplest case right now, you can just call out to Bokeh directly in your app. You can create "static" charts that have the data embedded in them (but still have interactive tools) based on the native app widget interactions. Or you can run bokeh-server and host the data there, and push data updates to the server (causing the plots to update). You can also get things like selections back from the plot to your python app code through the server.
>>>
>>> * App is not written in python
>>>
>>> If you rich client is written in some other language but you still have access to an HTML widget, you can create and export the JS required to plot your data in python, and then re-use it in your app. If you use the bokeh-server you can update the data with appropriate REST calls to the server, and the pots will update. Without the server, I think in this case you would be limited to "static" data plots.
>>>
>>> * pure web-app
>>>
>>> We are working on providing our own widget interface that can be used to develop "Bokeh Apps" or "Bokeh Dashboards". WE are still baking things out but will gladly help anyone that wants to try it out.
>>>
>>> Can you describe your app a little more, what languages and toolkits, etc that you will be using? I would be interested in helping you develop this use-case and then augmenting our user guide and documentation with more step by step instructions on how to integrate Bokeh in this way.
>>>
>>> Thanks for your interest in Bokeh!
>>>
>>> Bryan
>>>
>>>
>>> On Aug 8, 2014, at 12:10 AM, Jeremy Patterson <[email protected]> wrote:
>>>
>>>> Hey Bokeh,
>>>>
>>>> I am an active Data plotter and am very interested in Bokeh. Bokeh looks like a very good plotting tool.
>>>>
>>>> Is it possible to embed a Bokeh plot in a Graphical User Interface? Specifically, I would like to make something like the GUI shown halfway down this page:
>>>>
>>>> Create user interface control - MATLAB uicontrol
>>>>
>>>> When the buttons are clicked, the plot responds accordingly. I know there are several packages available to make GUIs in Python but I am not sure if the issue would be embedding iPython or embedding a small browser in the GUI?
>>>>
>>>> Would it be simpler/more appropriate to simply use a browser (Chrome/Firefox) with a plot in it and then put buttons around the plot?
>>>>
>>>> If more appropriate, I can put this question on Stackoverflow.
>>>>
>>>> Thanks.
>>>>
>>>> --
>>>> Jeremy Patterson
>>>>
>>>> --
>>>> 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 bokeh+un...@continuum.io.
>>>> To post to this group, send email to bo...@continuum.io.
>>>> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CACTwgNa_%3DuFTsYeZg2ea%2BzxSGj88x%3DBqt34THUkFjKcNip3Z7w%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/9d68b891-94f3-4cf3-beb8-816f38c2176a%40continuum.io\.
>>> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
>>
>> --
>> You received this message because you are subscribed to a topic in the Google Groups "Bokeh Discussion - Public" group.
>> To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/8YqCZdRBgJs/unsubscribe\.
>> To unsubscribe from this group and all its topics, 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/03B616AB-4C21-4FD2-9084-5A7AEDC42C99%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/CACTwgNY5MAJEHhLKxnZ1VAhrxwkNTPB2kf8SsoU2UA-T38PECQ%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 a topic in the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/8YqCZdRBgJs/unsubscribe\.
To unsubscribe from this group and all its topics, 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/7170E3D3-B706-41B2-8D1A-7A675D779905%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/CACTwgNY6SFs8ZHuNPTjvVwwk7s7B1nSeZoJf2MH3X1-fTdzx%2BQ%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Is there any update with this example? I would be curious to try to use bokeh embedded in some local gui, but don’t see any similar examples.

···

On Sunday, September 28, 2014 at 4:17:43 PM UTC-5, Bryan Van de ven wrote:

If you are using Anaconda, can you try installing/upating bokeh using conda?

    conda update bokeh

A version of Bokeh ships with Anaconda, I suppose it’s possible that using the setup.py somehow creates a problem with the installation. You can also try deleting any thing “bokeh” related in your Anaconda site-packages.

Bryan

On Sep 18, 2014, at 4:18 PM, Jeremy Patterson [email protected] wrote:

I am on Windows 7 using Anaconda. I installed Bokeh 0.6 by executing the setup.py in the zip file found here:

https://pypi.python.org/pypi/bokeh/0.6.0

Jeremy Patterson

On Thu, Sep 18, 2014 at 2:03 PM, Bryan Van de Ven [email protected] wrote:

Well, not browser in this case, of course… just platform. It’s been a long day.

On Sep 18, 2014, at 4:03 PM, Bryan Van de Ven [email protected] wrote:

Hi Jeremy,

I just tried this again with both 0.6 and also current GH master (OSX/safari), and it works fine for me. Can you supply more information about your platform, browser, how you installed everything (conda, pip, source?). Also can you see if there is any interesting output in the browser JS console?

Bryan

On Sep 18, 2014, at 3:26 PM, Jeremy Patterson [email protected] wrote:

Hey Bryan,

Thanks for the help. I have been playing with this example but it does not seem to work with Bokeh 6.0. It generates an app with a figure but the figure is blank and does not have a title. Could you provide a bit more help to get this started?

Thanks.

Jeremy Patterson

On Sun, Aug 17, 2014 at 10:18 AM, Bryan Van de Ven [email protected] wrote:

Hi Jeremy,

Unfortunately I don’t have alot of time I can spend on working up examples for this right now, but here is a small static example I cribbed together from some Stack Overflow WX questions:

from bokeh.embed import file_html

from bokeh.plotting import *

from bokeh.resources import INLINE

import numpy as np

import wx

import wx.html2

class PlotWidget(wx.Dialog):

def init(self, *args, **kwds):

wx.Dialog.init(self, *args, **kwds)

sizer = wx.BoxSizer(wx.VERTICAL)

self.browser = wx.html2.WebView.New(self)

sizer.Add(self.browser, 1, wx.EXPAND, 10)

self.SetSizer(sizer)

self.SetSize((700, 700))

app = wx.App()

w = PlotWidget(None, -1)

N = 1000

x = np.random.random(size=N) * 100

y = np.random.random(size=N) * 100

radii = np.random.random(size=N) * 4.5

colors = [“#%02x%02x%02x” % (r, g, 150) for r, g in zip(np.floor(50+2x), np.floor(30+2y))]

scatter(

x,y, radius=radii, fill_color=colors,

fill_alpha=0.6, line_color=None,

)

html = file_html(curdoc(), INLINE, “WX Embed Example”)

w.browser.SetPage(html, “.”)

w.Show()

app.MainLoop()

Note: on OSX with Anaconda, you have to run this with python.app (WX needs a Framework build of python)

Working up an example using the server should not be too hard. You will probably want to use bokeh.embed.autoload_server to generate a script tag that will load your plot from the server, then you can put the script tag wherever you like in the HTML text you pass to the SetPage(…) method. Let me know if I can answer any questions.

Thanks,

Bryan

On Aug 14, 2014, at 10:24 AM, Jeremy Patterson [email protected] wrote:

Hey Bryan,

I think my best option would be to write the app completely in Python (wxPython looks like a good option). Since I would be planning on updating the data/labels when buttons/dropdown menus are selected, I would either need to delete and remake the static plot or use the bokeh-server method. I am interested in both methods. I would like to keep the interactive tools that bokeh has (zoom, pan, etc.) beside the plot.

It would get me started if you would make a short example showing how to make a simple bokeh plot in a wxPython app and connect a drop-down box or listbox to the plot. (I am new to the GUI building tools in Python since I use Matlab.) Both the static plot and the bokeh-server method would be great to see.

Thanks,

Jeremy

On Friday, August 8, 2014 4:29:43 AM UTC-7, Bryan Van de ven wrote:

Hi Jeremy,

First, here and Stack Overflow are both great places to ask questions, we try to be as responsive as we can to both.

Bokeh requires an HTML5 canvas to render on, but what you have described, embedding a HTML widget into a rich client app, is something that has occurred to me before, although I have not had the opportunity to try it yet. We try to make Bokeh flexible in the ways it can be embedded, so I can imagine a few different scenarios:

  • App is written in python (PyQt, wxPython, etc)

This is probably the simplest case right now, you can just call out to Bokeh directly in your app. You can create “static” charts that have the data embedded in them (but still have interactive tools) based on the native app widget interactions. Or you can run bokeh-server and host the data there, and push data updates to the server (causing the plots to update). You can also get things like selections back from the plot to your python app code through the server.

  • App is not written in python

If you rich client is written in some other language but you still have access to an HTML widget, you can create and export the JS required to plot your data in python, and then re-use it in your app. If you use the bokeh-server you can update the data with appropriate REST calls to the server, and the pots will update. Without the server, I think in this case you would be limited to “static” data plots.

  • pure web-app

We are working on providing our own widget interface that can be used to develop “Bokeh Apps” or “Bokeh Dashboards”. WE are still baking things out but will gladly help anyone that wants to try it out.

Can you describe your app a little more, what languages and toolkits, etc that you will be using? I would be interested in helping you develop this use-case and then augmenting our user guide and documentation with more step by step instructions on how to integrate Bokeh in this way.

Thanks for your interest in Bokeh!

Bryan

On Aug 8, 2014, at 12:10 AM, Jeremy Patterson [email protected] wrote:

Hey Bokeh,

I am an active Data plotter and am very interested in Bokeh. Bokeh looks like a very good plotting tool.

Is it possible to embed a Bokeh plot in a Graphical User Interface? Specifically, I would like to make something like the GUI shown halfway down this page:

http://www.mathworks.com/help/matlab/ref/uicontrol.html

When the buttons are clicked, the plot responds accordingly. I know there are several packages available to make GUIs in Python but I am not sure if the issue would be embedding iPython or embedding a small browser in the GUI?

Would it be simpler/more appropriate to simply use a browser (Chrome/Firefox) with a plot in it and then put buttons around the plot?

If more appropriate, I can put this question on Stackoverflow.

Thanks.

Jeremy Patterson

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/CACTwgNa_%3DuFTsYeZg2ea%2BzxSGj88x%3DBqt34THUkFjKcNip3Z7w%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/9d68b891-94f3-4cf3-beb8-816f38c2176a%40continuum.io.

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

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/8YqCZdRBgJs/unsubscribe.

To unsubscribe from this group and all its topics, 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/03B616AB-4C21-4FD2-9084-5A7AEDC42C99%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/CACTwgNY5MAJEHhLKxnZ1VAhrxwkNTPB2kf8SsoU2UA-T38PECQ%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 a topic in the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/8YqCZdRBgJs/unsubscribe.

To unsubscribe from this group and all its topics, 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/7170E3D3-B706-41B2-8D1A-7A675D779905%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/CACTwgNY6SFs8ZHuNPTjvVwwk7s7B1nSeZoJf2MH3X1-fTdzx%2BQ%40mail.gmail.com.

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

Hi,

I'm not quite sure what you are asking for/about, specifically. In any case, while the rich-client GUI use case is not something that is officially supported/maintained, in general Bokeh just needs a JS capable browser with an HTML canvas. If your rich client UI library has such an HTML widget, then its plausible that the standard ways of embedding Bokeh plots and apps should function:

  https://bokeh.pydata.org/en/latest/docs/user_guide/embed.html

That said, "plausibly works" and "actually works" are not always the same, to you'd have to actually try things out with whatever toolkit you are actually using.

Thanks,

Bryan

···

On Feb 14, 2018, at 12:34, [email protected] wrote:

Is there any update with this example? I would be curious to try to use bokeh embedded in some local gui, but don't see any similar examples.

On Sunday, September 28, 2014 at 4:17:43 PM UTC-5, Bryan Van de ven wrote:
If you are using Anaconda, can you try installing/upating bokeh using conda?

        conda update bokeh

A version of Bokeh ships with Anaconda, I suppose it's possible that using the setup.py somehow creates a problem with the installation. You can also try deleting any thing "bokeh" related in your Anaconda site-packages.

Bryan

On Sep 18, 2014, at 4:18 PM, Jeremy Patterson <[email protected]> wrote:

> I am on Windows 7 using Anaconda. I installed Bokeh 0.6 by executing the setup.py in the zip file found here:
> bokeh · PyPI
>
>
>
>
> --
> Jeremy Patterson
>
> On Thu, Sep 18, 2014 at 2:03 PM, Bryan Van de Ven <[email protected]> wrote:
> Well, not browser in this case, of course... just platform. It's been a long day.
>
> On Sep 18, 2014, at 4:03 PM, Bryan Van de Ven <[email protected]> wrote:
>
> > Hi Jeremy,
> >
> > I just tried this again with both 0.6 and also current GH master (OSX/safari), and it works fine for me. Can you supply more information about your platform, browser, how you installed everything (conda, pip, source?). Also can you see if there is any interesting output in the browser JS console?
> >
> > Bryan
> >
> > On Sep 18, 2014, at 3:26 PM, Jeremy Patterson <[email protected]> wrote:
> >
> >> Hey Bryan,
> >>
> >> Thanks for the help. I have been playing with this example but it does not seem to work with Bokeh 6.0. It generates an app with a figure but the figure is blank and does not have a title. Could you provide a bit more help to get this started?
> >>
> >> Thanks.
> >>
> >>
> >>
> >>
> >> --
> >> Jeremy Patterson
> >>
> >> On Sun, Aug 17, 2014 at 10:18 AM, Bryan Van de Ven <[email protected]> wrote:
> >> Hi Jeremy,
> >>
> >> Unfortunately I don't have alot of time I can spend on working up examples for this right now, but here is a small static example I cribbed together from some Stack Overflow WX questions:
> >>
> >>
> >>
> >> from bokeh.embed import file_html
> >> from bokeh.plotting import *
> >> from bokeh.resources import INLINE
> >> import numpy as np
> >> import wx
> >> import wx.html2
> >>
> >> class PlotWidget(wx.Dialog):
> >> def __init__(self, *args, **kwds):
> >> wx.Dialog.__init__(self, *args, **kwds)
> >> sizer = wx.BoxSizer(wx.VERTICAL)
> >> self.browser = wx.html2.WebView.New(self)
> >> sizer.Add(self.browser, 1, wx.EXPAND, 10)
> >> self.SetSizer(sizer)
> >> self.SetSize((700, 700))
> >>
> >> app = wx.App()
> >> w = PlotWidget(None, -1)
> >>
> >> N = 1000
> >> x = np.random.random(size=N) * 100
> >> y = np.random.random(size=N) * 100
> >> radii = np.random.random(size=N) * 4.5
> >> colors = ["#%02x%02x%02x" % (r, g, 150) for r, g in zip(np.floor(50+2*x), np.floor(30+2*y))]
> >> scatter(
> >> x,y, radius=radii, fill_color=colors,
> >> fill_alpha=0.6, line_color=None,
> >> )
> >> html = file_html(curdoc(), INLINE, "WX Embed Example")
> >>
> >> w.browser.SetPage(html, ".")
> >>
> >> w.Show()
> >>
> >> app.MainLoop()
> >>
> >>
> >>
> >> Note: on OSX with Anaconda, you have to run this with python.app (WX needs a Framework build of python)
> >>
> >> Working up an example using the server should not be too hard. You will probably want to use bokeh.embed.autoload_server to generate a script tag that will load your plot from the server, then you can put the script tag wherever you like in the HTML text you pass to the SetPage(...) method. Let me know if I can answer any questions.
> >>
> >> Thanks,
> >>
> >> Bryan
> >>
> >>
> >> On Aug 14, 2014, at 10:24 AM, Jeremy Patterson <[email protected]> wrote:
> >>
> >>> Hey Bryan,
> >>> I think my best option would be to write the app completely in Python (wxPython looks like a good option). Since I would be planning on updating the data/labels when buttons/dropdown menus are selected, I would either need to delete and remake the static plot or use the bokeh-server method. I am interested in both methods. I would like to keep the interactive tools that bokeh has (zoom, pan, etc.) beside the plot.
> >>>
> >>> It would get me started if you would make a short example showing how to make a simple bokeh plot in a wxPython app and connect a drop-down box or listbox to the plot. (I am new to the GUI building tools in Python since I use Matlab.) Both the static plot and the bokeh-server method would be great to see.
> >>>
> >>> Thanks,
> >>> Jeremy
> >>>
> >>> On Friday, August 8, 2014 4:29:43 AM UTC-7, Bryan Van de ven wrote:
> >>>
> >>> Hi Jeremy,
> >>>
> >>> First, here and Stack Overflow are both great places to ask questions, we try to be as responsive as we can to both.
> >>>
> >>> Bokeh requires an HTML5 canvas to render on, but what you have described, embedding a HTML widget into a rich client app, is something that has occurred to me before, although I have not had the opportunity to try it yet. We try to make Bokeh flexible in the ways it can be embedded, so I can imagine a few different scenarios:
> >>>
> >>> * App is written in python (PyQt, wxPython, etc)
> >>>
> >>> This is probably the simplest case right now, you can just call out to Bokeh directly in your app. You can create "static" charts that have the data embedded in them (but still have interactive tools) based on the native app widget interactions. Or you can run bokeh-server and host the data there, and push data updates to the server (causing the plots to update). You can also get things like selections back from the plot to your python app code through the server.
> >>>
> >>> * App is not written in python
> >>>
> >>> If you rich client is written in some other language but you still have access to an HTML widget, you can create and export the JS required to plot your data in python, and then re-use it in your app. If you use the bokeh-server you can update the data with appropriate REST calls to the server, and the pots will update. Without the server, I think in this case you would be limited to "static" data plots.
> >>>
> >>> * pure web-app
> >>>
> >>> We are working on providing our own widget interface that can be used to develop "Bokeh Apps" or "Bokeh Dashboards". WE are still baking things out but will gladly help anyone that wants to try it out.
> >>>
> >>> Can you describe your app a little more, what languages and toolkits, etc that you will be using? I would be interested in helping you develop this use-case and then augmenting our user guide and documentation with more step by step instructions on how to integrate Bokeh in this way.
> >>>
> >>> Thanks for your interest in Bokeh!
> >>>
> >>> Bryan
> >>>
> >>>
> >>> On Aug 8, 2014, at 12:10 AM, Jeremy Patterson <[email protected]> wrote:
> >>>
> >>>> Hey Bokeh,
> >>>>
> >>>> I am an active Data plotter and am very interested in Bokeh. Bokeh looks like a very good plotting tool.
> >>>>
> >>>> Is it possible to embed a Bokeh plot in a Graphical User Interface? Specifically, I would like to make something like the GUI shown halfway down this page:
> >>>>
> >>>> Create user interface control - MATLAB uicontrol
> >>>>
> >>>> When the buttons are clicked, the plot responds accordingly. I know there are several packages available to make GUIs in Python but I am not sure if the issue would be embedding iPython or embedding a small browser in the GUI?
> >>>>
> >>>> Would it be simpler/more appropriate to simply use a browser (Chrome/Firefox) with a plot in it and then put buttons around the plot?
> >>>>
> >>>> If more appropriate, I can put this question on Stackoverflow.
> >>>>
> >>>> Thanks.
> >>>>
> >>>> --
> >>>> Jeremy Patterson
> >>>>
> >>>> --
> >>>> 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 bokeh+un...@continuum.io.
> >>>> To post to this group, send email to bo...@continuum.io.
> >>>> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CACTwgNa_%3DuFTsYeZg2ea%2BzxSGj88x%3DBqt34THUkFjKcNip3Z7w%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 bokeh+un...@continuum.io.
> >>> To post to this group, send email to bo...@continuum.io.
> >>> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/9d68b891-94f3-4cf3-beb8-816f38c2176a%40continuum.io\.
> >>> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
> >>
> >> --
> >> You received this message because you are subscribed to a topic in the Google Groups "Bokeh Discussion - Public" group.
> >> To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/8YqCZdRBgJs/unsubscribe\.
> >> To unsubscribe from this group and all its topics, send an email to bokeh+un...@continuum.io.
> >> To post to this group, send email to bo...@continuum.io.
> >> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/03B616AB-4C21-4FD2-9084-5A7AEDC42C99%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 bokeh+un...@continuum.io.
> >> To post to this group, send email to bo...@continuum.io.
> >> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CACTwgNY5MAJEHhLKxnZ1VAhrxwkNTPB2kf8SsoU2UA-T38PECQ%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 a topic in the Google Groups "Bokeh Discussion - Public" group.
> To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/8YqCZdRBgJs/unsubscribe\.
> To unsubscribe from this group and all its topics, send an email to bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/7170E3D3-B706-41B2-8D1A-7A675D779905%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 bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CACTwgNY6SFs8ZHuNPTjvVwwk7s7B1nSeZoJf2MH3X1-fTdzx%2BQ%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/a1fa0f80-6a87-4138-895d-aaa1ba8d21ea%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hello,

I have made a slightly modified version of this example which works well on my system (Ubuntu, Bokeh 0.13.0, wxPython 4.0.3). Posting here since this seems to be the only thread on the net for Bokeh+wxPython.

···

======================

from bokeh.embed import file_html
from bokeh.plotting import *
from bokeh.resources import INLINE
import numpy as np
import wx
import wx.html2

class PlotWidget(wx.Dialog):
def init(self, *args, **kwds):
wx.Dialog.init(self, *args, **kwds)
sizer = wx.BoxSizer(wx.VERTICAL)
self.browser = wx.html2.WebView.New(self)
sizer.Add(self.browser, 1, wx.EXPAND, 10)
self.SetSizer(sizer)
self.SetSize((700, 700))

app = wx.App()
w = PlotWidget(None, -1)

N = 1000
x = np.random.random(size=N) * 100
y = np.random.random(size=N) * 100
radii = np.random.random(size=N) * 4.5
colors = [“#%02x%02x%02x” % (int(r), int(g), 150) for r, g in zip(np.floor(50+2x), np.floor(30+2y))]
f = figure()
f.scatter(
x,y, radius=radii, fill_color=colors,
fill_alpha=0.6, line_color=None,
)
html = file_html(f, INLINE, “WX Embed Example”)

w.browser.SetPage(html, “.”)

w.Show()

app.MainLoop()

As I will likely be using this combination extensively, I’d welcome further conversation on it.

– Kim

On Sunday, August 17, 2014 at 7:18:33 PM UTC+2, Bryan Van de ven wrote:

Hi Jeremy,

Unfortunately I don’t have alot of time I can spend on working up examples for this right now, but here is a small static example I cribbed together from some Stack Overflow WX questions:

from bokeh.embed import file_html

from bokeh.plotting import *

from bokeh.resources import INLINE

import numpy as np

import wx

import wx.html2

class PlotWidget(wx.Dialog):

def init(self, *args, **kwds):

wx.Dialog.__init__(self, *args, **kwds)

sizer = wx.BoxSizer(wx.VERTICAL)

self.browser = wx.html2.WebView.New(self)

sizer.Add(self.browser, 1, wx.EXPAND, 10)

self.SetSizer(sizer)

self.SetSize((700, 700))

app = wx.App()

w = PlotWidget(None, -1)

N = 1000

x = np.random.random(size=N) * 100

y = np.random.random(size=N) * 100

radii = np.random.random(size=N) * 4.5

colors = [“#%02x%02x%02x” % (r, g, 150) for r, g in zip(np.floor(50+2x), np.floor(30+2y))]

scatter(

x,y, radius=radii, fill_color=colors,

fill_alpha=0.6, line_color=None,

)

html = file_html(curdoc(), INLINE, “WX Embed Example”)

w.browser.SetPage(html, “.”)

w.Show()

app.MainLoop()

Note: on OSX with Anaconda, you have to run this with python.app (WX needs a Framework build of python)

Working up an example using the server should not be too hard. You will probably want to use bokeh.embed.autoload_server to generate a script tag that will load your plot from the server, then you can put the script tag wherever you like in the HTML text you pass to the SetPage(…) method. Let me know if I can answer any questions.

Thanks,

Bryan

On Aug 14, 2014, at 10:24 AM, Jeremy Patterson [email protected] wrote:

Hey Bryan,

I think my best option would be to write the app completely in Python (wxPython looks like a good option). Since I would be planning on updating the data/labels when buttons/dropdown menus are selected, I would either need to delete and remake the static plot or use the bokeh-server method. I am interested in both methods. I would like to keep the interactive tools that bokeh has (zoom, pan, etc.) beside the plot.

It would get me started if you would make a short example showing how to make a simple bokeh plot in a wxPython app and connect a drop-down box or listbox to the plot. (I am new to the GUI building tools in Python since I use Matlab.) Both the static plot and the bokeh-server method would be great to see.

Thanks,

Jeremy

On Friday, August 8, 2014 4:29:43 AM UTC-7, Bryan Van de ven wrote:

Hi Jeremy,

First, here and Stack Overflow are both great places to ask questions, we try to be as responsive as we can to both.

Bokeh requires an HTML5 canvas to render on, but what you have described, embedding a HTML widget into a rich client app, is something that has occurred to me before, although I have not had the opportunity to try it yet. We try to make Bokeh flexible in the ways it can be embedded, so I can imagine a few different scenarios:

  • App is written in python (PyQt, wxPython, etc)

This is probably the simplest case right now, you can just call out to Bokeh directly in your app. You can create “static” charts that have the data embedded in them (but still have interactive tools) based on the native app widget interactions. Or you can run bokeh-server and host the data there, and push data updates to the server (causing the plots to update). You can also get things like selections back from the plot to your python app code through the server.

  • App is not written in python

If you rich client is written in some other language but you still have access to an HTML widget, you can create and export the JS required to plot your data in python, and then re-use it in your app. If you use the bokeh-server you can update the data with appropriate REST calls to the server, and the pots will update. Without the server, I think in this case you would be limited to “static” data plots.

  • pure web-app

We are working on providing our own widget interface that can be used to develop “Bokeh Apps” or “Bokeh Dashboards”. WE are still baking things out but will gladly help anyone that wants to try it out.

Can you describe your app a little more, what languages and toolkits, etc that you will be using? I would be interested in helping you develop this use-case and then augmenting our user guide and documentation with more step by step instructions on how to integrate Bokeh in this way.

Thanks for your interest in Bokeh!

Bryan

On Aug 8, 2014, at 12:10 AM, Jeremy Patterson [email protected] wrote:

Hey Bokeh,

I am an active Data plotter and am very interested in Bokeh. Bokeh looks like a very good plotting tool.

Is it possible to embed a Bokeh plot in a Graphical User Interface? Specifically, I would like to make something like the GUI shown halfway down this page:

http://www.mathworks.com/help/matlab/ref/uicontrol.html

When the buttons are clicked, the plot responds accordingly. I know there are several packages available to make GUIs in Python but I am not sure if the issue would be embedding iPython or embedding a small browser in the GUI?

Would it be simpler/more appropriate to simply use a browser (Chrome/Firefox) with a plot in it and then put buttons around the plot?

If more appropriate, I can put this question on Stackoverflow.

Thanks.


Jeremy Patterson


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/CACTwgNa_%3DuFTsYeZg2ea%2BzxSGj88x%3DBqt34THUkFjKcNip3Z7w%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/9d68b891-94f3-4cf3-beb8-816f38c2176a%40continuum.io.

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

Hi Kim,

I did one Python GUI application in the past in TkInter but as world is moving towards web apps I just followed in that direction.

I know also a little wxPython and PyQt and I can imagine there may be many reasons why you would choose for Python GUI, when it comes to Bokeh plots.

Is it possible to embed a html page in Python GUI using Google selenium chromedriver? This could allow automatic testing of different bokeh apps loaded dynamically from the server…

What about performance as compared to the standard webpage ? I mean like showing 6-10 live-plots on the same page. Did you try it?

···

On Wednesday, February 6, 2019 at 2:02:43 PM UTC+1, Kim Reece wrote:

Hello,

I have made a slightly modified version of this example which works well on my system (Ubuntu, Bokeh 0.13.0, wxPython 4.0.3). Posting here since this seems to be the only thread on the net for Bokeh+wxPython.

======================

from bokeh.embed import file_html
from bokeh.plotting import *
from bokeh.resources import INLINE
import numpy as np
import wx
import wx.html2

class PlotWidget(wx.Dialog):
def init(self, *args, **kwds):
wx.Dialog.init(self, *args, **kwds)
sizer = wx.BoxSizer(wx.VERTICAL)
self.browser = wx.html2.WebView.New(self)
sizer.Add(self.browser, 1, wx.EXPAND, 10)
self.SetSizer(sizer)
self.SetSize((700, 700))

app = wx.App()
w = PlotWidget(None, -1)

N = 1000
x = np.random.random(size=N) * 100
y = np.random.random(size=N) * 100
radii = np.random.random(size=N) * 4.5
colors = [“#%02x%02x%02x” % (int(r), int(g), 150) for r, g in zip(np.floor(50+2x), np.floor(30+2y))]
f = figure()
f.scatter(
x,y, radius=radii, fill_color=colors,
fill_alpha=0.6, line_color=None,
)
html = file_html(f, INLINE, “WX Embed Example”)

w.browser.SetPage(html, “.”)

w.Show()

app.MainLoop()

As I will likely be using this combination extensively, I’d welcome further conversation on it.

– Kim

On Sunday, August 17, 2014 at 7:18:33 PM UTC+2, Bryan Van de ven wrote:

Hi Jeremy,

Unfortunately I don’t have alot of time I can spend on working up examples for this right now, but here is a small static example I cribbed together from some Stack Overflow WX questions:

from bokeh.embed import file_html

from bokeh.plotting import *

from bokeh.resources import INLINE

import numpy as np

import wx

import wx.html2

class PlotWidget(wx.Dialog):

def init(self, *args, **kwds):

wx.Dialog.__init__(self, *args, **kwds)

sizer = wx.BoxSizer(wx.VERTICAL)

self.browser = wx.html2.WebView.New(self)

sizer.Add(self.browser, 1, wx.EXPAND, 10)

self.SetSizer(sizer)

self.SetSize((700, 700))

app = wx.App()

w = PlotWidget(None, -1)

N = 1000

x = np.random.random(size=N) * 100

y = np.random.random(size=N) * 100

radii = np.random.random(size=N) * 4.5

colors = [“#%02x%02x%02x” % (r, g, 150) for r, g in zip(np.floor(50+2x), np.floor(30+2y))]

scatter(

x,y, radius=radii, fill_color=colors,

fill_alpha=0.6, line_color=None,

)

html = file_html(curdoc(), INLINE, “WX Embed Example”)

w.browser.SetPage(html, “.”)

w.Show()

app.MainLoop()

Note: on OSX with Anaconda, you have to run this with python.app (WX needs a Framework build of python)

Working up an example using the server should not be too hard. You will probably want to use bokeh.embed.autoload_server to generate a script tag that will load your plot from the server, then you can put the script tag wherever you like in the HTML text you pass to the SetPage(…) method. Let me know if I can answer any questions.

Thanks,

Bryan

On Aug 14, 2014, at 10:24 AM, Jeremy Patterson [email protected] wrote:

Hey Bryan,

I think my best option would be to write the app completely in Python (wxPython looks like a good option). Since I would be planning on updating the data/labels when buttons/dropdown menus are selected, I would either need to delete and remake the static plot or use the bokeh-server method. I am interested in both methods. I would like to keep the interactive tools that bokeh has (zoom, pan, etc.) beside the plot.

It would get me started if you would make a short example showing how to make a simple bokeh plot in a wxPython app and connect a drop-down box or listbox to the plot. (I am new to the GUI building tools in Python since I use Matlab.) Both the static plot and the bokeh-server method would be great to see.

Thanks,

Jeremy

On Friday, August 8, 2014 4:29:43 AM UTC-7, Bryan Van de ven wrote:

Hi Jeremy,

First, here and Stack Overflow are both great places to ask questions, we try to be as responsive as we can to both.

Bokeh requires an HTML5 canvas to render on, but what you have described, embedding a HTML widget into a rich client app, is something that has occurred to me before, although I have not had the opportunity to try it yet. We try to make Bokeh flexible in the ways it can be embedded, so I can imagine a few different scenarios:

  • App is written in python (PyQt, wxPython, etc)

This is probably the simplest case right now, you can just call out to Bokeh directly in your app. You can create “static” charts that have the data embedded in them (but still have interactive tools) based on the native app widget interactions. Or you can run bokeh-server and host the data there, and push data updates to the server (causing the plots to update). You can also get things like selections back from the plot to your python app code through the server.

  • App is not written in python

If you rich client is written in some other language but you still have access to an HTML widget, you can create and export the JS required to plot your data in python, and then re-use it in your app. If you use the bokeh-server you can update the data with appropriate REST calls to the server, and the pots will update. Without the server, I think in this case you would be limited to “static” data plots.

  • pure web-app

We are working on providing our own widget interface that can be used to develop “Bokeh Apps” or “Bokeh Dashboards”. WE are still baking things out but will gladly help anyone that wants to try it out.

Can you describe your app a little more, what languages and toolkits, etc that you will be using? I would be interested in helping you develop this use-case and then augmenting our user guide and documentation with more step by step instructions on how to integrate Bokeh in this way.

Thanks for your interest in Bokeh!

Bryan

On Aug 8, 2014, at 12:10 AM, Jeremy Patterson [email protected] wrote:

Hey Bokeh,

I am an active Data plotter and am very interested in Bokeh. Bokeh looks like a very good plotting tool.

Is it possible to embed a Bokeh plot in a Graphical User Interface? Specifically, I would like to make something like the GUI shown halfway down this page:

http://www.mathworks.com/help/matlab/ref/uicontrol.html

When the buttons are clicked, the plot responds accordingly. I know there are several packages available to make GUIs in Python but I am not sure if the issue would be embedding iPython or embedding a small browser in the GUI?

Would it be simpler/more appropriate to simply use a browser (Chrome/Firefox) with a plot in it and then put buttons around the plot?

If more appropriate, I can put this question on Stackoverflow.

Thanks.


Jeremy Patterson


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/CACTwgNa_%3DuFTsYeZg2ea%2BzxSGj88x%3DBqt34THUkFjKcNip3Z7w%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/9d68b891-94f3-4cf3-beb8-816f38c2176a%40continuum.io.

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

Hi Bryan,

It seems the provided example does not work on my system. (windows 10, python 3.7, bokeh 2.0.2, wxpython 4.1)

The bokeh plot could not be rendered.

What example exactly? You replied to a post that has a link that contains multiple code segments. Did you mean to reply to this one?

That example uses Bokeh API that was removed more than half a decade ago. It’s entirely possible that wxPython has changed considerably in all this time too. I’ve edited the old post to add a disclaimer.

You can try replacing the single call to scatter with a typical call to figure and them some glyph method on that figure. But I’d also like to reiterate: there are no official guarantees of support for wxpython. If a new contributor wants to come in and champion and be responsible for “official wxpython support” we are happy the have that discussion.

Yes, but seemed Bryan has clarify it.

Thank you for the information. It seems this ticket is somehow related to this issue. From what I understood. this is more of the wx.html2 issue, which used the WEBVIEWIE_EMU_IE11 in WXMSW that does not fully support redering bokeh plots.

I will move on to other approaches.