How to use the @jupyterlab/cells.RawCellModel function in @jupyterlab/cells

To help you get started, we’ve selected a few @jupyterlab/cells 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 / test / src / console / widget.spec.ts View on Github external
it('should create a banner cell', () => {
          let model = new RawCellModel({});
          let banner = contentFactory.createBanner({
            model,
            contentFactory: contentFactory.rawCellContentFactory
          }, widget);
          expect(banner).to.be.a(RawCellWidget);
        });
github jupyterlab / jupyterlab / tests / test-cells / src / widget.spec.ts View on Github external
it('should create a raw cell widget', () => {
        const model = new RawCellModel({});
        const widget = new RawCell({ model, contentFactory }).initializeState();
        expect(widget).toBeInstanceOf(RawCell);
      });
    });
github jupyterlab / jupyterlab / test / src / cells / model.spec.ts View on Github external
it('should be set with type "raw"', () => {
        let model = new RawCellModel({});
        expect(model.type).to.be('raw');
      });
github jupyterlab / jupyterlab-data-explorer / tests / test-notebook / src / widget.spec.ts View on Github external
it('should create a `RawCell`', () => {
          const contentFactory = new StaticNotebook.ContentFactory();
          const model = new RawCellModel({});
          const rawOptions = { model, contentFactory };
          const parent = new StaticNotebook(options);
          const widget = contentFactory.createRawCell(rawOptions, parent);
          expect(widget).to.be.an.instanceof(RawCell);
        });
      });
github jupyterlab / jupyterlab / tests / test-notebook / src / widget.spec.ts View on Github external
it('should create a `RawCell`', () => {
          const contentFactory = new StaticNotebook.ContentFactory();
          const model = new RawCellModel({});
          const rawOptions = { model, contentFactory };
          const parent = new StaticNotebook(options);
          const widget = contentFactory.createRawCell(rawOptions, parent);
          expect(widget).to.be.an.instanceof(RawCell);
        });
      });
github jupyterlab / jupyterlab / packages / notebook / src / model.ts View on Github external
createRawCell(options: CellModel.IOptions): IRawCellModel {
      if (this.modelDB) {
        if (!options.id) {
          options.id = UUID.uuid4();
        }
        options.modelDB = this.modelDB.view(options.id);
      }
      return new RawCellModel(options);
    }
github jupyterlab / jupyterlab / packages / notebook / src / model.ts View on Github external
createRawCell(options: CellModel.IOptions): IRawCellModel {
      if (this.modelDB) {
        if (!options.id) {
          options.id = UUID.uuid4();
        }
        options.modelDB = this.modelDB.view(options.id);
        let cell;
        this.modelDB.withTransaction(() => {
          cell = new RawCellModel(options);
        });
        return cell;
      }
      return new RawCellModel(options);
    }
github jupyterlab / jupyterlab / packages / console / src / widget.ts View on Github external
createRawCell(options: CellModel.IOptions): IRawCellModel {
      return new RawCellModel(options);
    }
  }
github jupyterlab / jupyterlab-data-explorer / packages / notebook / src / model.ts View on Github external
createRawCell(options: CellModel.IOptions): IRawCellModel {
      if (this.modelDB) {
        if (!options.id) {
          options.id = UUID.uuid4();
        }
        options.modelDB = this.modelDB.view(options.id);
      }
      return new RawCellModel(options);
    }
github jupyterlab / jupyterlab-data-explorer / jupyterlab / packages / console / src / widget.ts View on Github external
createRawCell(options: CellModel.IOptions): IRawCellModel {
      return new RawCellModel(options);
    }
  }