holoviz-dev / nbsite

Build a tested, sphinx-based website from notebooks
https://nbsite.pyviz.org
BSD 3-Clause "New" or "Revised" License
28 stars 14 forks source link

Remove require.js? #240

Closed maximlt closed 1 year ago

maximlt commented 1 year ago

NBSite is shipping a pretty old version of require.js. I know I've needed require.js to get Plotly plot to be displayed (directly, not via HoloViews) on hvPlot. Except that kind of case, that seems unusual in HoloViz, I'm not sure require.js is of any use now.

philippjfr commented 1 year ago

I'm not really sure in what form we are shipping require.js. I don't see it on any of our sites.

maximlt commented 1 year ago

You removed the require.js file that was in nbsite/_shared_static, right?

philippjfr commented 1 year ago

Yeah, I found it, and then deleted it :)

maximlt commented 1 year ago

Ok thanks.

Actually I remember I had to fiddle with require.js in hvPlot's docs to display a plotly plot, rendered directly and not through HoloViews' machinery. This is the comment I left https://github.com/holoviz/hvplot/blob/874e4d9835980b820aaa36802e1449f4ad0ee163/doc/conf.py#L26

And indeed the dev built of hvPlot no longer shows that plot https://pyviz-dev.github.io/hvplot/user_guide/Plotting_Extensions.html

image
Uncaught ReferenceError: require is not defined
    <anonymous> https://pyviz-dev.github.io/hvplot/user_guide/Plotting_Extensions.html:5988

But I bet there's another way to render that plot on the site without requiring nbsite to bundle require.js.

philippjfr commented 1 year ago

Worst case we just use Panel to render the figure.