thebe-core / Exports / ThebeManager

Hierarchy

  • WidgetManager

    ThebeManager

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new ThebeManager(kernel)

Parameters

NameType
kernelIKernelConnection

Overrides

JupyterLabManager.constructor

Defined in

packages/core/src/manager.ts:38

Properties

_handleCommOpen

Protected _handleCommOpen: (comm: IComm, msg: ICommOpenMsg<"iopub" | "shell">) => Promise<void>

Type declaration

▸ (comm, msg): Promise<void>

Parameters
NameType
commIComm
msgICommOpenMsg<"iopub" | "shell">
Returns

Promise<void>

Inherited from

JupyterLabManager._handleCommOpen

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:102


_kernelRestoreInProgress

Protected _kernelRestoreInProgress: boolean

Inherited from

JupyterLabManager._kernelRestoreInProgress

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:105


_loader

_loader: RequireJsLoader

Defined in

packages/core/src/manager.ts:36


_restored

Protected _restored: Signal<ThebeManager, void>

Inherited from

JupyterLabManager._restored

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:103


_restoredStatus

Protected _restoredStatus: boolean

Inherited from

JupyterLabManager._restoredStatus

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:104


comm_target_name

Readonly comm_target_name: "jupyter.widget"

The comm target name to register

Inherited from

JupyterLabManager.comm_target_name

Defined in

node_modules/@jupyter-widgets/base-manager/lib/manager-base.d.ts:171


id

id: string

Defined in

packages/core/src/manager.ts:35

Accessors

context

get context(): IContext<INotebookModel>

Returns

IContext<INotebookModel>

Inherited from

JupyterLabManager.context

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:161


isDisposed

get isDisposed(): boolean

Get whether the manager is disposed.

Notes

This is a read-only property.

Returns

boolean

Inherited from

JupyterLabManager.isDisposed

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:51


kernel

get kernel(): null | IKernelConnection

Returns

null | IKernelConnection

Inherited from

JupyterLabManager.kernel

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:162


onUnhandledIOPubMessage

get onUnhandledIOPubMessage(): ISignal<this, IIOPubMessage<IOPubMessageType>>

A signal emitted for unhandled iopub kernel messages.

Returns

ISignal<this, IIOPubMessage<IOPubMessageType>>

Inherited from

JupyterLabManager.onUnhandledIOPubMessage

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:81


rendermime

get rendermime(): IRenderMimeRegistry

Returns

IRenderMimeRegistry

Inherited from

JupyterLabManager.rendermime

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:65


restored

get restored(): ISignal<this, void>

A signal emitted when state is restored to the widget manager.

Notes

This indicates that previously-unavailable widget models might be available now.

Returns

ISignal<this, void>

Inherited from

JupyterLabManager.restored

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:72


restoredStatus

get restoredStatus(): boolean

Whether the state has been restored yet or not.

Returns

boolean

Inherited from

JupyterLabManager.restoredStatus

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:76

Methods

_create_comm

_create_comm(target_name, model_id, data?, metadata?, buffers?): Promise<IClassicComm>

Create a comm.

Parameters

NameType
target_namestring
model_idstring
data?any
metadata?any
buffers?ArrayBuffer[] | ArrayBufferView[]

Returns

Promise<IClassicComm>

Inherited from

JupyterLabManager._create_comm

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:40


_get_comm_info

_get_comm_info(): Promise<any>

Get the currently-registered comms.

Returns

Promise<any>

Inherited from

JupyterLabManager._get_comm_info

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:44


_handleKernelChanged

Protected _handleKernelChanged(«destructured»): void

Register a new kernel

Parameters

NameType
«destructured»IKernelChangedArgs

Returns

void

Inherited from

JupyterLabManager._handleKernelChanged

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:30


_handleKernelConnectionStatusChange

_handleKernelConnectionStatusChange(status): void

Parameters

NameType
statusConnectionStatus

Returns

void

Inherited from

JupyterLabManager._handleKernelConnectionStatusChange

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:140


_handleKernelStatusChange

_handleKernelStatusChange(status): void

Parameters

NameType
statusStatus

Returns

void

Inherited from

JupyterLabManager._handleKernelStatusChange

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:141


_loadFromKernel

Protected _loadFromKernel(): Promise<void>

Returns

Promise<void>

Inherited from

JupyterLabManager._loadFromKernel

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:36


_loadFromKernelModels

Protected _loadFromKernelModels(): Promise<void>

Old implementation of fetching widget models one by one using the request_state message on each comm.

This is a utility function that can be used in subclasses.

Returns

Promise<void>

Inherited from

JupyterLabManager._loadFromKernelModels

Defined in

node_modules/@jupyter-widgets/base-manager/lib/manager-base.d.ts:129


_loadFromNotebook

_loadFromNotebook(notebook): Promise<void>

Load widget state from notebook metadata

Parameters

NameType
notebookINotebookModel

Returns

Promise<void>

Inherited from

JupyterLabManager._loadFromNotebook

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:152


_make_model

_make_model(options, serialized_state?): Promise<WidgetModel>

Parameters

NameType
optionsRequiredSome<IModelOptions, "model_id">
serialized_state?any

Returns

Promise<WidgetModel>

Inherited from

JupyterLabManager._make_model

Defined in

node_modules/@jupyter-widgets/base-manager/lib/manager-base.d.ts:130


_registerWidgets

Private _registerWidgets(): void

Returns

void

Defined in

packages/core/src/manager.ts:156


addWidgetFactories

addWidgetFactories(rendermime): void

Parameters

NameType
rendermimeIRenderMimeRegistry

Returns

void

Defined in

packages/core/src/manager.ts:50


build_widgets

build_widgets(): Promise<void>

Returns

Promise<void>

Defined in

packages/core/src/manager.ts:65


callbacks

callbacks(view?): ICallbacks

Default callback handler to emit unhandled kernel messages.

Parameters

NameType
view?WidgetView

Returns

ICallbacks

Inherited from

JupyterLabManager.callbacks

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:26


clear_state

clear_state(): Promise<void>

Close all widgets and empty the widget state.

Returns

Promise<void>

Promise that resolves when the widget state is cleared.

Inherited from

JupyterLabManager.clear_state

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:171


create_view

create_view<VT>(model, options?): Promise<VT>

Creates a promise for a view of a given model

Notes

The implementation must trigger the Lumino 'after-attach' and 'after-show' events when appropriate, which in turn will trigger the view's 'displayed' events.

Make sure the view creation is not out of order with any state updates.

Type parameters

NameType
VTextends DOMWidgetView<VT> = DOMWidgetView

Parameters

NameType
modelDOMWidgetModel
options?any

Returns

Promise<VT>

Inherited from

JupyterLabManager.create_view

Defined in

node_modules/@jupyter-widgets/base-manager/lib/manager-base.d.ts:64

create_view<VT>(model, options?): Promise<VT>

Type parameters

NameType
VTextends WidgetView<VT> = WidgetView

Parameters

NameType
modelWidgetModel
options?any

Returns

Promise<VT>

Inherited from

JupyterLabManager.create_view

Defined in

node_modules/@jupyter-widgets/base-manager/lib/manager-base.d.ts:65


disconnect

disconnect(): void

Disconnect the widget manager from the kernel, setting each model's comm as dead.

Returns

void

Inherited from

JupyterLabManager.disconnect

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:35


display_view

display_view(msg, view, options): Promise<Widget>

Parameters

NameType
msgany
viewany
optionsany

Returns

Promise<Widget>

Defined in

packages/core/src/manager.ts:101


dispose

dispose(): void

Dispose the resources held by the manager.

Returns

void

Inherited from

JupyterLabManager.dispose

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:156


filterExistingModelState

Protected filterExistingModelState(serialized_state): any

Filter serialized widget state to remove any ID's already present in manager.

Parameters

NameType
serialized_stateany

Returns

any

A copy of the state, with its 'state' attribute filtered

Inherited from

JupyterLabManager.filterExistingModelState

Defined in

node_modules/@jupyter-widgets/base-manager/lib/manager-base.d.ts:200


get_model

get_model(model_id): Promise<WidgetModel>

Get a promise for a model by model id.

Notes

If the model is not found, the returned Promise object is rejected.

If you would like to synchronously test if a model exists, use .has_model().

Parameters

NameType
model_idstring

Returns

Promise<WidgetModel>

Inherited from

JupyterLabManager.get_model

Defined in

node_modules/@jupyter-widgets/base-manager/lib/manager-base.d.ts:78


get_state

get_state(options?): Promise<IManagerState>

Asynchronously get the state of the widget manager.

This includes all of the widget models, and follows the format given in the @jupyter-widgets/schema package.

Parameters

NameTypeDescription
options?IStateOptionsThe options for what state to return.

Returns

Promise<IManagerState>

Promise for a state dictionary

Inherited from

JupyterLabManager.get_state

Defined in

node_modules/@jupyter-widgets/base-manager/lib/manager-base.d.ts:145


get_state_sync

get_state_sync(options?): ReadonlyPartialJSONValue

Synchronously get the state of the live widgets in the widget manager.

This includes all of the live widget models, and follows the format given in the @jupyter-widgets/schema package.

Parameters

NameTypeDescription
options?IStateOptionsThe options for what state to return.

Returns

ReadonlyPartialJSONValue

A state dictionary

Inherited from

JupyterLabManager.get_state_sync

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:101


handle_comm_open

handle_comm_open(comm, msg): Promise<WidgetModel>

Handle when a comm is opened.

Parameters

NameType
commIClassicComm
msgICommOpenMsg<"iopub" | "shell">

Returns

Promise<WidgetModel>

Inherited from

JupyterLabManager.handle_comm_open

Defined in

node_modules/@jupyter-widgets/base-manager/lib/manager-base.d.ts:89


has_model

has_model(model_id): boolean

Returns true if the given model is registered, otherwise false.

Notes

This is a synchronous way to check if a model is registered.

Parameters

NameType
model_idstring

Returns

boolean

Inherited from

JupyterLabManager.has_model

Defined in

node_modules/@jupyter-widgets/base-manager/lib/manager-base.d.ts:85


inline_sanitize

inline_sanitize(source): string

Parameters

NameType
sourcestring

Returns

string

Inherited from

JupyterLabManager.inline_sanitize

Defined in

node_modules/@jupyter-widgets/base-manager/lib/manager-base.d.ts:167


loadClass

loadClass(className, moduleName, moduleVersion): Promise<typeof WidgetModel | typeof WidgetView>

Parameters

NameType
classNamestring
moduleNamestring
moduleVersionstring

Returns

Promise<typeof WidgetModel | typeof WidgetView>

Overrides

JupyterLabManager.loadClass

Defined in

packages/core/src/manager.ts:114


loadModelClass

Protected loadModelClass(className, moduleName, moduleVersion): Promise<typeof WidgetModel>

Parameters

NameType
classNamestring
moduleNamestring
moduleVersionstring

Returns

Promise<typeof WidgetModel>

Inherited from

JupyterLabManager.loadModelClass

Defined in

node_modules/@jupyter-widgets/base-manager/lib/manager-base.d.ts:176


loadViewClass

Protected loadViewClass(className, moduleName, moduleVersion): Promise<typeof WidgetView>

Parameters

NameType
classNamestring
moduleNamestring
moduleVersionstring

Returns

Promise<typeof WidgetView>

Inherited from

JupyterLabManager.loadViewClass

Defined in

node_modules/@jupyter-widgets/base-manager/lib/manager-base.d.ts:177


new_model

new_model(options, serialized_state?): Promise<WidgetModel>

Create and return a promise for a new widget model

Example

widget_manager.new_model({
     model_name: 'IntSlider',
     model_module: '@jupyter-widgets/controls',
     model_module_version: '1.0.0',
     model_id: 'u-u-i-d'
}).then((model) => { console.log('Create success!', model); },
 (err) => {console.error(err)});

Parameters

NameTypeDescription
optionsIModelOptionsthe options for creating the model.
serialized_state?anyattribute values for the model.

Returns

Promise<WidgetModel>

Inherited from

JupyterLabManager.new_model

Defined in

node_modules/@jupyter-widgets/base-manager/lib/manager-base.d.ts:114


new_widget

new_widget(options, serialized_state?): Promise<WidgetModel>

Create a comm and new widget model.

Parameters

NameTypeDescription
optionsIWidgetOptionssame options as new_model but comm is not required and additional options are available.
serialized_state?JSONObjectserialized model attributes.

Returns

Promise<WidgetModel>

Inherited from

JupyterLabManager.new_widget

Defined in

node_modules/@jupyter-widgets/base-manager/lib/manager-base.d.ts:96


register

register(data): void

Parameters

NameType
dataIWidgetRegistryData

Returns

void

Inherited from

JupyterLabManager.register

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:82


register_model

register_model(model_id, modelPromise): void

Register a widget model.

Parameters

NameType
model_idstring
modelPromisePromise<WidgetModel>

Returns

void

Inherited from

JupyterLabManager.register_model

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:166


removeWidgetFactories

removeWidgetFactories(rendermime): void

Parameters

NameType
rendermimeIRenderMimeRegistry

Returns

void

Defined in

packages/core/src/manager.ts:61


resolveUrl

resolveUrl(url): Promise<string>

Resolve a URL relative to the current notebook location.

Parameters

NameType
urlstring

Returns

Promise<string>

Inherited from

JupyterLabManager.resolveUrl

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:160


restoreWidgets

restoreWidgets(notebook, «destructured»?): Promise<void>

Restore widgets from kernel and saved state.

Parameters

NameType
notebookINotebookModel
«destructured»Object
› loadKernelboolean
› loadNotebookboolean

Returns

Promise<void>

Inherited from

JupyterLabManager.restoreWidgets

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:145


setDirty

setDirty(): void

Set the dirty state of the notebook model if applicable.

TODO: perhaps should also set dirty when any model changes any data

Returns

void

Inherited from

JupyterLabManager.setDirty

Defined in

node_modules/@jupyter-widgets/jupyterlab-manager/lib/manager.d.ts:177


setViewOptions

setViewOptions(options?): any

Modifies view options. Generally overloaded in custom widget manager implementations.

Parameters

NameType
options?any

Returns

any

Inherited from

JupyterLabManager.setViewOptions

Defined in

node_modules/@jupyter-widgets/base-manager/lib/manager-base.d.ts:53


set_state

set_state(state): Promise<WidgetModel[]>

Set the widget manager state.

Parameters

NameTypeDescription
stateIManagerStatea Javascript object conforming to the application/vnd.jupyter.widget-state+json spec. Reconstructs all of the widget models in the state, merges that with the current manager state, and then attempts to redisplay the widgets in the state.

Returns

Promise<WidgetModel[]>

Inherited from

JupyterLabManager.set_state

Defined in

node_modules/@jupyter-widgets/base-manager/lib/manager-base.d.ts:155