@jupytergis/jupytergis-qgis 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/modelfactory.js +2 -2
- package/lib/plugins.js +21 -21
- package/package.json +4 -4
package/lib/modelfactory.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JupyterGISModel } from '@jupytergis/schema';
|
|
1
|
+
import { JupyterGISModel, } from '@jupytergis/schema';
|
|
2
2
|
/**
|
|
3
3
|
* A Model factory to create new instances of JupyterGISModel.
|
|
4
4
|
*/
|
|
@@ -68,7 +68,7 @@ export class JupyterGISModelFactoryBase {
|
|
|
68
68
|
sharedModel: options.sharedModel,
|
|
69
69
|
languagePreference: options.languagePreference,
|
|
70
70
|
annotationModel: this._annotationModel,
|
|
71
|
-
settingRegistry: this._settingRegistry
|
|
71
|
+
settingRegistry: this._settingRegistry,
|
|
72
72
|
});
|
|
73
73
|
return model;
|
|
74
74
|
}
|
package/lib/plugins.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ICollaborativeDrive } from '@jupyter/collaborative-drive';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { ICollaborativeDrive, } from '@jupyter/collaborative-drive';
|
|
2
|
+
import { logoMiniIcon, logoMiniIconQGZ, requestAPI, } from '@jupytergis/base';
|
|
3
|
+
import { JupyterGISDocumentWidgetFactory } from '@jupytergis/jupytergis-core';
|
|
4
|
+
import { IJGISExternalCommandRegistryToken, JupyterGISDoc, IJupyterGISDocTracker, IAnnotationToken, } from '@jupytergis/schema';
|
|
5
|
+
import { Dialog, ICommandPalette, IThemeManager, InputDialog, showDialog, showErrorMessage, } from '@jupyterlab/apputils';
|
|
4
6
|
import { IEditorServices } from '@jupyterlab/codeeditor';
|
|
5
7
|
import { ConsolePanel, IConsoleTracker } from '@jupyterlab/console';
|
|
6
8
|
import { PathExt } from '@jupyterlab/coreutils';
|
|
7
9
|
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
|
|
8
|
-
import { Widget } from '@lumino/widgets';
|
|
9
10
|
import { ISettingRegistry } from '@jupyterlab/settingregistry';
|
|
10
|
-
import {
|
|
11
|
-
import { JupyterGISDocumentWidgetFactory } from '@jupytergis/jupytergis-core';
|
|
11
|
+
import { Widget } from '@lumino/widgets';
|
|
12
12
|
import { QGSModelFactory, QGZModelFactory } from './modelfactory';
|
|
13
13
|
/**
|
|
14
14
|
* The command IDs used by the qgis plugin.
|
|
@@ -20,7 +20,7 @@ var CommandIDs;
|
|
|
20
20
|
const activate = async (app, tracker, themeManager, drive, externalCommandRegistry, contentFactory, editorServices, rendermime, consoleTracker, annotationModel, settingRegistry, commandPalette) => {
|
|
21
21
|
const fcCheck = await requestAPI('jupytergis_qgis/backend-check', {
|
|
22
22
|
method: 'POST',
|
|
23
|
-
body: JSON.stringify({})
|
|
23
|
+
body: JSON.stringify({}),
|
|
24
24
|
});
|
|
25
25
|
const { installed } = fcCheck;
|
|
26
26
|
const backendCheck = () => {
|
|
@@ -42,7 +42,7 @@ const activate = async (app, tracker, themeManager, drive, externalCommandRegist
|
|
|
42
42
|
contentFactory,
|
|
43
43
|
rendermime,
|
|
44
44
|
mimeTypeService: editorServices.mimeTypeService,
|
|
45
|
-
consoleTracker
|
|
45
|
+
consoleTracker,
|
|
46
46
|
});
|
|
47
47
|
const QGZWidgetFactory = new JupyterGISDocumentWidgetFactory({
|
|
48
48
|
name: 'JupyterGIS QGZ Factory',
|
|
@@ -57,7 +57,7 @@ const activate = async (app, tracker, themeManager, drive, externalCommandRegist
|
|
|
57
57
|
contentFactory,
|
|
58
58
|
rendermime,
|
|
59
59
|
mimeTypeService: editorServices.mimeTypeService,
|
|
60
|
-
consoleTracker
|
|
60
|
+
consoleTracker,
|
|
61
61
|
});
|
|
62
62
|
// Registering the widget factory
|
|
63
63
|
app.docRegistry.addWidgetFactory(QGSWidgetFactory);
|
|
@@ -73,7 +73,7 @@ const activate = async (app, tracker, themeManager, drive, externalCommandRegist
|
|
|
73
73
|
extensions: ['.qgs', '.QGS'],
|
|
74
74
|
fileFormat: 'base64',
|
|
75
75
|
contentType: 'QGS',
|
|
76
|
-
icon: logoMiniIcon
|
|
76
|
+
icon: logoMiniIcon,
|
|
77
77
|
});
|
|
78
78
|
app.docRegistry.addFileType({
|
|
79
79
|
name: 'QGZ',
|
|
@@ -82,7 +82,7 @@ const activate = async (app, tracker, themeManager, drive, externalCommandRegist
|
|
|
82
82
|
extensions: ['.qgz', '.QGZ'],
|
|
83
83
|
fileFormat: 'base64',
|
|
84
84
|
contentType: 'QGZ',
|
|
85
|
-
icon: logoMiniIconQGZ
|
|
85
|
+
icon: logoMiniIconQGZ,
|
|
86
86
|
});
|
|
87
87
|
const QGISSharedModelFactory = () => {
|
|
88
88
|
return new JupyterGISDoc();
|
|
@@ -128,7 +128,7 @@ const activate = async (app, tracker, themeManager, drive, externalCommandRegist
|
|
|
128
128
|
filepath = (await InputDialog.getText({
|
|
129
129
|
label: 'File name',
|
|
130
130
|
placeholder: PathExt.basename(sourcePath, sourceExtension),
|
|
131
|
-
title: 'Export the project to QGZ file'
|
|
131
|
+
title: 'Export the project to QGZ file',
|
|
132
132
|
})).value;
|
|
133
133
|
}
|
|
134
134
|
if (filepath === null) {
|
|
@@ -152,7 +152,7 @@ const activate = async (app, tracker, themeManager, drive, externalCommandRegist
|
|
|
152
152
|
layers: model.layers,
|
|
153
153
|
sources: model.sources,
|
|
154
154
|
layerTree: model.layerTree.slice().reverse(),
|
|
155
|
-
options: model.options
|
|
155
|
+
options: model.options,
|
|
156
156
|
};
|
|
157
157
|
// Check if the file exists
|
|
158
158
|
let fileExist = true;
|
|
@@ -162,7 +162,7 @@ const activate = async (app, tracker, themeManager, drive, externalCommandRegist
|
|
|
162
162
|
if (fileExist) {
|
|
163
163
|
const overwrite = await showDialog({
|
|
164
164
|
title: 'Export the project to QGZ file',
|
|
165
|
-
body: `The file ${filepath} already exists.\nDo you want to overwrite it
|
|
165
|
+
body: `The file ${filepath} already exists.\nDo you want to overwrite it ?`,
|
|
166
166
|
});
|
|
167
167
|
if (!overwrite.button.accept) {
|
|
168
168
|
return;
|
|
@@ -172,8 +172,8 @@ const activate = async (app, tracker, themeManager, drive, externalCommandRegist
|
|
|
172
172
|
method: 'POST',
|
|
173
173
|
body: JSON.stringify({
|
|
174
174
|
path: absolutePath,
|
|
175
|
-
virtual_file: virtualFile
|
|
176
|
-
})
|
|
175
|
+
virtual_file: virtualFile,
|
|
176
|
+
}),
|
|
177
177
|
});
|
|
178
178
|
if (!response.exported) {
|
|
179
179
|
showErrorMessage('Export the project to QGZ file', response.logs.errors.length
|
|
@@ -187,15 +187,15 @@ const activate = async (app, tracker, themeManager, drive, externalCommandRegist
|
|
|
187
187
|
await showDialog({
|
|
188
188
|
title: 'Export the project to QGZ file',
|
|
189
189
|
body,
|
|
190
|
-
buttons: [Dialog.okButton()]
|
|
190
|
+
buttons: [Dialog.okButton()],
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
|
-
}
|
|
193
|
+
},
|
|
194
194
|
});
|
|
195
195
|
if (commandPalette) {
|
|
196
196
|
commandPalette.addItem({
|
|
197
197
|
command: CommandIDs.exportQgis,
|
|
198
|
-
category: 'JupyterGIS'
|
|
198
|
+
category: 'JupyterGIS',
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
201
|
}
|
|
@@ -213,9 +213,9 @@ export const qgisplugin = {
|
|
|
213
213
|
IRenderMimeRegistry,
|
|
214
214
|
IConsoleTracker,
|
|
215
215
|
IAnnotationToken,
|
|
216
|
-
ISettingRegistry
|
|
216
|
+
ISettingRegistry,
|
|
217
217
|
],
|
|
218
218
|
optional: [ICommandPalette],
|
|
219
219
|
autoStart: true,
|
|
220
|
-
activate
|
|
220
|
+
activate,
|
|
221
221
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupytergis/jupytergis-qgis",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "JupyterGIS QGIS extension.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@jupyter/collaborative-drive": "^3.0.0",
|
|
57
|
-
"@jupytergis/base": "^0.
|
|
58
|
-
"@jupytergis/jupytergis-core": "^0.
|
|
59
|
-
"@jupytergis/schema": "^0.
|
|
57
|
+
"@jupytergis/base": "^0.6.1",
|
|
58
|
+
"@jupytergis/jupytergis-core": "^0.6.1",
|
|
59
|
+
"@jupytergis/schema": "^0.6.1",
|
|
60
60
|
"@jupyterlab/application": "^4.3.0",
|
|
61
61
|
"@jupyterlab/apputils": "^4.3.0",
|
|
62
62
|
"@jupyterlab/coreutils": "^6.3.0",
|