Member-only story
Real-time and Live charts on Google Colab(Jupyter Notebooks)
Embedding live charts in a website is a trivial task with a websockets or a polling back-end. Having a live chart in a standalone python application is also trivial. However, Jupyter notebooks work differently. They execute python code in notebook servers and brings the results back to the browser.
(https://jupyter.readthedocs.io/en/latest/projects/architecture/content-architecture.html)
One possible solution for achieving this has been mentioned in below stackoverflow thread.
However, when this code is executed, it has to generate every frame in the server-side and download the image to update the notebook’s output cell. Apart from that, we have to call,
in-order to avoid notebook from drawing each frame as a new image, resulting in thousands of images repeated in the output cell. This could even crash the browser at some point.
The alternative is using Javascript!