N-Coder / ogdf-python-widget

0 stars 0 forks source link

Graph preview broken in jupyter lab #5

Open N-Coder opened 2 years ago

N-Coder commented 2 years ago

Graph preview doesn't work in jupyter lab, i.e. shows an empty window with the error message that require is not defined printed to console. To reproduce download and unpack the latest "dist" artifact from the actions to get ogdf_python_widget-0.1.0a0-py2.py3-none-any.whl and run:

wget https://raw.githubusercontent.com/N-Coder/ogdf-python-widget/main/docs/examples/GraphEditorDemo.ipynb
wget https://raw.githubusercontent.com/N-Coder/ogdf-python/master/docs/examples/sugiyama-simple.ipynb
docker run --rm -ti -p 8888:8888/tcp -v $(pwd):root python /bin/bash

cd ~
pip install -i https://test.pypi.org/simple/ ogdf-wheel==2022.2
pip install jupyter jupyterlab voila git+https://github.com/N-Coder/ogdf-python.git ./ogdf_python_widget-0.1.0a0-py2.py3-none-any.whl
pip freeze
jupyter nbextension list
jupyter labextension list

jupyter notebook --allow-root --ip=0.0.0.0 --port=8888 --VoilaConfiguration.enable_nbextensions=True
jupyter lab --allow-root --ip=0.0.0.0 --port=8888 --VoilaConfiguration.enable_nbextensions=True
N-Coder commented 2 years ago

This might be related to our resource bundling being pretty hacky, please check the documentation of Jupyter Lab and possibly that of Webpack what the best approach would be here and maybe clean up the whole thing.