Skip to content

Commit 1dc1253

Browse files
Danyaal MasoodDanyaal Masood
Danyaal Masood
authored and
Danyaal Masood
committed
Jupyterlab 2 compatibility updates
1 parent 400a2c9 commit 1dc1253

File tree

16 files changed

+1245
-1155
lines changed

16 files changed

+1245
-1155
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ A diagram showing roughly how the different components interact is shown below.
234234

235235
JupyterLab Component:
236236

237-
- [JupyterLab](https://jupyter.org/) (v1.0.0 or compatible) - *BSD 3-Clause*
237+
- [JupyterLab](https://jupyter.org/) (v2.0.0 or compatible) - *BSD 3-Clause*
238238
- [jupyterlab_toastify](https://www.npmjs.com/package/jupyterlab_toastify) - *BSD 3-Clause*
239239

240240
IPython Component:

autoplot-display/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
0.2.0
2+
=====
3+
4+
- Compatibility changes for JupyterLab 2
5+
16
0.1.1
27
=====
38

autoplot-display/package-lock.json

Lines changed: 643 additions & 623 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

autoplot-display/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mangroup/jupyterlab-autoplot-display",
3-
"version": "0.1.1",
3+
"version": "0.2.0",
44
"description": "The JupyterLab component for the Autoplot JupyterLab extension.",
55
"license": "BSD-3-Clause",
66
"keywords": [
@@ -24,11 +24,11 @@
2424
"watch": "tsc -w"
2525
},
2626
"dependencies": {
27-
"@jupyter-widgets/jupyterlab-manager": "^1.1.0",
28-
"@jupyterlab/application": "^1.0.0",
29-
"@jupyterlab/mainmenu": "^1.2.8",
30-
"@jupyterlab/notebook": "^1.2.9",
31-
"jupyterlab_toastify": "^4.0.0"
27+
"@jupyter-widgets/jupyterlab-manager": "^2.0.0",
28+
"@jupyterlab/application": "^2.2.6",
29+
"@jupyterlab/mainmenu": "^2.0.0",
30+
"@jupyterlab/notebook": "^2.0.0",
31+
"jupyterlab_toastify": "^4.1.2"
3232
},
3333
"devDependencies": {
3434
"@typescript-eslint/eslint-plugin": "3.4.0",

autoplot-display/src/handlers/embedImage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function embedImage(tracker: INotebookTracker, event: CustomEventInit<{ s
3535
NotebookActions.changeCellType(notebook, 'markdown');
3636

3737
const cell = tracker.activeCell;
38-
cell.model.value.text = `![${imageAlt}](${dataUrl})`;
38+
cell!.model.value.text = `![${imageAlt}](${dataUrl})`;
3939

4040
// run the cell to render it
4141
void NotebookActions.run(notebook);

autoplot-display/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { OutputView } from '@jupyter-widgets/jupyterlab-manager/lib/output';
77
import { embedImage } from './handlers/embedImage';
88
import { toastHandler } from './handlers/toasts';
99
import { AutoplotDisplayModel } from './model';
10-
import {AutoplotButton, DtaleButton} from './toolbar';
10+
import { AutoplotButton, DtaleButton } from './toolbar';
1111
import { WidgetsByNotebook, WidgetManager } from './utils/WidgetManager';
1212
import { VERSION } from './version';
1313

autoplot-display/src/panel.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { NotebookPanel } from '@jupyterlab/notebook';
22
import { OutputArea } from '@jupyterlab/outputarea';
33

4-
import { UUID } from '@phosphor/coreutils';
5-
import { Signal } from '@phosphor/signaling';
6-
import { Panel } from '@phosphor/widgets';
4+
import { UUID } from '@lumino/coreutils';
5+
import { Signal } from '@lumino/signaling';
6+
import { Panel } from '@lumino/widgets';
77

88
/**
99
* The namespace for the `AutoplotPanel` class statics.

autoplot-display/src/toolbar.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ToolbarButton } from '@jupyterlab/apputils';
22
import { DocumentRegistry } from '@jupyterlab/docregistry';
33
import { NotebookPanel, NotebookActions, INotebookModel } from '@jupyterlab/notebook';
44

5-
import { IDisposable } from '@phosphor/disposable';
5+
import { IDisposable } from '@lumino/disposable';
66

77
/**
88
* Content of the new cell that will be added to the top of the notebook.
@@ -42,7 +42,7 @@ export class AutoplotButton implements DocumentRegistry.IWidgetExtension<Noteboo
4242

4343
const button = new ToolbarButton({
4444
className,
45-
iconClassName: 'fa fa-line-chart',
45+
iconClass: 'fa fa-line-chart',
4646
onClick,
4747
tooltip: 'Add an autoplot display panel to this notebook',
4848
});
@@ -81,7 +81,7 @@ export class DtaleButton implements DocumentRegistry.IWidgetExtension<NotebookPa
8181

8282
const button = new ToolbarButton({
8383
className,
84-
iconClassName: 'fa fa-table',
84+
iconClass: 'fa fa-table',
8585
onClick,
8686
tooltip: 'Add a dtale display panel to this notebook',
8787
});

autoplot-display/src/utils/WidgetManager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ export class WidgetManager {
193193
this.buildWidget(outputArea, notebook, modelId, path);
194194
} else {
195195
// notebook is running but not open -> define callback
196-
notebook.activated.connect(() => this.buildWidget(outputArea, notebook, modelId, path));
196+
// @ts-ignore
197+
notebook.activated.connect(() => this.buildWidget(outputArea, notebook, modelId, path)); // eslint-disable-line
197198
}
198199
} else {
199200
// no notebook with matching path open -> dispose widget and delete record

autoplot-display/src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
export namespace VERSION {
77
export const title = 'Autoplot Display';
8-
export const version = '0.1.1';
8+
export const version = '0.2.0';
99
export const module = '@jupyter-widgets/autoplot-display';
1010

1111
export const modelName = 'AutoplotDisplayModel';

autoplot-display/style/index.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
background-image: var(--jp-icon-autoplot);
77
}
88

9+
.autoplotButton .jp-Icon {
10+
color: var(--jp-layout-color4);
11+
}
12+
13+
.dtaleButton .jp-Icon {
14+
color: var(--jp-layout-color4);
15+
}
16+
917
/* shrink the whitespace to the right of the plot */
1018
.autoplot-panel .jp-OutputArea-prompt {
1119
width: 3px;

0 commit comments

Comments
 (0)