How to use the @jupyterlab/notebook.NotebookModel.ContentFactory 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 / tests / test-notebook / src / model.spec.ts View on Github external
it('should create a new content factory with a new IModelDB', () => {
          let modelDB = new ModelDB();
          let factory = new NotebookModel.ContentFactory({ modelDB });
          expect(factory.modelDB).to.be(modelDB);
          let newModelDB = new ModelDB();
          let newFactory = factory.clone(newModelDB);
          expect(newFactory.modelDB).to.be(newModelDB);
          expect(newFactory.codeCellContentFactory)
          .to.be(factory.codeCellContentFactory);
        });
github jupyterlab / jupyterlab / tests / test-notebook / src / model.spec.ts View on Github external
it('should be settable in the constructor', () => {
          const codeCellContentFactory = new CodeCellModel.ContentFactory();
          factory = new NotebookModel.ContentFactory({
            codeCellContentFactory
          });
          expect(factory.codeCellContentFactory).to.equal(
            codeCellContentFactory
          );
        });
      });
github jupyterlab / jupyterlab / tests / test-notebook / src / model.spec.ts View on Github external
it('should be settable in the constructor', () => {
          let codeCellContentFactory = new CodeCellModel.ContentFactory();
          factory = new NotebookModel.ContentFactory({ codeCellContentFactory });
          expect(factory.codeCellContentFactory).to.be(codeCellContentFactory);
        });
github jupyterlab / jupyterlab / tests / test-notebook / src / modelfactory.spec.ts View on Github external
it('should accept a notebook model content factory', () => {
        const contentFactory = new NotebookModel.ContentFactory({});
        const factory = new NotebookModelFactory({ contentFactory });
        expect(factory.contentFactory).to.equal(contentFactory);
      });
    });
github jupyterlab / jupyterlab / tests / test-notebook / src / model.spec.ts View on Github external
it('should create a new content factory with a new IModelDB', () => {
          const modelDB = new ModelDB();
          const factory = new NotebookModel.ContentFactory({ modelDB });
          expect(factory.modelDB).to.equal(modelDB);
          const newModelDB = new ModelDB();
          const newFactory = factory.clone(newModelDB);
          expect(newFactory.modelDB).to.equal(newModelDB);
          expect(newFactory.codeCellContentFactory).to.equal(
            factory.codeCellContentFactory
          );
        });
      });
github jupyterlab / jupyterlab / tests / test-notebook / src / model.spec.ts View on Github external
describe('.ContentFactory', () => {

      let factory = new NotebookModel.ContentFactory({});

      context('#codeCellContentFactory', () => {

        it('should be a code cell content factory', () => {
          expect(factory.codeCellContentFactory).to.be(CodeCellModel.defaultContentFactory);
        });

        it('should be settable in the constructor', () => {
          let codeCellContentFactory = new CodeCellModel.ContentFactory();
          factory = new NotebookModel.ContentFactory({ codeCellContentFactory });
          expect(factory.codeCellContentFactory).to.be(codeCellContentFactory);
        });

      });

      context('#createCodeCell()', () => {
github jupyterlab / jupyterlab-data-explorer / tests / test-notebook / src / model.spec.ts View on Github external
it('should accept an optional factory', () => {
        const contentFactory = new NotebookModel.ContentFactory({});
        const model = new NotebookModel({ contentFactory });
        expect(model.contentFactory.codeCellContentFactory).to.equal(
          contentFactory.codeCellContentFactory
        );
      });
    });
github jupyterlab / jupyterlab-data-explorer / tests / test-notebook / src / model.spec.ts View on Github external
it('should create a new content factory with a new IModelDB', () => {
          const modelDB = new ModelDB();
          const factory = new NotebookModel.ContentFactory({ modelDB });
          expect(factory.modelDB).to.equal(modelDB);
          const newModelDB = new ModelDB();
          const newFactory = factory.clone(newModelDB);
          expect(newFactory.modelDB).to.equal(newModelDB);
          expect(newFactory.codeCellContentFactory).to.equal(
            factory.codeCellContentFactory
          );
        });
      });
github jupyterlab / jupyterlab / tests / test-notebook / src / model.spec.ts View on Github external
it('should accept an optional factory', () => {
        const contentFactory = new NotebookModel.ContentFactory({});
        const model = new NotebookModel({ contentFactory });
        expect(model.contentFactory.codeCellContentFactory).to.equal(
          contentFactory.codeCellContentFactory
        );
      });
    });
github jupyterlab / jupyterlab-data-explorer / tests / test-notebook / src / model.spec.ts View on Github external
describe('.ContentFactory', () => {
      let factory = new NotebookModel.ContentFactory({});

      context('#codeCellContentFactory', () => {
        it('should be a code cell content factory', () => {
          expect(factory.codeCellContentFactory).to.equal(
            CodeCellModel.defaultContentFactory
          );
        });

        it('should be settable in the constructor', () => {
          const codeCellContentFactory = new CodeCellModel.ContentFactory();
          factory = new NotebookModel.ContentFactory({
            codeCellContentFactory
          });
          expect(factory.codeCellContentFactory).to.equal(
            codeCellContentFactory
          );