Skip to content

Commit

Permalink
Merge pull request #34 from jtpio/jlab-2
Browse files Browse the repository at this point in the history
Update to JLab 2.0 and latest ipywidgets
  • Loading branch information
jtpio authored Feb 29, 2020
2 parents 804d875 + 7c42ce8 commit 71df129
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Control JupyterLab from Python notebooks.
The goal is to provide access to most of the JupyterLab environment from Python notebooks. For example:

- Adding widgets to the main area `DockPanel`, left, right or top area
- Build more advanced interfaces leveraging `SplitPanel`, `Toolbar` and other Phosphor widgets
- Build more advanced interfaces leveraging `SplitPanel`, `Toolbar` and other Lumino widgets
- Launch arbitrary commands (new terminal, change theme, open file and so on)
- Open a workspace with a specific layout
- Listen to JupyterLab signals (notebook opened, console closed) and trigger Python callbacks
Expand Down
2 changes: 1 addition & 1 deletion css/widget.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Default Split Handle Color*/
.jp-JupyterPhosphorSplitPanelWidget .p-SplitPanel-handle {
.jp-JupyterLuminoSplitPanelWidget .p-SplitPanel-handle {
background-color: var(--jp-border-color2);
}

Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,18 @@
]
},
"dependencies": {
"@jupyter-widgets/base": "^1 || ^2",
"@jupyter-widgets/controls": "^1.5.3",
"@jupyter-widgets/jupyterlab-manager": "^1.0.0",
"@jupyterlab/application": "^1.2.0",
"@jupyterlab/apputils": "^1.2.1",
"@jupyterlab/observables": "^2.4.0",
"@phosphor/commands": "^1.7.2",
"@phosphor/disposable": "1.3.1",
"@phosphor/widgets": "^1.9.3"
"@jupyter-widgets/base": "^1 || ^3.0.0-rc.0",
"@jupyter-widgets/controls": "^2.0.0-rc.12",
"@jupyter-widgets/jupyterlab-manager": "^2.0.0-rc.3",
"@jupyterlab/application": "^2.0.0",
"@jupyterlab/apputils": "^2.0.0",
"@jupyterlab/observables": "^3.0.0",
"@lumino/commands": "^1.10.1",
"@lumino/disposable": "^1.3.5",
"@lumino/widgets": "^1.11.1"
},
"devDependencies": {
"@phosphor/application": "^1.6.0",
"@lumino/application": "^1.8.4",
"@types/expect.js": "^0.3.29",
"@types/mocha": "^5.2.5",
"@types/node": "^10.11.6",
Expand Down
6 changes: 3 additions & 3 deletions src/widgets/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

import { ObservableMap } from '@jupyterlab/observables';

import { CommandRegistry } from '@phosphor/commands';
import { ISerializers, WidgetModel } from '@jupyter-widgets/base';

import { IDisposable } from '@phosphor/disposable';
import { CommandRegistry } from '@lumino/commands';

import { ISerializers, WidgetModel } from '@jupyter-widgets/base';
import { IDisposable } from '@lumino/disposable';

import { MODULE_NAME, MODULE_VERSION } from '../version';

Expand Down
12 changes: 6 additions & 6 deletions src/widgets/split_panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ import { JupyterPhosphorWidget, DOMWidgetView } from '@jupyter-widgets/base';

import { VBoxView } from '@jupyter-widgets/controls';

import { Message } from '@phosphor/messaging';
import { Message } from '@lumino/messaging';

import { SplitPanel } from '@phosphor/widgets';
import { SplitPanel } from '@lumino/widgets';

import $ from 'jquery';

import { PanelModel } from './panel';

import { MODULE_NAME, MODULE_VERSION } from '../version';

class JupyterPhosphorSplitPanelWidget extends SplitPanel {
class JupyterLuminoSplitPanelWidget extends SplitPanel {
constructor(options: JupyterPhosphorWidget.IOptions & SplitPanel.IOptions) {
let view = options.view;
delete options.view;
super(options);
this.addClass('jp-JupyterPhosphorSplitPanelWidget');
this.addClass('jp-JupyterLuminoSplitPanelWidget');
this._view = view;
}

Expand Down Expand Up @@ -66,7 +66,7 @@ export class SplitPanelModel extends PanelModel {

export class SplitPanelView extends VBoxView {
_createElement(tagName: string) {
this.pWidget = new JupyterPhosphorSplitPanelWidget({
this.pWidget = new JupyterLuminoSplitPanelWidget({
view: this,
orientation: this.model.get('orientation')
}) as any;
Expand All @@ -84,7 +84,7 @@ export class SplitPanelView extends VBoxView {

initialize(parameters: any) {
super.initialize(parameters);
const pWidget = (this.pWidget as any) as JupyterPhosphorSplitPanelWidget;
const pWidget = (this.pWidget as any) as JupyterLuminoSplitPanelWidget;
this.model.on('change:orientation', () => {
const orientation = this.model.get('orientation');
pWidget.orientation = orientation;
Expand Down

0 comments on commit 71df129

Please sign in to comment.