all files / src/ plugin.ts

87.5% Statements 7/8
100% Branches 0/0
0% Functions 0/1
87.5% Lines 7/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53                                                                                           
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
 
import {
  Application, IPlugin
} from '@phosphor/application';
 
import {
  Widget
} from '@phosphor/widgets';
 
import {
  IJupyterWidgetRegistry
 } from '@jupyter-widgets/base';
 
import {
  ExampleModel, ExampleView
} from './widget';
 
import {
  EXTENSION_SPEC_VERSION
} from './version';
 
const EXTENSION_ID = 'clustergrammer_widget2';
 
 
/**
 * The example plugin.
 */
const examplePlugin: IPlugin<Application<Widget>, void> = {
  id: EXTENSION_ID,
  requires: [IJupyterWidgetRegistry],
  activate: activateWidgetExtension,
  autoStart: true
};
 
export default examplePlugin;
 
 
/**
 * Activate the widget extension.
 */
function activateWidgetExtension(app: Application<Widget>, registry: IJupyterWidgetRegistry): void {
  registry.registerWidget({
    name: 'clustergrammer_widget2',
    version: EXTENSION_SPEC_VERSION,
    exports: {
      ExampleModel: ExampleModel,
      ExampleView: ExampleView
    }
  });
}