Open luiztauffer opened 4 years ago
I did some progress with it, I can now display Voila form my pyqt app using QwebEngineView.
To completely solve my problem, I still need to call voila programmatically, from within my python code:
1 – with the --no-browser
and --port XXXX
options
2 – close the voila process
any suggestions on how to do that the best way with a python code?
Hey @luiztauffer. This is an idea that @astrofrog experimented with at a workshop in may.
I don't know if his code is available somewhere but I presume it could be a good start.
Ping @astrofrog.
Hi @SylvainCorlay thanks for the reply!
I managed to make it work somehow, although in a quite inefficient way I believe. I’m starting a Thread for voila separate from my main Pyqt Thread and I’m calling it using:
os.system("voila "+self.filename+'.ipynb --no-browser --port '+str(self.port))
I wonder if you could point me to a couple of things:
from voila.app import Voila
but no success so far.Also good to hear that @astrofrog worked on something similar. Did you make progress on that? Would you mind sharing your opinion? =)
cc @cmaureir who might be interested in this too.
@jtpio found the repo by @astrofrog https://github.com/astrofrog/voila-qt-app the idea is similar to what you did @luiztauffer, which is just starting the voila app on a thread and then just display that on a QWebEngine page. To answer your questions I will need to dig a little bit more into the voila code, but in any case, check the repo out!
After looking at this a little bit more deeper, I think there are three ways to proceed:
WebAssembly
by writing C++ components that have equivalents for the ipywidgets
so we can render an app completely in wasm, with Qt components and some new ones from plotly
or other modules. This, of course, requires us to interact with plotly
from C++, which I don't know if it's possible.Any further ideas?
FYI, the output of @astrofrog 's binaries can be easily reused, using pip install --target ...
you can install extra packages in the binaries, and the notebooks can also be replaced (for instance a static html page with links to the notebooks).
Hi @SylvainCorlay @jtpio @maartenbreddels @cmaureir, for your update, I ended up creating a similar thing that proposed by @astrofrog, a Qt widget that embeds the Voila output and can be easily included in any PySide2 project:
It's still not optimal, since it for now the widget:
It would be great to have a way around it and passing the nbformat
object directly to Voila!
Hi, I’m building a Pyqt5 GUI and I’m interested in embedding the voila-rendered notebooks in it. Is there any straightforward way of doing this? Or else, where would you suggest me to start looking at? Thanks for the work in this great project!