How to use the @jupyterlab/cells.RawCell 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 / packages / console / src / widget.ts View on Github external
addBanner() {
    if (this._banner) {
      // An old banner just becomes a normal cell now.
      let cell = this._banner;
      this._cells.push(this._banner);
      cell.disposed.connect(this._onCellDisposed, this);
    }
    // Create the banner.
    let banner = (this._banner = new RawCell({
      contentFactory: this.contentFactory
    }));
    banner.editor.model.value = '...';
    banner.addClass(BANNER_CLASS);
    banner.readOnly = true;
    this._content.addWidget(banner);
  }
github jupyterlab / jupyterlab / packages / console / src / widget.ts View on Github external
addBanner() {
    if (this._banner) {
      // An old banner just becomes a normal cell now.
      let cell = this._banner;
      this._cells.push(this._banner);
      cell.disposed.connect(
        this._onCellDisposed,
        this
      );
    }
    // Create the banner.
    let model = this.modelFactory.createRawCell({});
    model.value.text = '...';
    let banner = (this._banner = new RawCell({
      model,
      contentFactory: this.contentFactory
    })).initializeState();
    banner.addClass(BANNER_CLASS);
    banner.readOnly = true;
    this._content.addWidget(banner);
  }
github jupyterlab / jupyterlab-data-explorer / jupyterlab / packages / console / src / widget.ts View on Github external
addBanner() {
    if (this._banner) {
      // An old banner just becomes a normal cell now.
      let cell = this._banner;
      this._cells.push(this._banner);
      cell.disposed.connect(
        this._onCellDisposed,
        this
      );
    }
    // Create the banner.
    let model = this.modelFactory.createRawCell({});
    model.value.text = '...';
    let banner = (this._banner = new RawCell({
      model,
      contentFactory: this.contentFactory
    }));
    banner.addClass(BANNER_CLASS);
    banner.readOnly = true;
    this._content.addWidget(banner);
  }
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-data-explorer / 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 / packages / console / src / widget.ts View on Github external
createRawCell(options: RawCell.IOptions): RawCell {
      if (!options.contentFactory) {
        options.contentFactory = this;
      }
      return new RawCell(options).initializeState();
    }
  }
github jupyterlab / jupyterlab / packages / notebook / src / widget.ts View on Github external
createRawCell(options: RawCell.IOptions, parent: StaticNotebook): RawCell {
      if (!options.contentFactory) {
        options.contentFactory = this;
      }
      return new RawCell(options).initializeState();
    }
  }
github jupyterlab / jupyterlab-data-explorer / jupyterlab / packages / console / src / widget.ts View on Github external
createRawCell(options: RawCell.IOptions): RawCell {
      if (!options.contentFactory) {
        options.contentFactory = this;
      }
      return new RawCell(options);
    }
  }