How to use the @jupyterlab/notebook.NotebookModel function in @jupyterlab/notebook

To help you get started, we’ve selected a few @jupyterlab/notebook examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyterlab / jupyterlab-data-explorer / tests / test-notebook / src / model.spec.ts View on Github external
it('should set the dirty flag', () => {
        const model = new NotebookModel();
        model.dirty = false;
        model.fromJSON(NBTestUtils.DEFAULT_CONTENT);
        expect(model.dirty).to.equal(true);
      });
    });
github jupyterlab / jupyterlab / tests / test-notebook / src / model.spec.ts View on Github external
it('should default to an empty string', () => {
        let model = new NotebookModel();
        expect(model.defaultKernelName).to.be('');
      });
github jupyterlab / jupyterlab / tests / test-notebook / src / model.spec.ts View on Github external
it('should default to an empty string', () => {
        const model = new NotebookModel();
        expect(model.defaultKernelName).to.equal('');
      });
    });
github jupyterlab / jupyterlab / tests / test-notebook / src / model.spec.ts View on Github external
it('should get the default kernel language of the document', () => {
        const model = new NotebookModel();
        model.metadata.set('language_info', { name: 'python' });
        expect(model.defaultKernelLanguage).to.equal('python');
      });
github jupyterlab / jupyterlab / tests / test-notebook / src / model.spec.ts View on Github external
it('should default to an empty string', () => {
        let model = new NotebookModel();
        expect(model.defaultKernelLanguage).to.be('');
      });
github jupyterlab / jupyterlab-data-explorer / tests / test-notebook / src / model.spec.ts View on Github external
it('should serialize the model to JSON', () => {
        const model = new NotebookModel();
        model.fromJSON(NBTestUtils.DEFAULT_CONTENT);
        const data = model.toJSON();
        expect(data.cells.length).to.equal(6);
      });
    });
github jupyterlab / jupyterlab-data-explorer / tests / test-notebook / src / model.spec.ts View on Github external
it('should default to an empty string', () => {
        const model = new NotebookModel();
        expect(model.defaultKernelLanguage).to.equal('');
      });
github jupyterlab / jupyterlab-data-explorer / tests / test-notebook / src / actions.spec.ts View on Github external
beforeEach(() => {
      widget = new Notebook({
        rendermime,
        contentFactory: NBTestUtils.createNotebookFactory(),
        mimeTypeService: NBTestUtils.mimeTypeService
      });
      const model = new NotebookModel();
      model.fromJSON(NBTestUtils.DEFAULT_CONTENT);
      widget.model = model;

      widget.activeCellIndex = 0;
    });
github jupyterlab / jupyterlab-data-explorer / tests / test-notebook / src / widget.spec.ts View on Github external
function createActiveWidget(): LogNotebook {
  const model = new NotebookModel();
  const widget = new LogNotebook(options);
  widget.model = model;
  return widget;
}
github jupyterlab / jupyterlab / tests / test-notebook / src / widget.spec.ts View on Github external
function createActiveWidget(): LogNotebook {
  const model = new NotebookModel();
  const widget = new LogNotebook(options);
  widget.model = model;
  return widget;
}