holoviz / hvplot

A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews
https://hvplot.holoviz.org
BSD 3-Clause "New" or "Revised" License
1.13k stars 109 forks source link

Bokeh Webgl output backend? #179

Open michael-imbeault opened 5 years ago

michael-imbeault commented 5 years ago

Been using hvplot for a couple of weeks and it's definitively the best thing out there for dealing with lots of data, but I'm encountering a few performance issues with scatter plots using a matrix of 400 x 100 000 points.

There doesn't seem to be a way to switch the bokeh output to the webgl backend in hvplot right now - I've seen it in the roadmap, is it still a planned feature? I might have to switch back to pure bokeh right now because of this.

Not using datashade=True at the moment because I need hover functionality.

philippjfr commented 5 years ago

You can enable webgl output by setting it on the HoloViews BokehRenderer, i.e. using:

import holoviews as hv
hv.renderer('bokeh').webgl = True
michael-imbeault commented 5 years ago

Tried this after you suggested it, is there a way to verify if the renderer is being used? Performance is the same as before, but its much better when I use bokeh directly.

I'm using hvplot.scatter with normal parameters

philippjfr commented 5 years ago

I'll take a proper look later. I'd be surprised if it doesn't take effect because hvplot is just returning standrd holoviews objects which are renderered like all other holoviews objects.

SandervandenOord commented 5 years ago

Hi, just curious about the status of this issue. I'd like to plot a large timeseries scatterplot with 700,000 datapoints, which is no problem with the normal pandas .plot() which is effectively matplotlib, but interactive .hvplot() is too slow for this, so webgl is needed here since I would like to use hover functionality. Plotly has go.Scattergl(), so webgl works alright there, but I don't want to use that since I love the conciseness of .hvplot(). This issue is unfortunately keeping me from switching to .hvplot() for all my plots.

philippjfr commented 4 years ago

So the WebGL backend in Bokeh has been partially abandoned, there has been some efforts to revive it but until it is fully supported again I'd consider this blocked.

jamestwebber commented 3 years ago

It seems like WebGL support is being worked on in the Bokeh library, so perhaps there is hope for this issue? I am having this issue as well, although I should say I'm just using holoviews and not hvplot.

I've been building off of the Selection1D example, and while I set hv.renderer('bokeh').webgl = True, but it doesn't appear to use it for rendering the figure (the equivalent plot in Bokeh is far more responsive).

philippjfr commented 3 years ago

Should definitely revive this since there indeed have been quite a few improvements in bokeh.

jamestwebber commented 3 years ago

This would be super useful for me so happy to help if I can! Although from my first look at the holoviews codebase, it seems like a steep learning curve .. 🙂

maximlt commented 2 years ago

WebGL support has definitely improved in Bokeh.

This is still the right way to enable WebGL in hvplot:

import holoviews as hv
hv.renderer('bokeh').webgl = True

What we should do now is document this at hvPlot's level.