Closed djangoliv closed 2 years ago
Hi @djangoliv , thank you for the suggestion and for the code snippet. Yes indeed I do like the idea to have something like an on/off toggle, that sounds great.
On the way towards such an extension I see two points that we should discuss:
requestExecute
goes? Probably it is not displayed at all in the notebook? If not, until we solve #51 , the absence of the init_notebook_mode
cell is going to break the HTML export of the notebook.Let me know if you have any advice regarding the above. Thanks!
Hello @mwouts
You're right, it may be better to make two separate repository (a jupyterlab-itables project).
Indeed, the output is not displayed and the init_notebook_mode code will not be present in the HTML export.
Personally it doesn't bother me. Since the code just replaces the table visualization. The exported code will remain consistent and display the tables in a classic way.
Otherwise, the button could generate and execute the init cell at the beginning of the notebook.
Hello @djangoliv , I have created a draft extension at https://github.com/mwouts/jupyterlab-itables
However when I try to install it with
jupyter labextension develop . --overwrite
then I run into this error:
src/index.ts(7,63): error TS2344: Type 'INotebookModel' does not satisfy the constraint 'IModel'.
Types of property 'sharedModel' are incompatible.
Property 'dirty' is missing in type 'ISharedNotebook' but required in type 'ISharedDocument'.
Do you think you can iterate on top of my draft? Thanks!
@mwouts See: https://github.com/mwouts/jupyterlab-itables/pull/1
Hi @djangoliv , I am going to close this issue because the init_notebook_mode
function changed significantly in itables==1.0.0
.
In particular it now has outputs, and we need these outputs in the notebook, so I am afraid the solution that you considered here would only work for init_notebook_mode(connected=True)
while the default is now init_notebook_mode(connected=False)
.
Anyway let me thank you for suggesting this (and use connected=False
in your local extension if you want to continue using it!)
it might be nice to have a button to enable interactive mode.
A simple example of code for that:
Regards