mwouts / itables

Pandas DataFrames as Interactive DataTables
https://mwouts.github.io/itables/
MIT License
740 stars 55 forks source link

"Loading...", then maybe #75

Closed jainraje closed 2 years ago

jainraje commented 2 years ago

The guidance to solve this very weak and the "see our [require.config]" is broken. What am I suppose to do to resolve this??

thank-you!

mwouts commented 2 years ago

Thank you for noticing the broken link! Indeed it should be https://github.com/mwouts/itables/blob/main/itables/require_config.js

Can you share more details of how you use itables? Are you using Jupyter Notebook, Jupyter Lab, or yet another editor ? In which version ? Is your notebook "Trusted" ? Do you have access to the internet ?

drnw commented 2 years ago

I too get Loading... (need [help](https://mwouts.github.io/itables/troubleshooting.html)?). I use VS Code on Mac OS. In a session last week I somehow got past this. However, now rerunning my Jupyter Notebook itables is back to its bad behaviour :-(

image

Yes I am online. Visual Studio Code Version: 1.68.0

I think the notebook is trusted but I am not sure how to double check this.

drnw commented 2 years ago

Inspecting the Jupyter extension in VS Code I noticed "Reload required".

image

After clicking the Reload button the itable magically appeared in my Notebook cell output. However, cells would no longer run and a restart of VS Code was needed to restore normal service.

drnw commented 2 years ago

Unfortunately the behaviour is intermittent. Some notebooks still have the Loading... issue. Reinstalling the Jupyter extension and restarting VS Code has some success but this is a real pain :-(

mwouts commented 2 years ago

Hi @drnw , sorry to hear that... I think it would help if we could see the browser logs, but I have no idea how to see the logs for Javascript content in VS Code. This SO question has no answer, does anyone know how to get more debug information in this context?

mwouts commented 2 years ago

Hi @drnw , we have just published itables==1.0.0 which introduces an offline mode - now you don't need to be online any more to see the interactive tables.

Would you mind to upgrade itables and let us know whether the new offline mode works better?

Note that the offline mode is the default, so you don't need to change anything in your notebooks, you just need to restart the kernel and re-run them.

drnw commented 2 years ago

Thanks @mwouts for the information about itables==1.0.0. The offline mode is working well for me with Jupyter in VS Code. With wifi switched off, the following code shows an itable :-)

import itables
from itables.sample_dfs import get_countries
df = get_countries()
itables.show(df)
mwouts commented 2 years ago

Lovely! Well if you really want the offline mode you should add a call to init_notebook_mode (if you don't execute init_notebook_mode then you're still using the connected mode, maybe VS Code has some kind of cache that hides that?)

drnw commented 2 years ago

@mwouts above you said

the offline mode is the default, so you don't need to change anything in your notebooks

So my first try (which worked) was not to call init_notebook_mode. Please clarify if you can.

mwouts commented 2 years ago

Oh I see... Well I would expect users to call init_notebook_mode at the top of their notebook (cf. the documentation). That function now has an argument connected that defaults to False (except in Google Colab), so calling that function will activate the offline mode in VS Code.

If you don't call init_notebook_mode (or if you call it with connected=True) then the offline mode is not activated, see the source code. So I don't see what makes it work offline in VS Code (but I just tested and I do agree with you that it does work when the wifi is down...)