How to use @jupyter-widgets/jupyterlab-manager - 5 common examples

To help you get started, we’ve selected a few @jupyter-widgets/jupyterlab-manager 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 jupyter-widgets / jupyterlab-sidecar / src / widget.ts View on Github external
_model_module: SidecarModel.model_module,
      _model_module_version: SidecarModel.model_module_version,
      _view_name: SidecarModel.view_name,
      _view_module: SidecarModel.view_module,
      _view_module_version: SidecarModel.view_module_version,
      title: 'Sidecar'
    };
  }

  initialize(attributes: any, options: any) {
    super.initialize(attributes, options);
    this.widget_manager.display_model(undefined, this, {});
  }

  static serializers : any = {
      ...OutputModel.serializers,
      // Add any extra serializers here
    }

  static model_name = 'SidecarModel';
  static model_module = '@jupyter-widgets/jupyterlab-sidecar';
  static model_module_version = EXTENSION_SPEC_VERSION;
  static view_name = 'SidecarView';  // Set to null if no view
  static view_module = '@jupyter-widgets/jupyterlab-sidecar';   // Set to null if no view
  static view_module_version = EXTENSION_SPEC_VERSION;
}
github voila-dashboards / voila / js / src / manager.js View on Github external
_registerWidgets() {
        this.register({
            name: '@jupyter-widgets/base',
            version: base.JUPYTER_WIDGETS_VERSION,
            exports: base
        });
        this.register({
            name: '@jupyter-widgets/controls',
            version: controls.JUPYTER_CONTROLS_VERSION,
            exports: controls
        });
        this.register({
            name: '@jupyter-widgets/output',
            version: output.OUTPUT_WIDGET_VERSION,
            exports: output
        });
    }
github exa-analytics / exatomic / jslab / lib / index.js View on Github external
var jupyter_exatomic = require("jupyter-exatomic");

var jupyterlab_widgets = require("@jupyter-widgets/jupyterlab-manager");

module.exports = {
    id: "jupyter.extensions.jupyter-exatomic",
    requires: [jupyterlab_widgets.INBWidgetExtension],
    activate: function(app, widgets) {
        widgets.registerWidget({
            name: "jupyter-exatomic",
            version: jupyter_exatomic.version,
            exports: jupyter_exatomic
        });
    },
    autoStart: true
};
github voila-dashboards / voila / js / src / manager.js View on Github external
            createRenderer: options => new WidgetRenderer(options, this)
        }, 1);
github jupyter-widgets / jupyterlab-sidecar / src / plugin.ts View on Github external
function activateWidgetExtension(app: JupyterLab, registry: IJupyterWidgetRegistry): void {
    let SidecarView = class extends output.OutputView {
      model: SidecarModel;

      render() {
        if (!this.model.rendered) {
          super.render();
          let w = this._outputView;
          w.addClass('jupyterlab-sidecar');
          w.addClass('jp-LinkedOutputView');
          w.title.label = this.model.get('title');
          w.title.closable = true;
          app.shell['_rightHandler'].sideBar.tabCloseRequested.connect((sender : any, tab : any) => {
              tab.title.owner.dispose();
          });
          w.id = UUID.uuid4();
          if (Object.keys(this.model.views).length > 1) {
            w.node.style.display = 'none';