Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NotebookModel

An implementation of a notebook Model. The namespace for the NotebookModel class statics.

Hierarchy

  • DocumentModel
    • NotebookModel

Implements

Index

Constructors

constructor

  • Construct a new notebook model.

    Parameters

    Returns NotebookModel

Properties

Private _cells

_cells: CellList

Private _deletedCells

_deletedCells: string[]

Private _nbformat

_nbformat: number = nbformat.MAJOR_VERSION

Private _nbformatMinor

_nbformatMinor: number = nbformat.MINOR_VERSION

contentChanged

contentChanged: ISignal<this, void>

A signal emitted when the document content changes.

contentFactory

contentFactory: IContentFactory

The cell model factory for the notebook.

dirty

dirty: boolean

The dirty state of the document.

isDisposed

isDisposed: boolean

Whether the model is disposed.

mimeType

mimeType: string

A mime type of the model.

mimeTypeChanged

mimeTypeChanged: ISignal<this, IChangedArgs<string>>

A signal emitted when a mimetype changes.

modelDB

modelDB: IModelDB

The underlying IModelDB instance in which model data is stored.

readOnly

readOnly: boolean

The read only state of the document.

selections

selections: IObservableMap<ITextSelection[]>

Get the selections for the model.

stateChanged

stateChanged: ISignal<this, IChangedArgs<any>>

A signal emitted when the document state changes.

value

value: IObservableString

Get the value of the model.

Static defaultContentFactory

defaultContentFactory: ContentFactory = new ContentFactory({})

The default ContentFactory instance.

Accessors

cells

  • get cells(): IObservableUndoableList<ICellModel>
  • Get the observable list of notebook cells.

    Returns IObservableUndoableList<ICellModel>

defaultKernelLanguage

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

    Returns string

defaultKernelName

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

    Returns string

deletedCells

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

    Returns string[]

metadata

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

    Returns IObservableJSON

nbformat

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

    Returns number

nbformatMinor

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

    Returns number

Methods

Private _ensureMetadata

  • _ensureMetadata(): void
  • Make sure we have the required metadata fields.

    Returns void

Private _onCellsChanged

  • _onCellsChanged(list: IObservableList<ICellModel>, change: IChangedArgs<ICellModel>): void
  • Handle a change in the cells list.

    Parameters

    • list: IObservableList<ICellModel>
    • change: IChangedArgs<ICellModel>

    Returns void

dispose

  • dispose(): void

fromJSON

  • fromJSON(value: INotebookContent): void
  • Deserialize the model from JSON.

    Notes

    Should emit a [contentChanged] signal.

    Parameters

    • value: INotebookContent

    Returns void

fromString

  • fromString(value: string): void
  • Deserialize the model from a string.

    Notes

    Should emit a [contentChanged] signal.

    Parameters

    • value: string

    Returns void

initialize

  • initialize(): void

toJSON

  • toJSON(): INotebookContent

toString

  • toString(): string

Protected triggerContentChange

  • triggerContentChange(): void
  • Trigger a content changed signal.

    Returns void

Protected triggerStateChange

  • triggerStateChange(args: IChangedArgs<any>): void
  • Trigger a state change signal.

    Parameters

    • args: IChangedArgs<any>

    Returns void

Generated using TypeDoc