Data Visualisation
Some data visualisation libraries can be used, but require some workarounds.
Matplotlib
By default, matplotlib relies on the import statement from js import document
, which does not work from within a web worker.
One workaround is to patch the default behaviour of matplotlib.pyplot.show
.
Patching matplotlib.pyplot.show
The following patch sets matplotlib to use the AGG
renderer. Source.
This workaround relies on the base64 string to be printed to stdout
.
Result
No image yet. Click run to see the result.
You can find the source code for this example here.
Folium
This workaround relies on the HTML output to be printed to stdout
.
Result
No output yet. Click run to see the result.
You can find the source code for this example here.
Plotly
This workaround relies on the HTML output to be printed to stdout
.
Result
No output yet. Click run to see the result.
You can find the source code for this example here.