Good afternoon
[First time to post on stackoverflow after years of reading. Exciting!]
I use bokeh to generate html code that I feed into a QWebView in a very simple PyQt4 GUI. The standard tools on top of the bokeh chart do not work in the QWebView, while they work properly if I open the same html code in any standard browser (in my case, Chrome).
Detailed example:
I am using the snippet below taken from an older Bokeh User Guide example to test the issue (the latest User Guide can be found here):
from bokeh.plotting import figure
from bokeh.resources import CDN, INLINE
from bokeh.embed import file_html
# [other code...]
f = figure()
f.circle([1, 2.5, 3, 2], [2, 3, 1, 1.5], radius=0.3, alpha=0.5)
html = file_html(f, CDN, "my plot")
the 'html' snippet is then fed into a QtWebKit.QWebView instance called 'self.web' embedded in the GUI:
self.web.setHtml(html)
The chart displays properly, however the tools are inactive:
i) the 'Pan' tool is selected and click-and-drag works to pan the chart,
ii) the 'Scroll-wheel' tool is selected but scrolling the wheel does not zoom on the chart,
iii) clicking on any other tool ('Resize', 'Box Zoom', 'Save') does not succeed in selecting the tool
Any idea of what settings are required to make the (static) bokeh html work in the QWebView?
I have searched for related issues, and tried working on the attributes of the QWebView (e.g. setting QtWebKit.QWebSettings.JavascriptEnabled to True) with no effect.
Many thanks for the help.
(the environment is: Python 2.7.8, Anaconda 2.1.0 (64-bit), PyQt4)