-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc8b5e7
commit acdece6
Showing
6 changed files
with
185 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { WidgetModel } from '@jupyter-widgets/base'; | ||
import { KernelWidgetManager } from '@jupyter-widgets/jupyterlab-manager'; | ||
import { ISignal, Signal } from '@lumino/signaling'; | ||
|
||
export class VoilaWidgetManager extends KernelWidgetManager { | ||
register_model(model_id: string, modelPromise: Promise<WidgetModel>): void { | ||
super.register_model(model_id, modelPromise); | ||
this._registeredModels.add(model_id); | ||
this._modelRegistered.emit(model_id); | ||
} | ||
get registeredModels(): ReadonlySet<string> { | ||
return this._registeredModels; | ||
} | ||
get modelRegistered(): ISignal<VoilaWidgetManager, string> { | ||
return this._modelRegistered; | ||
} | ||
removeRegisteredModel(modelId: string) { | ||
this._registeredModels.delete(modelId); | ||
} | ||
private _modelRegistered = new Signal<VoilaWidgetManager, string>(this); | ||
private _registeredModels = new Set<string>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.