How to use the @jupyterlab/console.ConsolePanel.ContentFactory function in @jupyterlab/console

To help you get started, we’ve selected a few @jupyterlab/console 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 / examples / console / src / index.ts View on Github external
function startApp(path: string, manager: ServiceManager.IManager) {
  console.log('starting app');
  // Initialize the command registry with the key bindings.
  let commands = new CommandRegistry();

  // Setup the keydown listener for the document.
  document.addEventListener('keydown', event => {
    commands.processKeydownEvent(event);
  });

  let rendermime = new RenderMimeRegistry({ initialFactories });

  let editorFactory = editorServices.factoryService.newInlineEditor;
  let contentFactory = new ConsolePanel.ContentFactory({ editorFactory });
  let consolePanel = new ConsolePanel({
    rendermime,
    manager,
    path,
    contentFactory,
    mimeTypeService: editorServices.mimeTypeService
  });
  consolePanel.title.label = TITLE;

  let palette = new CommandPalette({ commands });

  let panel = new SplitPanel();
  panel.id = 'main';
  panel.orientation = 'horizontal';
  panel.spacing = 0;
  SplitPanel.setStretch(palette, 0);
github yuvipanda / simplest-notebook / examples / console / src / index.ts View on Github external
// Initialize the command registry with the key bindings.
  let commands = new CommandRegistry();

  // Setup the keydown listener for the document.
  document.addEventListener('keydown', event => {
    commands.processKeydownEvent(event);
  });

  let rendermime = new RenderMime({
    initialFactories: defaultRendererFactories
  });

  let editorFactory = editorServices.factoryService.newInlineEditor.bind(
    editorServices.factoryService);
  let contentFactory = new ConsolePanel.ContentFactory({ editorFactory });
  let consolePanel = new ConsolePanel({
    rendermime,
    manager,
    path,
    contentFactory,
    mimeTypeService: editorServices.mimeTypeService
  });
  consolePanel.title.label = TITLE;

  let palette = new CommandPalette({ commands });

  let panel = new SplitPanel();
  panel.id = 'main';
  panel.orientation = 'horizontal';
  panel.spacing = 0;
  SplitPanel.setStretch(palette, 0);
github jupyterlab / jupyterlab-data-explorer / jupyterlab / examples / console / src / index.ts View on Github external
function startApp(path: string, manager: ServiceManager.IManager) {
  // Initialize the command registry with the key bindings.
  let commands = new CommandRegistry();

  // Setup the keydown listener for the document.
  document.addEventListener('keydown', event => {
    commands.processKeydownEvent(event);
  });

  let rendermime = new RenderMimeRegistry({ initialFactories });

  let editorFactory = editorServices.factoryService.newInlineEditor;
  let contentFactory = new ConsolePanel.ContentFactory({ editorFactory });
  let consolePanel = new ConsolePanel({
    rendermime,
    manager,
    path,
    contentFactory,
    mimeTypeService: editorServices.mimeTypeService
  });
  consolePanel.title.label = TITLE;

  let palette = new CommandPalette({ commands });

  let panel = new SplitPanel();
  panel.id = 'main';
  panel.orientation = 'horizontal';
  panel.spacing = 0;
  SplitPanel.setStretch(palette, 0);
github pymedphys / pymedphys / packages / pymedphys / src / pymedphys / gui / src / jupyter.tsx View on Github external
function buildConsole(manager: ServiceManager.IManager) {
  let commands = new CommandRegistry();

  // Setup the keydown listener for the document.
  document.addEventListener('keydown', event => {
    commands.processKeydownEvent(event);
  });

  let editorFactory = editorServices.factoryService.newInlineEditor;
  let contentFactory = new ConsolePanel.ContentFactory({ editorFactory });
  // let consoleWidget = new CodeConsole({
  //   contentFactory,
  //   rendermime,
  //   mimeTypeService: editorServices.mimeTypeService,
  //   session:
  // })
  let consolePanel = new ConsolePanel({
    rendermime,
    manager,
    contentFactory,
    mimeTypeService: editorServices.mimeTypeService
  });

  let panel = new SplitPanel();
  panel.id = 'console-panel';
  panel.orientation = 'horizontal';
github jupyterlab / jupyterlab-data-explorer / tests / test-console / src / panel.spec.ts View on Github external
it('should create a new code console factory', () => {
          const factory = new ConsolePanel.ContentFactory({ editorFactory });
          expect(factory).to.be.an.instanceof(ConsolePanel.ContentFactory);
        });
      });
github jupyterlab / jupyterlab / tests / test-console / src / panel.spec.ts View on Github external
it('should create a new code console factory', () => {
          const factory = new ConsolePanel.ContentFactory({ editorFactory });
          expect(factory).to.be.an.instanceof(ConsolePanel.ContentFactory);
        });
      });
github jupyterlab / jupyterlab / tests / test-console / src / utils.ts View on Github external
export function createConsolePanelFactory(): ConsolePanel.IContentFactory {
  return new ConsolePanel.ContentFactory({ editorFactory });
}