How to use the @jupyterlab/apputils.ReactWidget.create function in @jupyterlab/apputils

To help you get started, we’ve selected a few @jupyterlab/apputils 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-metadata-service / frontend / src / ui / index.tsx View on Github external
export function activateMetadataUI(
  app: JupyterFrontEnd,
  activeDataset: IActiveDataset,
  palette: ICommandPalette,
  comments: IMetadataCommentsService,
  datasets: IMetadataDatasetsService,
  people: IMetadataPeopleService,
  labShell: ILabShell,
  converters: IConverterRegistry
): void {
  console.log('JupyterLab extension jupyterlab-metadata-service is activated!');

  // Create a single widget
  const widget = ReactWidget.create(
    
      {(sender, args) => {
        try {
          let URL = activeDataset.active.pathname;
          return (
            
          );
        } catch {
          return ;
        }
      }}
github jupyterlab / jupyterlab-data-explorer / packages / dataregistry-extension / src / explorer.tsx View on Github external
function activate(
  lab: JupyterFrontEnd,
  labShell: ILabShell,
  registry: Registry,
  restorer: ILayoutRestorer,
  active: IActiveDataset
): IDataExplorer {
  const displayedURLs = new ObservableSet();
  displayedURLs.add(ACTIVE_URL);
  displayedURLs.add(new URL('file:').toString());

  // Create a dataset with this URL
  const widget = ReactWidget.create(
    
  );
  widget.id = '@jupyterlab-dataRegistry/explorer';
  widget.title.iconClass = 'jp-SpreadsheetIcon jp-SideBar-tabIcon';
  widget.title.caption = 'Data Explorer';

  restorer.add(widget, widget.id);
  labShell.add(widget, 'left');
  return { widget, addURL: displayedURLs.add, removeURL: displayedURLs.remove };
}
github jupyterlab / jupyterlab / packages / datastore-extension / src / todo.tsx View on Github external
execute: async () => {
        if (!widget) {
          // Create a new widget if one does not exist
          const content = ReactWidget.create();
          widget = new MainAreaWidget({ content });
          widget.id = 'todo';
          widget.title.label = 'TODO';
          widget.title.closable = true;
        }
        if (!tracker.has(widget)) {
          // Track the state of the widget for later restoration
          await tracker.add(widget);
        }
        if (!widget.isAttached) {
          // Attach the widget to the main work area if it's not there
          app.shell.add(widget, 'main');
        }
        widget.content.update();

        // Activate the widget
github jupyterlab / jupyterlab / packages / statusbar / src / defaults / lineCol.tsx View on Github external
private _handleClick(): void {
    if (this._popup) {
      this._popup.dispose();
    }
    const body = ReactWidget.create(
       this._handleSubmit(val)}
        currentLine={this.model!.line}
        maxLine={this.model!.editor!.lineCount}
      />
    );

    this._popup = showPopup({
      body: body,
      anchor: this,
      align: 'right'
    });
  }
github jupyterlab / jupyterlab / packages / notebook / src / default-toolbar.tsx View on Github external
function onClick() {
      if (panel.context.model.readOnly) {
        return showDialog({
          title: 'Cannot Save',
          body: 'Document is read-only',
          buttons: [Dialog.okButton()]
        });
      }
      void panel.context.save().then(() => {
        if (!panel.isDisposed) {
          return panel.context.createCheckpoint();
        }
      });
    }
    return addToolbarButtonClass(
      ReactWidget.create(
        
          {() => (
            
          )}
github jupyterlab / jupyterlab / packages / documentsearch / src / searchoverlay.tsx View on Github external
options: createSearchOverlay.IOptions
): Widget {
  const {
    widgetChanged,
    overlayState,
    onCaseSensitiveToggled,
    onRegexToggled,
    onHightlightNext,
    onHighlightPrevious,
    onStartQuery,
    onReplaceCurrent,
    onReplaceAll,
    onEndSearch,
    isReadOnly
  } = options;
  const widget = ReactWidget.create(
    
      {(_, args) => {
        return (
          
        );
github QuantStack / jupyterlab-debugger / src / widget.tsx View on Github external
constructor(options: Debugger.IOptions) {
    super();
    this.addClass(DEBUGGER_WIDGET_CLASS);

    const { tracker } = options;
    this.debugger = new Debugger({ tracker });
    const debuggerComponent = ReactWidget.create(
      
    );

    let layout = new PanelLayout();
    layout.addWidget(debuggerComponent);

    this.layout = layout;
  }
github jupyterlab / jupyterlab-data-explorer / packages / documentsearch / src / searchoverlay.tsx View on Github external
options: createSearchOverlay.IOptions
): Widget {
  const {
    widgetChanged,
    overlayState,
    onCaseSensitiveToggled,
    onRegexToggled,
    onHightlightNext,
    onHighlightPrevious,
    onStartQuery,
    onReplaceCurrent,
    onReplaceAll,
    onEndSearch,
    isReadOnly
  } = options;
  const widget = ReactWidget.create(
    
      {(_, args) => {
        return (
          
        );