Steven Silvester 8 лет назад
Родитель
Сommit
6a10c31633
2 измененных файлов с 15 добавлено и 14 удалено
  1. 8 8
      src/leafletwidget/plugin.ts
  2. 7 6
      src/leafletwidget/widget.ts

+ 8 - 8
src/leafletwidget/plugin.ts

@@ -2,15 +2,15 @@
 // Distributed under the terms of the Modified BSD License.
 
 import {
-  Application
-} from 'phosphide/lib/core/application';
+  IDocumentRegistry
+} from '../docregistry';
 
 import {
-  DocumentRegistry
-} from '../docregistry';
+  JupyterLab, JupyterLabPlugin
+} from '../application';
 
 import {
-  MapWidget, MapWidgetFactory
+  MapWidgetFactory
 } from './widget';
 
 import 'leaflet/dist/leaflet.css';
@@ -26,9 +26,9 @@ const EXTENSIONS = ['.geojson'];
  * The geojson file handler extension.
  */
 export
-const mapHandlerExtension = {
+const mapHandlerExtension: JupyterLabPlugin<void> = {
   id: 'jupyter.extensions.mapHandler',
-  requires: [DocumentRegistry],
+  requires: [IDocumentRegistry],
   activate: activateMapWidget
 };
 
@@ -36,7 +36,7 @@ const mapHandlerExtension = {
 /**
  * Activate the map widget extension.
  */
-function activateMapWidget(app: Application, registry: DocumentRegistry): void {
+function activateMapWidget(app: JupyterLab, registry: IDocumentRegistry): void {
     let options = {
       fileExtensions: EXTENSIONS,
       displayName: 'Map',

+ 7 - 6
src/leafletwidget/widget.ts

@@ -5,21 +5,22 @@ import {
   IKernel
 } from 'jupyter-js-services';
 
+import {
+  deepEqual, JSONValue
+} from 'phosphor/lib/algorithm/json';
+
 import {
   Message
-} from 'phosphor-messaging';
+} from 'phosphor/lib/core/messaging';
 
 import {
   Widget, ResizeMessage
-} from 'phosphor-widget';
+} from 'phosphor/lib/ui/widget';
 
 import {
   ABCWidgetFactory, IDocumentModel, IDocumentContext
 } from '../docregistry';
 
-import {
-  deepEqual, JSONValue
-} from '../notebook/common/json';
 
 import leaflet = require('leaflet');
 
@@ -95,7 +96,7 @@ class MapWidget extends Widget {
    * Handle `update-request` messages for the widget.
    */
   protected onUpdateRequest(msg: Message): void {
-    this.title.text = this._context.path.split('/').pop();
+    this.title.label = this._context.path.split('/').pop();
     if (!this.isAttached) {
       return;
     }