-
Notifications
You must be signed in to change notification settings - Fork 63
/
plugin.ts
41 lines (33 loc) · 1.02 KB
/
plugin.ts
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
// Copyright (c) 2020, QuantStack, Mariana Meireles and ipycytoscape Contributors
//
// Distributed under the terms of the Modified BSD License.
//
// The full license is in the file LICENSE, distributed with this software.
import { Application, IPlugin } from '@phosphor/application';
import { Widget } from '@phosphor/widgets';
import { IJupyterWidgetRegistry } from '@jupyter-widgets/base';
import { MODULE_NAME, MODULE_VERSION } from './version';
const EXTENSION_ID = 'jupyter-cytoscape:plugin';
/**
* The ipycytoscape plugin.
*/
const ipycytoscapePlugin: IPlugin<Application<Widget>, void> = {
id: EXTENSION_ID,
requires: [IJupyterWidgetRegistry as any],
activate: activateWidgetExtension,
autoStart: true,
};
export default ipycytoscapePlugin;
/**
* Activate the widget extension.
*/
function activateWidgetExtension(
app: Application<Widget>,
registry: IJupyterWidgetRegistry,
): void {
registry.registerWidget({
name: MODULE_NAME,
version: MODULE_VERSION,
exports: () => import('./index'),
});
}