voila-dashboards / voila

Voilà turns Jupyter notebooks into standalone web applications
https://voila.readthedocs.io
Other
5.41k stars 503 forks source link

Voila not displaying Canvas from IpyCanvas #1447

Closed Voranto closed 7 months ago

Voranto commented 7 months ago

Description

When executing the Jupyter Notebook, the canvas appears and works as intended, but when executing with Voila, its a blank canvas

image image Empty...

martinRenou commented 7 months ago

This is a known issue in ipycanvas. You get a blank canvas most likely because all your drawings happened before the client browser was ready to receive anything. You can look at https://ipycanvas.readthedocs.io/en/latest/advanced.html#ipycanvas-in-voila to find the workaround.

Closing as answered, but feel free to continue to chat if you need any clarification/guidance.

Voranto commented 7 months ago

@martinRenou I managed to render static shapes, but when doing dynamic drawing (I'm doing something similar to a drawing board), Im having trouble. Is there any way to use a function to synchronize both so that I can do an interactive canvas (drawing board). Sorry for the inconvenience and thanks!

martinRenou commented 7 months ago

Would it be possible to point to a GitHub repository or a notebook file so that I can give a look at your code ?

Voranto commented 7 months ago

@martinRenou Here it is, the first few lines of code (up until the "----------------------------------" is an OCR algorithm, which has nothing to do with ipycanvas and Voila). I simply don't know how to implement the on_client_ready method. Thanks very much! Any sort of feedback would be appreciated.

Repository: https://github.com/Voranto/OCR-proyect

Voranto commented 7 months ago

@martinRenou are you still willing to check my code?