You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Jupyterlab_Voyager project, we plan to use the native 'Save'&'Save as' buttons under 'File' menu to save current Voyager state.
Since the Voyager content is in vegalite form, when using other file types( csv/tsv...) as Voyager data source, we need to disable those native 'Save'&'Save as' buttons, otherwise it will ruin the original files. Here's a link for the detail design (issue44)
I checked inside Docmanger, the enable/disable of those two buttons is controlled by const isEnabled = () => { const { currentWidget } = app.shell; return !!(currentWidget && docManager.contextForWidget(currentWidget)); };
this contextForWidget() is quite complex, I tried to modify the get context() inside voyager widget class but failed to make a difference.
I wonder if there's any way to achieve this without modifying the above function in JupyterLab itself.
Hope you guys can help me with it. @ellisonbg@ian-r-rose
The text was updated successfully, but these errors were encountered:
Hi @zzhangjii, I'm not sure I understand what you mean by the "native" buttons. Can you elaborate?
It sounds to me like an alternative might be to implement toString and fromString fuctions for your data models that are able to serialize and deserialize them correctly.
Sorry, @ian-r-rose, I mean using the 'Save' and 'Save As...' buttons under 'File menu'.
My question is how to disable the buttons by modifying my extension.
for example: change some methods inside my class VoyagerPanel extends Widget implements DocumentRegistry.IReadyWidget
For Jupyterlab_Voyager project, we plan to use the native 'Save'&'Save as' buttons under 'File' menu to save current Voyager state.
Since the Voyager content is in vegalite form, when using other file types( csv/tsv...) as Voyager data source, we need to disable those native 'Save'&'Save as' buttons, otherwise it will ruin the original files. Here's a link for the detail design (issue44)
I checked inside Docmanger, the enable/disable of those two buttons is controlled by
const isEnabled = () => { const { currentWidget } = app.shell; return !!(currentWidget && docManager.contextForWidget(currentWidget)); };
this contextForWidget() is quite complex, I tried to modify the
get context()
inside voyager widget class but failed to make a difference.I wonder if there's any way to achieve this without modifying the above function in JupyterLab itself.
Hope you guys can help me with it.
@ellisonbg @ian-r-rose
The text was updated successfully, but these errors were encountered: