Class NotebookModel

An implementation of a notebook Model.

Hierarchy

  • NotebookModel

Implements

Constructors

Properties

_cells: any
_collaborationEnabled: any
_contentChanged: any
_deletedCells: any
_dirty: any
_ensureMetadata: any

Make sure we have the required metadata fields.

_isDisposed: any
_metadataChanged: any
_onCellsChanged: any

Handle a change in the cells list.

_onMetadataChanged: any
_onStateChanged: any
_readOnly: any
_stateChanged: any
_trans: any
sharedModel: ISharedNotebook

The shared notebook model.

standaloneModel: boolean

Whether the model should disposed the shared model on disposal or not.

Accessors

  • get collaborative(): boolean
  • Whether the model is collaborative or not.

    Returns boolean

  • get contentChanged(): ISignal<this, void>
  • A signal emitted when the document content changes.

    Returns ISignal<this, void>

  • get defaultKernelLanguage(): string
  • The default kernel language of the document.

    Returns string

  • get defaultKernelName(): string
  • The default kernel name of the document.

    Returns string

  • get deletedCells(): string[]
  • A list of deleted cells for the notebook..

    Returns string[]

  • get dirty(): boolean
  • The dirty state of the document.

    Returns boolean

  • set dirty(newValue): void
  • The dirty state of the model.

    Notes

    This should be cleared when the document is loaded from or saved to disk.

    Parameters

    • newValue: boolean

    Returns void

  • get isDisposed(): boolean
  • Whether the model is disposed.

    Returns boolean

  • get metadata(): INotebookMetadata
  • The metadata associated with the notebook.

    Notes

    This is a copy of the metadata. Changing a part of it won't affect the model. As this returns a copy of all metadata, it is advised to use getMetadata to speed up the process of getting a single key.

    Returns INotebookMetadata

  • get nbformat(): number
  • The major version number of the nbformat.

    Returns number

  • get nbformatMinor(): number
  • The minor version number of the nbformat.

    Returns number

  • get readOnly(): boolean
  • The read only state of the document.

    Returns boolean

  • set readOnly(newValue): void
  • The read-only state of the model.

    Parameters

    • newValue: boolean

    Returns void

Methods

  • Delete a metadata

    Parameters

    • key: string

      Metadata key

    Returns void

  • Dispose of the resources held by the model.

    Returns void

  • Deserialize the model from JSON.

    Notes

    Should emit a [contentChanged] signal.

    Parameters

    Returns void

  • Deserialize the model from a string.

    Notes

    Should emit a [contentChanged] signal.

    Parameters

    • value: string

    Returns void

  • Get a metadata

    Notes

    This returns a copy of the key value.

    Parameters

    • key: string

      Metadata key

    Returns any

  • Set a metadata

    Parameters

    • key: string

      Metadata key

    • value: any

      Metadata value

    Returns void

  • Serialize the model to a string.

    Returns string

  • Trigger a content changed signal.

    Returns void

  • Trigger a state change signal.

    Parameters

    Returns void

Generated using TypeDoc