@jupytergis/jupytergis-lab 0.5.0 → 0.6.0
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/index.js +38 -39
- package/lib/notebookrenderer.js +11 -11
- package/package.json +3 -3
- package/style/base.css +44 -4
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommandIDs, ControlPanelModel, GlobalStateDbManager, LeftPanelWidget, RightPanelWidget, addCommands, createDefaultLayerRegistry, rasterSubMenu, vectorSubMenu,
|
|
2
|
-
import { IAnnotationToken, IJGISFormSchemaRegistryToken, IJGISLayerBrowserRegistryToken, IJupyterGISDocTracker } from '@jupytergis/schema';
|
|
3
|
-
import { ILayoutRestorer } from '@jupyterlab/application';
|
|
1
|
+
import { CommandIDs, ControlPanelModel, GlobalStateDbManager, LeftPanelWidget, RightPanelWidget, addCommands, createDefaultLayerRegistry, logoMiniIcon, rasterSubMenu, vectorSubMenu, } from '@jupytergis/base';
|
|
2
|
+
import { IAnnotationToken, IJGISFormSchemaRegistryToken, IJGISLayerBrowserRegistryToken, IJupyterGISDocTracker, ProcessingMerge, } from '@jupytergis/schema';
|
|
3
|
+
import { ILayoutRestorer, } from '@jupyterlab/application';
|
|
4
4
|
import { ICompletionProviderManager } from '@jupyterlab/completer';
|
|
5
5
|
import { IMainMenu } from '@jupyterlab/mainmenu';
|
|
6
6
|
import { IStateDB } from '@jupyterlab/statedb';
|
|
@@ -15,7 +15,7 @@ const plugin = {
|
|
|
15
15
|
IJupyterGISDocTracker,
|
|
16
16
|
IJGISFormSchemaRegistryToken,
|
|
17
17
|
IJGISLayerBrowserRegistryToken,
|
|
18
|
-
IStateDB
|
|
18
|
+
IStateDB,
|
|
19
19
|
],
|
|
20
20
|
optional: [IMainMenu, ITranslator, ICompletionProviderManager],
|
|
21
21
|
activate: (app, tracker, formSchemaRegistry, layerBrowserRegistry, state, mainMenu, translator, completionProviderManager) => {
|
|
@@ -32,53 +32,53 @@ const plugin = {
|
|
|
32
32
|
app.contextMenu.addItem({
|
|
33
33
|
selector: '.jp-gis-source.jp-gis-sourceUnused',
|
|
34
34
|
rank: 1,
|
|
35
|
-
command: CommandIDs.removeSource
|
|
35
|
+
command: CommandIDs.removeSource,
|
|
36
36
|
});
|
|
37
37
|
app.contextMenu.addItem({
|
|
38
38
|
selector: '.jp-gis-source',
|
|
39
39
|
rank: 1,
|
|
40
|
-
command: CommandIDs.renameSource
|
|
40
|
+
command: CommandIDs.renameSource,
|
|
41
41
|
});
|
|
42
42
|
// LAYERS and LAYER GROUPS context menu
|
|
43
43
|
app.contextMenu.addItem({
|
|
44
44
|
command: CommandIDs.symbology,
|
|
45
45
|
selector: '.jp-gis-layerItem',
|
|
46
|
-
rank: 1
|
|
46
|
+
rank: 1,
|
|
47
47
|
});
|
|
48
48
|
// Separator
|
|
49
49
|
app.contextMenu.addItem({
|
|
50
50
|
type: 'separator',
|
|
51
51
|
selector: '.jp-gis-layerPanel',
|
|
52
|
-
rank: 1
|
|
52
|
+
rank: 1,
|
|
53
53
|
});
|
|
54
54
|
app.contextMenu.addItem({
|
|
55
55
|
command: CommandIDs.removeLayer,
|
|
56
56
|
selector: '.jp-gis-layerItem',
|
|
57
|
-
rank: 2
|
|
57
|
+
rank: 2,
|
|
58
58
|
});
|
|
59
59
|
app.contextMenu.addItem({
|
|
60
60
|
command: CommandIDs.renameLayer,
|
|
61
61
|
selector: '.jp-gis-layerItem',
|
|
62
|
-
rank: 2
|
|
62
|
+
rank: 2,
|
|
63
63
|
});
|
|
64
64
|
app.contextMenu.addItem({
|
|
65
65
|
command: CommandIDs.zoomToLayer,
|
|
66
66
|
selector: '.jp-gis-layerItem',
|
|
67
|
-
rank: 2
|
|
67
|
+
rank: 2,
|
|
68
68
|
});
|
|
69
69
|
// Create the Download submenu
|
|
70
70
|
const downloadSubmenu = new Menu({ commands: app.commands });
|
|
71
71
|
downloadSubmenu.title.label = translator.load('jupyterlab').__('Download');
|
|
72
72
|
downloadSubmenu.id = 'jp-gis-contextmenu-download';
|
|
73
73
|
downloadSubmenu.addItem({
|
|
74
|
-
command: CommandIDs.downloadGeoJSON
|
|
74
|
+
command: CommandIDs.downloadGeoJSON,
|
|
75
75
|
});
|
|
76
76
|
// Add the Download submenu to the context menu
|
|
77
77
|
app.contextMenu.addItem({
|
|
78
78
|
type: 'submenu',
|
|
79
79
|
selector: '.jp-gis-layerItem',
|
|
80
80
|
rank: 2,
|
|
81
|
-
submenu: downloadSubmenu
|
|
81
|
+
submenu: downloadSubmenu,
|
|
82
82
|
});
|
|
83
83
|
// Create the Processing submenu
|
|
84
84
|
const processingSubmenu = new Menu({ commands: app.commands });
|
|
@@ -86,17 +86,16 @@ const plugin = {
|
|
|
86
86
|
.load('jupyterlab')
|
|
87
87
|
.__('Processing');
|
|
88
88
|
processingSubmenu.id = 'jp-gis-contextmenu-processing';
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
});
|
|
89
|
+
for (const processingElement of ProcessingMerge) {
|
|
90
|
+
processingSubmenu.addItem({
|
|
91
|
+
command: processingElement.name,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
95
94
|
app.contextMenu.addItem({
|
|
96
95
|
type: 'submenu',
|
|
97
96
|
selector: '.jp-gis-layerItem',
|
|
98
97
|
rank: 2,
|
|
99
|
-
submenu: processingSubmenu
|
|
98
|
+
submenu: processingSubmenu,
|
|
100
99
|
});
|
|
101
100
|
const moveLayerSubmenu = new Menu({ commands: app.commands });
|
|
102
101
|
moveLayerSubmenu.title.label = translator
|
|
@@ -107,46 +106,46 @@ const plugin = {
|
|
|
107
106
|
type: 'submenu',
|
|
108
107
|
selector: '.jp-gis-layerItem',
|
|
109
108
|
rank: 2,
|
|
110
|
-
submenu: moveLayerSubmenu
|
|
109
|
+
submenu: moveLayerSubmenu,
|
|
111
110
|
});
|
|
112
111
|
app.contextMenu.opened.connect(() => buildGroupsMenu(app.contextMenu, tracker));
|
|
113
112
|
app.contextMenu.addItem({
|
|
114
113
|
command: CommandIDs.removeGroup,
|
|
115
114
|
selector: '.jp-gis-layerGroupHeader',
|
|
116
|
-
rank: 2
|
|
115
|
+
rank: 2,
|
|
117
116
|
});
|
|
118
117
|
app.contextMenu.addItem({
|
|
119
118
|
command: CommandIDs.renameGroup,
|
|
120
119
|
selector: '.jp-gis-layerGroupHeader',
|
|
121
|
-
rank: 2
|
|
120
|
+
rank: 2,
|
|
122
121
|
});
|
|
123
122
|
// Separator
|
|
124
123
|
app.contextMenu.addItem({
|
|
125
124
|
type: 'separator',
|
|
126
125
|
selector: '.jp-gis-layerPanel',
|
|
127
|
-
rank: 2
|
|
126
|
+
rank: 2,
|
|
128
127
|
});
|
|
129
128
|
const newLayerSubMenu = new Menu({ commands: app.commands });
|
|
130
129
|
newLayerSubMenu.title.label = translator.load('jupyterlab').__('Add Layer');
|
|
131
130
|
newLayerSubMenu.id = 'jp-gis-contextmenu-addLayer';
|
|
132
131
|
newLayerSubMenu.addItem({
|
|
133
132
|
type: 'submenu',
|
|
134
|
-
submenu: rasterSubMenu(app.commands)
|
|
133
|
+
submenu: rasterSubMenu(app.commands),
|
|
135
134
|
});
|
|
136
135
|
newLayerSubMenu.addItem({
|
|
137
136
|
type: 'submenu',
|
|
138
|
-
submenu: vectorSubMenu(app.commands)
|
|
137
|
+
submenu: vectorSubMenu(app.commands),
|
|
139
138
|
});
|
|
140
139
|
app.contextMenu.addItem({
|
|
141
140
|
type: 'submenu',
|
|
142
141
|
selector: '.jp-gis-layerPanel',
|
|
143
142
|
rank: 3,
|
|
144
|
-
submenu: newLayerSubMenu
|
|
143
|
+
submenu: newLayerSubMenu,
|
|
145
144
|
});
|
|
146
145
|
if (mainMenu) {
|
|
147
146
|
populateMenus(mainMenu, isEnabled);
|
|
148
147
|
}
|
|
149
|
-
}
|
|
148
|
+
},
|
|
150
149
|
};
|
|
151
150
|
const controlPanel = {
|
|
152
151
|
id: 'jupytergis:lab:controlpanel',
|
|
@@ -156,7 +155,7 @@ const controlPanel = {
|
|
|
156
155
|
IJupyterGISDocTracker,
|
|
157
156
|
IJGISFormSchemaRegistryToken,
|
|
158
157
|
IStateDB,
|
|
159
|
-
IAnnotationToken
|
|
158
|
+
IAnnotationToken,
|
|
160
159
|
],
|
|
161
160
|
activate: (app, restorer, tracker, formSchemaRegistry, state, annotationModel) => {
|
|
162
161
|
const controlModel = new ControlPanelModel({ tracker });
|
|
@@ -164,7 +163,7 @@ const controlPanel = {
|
|
|
164
163
|
model: controlModel,
|
|
165
164
|
tracker,
|
|
166
165
|
state,
|
|
167
|
-
commands: app.commands
|
|
166
|
+
commands: app.commands,
|
|
168
167
|
});
|
|
169
168
|
leftControlPanel.id = 'jupytergis::leftControlPanel';
|
|
170
169
|
leftControlPanel.title.caption = 'JupyterGIS Control Panel';
|
|
@@ -173,18 +172,18 @@ const controlPanel = {
|
|
|
173
172
|
model: controlModel,
|
|
174
173
|
tracker,
|
|
175
174
|
formSchemaRegistry,
|
|
176
|
-
annotationModel
|
|
175
|
+
annotationModel,
|
|
177
176
|
});
|
|
178
177
|
rightControlPanel.id = 'jupytergis::rightControlPanel';
|
|
179
178
|
rightControlPanel.title.caption = 'JupyterGIS Control Panel';
|
|
180
179
|
rightControlPanel.title.icon = logoMiniIcon;
|
|
181
180
|
if (restorer) {
|
|
182
|
-
restorer.add(leftControlPanel, NAME_SPACE);
|
|
183
|
-
restorer.add(rightControlPanel, NAME_SPACE);
|
|
181
|
+
restorer.add(leftControlPanel, `${NAME_SPACE}-left`);
|
|
182
|
+
restorer.add(rightControlPanel, `${NAME_SPACE}-right`);
|
|
184
183
|
}
|
|
185
184
|
app.shell.add(leftControlPanel, 'left', { rank: 2000 });
|
|
186
185
|
app.shell.add(rightControlPanel, 'right', { rank: 2000 });
|
|
187
|
-
}
|
|
186
|
+
},
|
|
188
187
|
};
|
|
189
188
|
/**
|
|
190
189
|
* Populates the application menus for the notebook.
|
|
@@ -193,11 +192,11 @@ function populateMenus(mainMenu, isEnabled) {
|
|
|
193
192
|
// Add undo/redo hooks to the edit menu.
|
|
194
193
|
mainMenu.editMenu.undoers.redo.add({
|
|
195
194
|
id: CommandIDs.redo,
|
|
196
|
-
isEnabled
|
|
195
|
+
isEnabled,
|
|
197
196
|
});
|
|
198
197
|
mainMenu.editMenu.undoers.undo.add({
|
|
199
198
|
id: CommandIDs.undo,
|
|
200
|
-
isEnabled
|
|
199
|
+
isEnabled,
|
|
201
200
|
});
|
|
202
201
|
}
|
|
203
202
|
/**
|
|
@@ -242,16 +241,16 @@ function buildGroupsMenu(contextMenu, tracker) {
|
|
|
242
241
|
}
|
|
243
242
|
submenu.addItem({
|
|
244
243
|
command: CommandIDs.moveLayersToGroup,
|
|
245
|
-
args: { label: '' }
|
|
244
|
+
args: { label: '' },
|
|
246
245
|
});
|
|
247
246
|
groupNames.forEach(name => {
|
|
248
247
|
submenu.addItem({
|
|
249
248
|
command: CommandIDs.moveLayersToGroup,
|
|
250
|
-
args: { label: name }
|
|
249
|
+
args: { label: name },
|
|
251
250
|
});
|
|
252
251
|
});
|
|
253
252
|
submenu.addItem({
|
|
254
|
-
command: CommandIDs.moveLayerToNewGroup
|
|
253
|
+
command: CommandIDs.moveLayerToNewGroup,
|
|
255
254
|
});
|
|
256
255
|
}
|
|
257
256
|
export default [plugin, controlPanel, notebookRendererPlugin];
|
package/lib/notebookrenderer.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ICollaborativeDrive } from '@jupyter/collaborative-drive';
|
|
2
|
-
import { JupyterGISOutputWidget, JupyterGISPanel, ToolbarWidget } from '@jupytergis/base';
|
|
3
|
-
import { IJGISExternalCommandRegistryToken, IJupyterGISDocTracker, JupyterGISModel } from '@jupytergis/schema';
|
|
2
|
+
import { JupyterGISOutputWidget, JupyterGISPanel, ToolbarWidget, } from '@jupytergis/base';
|
|
3
|
+
import { IJGISExternalCommandRegistryToken, IJupyterGISDocTracker, JupyterGISModel, } from '@jupytergis/schema';
|
|
4
4
|
import { showErrorMessage } from '@jupyterlab/apputils';
|
|
5
5
|
import { ConsolePanel } from '@jupyterlab/console';
|
|
6
6
|
import { PathExt } from '@jupyterlab/coreutils';
|
|
7
7
|
import { NotebookPanel } from '@jupyterlab/notebook';
|
|
8
8
|
import { MessageLoop } from '@lumino/messaging';
|
|
9
9
|
import { Panel, Widget } from '@lumino/widgets';
|
|
10
|
-
import { IJupyterYWidgetManager, JupyterYDoc, JupyterYModel } from 'yjs-widgets';
|
|
10
|
+
import { IJupyterYWidgetManager, JupyterYDoc, JupyterYModel, } from 'yjs-widgets';
|
|
11
11
|
export const CLASS_NAME = 'jupytergis-notebook-widget';
|
|
12
12
|
export class YJupyterGISModel extends JupyterYModel {
|
|
13
13
|
}
|
|
@@ -26,13 +26,13 @@ export class YJupyterGISLuminoWidget extends Panel {
|
|
|
26
26
|
toolbar = new ToolbarWidget({
|
|
27
27
|
commands,
|
|
28
28
|
model,
|
|
29
|
-
externalCommands: (externalCommands === null || externalCommands === void 0 ? void 0 : externalCommands.getCommands()) || []
|
|
29
|
+
externalCommands: (externalCommands === null || externalCommands === void 0 ? void 0 : externalCommands.getCommands()) || [],
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
this._jgisWidget = new JupyterGISOutputWidget({
|
|
33
33
|
model,
|
|
34
34
|
content,
|
|
35
|
-
toolbar
|
|
35
|
+
toolbar,
|
|
36
36
|
});
|
|
37
37
|
this.addWidget(this._jgisWidget);
|
|
38
38
|
tracker === null || tracker === void 0 ? void 0 : tracker.add(this._jgisWidget);
|
|
@@ -67,7 +67,7 @@ export const notebookRendererPlugin = {
|
|
|
67
67
|
IJGISExternalCommandRegistryToken,
|
|
68
68
|
IJupyterGISDocTracker,
|
|
69
69
|
IJupyterYWidgetManager,
|
|
70
|
-
ICollaborativeDrive
|
|
70
|
+
ICollaborativeDrive,
|
|
71
71
|
],
|
|
72
72
|
activate: (app, externalCommandRegistry, jgisTracker, yWidgetManager, drive) => {
|
|
73
73
|
if (!yWidgetManager) {
|
|
@@ -99,7 +99,7 @@ export const notebookRendererPlugin = {
|
|
|
99
99
|
catch (e) {
|
|
100
100
|
await app.serviceManager.contents.save(localPath, {
|
|
101
101
|
content: btoa('{}'),
|
|
102
|
-
format: 'base64'
|
|
102
|
+
format: 'base64',
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -111,10 +111,10 @@ export const notebookRendererPlugin = {
|
|
|
111
111
|
path: localPath,
|
|
112
112
|
format: fileFormat,
|
|
113
113
|
contentType,
|
|
114
|
-
collaborative: true
|
|
114
|
+
collaborative: true,
|
|
115
115
|
});
|
|
116
116
|
this.jupyterGISModel = new JupyterGISModel({
|
|
117
|
-
sharedModel: sharedModel
|
|
117
|
+
sharedModel: sharedModel,
|
|
118
118
|
});
|
|
119
119
|
this.jupyterGISModel.contentsManager = app.serviceManager.contents;
|
|
120
120
|
this.jupyterGISModel.filePath = localPath;
|
|
@@ -130,7 +130,7 @@ export const notebookRendererPlugin = {
|
|
|
130
130
|
commands: app.commands,
|
|
131
131
|
model: yModel.jupyterGISModel,
|
|
132
132
|
externalCommands: externalCommandRegistry,
|
|
133
|
-
tracker: jgisTracker
|
|
133
|
+
tracker: jgisTracker,
|
|
134
134
|
});
|
|
135
135
|
this._jgisWidget = widget.jgisWidget;
|
|
136
136
|
MessageLoop.sendMessage(widget, Widget.Msg.BeforeAttach);
|
|
@@ -143,5 +143,5 @@ export const notebookRendererPlugin = {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
yWidgetManager.registerWidget('@jupytergis:widget', YJupyterGISModelFactory, YJupyterGISWidget);
|
|
146
|
-
}
|
|
146
|
+
},
|
|
147
147
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupytergis/jupytergis-lab",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "JupyterGIS Lab extension.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@jupyter/collaborative-drive": "^3.0.0",
|
|
56
|
-
"@jupytergis/base": "^0.
|
|
57
|
-
"@jupytergis/schema": "^0.
|
|
56
|
+
"@jupytergis/base": "^0.6.0",
|
|
57
|
+
"@jupytergis/schema": "^0.6.0",
|
|
58
58
|
"@jupyterlab/application": "^4.3.0",
|
|
59
59
|
"@jupyterlab/apputils": "^4.3.0",
|
|
60
60
|
"@jupyterlab/completer": "^4.3.0",
|
package/style/base.css
CHANGED
|
@@ -223,6 +223,7 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
|
|
|
223
223
|
width: 100%;
|
|
224
224
|
box-sizing: border-box;
|
|
225
225
|
flex: 1;
|
|
226
|
+
position: relative;
|
|
226
227
|
}
|
|
227
228
|
|
|
228
229
|
.jGIS-Popup-Wrapper {
|
|
@@ -586,10 +587,6 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
|
|
|
586
587
|
display: none;
|
|
587
588
|
}
|
|
588
589
|
|
|
589
|
-
.jGIS-property-panel .rjsf .errors {
|
|
590
|
-
color: var(--jp-warn-color0);
|
|
591
|
-
}
|
|
592
|
-
|
|
593
590
|
.jGIS-property-panel .rjsf .errors ul,
|
|
594
591
|
.jGIS-property-panel .rjsf .validationErrors ul,
|
|
595
592
|
.jGIS-property-panel .rjsf .validationErrors li,
|
|
@@ -790,3 +787,46 @@ div.jGIS-toolbar-widget > div.jp-Toolbar-item:last-child {
|
|
|
790
787
|
cursor: not-allowed;
|
|
791
788
|
pointer-events: auto;
|
|
792
789
|
}
|
|
790
|
+
|
|
791
|
+
.jp-gis-stop-container-wrapper {
|
|
792
|
+
display: flex;
|
|
793
|
+
flex-direction: row;
|
|
794
|
+
gap: 2rem;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
.jp-gis-stop-container-wrapper > * {
|
|
798
|
+
flex: 1;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
.jp-gis-stop-container-wrapper > *:only-child {
|
|
802
|
+
flex: 1 1 100%;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
.jp-gis-symbology-tabs {
|
|
806
|
+
display: flex;
|
|
807
|
+
border-bottom: 1px solid #ccc;
|
|
808
|
+
margin: 12px 0;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
.jp-gis-tab {
|
|
812
|
+
flex: 1;
|
|
813
|
+
text-align: center;
|
|
814
|
+
padding: 10px 16px;
|
|
815
|
+
border: none;
|
|
816
|
+
border-bottom: 2px solid transparent;
|
|
817
|
+
cursor: pointer;
|
|
818
|
+
font-size: var(--jp-ui-font-size2);
|
|
819
|
+
color: var(--jp-ui-font-color1);
|
|
820
|
+
background-color: var(--jp-layout-color1);
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
.jp-gis-tab:not(.active):hover {
|
|
824
|
+
background-color: var(--jp-layout-color2);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
.jp-gis-tab.active {
|
|
828
|
+
background-color: var(--jp-layout-color2);
|
|
829
|
+
color: var(--jp-brand-color1);
|
|
830
|
+
border-bottom: 2px solid var(--jp-brand-color1);
|
|
831
|
+
font-weight: 500;
|
|
832
|
+
}
|