How to use the @jupyterlab/notebook.NotebookActions.splitCell 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 / actions.spec.ts View on Github external
it('should split the active cell into two cells', () => {
        const cell = widget.activeCell;
        const source = 'thisisasamplestringwithnospaces';
        cell.model.value.text = source;
        const index = widget.activeCellIndex;
        const editor = cell.editor;
        editor.setCursorPosition(editor.getPositionAt(10));
        NotebookActions.splitCell(widget);
        const cells = widget.model.cells;
        const newSource =
          cells.get(index).value.text + cells.get(index + 1).value.text;
        expect(newSource).to.equal(source);
      });
github jupyterlab / jupyterlab-data-explorer / tests / test-notebook / src / actions.spec.ts View on Github external
it('should clear the existing selection', () => {
        each(widget.widgets, child => {
          widget.select(child);
        });
        NotebookActions.splitCell(widget);
        for (let i = 0; i < widget.widgets.length; i++) {
          if (i === widget.activeCellIndex) {
            continue;
          }
          expect(widget.isSelected(widget.widgets[i])).to.equal(false);
        }
      });
github jupyterlab / jupyterlab / examples / notebook / src / commands.ts View on Github external
    execute: () => NotebookActions.splitCell(nbWidget.content)
  });
github jupyterlab / jupyterlab / examples / notebook / src / index.ts View on Github external
    execute: () => NotebookActions.splitCell(nbWidget.notebook)
  });
github yuvipanda / simplest-notebook / src / notebook / component.tsx View on Github external
      execute: () => NotebookActions.splitCell(nbWidget.content)
    });
github jupyterlab / jupyterlab / packages / notebook-extension / src / index.ts View on Github external
execute: args => {
      const current = getCurrent(args);

      if (current) {
        return NotebookActions.splitCell(current.notebook);
      }
    },
    isEnabled
github spyder-ide / spyder-notebook / spyder_notebook / server / src / commands.ts View on Github external
    execute: () => NotebookActions.splitCell(nbWidget.content)
  });
github jupyterlab / jupyterlab-data-explorer / jupyterlab / packages / notebook-extension / src / index.ts View on Github external
execute: args => {
      const current = getCurrent(args);

      if (current) {
        return NotebookActions.splitCell(current.content);
      }
    },
    isEnabled
github yuvipanda / simplest-notebook / packages / notebook-extension / src / index.ts View on Github external
execute: args => {
      const current = getCurrent(args);

      if (current) {
        return NotebookActions.splitCell(current.notebook);
      }
    },
    isEnabled