Layout of datashaded curves breaks when viewing html
See original GitHub issueHello, and thank you for your time. I’ve been using datashading with great success at my work; however, I’ve recently begun to try incorporating holoviews to interact with the graphs. I am not using a notebook, which I believe is the root of the issue. I have a dataframe with four columns. 0th column is time, columns 1,2,3 are x,y,z respectively. Each column consists of multiple ‘runs’ of the data, separated by a row of NaN. I am creating curves from each column, putting them in a layout, and then trying to save to datashaded layout. Here is my code:
hv.extension('bokeh')
curvesx = hv.Curve(df[['0','1']])
curvesy = hv.Curve(df[['0','2']])
curvesz = hv.Curve(df[['0','3']])
layout = curvesx * curvesy * curvesz
renderer = hv.renderer('bokeh').instance(fig='html')
renderer.save(datashade(layout), "html/"+data)
When I open the html file, nothing shows up. Once I select developer tools, then the datashaded graph appear along with the error:
Jupyter notebooks comms not available. push_notebook() will not function. If running JupyterLab ensure the latest jupyterlab_bokeh extension is installed. In an exported notebook this warning is expected. _ @ bokeh-0.13.0.min.js:31 VM50:57 Uncaught TypeError: Cannot read property ‘get_client_comm’ of undefined at t.eval (eval at get (bokeh-0.13.0.min.js:31), <anonymous>:57:34) at t.execute (bokeh-0.13.0.min.js:31) at t.<anonymous> (bokeh-0.13.0.min.js:31) at e.t.emit (bokeh-0.13.0.min.js:31) at e.emit (bokeh-0.13.0.min.js:31) at t.u._setv (bokeh-0.13.0.min.js:31) at t.u.setv (bokeh-0.13.0.min.js:31) at t._layout (bokeh-0.13.0.min.js:31) at e.t._layout (bokeh-0.13.0.min.js:31) at e.t._do_layout (bokeh-0.13.0.min.js:31)
I didn’t believe I was using anything related to a notebook in my code. I believe this to be related to the holoviews renderer otherwise I can post this to the bokeh git, and please forgive me if this is a mistake on my end. Without datashading the layout, or the curves independently, this creates an html file perfectly.
Thank you
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (6 by maintainers)
Top GitHub Comments
You can export a static rendering of any datashaded plot by just passing
dynamic=False
to datashade(); the resulting plot should display properly without any Python process. But you do need Python if you want the plot to update when you zoom in; what’s embedded in the initial plot is just a rasterized image of the data, with no access to the data itself unless Python is available. You can fake some limited support for zooming by specifying a larger height and width to the datashade() call, causing the higher resolution plot to be embedded in the HTML file, but that will quickly generate quite a large HTML file…renderer.save will normally export a visualization to a static HTML file, without any Python process attached to it for running Datashader. Luckily, Bokeh server allows you to set up such a pairing and a communication channel to replace the missing Jupyter comm listed in the error above. You can start with the examples in http://pyviz.org/tutorial/13_Deploying_Bokeh_Apps.html . E.g. https://github.com/pyviz/pyviz/blob/master/apps/osm-1billion.py should work as a starting point; just replace the HoloViews object returned by make_view with your own layout object, then do “bokeh serve osm-1billion.py”.