Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NotebookModel

An implementation of a notebook Model.

Hierarchy

  • NotebookModel

Implements

Index

Constructors

constructor

Properties

Private _cells

Private _cursors

_cursors: object

Type declaration

Private _dirty

_dirty: boolean

Private _metadata

_metadata: object

Type declaration

  • [key: string]: any

Private _nbformat

_nbformat: number

Private _nbformatMinor

_nbformatMinor: number

Private _readOnly

_readOnly: boolean

Accessors

cells

contentChanged

defaultKernelLanguage

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

    Notes

    This is a read-only property.

    Returns string

defaultKernelName

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

    Notes

    This is a read-only property.

    Returns string

dirty

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

    Notes

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

    Returns boolean

  • 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

isDisposed

  • get (): boolean
  • Get whether the model is disposed.

    Notes

    This is a read-only property.

    Returns boolean

metadataChanged

  • get (): ISignal<IDocumentModel, IChangedArgs<any>>
  • A signal emitted when a metadata field changes.

    Returns ISignal<IDocumentModel, IChangedArgs<any>>

nbformat

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

    Notes

    This is a read-only property.

    Returns number

nbformatMinor

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

    Notes

    This is a read-only property.

    Returns number

readOnly

  • get (): boolean
  • set (newValue: boolean): void

stateChanged

  • get (): ISignal<IDocumentModel, IChangedArgs<any>>
  • A signal emitted when a model state changes.

    Returns ISignal<IDocumentModel, IChangedArgs<any>>

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

createRawCell

dispose

  • dispose(): void

fromJSON

fromString

  • fromString(value: string): void

getMetadata

  • Get a metadata cursor for the notebook.

    Notes

    Metadata associated with the nbformat spec are set directly on the model. This method is used to interact with a namespaced set of metadata on the notebook.

    Parameters

    • name: string

    Returns IMetadataCursor

initialize

  • initialize(): void

listMetadata

  • listMetadata(): string[]

Protected onCellChanged

  • onCellChanged(cell: ICellModel, change: any): void

Protected onCellsChanged

Protected setCursorData

  • setCursorData(name: string, newValue: any): void
  • Set the cursor data for a given field.

    Parameters

    • name: string
    • newValue: any

    Returns void

toJSON

toString

  • toString(): string

Generated using TypeDoc