mariobuikhuizen / voila-embed

Embed jupyter widgets in existing websites
Other
52 stars 7 forks source link

Voila-embed not working with qgrid #1

Closed seidlr closed 4 years ago

seidlr commented 4 years ago

Hey Mario,

thanks for the great repo! Of course, I was eager to test it, but I couldn't get it to work with qgrid. I found debugging this a little bit tricky as running a notebook including qgrid with voila is working, but it does not work with voila-embed.

I've forked your repo and extended your notebook2.ipynb with a plain ipywidget just to make sure that .add_traits is working when I am not using ipyvuetify. Then I copied notebook2.ipynb into notebook2_qgrid.ipynb where I just added the standard qgrid example with mount-id=my_qgridwidget. If I include any widget from notebook2 in my website, it is working correctly. But when I add any of the widgets from notebook2_qgrid, they can't be loaded. Here is the repo: https://github.com/seidlr/voila-embed

The only output I see in the console is this:

Screen Shot 2019-11-10 at 19 41 52

But I am not sure if this is the problem. It would be great, if you could have a look into this.

maartenbreddels commented 4 years ago

Dear Rob,

thanks for your issue/ You could try to hack I tried here: https://github.com/voila-dashboards/voila/pull/75/files basically defining that JS module. But the later comment by @jtpio seems to suggest it should not be needed anymore, so I am a bit confused. Note that this is a qgrid issue.

cheers,

Maarten

jtpio commented 4 years ago

Indeed, the Binder link points to a qgrid dashboard that seems to be working fine.

But there is also this issue about qgrid where lots of people had trouble with it: https://github.com/voila-dashboards/voila/issues/72.

So it's definitely possible it's an issue again.

jtpio commented 4 years ago

Note that on Binder qgrid is retrieved from unpkg: https://unpkg.com/qgrid@1.1.1/dist/index.js

maartenbreddels commented 4 years ago

That's the different I guess, from unpkg vs widget-extension. How/why it works I'm not sure, but it partly solves the mystery.

seidlr commented 4 years ago

Interesting. Maybe it helps when I elaborate a bit on my setup. I run voila on CapRover, which is similar to Heroku. Here I provide a Dockerfile which installs all requirements with pip and then enables them. Maybe there is no issue when everything is build from a conda env.

I've played around with the parameters and I realized that in my setting actually qgrid is not working when you pass --enable_nbextensions=True to voila on startup. Running voila without the flag on one notebook or folder allows to run qgrid. When I add the flag, it does not work anymore. The strange thing is that voila-embed seems to need --enable_nbextensions=True to function, which then prevents qgrid to work.

seidlr commented 4 years ago

Just tried it. When I add define("base/js/dialog", [], () => {}) in voila-embed.js qgrid is working. Thanks for the help!