question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Layout of datashaded curves breaks when viewing html

See original GitHub issue

Hello, 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:closed
  • Created 5 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jbednarcommented, Jul 23, 2018

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…

1reaction
jbednarcommented, Jul 23, 2018

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”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Layout of datashaded curves breaks when viewing html · Issue ...
When I open the html file, nothing shows up. Once I select developer tools, then the datashaded graph appear along with the error:...
Read more >
Holoviews "Points" working with Datashader but "Curve" is ...
Using Bokeh gives me the interactivity and Holoviews and Datashader allows the data to be graphed relatively quickly. Python: 3.7.6
Read more >
API — Datashader v0.14.3
Breaks each edge into a path with multiple line segments, and iteratively curves this path to bundle edges into groups.
Read more >
HoloViews | Dash for Python Documentation | Plotly
This example demonstrates how to use datashader to display a large geographic scatter plot on top of a vector tiled Mapbox map. A...
Read more >
Plotting — hvPlot 0.8.2 documentation
A small CSV file of US crime data, broken down by state. A larger Parquet-format file of airline flight data. The hvplot.sample_data module...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found