Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface INotebookModel

The definition of a model object for a notebook widget.

Hierarchy

  • IDocumentModel

Implemented by

Index

Properties

cells

The list of cells in the notebook.

Notes

This is a read-only property.

contentChanged

contentChanged: ISignal<IDocumentModel, void>

A signal emitted when the document content changes.

defaultKernelLanguage

defaultKernelLanguage: string

The default kernel language of the document.

Notes

This is a read-only property.

defaultKernelName

defaultKernelName: string

The default kernel name of the document.

Notes

This is a read-only property.

dirty

dirty: boolean

The dirty state of the model.

Notes

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

isDisposed

isDisposed: boolean

Test whether the object has been disposed.

Notes

This is a read-only property which is always safe to access.

metadataChanged

metadataChanged: ISignal<IDocumentModel, IChangedArgs<any>>

A signal emitted when a metadata field changes.

nbformat

nbformat: number

The major version number of the nbformat.

Notes

This is a read-only property.

nbformatMinor

nbformatMinor: number

The minor version number of the nbformat.

Notes

This is a read-only property.

readOnly

readOnly: boolean

The read-only state of the model.

stateChanged

stateChanged: ISignal<IDocumentModel, IChangedArgs<any>>

A signal emitted when a model state changes.

Methods

createCodeCell

  • A factory for creating a new code cell.

    Parameters

    • Optional source: IBaseCell

      The data to use for the original source data.

    Returns CodeCellModel

    A new code cell. If a source cell is provided, the new cell will be intialized with the data from the source.

    Notes

    If the source argument does not give an input mimetype, the code cell defaults to the notebook [[defaultMimetype]].

createMarkdownCell

  • A factory for creating a new Markdown cell.

    Parameters

    • Optional source: IBaseCell

      The data to use for the original source data.

    Returns MarkdownCellModel

    A new markdown cell. If a source cell is provided, the new cell will be intialized with the data from the source.

createRawCell

  • A factory for creating a new raw cell.

    Parameters

    • Optional source: IBaseCell

      The data to use for the original source data.

    Returns RawCellModel

    A new raw cell. If a source cell is provided, the new cell will be intialized with the data from the source.

dispose

  • dispose(): void
  • Dispose of the resources held by the object.

    Notes

    It is generally unsafe to use the object after it has been disposed.

    If the object's dispose method is called more than once, all calls made after the first will be a no-op.

    Returns void

fromJSON

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

    Notes

    Should emit a [contentChanged] signal.

    Parameters

    • value: any

    Returns void

fromString

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

    Notes

    Should emit a [contentChanged] signal.

    Parameters

    • value: string

    Returns void

getMetadata

  • Get a metadata cursor for the notebook.

    Notes

    This method is used to interact with a namespaced set of metadata on the notebook.

    Parameters

    • namespace: string

    Returns IMetadataCursor

initialize

  • initialize(): void
  • Initialize the model state.

    Returns void

listMetadata

  • listMetadata(): string[]
  • List the metadata namespace keys for the notebook.

    Notes

    Metadata associated with the nbformat are not included.

    Returns string[]

toJSON

  • toJSON(): any
  • Serialize the model to JSON.

    Returns any

toString

  • toString(): string
  • Serialize the model to a string.

    Returns string

Generated using TypeDoc