hvplot icon indicating copy to clipboard operation
hvplot copied to clipboard

Document that hvPlot works with `quarto preview` if you add `hvplot.extension()`

Open MarcSkovMadsen opened this issue 6 months ago • 3 comments

If you are using hvPlot with Quarto the plots are not shown when quarto preview rerenders. See https://github.com/quarto-dev/quarto-cli/issues/8030.

The solution is to add the line hvplot.extension().

I think that this workaround should be applied automatically behind the scenes if it can or documented somewhere.

This works

https://github.com/holoviz/hvplot/assets/42288570/bd75e925-6cbd-4058-b1df-8695ad46a2b7

MarcSkovMadsen avatar Dec 25 '23 08:12 MarcSkovMadsen

I'm quite puzzled by this issue. I don't quite understand why Quarto needs hvPlot users to call hvplot.extension() explicitly? While this is actually already done automatically when running import hvplot.pandas. Not saying there isn't a bug in hvPlot/HoloViews, but the fact that there's extra work required to get Quarto to work for hvPlot compared to in a Jupyter notebook hints at a bug in Quarto more than in hvPlot in my opinion.

maximlt avatar Jan 02 '24 10:01 maximlt

My hypothesis is that hvPlot/ HoloViews has some test whether the extension has already been loaded. If it has it does not (re-inject) the javascript. But quarto needs it reinjected when it reloads.

MarcSkovMadsen avatar Jan 02 '24 16:01 MarcSkovMadsen

My hypothesis is that hvPlot/ HoloViews has some test whether the extension has already been loaded.

I think so, and as such I'd imagine that adding hvplot.extension() after import hvplot.pandas would be a no-op.

maximlt avatar Jan 04 '24 08:01 maximlt