hvplot icon indicating copy to clipboard operation
hvplot copied to clipboard

Bokeh Webgl output backend?

Open michael-imbeault opened this issue 5 years ago • 9 comments

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.

michael-imbeault avatar Mar 03 '19 11:03 michael-imbeault

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

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

philippjfr avatar Mar 03 '19 17:03 philippjfr

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

michael-imbeault avatar Mar 03 '19 20:03 michael-imbeault

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.

philippjfr avatar Mar 03 '19 21:03 philippjfr

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.

SandervandenOord avatar Aug 29 '19 09:08 SandervandenOord

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.

philippjfr avatar Jun 22 '20 16:06 philippjfr

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

jamestwebber avatar Aug 07 '21 21:08 jamestwebber

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

philippjfr avatar Aug 07 '21 21:08 philippjfr

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

jamestwebber avatar Aug 07 '21 21:08 jamestwebber

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.

maximlt avatar Oct 11 '22 10:10 maximlt