@jupytergis/schema 0.2.1 → 0.4.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/_interface/forms.json +75 -30
- package/lib/_interface/heatmapLayer.d.ts +37 -0
- package/lib/_interface/imageSource.d.ts +2 -2
- package/lib/_interface/jgis.d.ts +5 -2
- package/lib/_interface/rasterDemSource.d.ts +0 -5
- package/lib/_interface/vectorTileLayer.d.ts +0 -4
- package/lib/_interface/vectorlayer.d.ts +0 -4
- package/lib/_interface/webGlLayer.d.ts +8 -5
- package/lib/doc.d.ts +1 -1
- package/lib/doc.js +5 -0
- package/lib/interfaces.d.ts +27 -9
- package/lib/model.d.ts +32 -14
- package/lib/model.js +54 -28
- package/lib/schema/heatmapLayer.json +52 -0
- package/lib/schema/imageSource.json +3 -3
- package/lib/schema/jgis.json +9 -2
- package/lib/schema/rasterDemSource.json +0 -10
- package/lib/schema/vectorTileLayer.json +0 -4
- package/lib/schema/vectorlayer.json +0 -4
- package/lib/schema/webGlLayer.json +10 -8
- package/lib/types.d.ts +1 -0
- package/lib/types.js +1 -0
- package/package.json +1 -1
|
@@ -35,6 +35,68 @@
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
+
"HeatmapLayer": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"required": [
|
|
41
|
+
"source",
|
|
42
|
+
"blur",
|
|
43
|
+
"radius"
|
|
44
|
+
],
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"properties": {
|
|
47
|
+
"source": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"description": "The id of the source"
|
|
50
|
+
},
|
|
51
|
+
"opacity": {
|
|
52
|
+
"type": "number",
|
|
53
|
+
"description": "The opacity of the source",
|
|
54
|
+
"default": 1,
|
|
55
|
+
"multipleOf": 0.1,
|
|
56
|
+
"minimum": 0,
|
|
57
|
+
"maximum": 1
|
|
58
|
+
},
|
|
59
|
+
"radius": {
|
|
60
|
+
"type": "number",
|
|
61
|
+
"description": "Radius size in pixels",
|
|
62
|
+
"default": 8
|
|
63
|
+
},
|
|
64
|
+
"blur": {
|
|
65
|
+
"type": "number",
|
|
66
|
+
"description": "Blur size in pixels",
|
|
67
|
+
"default": 15
|
|
68
|
+
},
|
|
69
|
+
"color": {
|
|
70
|
+
"type": "array",
|
|
71
|
+
"items": {
|
|
72
|
+
"type": "string"
|
|
73
|
+
},
|
|
74
|
+
"default": [
|
|
75
|
+
"#00f",
|
|
76
|
+
"#0ff",
|
|
77
|
+
"#0f0",
|
|
78
|
+
"#ff0",
|
|
79
|
+
"#f00"
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
"symbologyState": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"description": "The state of the symbology panel options",
|
|
85
|
+
"required": [
|
|
86
|
+
"renderType"
|
|
87
|
+
],
|
|
88
|
+
"properties": {
|
|
89
|
+
"renderType": {
|
|
90
|
+
"type": "string"
|
|
91
|
+
},
|
|
92
|
+
"colorRamp": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"default": "cool"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
38
100
|
"HillshadeLayer": {
|
|
39
101
|
"type": "object",
|
|
40
102
|
"required": [
|
|
@@ -77,15 +139,15 @@
|
|
|
77
139
|
"ImageSource": {
|
|
78
140
|
"type": "object",
|
|
79
141
|
"required": [
|
|
80
|
-
"
|
|
142
|
+
"path",
|
|
81
143
|
"coordinates"
|
|
82
144
|
],
|
|
83
145
|
"additionalProperties": false,
|
|
84
146
|
"properties": {
|
|
85
|
-
"
|
|
147
|
+
"path": {
|
|
86
148
|
"type": "string",
|
|
87
149
|
"readOnly": true,
|
|
88
|
-
"description": "
|
|
150
|
+
"description": "Path that points to an image"
|
|
89
151
|
},
|
|
90
152
|
"coordinates": {
|
|
91
153
|
"type": "array",
|
|
@@ -116,23 +178,10 @@
|
|
|
116
178
|
"type": "string",
|
|
117
179
|
"description": "The url to the tile provider"
|
|
118
180
|
},
|
|
119
|
-
"tileSize": {
|
|
120
|
-
"type": "number",
|
|
121
|
-
"description": " The tile size",
|
|
122
|
-
"default": 512
|
|
123
|
-
},
|
|
124
181
|
"attribution": {
|
|
125
182
|
"type": "string",
|
|
126
183
|
"description": "The attribution for the raster-dem source"
|
|
127
184
|
},
|
|
128
|
-
"encoding": {
|
|
129
|
-
"type": "string",
|
|
130
|
-
"enum": [
|
|
131
|
-
"terrarium",
|
|
132
|
-
"mapbox"
|
|
133
|
-
],
|
|
134
|
-
"default": "mapbox"
|
|
135
|
-
},
|
|
136
185
|
"urlParameters": {
|
|
137
186
|
"type": "object",
|
|
138
187
|
"additionalProperties": {
|
|
@@ -289,10 +338,6 @@
|
|
|
289
338
|
"default": "line",
|
|
290
339
|
"description": "The type of vector layer"
|
|
291
340
|
},
|
|
292
|
-
"sourceLayer": {
|
|
293
|
-
"type": "string",
|
|
294
|
-
"description": "The source layer to use"
|
|
295
|
-
},
|
|
296
341
|
"color": {
|
|
297
342
|
"type": "object",
|
|
298
343
|
"description": "The color of the the object"
|
|
@@ -329,10 +374,6 @@
|
|
|
329
374
|
"default": "line",
|
|
330
375
|
"description": "The type of vector layer"
|
|
331
376
|
},
|
|
332
|
-
"sourceLayer": {
|
|
333
|
-
"type": "string",
|
|
334
|
-
"description": "The source layer to use"
|
|
335
|
-
},
|
|
336
377
|
"color": {
|
|
337
378
|
"type": "object",
|
|
338
379
|
"description": "The color of the the object"
|
|
@@ -543,12 +584,7 @@
|
|
|
543
584
|
"type": "object",
|
|
544
585
|
"description": "The state of the symbology panel options",
|
|
545
586
|
"required": [
|
|
546
|
-
"renderType"
|
|
547
|
-
"band",
|
|
548
|
-
"interpolation",
|
|
549
|
-
"colorRamp",
|
|
550
|
-
"nClasses",
|
|
551
|
-
"mode"
|
|
587
|
+
"renderType"
|
|
552
588
|
],
|
|
553
589
|
"properties": {
|
|
554
590
|
"renderType": {
|
|
@@ -557,6 +593,15 @@
|
|
|
557
593
|
"band": {
|
|
558
594
|
"type": "number"
|
|
559
595
|
},
|
|
596
|
+
"redBand": {
|
|
597
|
+
"type": "number"
|
|
598
|
+
},
|
|
599
|
+
"greenBand": {
|
|
600
|
+
"type": "number"
|
|
601
|
+
},
|
|
602
|
+
"blueBand": {
|
|
603
|
+
"type": "number"
|
|
604
|
+
},
|
|
560
605
|
"interpolation": {
|
|
561
606
|
"type": "string",
|
|
562
607
|
"enum": [
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* HeatmapLayer
|
|
10
|
+
*/
|
|
11
|
+
export interface IHeatmapLayer {
|
|
12
|
+
/**
|
|
13
|
+
* The id of the source
|
|
14
|
+
*/
|
|
15
|
+
source: string;
|
|
16
|
+
/**
|
|
17
|
+
* The opacity of the source
|
|
18
|
+
*/
|
|
19
|
+
opacity?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Radius size in pixels
|
|
22
|
+
*/
|
|
23
|
+
radius: number;
|
|
24
|
+
/**
|
|
25
|
+
* Blur size in pixels
|
|
26
|
+
*/
|
|
27
|
+
blur: number;
|
|
28
|
+
color?: string[];
|
|
29
|
+
/**
|
|
30
|
+
* The state of the symbology panel options
|
|
31
|
+
*/
|
|
32
|
+
symbologyState?: {
|
|
33
|
+
renderType: string;
|
|
34
|
+
colorRamp?: string;
|
|
35
|
+
[k: string]: any;
|
|
36
|
+
};
|
|
37
|
+
}
|
package/lib/_interface/jgis.d.ts
CHANGED
|
@@ -15,7 +15,8 @@ export type LayerType =
|
|
|
15
15
|
| "VectorTileLayer"
|
|
16
16
|
| "HillshadeLayer"
|
|
17
17
|
| "WebGlLayer"
|
|
18
|
-
| "ImageLayer"
|
|
18
|
+
| "ImageLayer"
|
|
19
|
+
| "HeatmapLayer";
|
|
19
20
|
/**
|
|
20
21
|
* This interface was referenced by `IJGISContent`'s JSON-Schema
|
|
21
22
|
* via the `definition` "sourceType".
|
|
@@ -86,9 +87,11 @@ export interface IJGISFilter {
|
|
|
86
87
|
* via the `definition` "jGISFilterItem".
|
|
87
88
|
*/
|
|
88
89
|
export interface IJGISFilterItem {
|
|
89
|
-
operator: "==" | "!=" | ">" | "<" | ">=" | "<=";
|
|
90
|
+
operator: "==" | "!=" | ">" | "<" | ">=" | "<=" | "between";
|
|
90
91
|
feature: string;
|
|
91
92
|
value: string | number;
|
|
93
|
+
betweenMin?: number;
|
|
94
|
+
betweenMax?: number;
|
|
92
95
|
}
|
|
93
96
|
/**
|
|
94
97
|
* This interface was referenced by `IJGISContent`'s JSON-Schema
|
|
@@ -13,15 +13,10 @@ export interface IRasterDemSource {
|
|
|
13
13
|
* The url to the tile provider
|
|
14
14
|
*/
|
|
15
15
|
url: string;
|
|
16
|
-
/**
|
|
17
|
-
* The tile size
|
|
18
|
-
*/
|
|
19
|
-
tileSize?: number;
|
|
20
16
|
/**
|
|
21
17
|
* The attribution for the raster-dem source
|
|
22
18
|
*/
|
|
23
19
|
attribution?: string;
|
|
24
|
-
encoding?: "terrarium" | "mapbox";
|
|
25
20
|
urlParameters?: {
|
|
26
21
|
[k: string]: string;
|
|
27
22
|
};
|
|
@@ -26,10 +26,13 @@ export interface IWebGlLayer {
|
|
|
26
26
|
*/
|
|
27
27
|
symbologyState?: {
|
|
28
28
|
renderType: string;
|
|
29
|
-
band
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
band?: number;
|
|
30
|
+
redBand?: number;
|
|
31
|
+
greenBand?: number;
|
|
32
|
+
blueBand?: number;
|
|
33
|
+
interpolation?: "discrete" | "linear" | "exact";
|
|
34
|
+
colorRamp?: string;
|
|
35
|
+
nClasses?: string;
|
|
36
|
+
mode?: "continuous" | "equal interval" | "quantile";
|
|
34
37
|
};
|
|
35
38
|
}
|
package/lib/doc.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { IDict, IJGISLayerDocChange, IJGISLayerTreeDocChange, IJGISSourceDocChan
|
|
|
6
6
|
export declare class JupyterGISDoc extends YDocument<IJupyterGISDocChange> implements IJupyterGISDoc {
|
|
7
7
|
constructor();
|
|
8
8
|
getSource(): JSONObject;
|
|
9
|
-
setSource(value: JSONObject): void;
|
|
9
|
+
setSource(value: JSONObject | string): void;
|
|
10
10
|
dispose(): void;
|
|
11
11
|
get version(): string;
|
|
12
12
|
get layers(): IJGISLayers;
|
package/lib/doc.js
CHANGED
|
@@ -42,6 +42,10 @@ export class JupyterGISDoc extends YDocument {
|
|
|
42
42
|
if (!value) {
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
+
if (typeof value === 'string') {
|
|
46
|
+
value = JSON.parse(value);
|
|
47
|
+
}
|
|
48
|
+
value = value;
|
|
45
49
|
this.transact(() => {
|
|
46
50
|
var _a, _b, _c, _d, _e;
|
|
47
51
|
const layers = (_a = value['layers']) !== null && _a !== void 0 ? _a : {};
|
|
@@ -255,6 +259,7 @@ export class JupyterGISDoc extends YDocument {
|
|
|
255
259
|
}
|
|
256
260
|
changes.push({
|
|
257
261
|
id: key,
|
|
262
|
+
oldValue: change.oldValue,
|
|
258
263
|
newValue: JSONExt.deepCopy(event.target.toJSON()[key])
|
|
259
264
|
});
|
|
260
265
|
});
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Delta, DocumentChange, MapChange, StateChange, YDocument } from '@jupyter/ydoc';
|
|
2
|
-
import { IWidgetTracker } from '@jupyterlab/apputils';
|
|
2
|
+
import { IWidgetTracker, MainAreaWidget } from '@jupyterlab/apputils';
|
|
3
3
|
import { IChangedArgs } from '@jupyterlab/coreutils';
|
|
4
|
+
import { IDocumentManager } from '@jupyterlab/docmanager';
|
|
4
5
|
import { DocumentRegistry, IDocumentWidget } from '@jupyterlab/docregistry';
|
|
5
6
|
import { Contents, User } from '@jupyterlab/services';
|
|
7
|
+
import { JSONObject } from '@lumino/coreutils';
|
|
6
8
|
import { ISignal, Signal } from '@lumino/signaling';
|
|
7
9
|
import { SplitPanel } from '@lumino/widgets';
|
|
8
|
-
import { GeoJSON } from './_interface/geojsonsource';
|
|
9
10
|
import { IJGISContent, IJGISLayer, IJGISLayerGroup, IJGISLayerItem, IJGISLayers, IJGISLayerTree, IJGISOptions, IJGISSource, IJGISSources, SourceType } from './_interface/jgis';
|
|
10
11
|
import { IRasterSource } from './_interface/rastersource';
|
|
11
12
|
export { IGeoJSONSource } from './_interface/geojsonsource';
|
|
@@ -29,6 +30,7 @@ export interface IDict<T = any> {
|
|
|
29
30
|
export interface IJGISLayerDocChange {
|
|
30
31
|
layerChange?: Array<{
|
|
31
32
|
id: string;
|
|
33
|
+
oldValue: IDict;
|
|
32
34
|
newValue: IJGISLayer | undefined;
|
|
33
35
|
}>;
|
|
34
36
|
}
|
|
@@ -69,6 +71,7 @@ export interface IJupyterGISClientState {
|
|
|
69
71
|
user: User.IIdentity;
|
|
70
72
|
remoteUser?: number;
|
|
71
73
|
toolbarForm?: IDict;
|
|
74
|
+
isTemporalControllerActive: boolean;
|
|
72
75
|
}
|
|
73
76
|
export interface IJupyterGISDoc extends YDocument<IJupyterGISDocChange> {
|
|
74
77
|
options: IJGISOptions;
|
|
@@ -78,6 +81,8 @@ export interface IJupyterGISDoc extends YDocument<IJupyterGISDocChange> {
|
|
|
78
81
|
metadata: any;
|
|
79
82
|
readonly editable: boolean;
|
|
80
83
|
readonly toJGISEndpoint?: string;
|
|
84
|
+
getSource(): JSONObject;
|
|
85
|
+
setSource(value: JSONObject | string): void;
|
|
81
86
|
layerExists(id: string): boolean;
|
|
82
87
|
getLayer(id: string): IJGISLayer | undefined;
|
|
83
88
|
removeLayer(id: string): void;
|
|
@@ -127,8 +132,11 @@ export interface IJupyterGISModel extends DocumentRegistry.IModel {
|
|
|
127
132
|
sharedLayerTreeChanged: ISignal<IJupyterGISDoc, IJGISLayerTreeDocChange>;
|
|
128
133
|
sharedSourcesChanged: ISignal<IJupyterGISDoc, IJGISSourceDocChange>;
|
|
129
134
|
sharedMetadataChanged: ISignal<IJupyterGISModel, MapChange>;
|
|
130
|
-
|
|
131
|
-
|
|
135
|
+
zoomToPositionSignal: ISignal<IJupyterGISModel, string>;
|
|
136
|
+
addFeatureAsMsSignal: ISignal<IJupyterGISModel, string>;
|
|
137
|
+
updateLayerSignal: ISignal<IJupyterGISModel, string>;
|
|
138
|
+
contentsManager: Contents.IManager | undefined;
|
|
139
|
+
filePath: string;
|
|
132
140
|
getContent(): IJGISContent;
|
|
133
141
|
getLayers(): IJGISLayers;
|
|
134
142
|
getLayer(id: string): IJGISLayer | undefined;
|
|
@@ -143,7 +151,6 @@ export interface IJupyterGISModel extends DocumentRegistry.IModel {
|
|
|
143
151
|
removeLayer(id: string): void;
|
|
144
152
|
getOptions(): IJGISOptions;
|
|
145
153
|
setOptions(value: IJGISOptions): void;
|
|
146
|
-
readGeoJSON(filepath: string): Promise<GeoJSON | undefined>;
|
|
147
154
|
removeLayerGroup(groupName: string): void;
|
|
148
155
|
renameLayerGroup(groupName: string, newName: string): void;
|
|
149
156
|
moveItemsToGroup(items: string[], groupName: string, index?: number): void;
|
|
@@ -161,16 +168,26 @@ export interface IJupyterGISModel extends DocumentRegistry.IModel {
|
|
|
161
168
|
getClientId(): number;
|
|
162
169
|
addMetadata(key: string, value: string): void;
|
|
163
170
|
removeMetadata(key: string): void;
|
|
164
|
-
|
|
171
|
+
centerOnPosition(id: string): void;
|
|
165
172
|
toggleIdentify(): void;
|
|
166
173
|
isIdentifying: boolean;
|
|
174
|
+
isTemporalControllerActive: boolean;
|
|
175
|
+
toggleTemporalController(): void;
|
|
176
|
+
addFeatureAsMs(id: string, selectedFeature: string): void;
|
|
177
|
+
triggerLayerUpdate(layerId: string, layer: IJGISLayer): void;
|
|
167
178
|
disposed: ISignal<any, void>;
|
|
168
179
|
}
|
|
169
180
|
export interface IUserData {
|
|
170
181
|
userId: number;
|
|
171
182
|
userData: User.IIdentity;
|
|
172
183
|
}
|
|
173
|
-
export
|
|
184
|
+
export interface IJupyterGISDocumentWidget extends IDocumentWidget<SplitPanel, IJupyterGISModel> {
|
|
185
|
+
readonly model: IJupyterGISModel;
|
|
186
|
+
}
|
|
187
|
+
export interface IJupyterGISOutputWidget extends MainAreaWidget {
|
|
188
|
+
model: IJupyterGISModel;
|
|
189
|
+
}
|
|
190
|
+
export type IJupyterGISWidget = IJupyterGISDocumentWidget | IJupyterGISOutputWidget;
|
|
174
191
|
export type IJupyterGISTracker = IWidgetTracker<IJupyterGISWidget>;
|
|
175
192
|
export interface IJGISFormSchemaRegistry {
|
|
176
193
|
/**
|
|
@@ -196,6 +213,7 @@ export interface IJGISFormSchemaRegistry {
|
|
|
196
213
|
* @memberof IJGISFormSchemaRegistry
|
|
197
214
|
*/
|
|
198
215
|
has(name: string): boolean;
|
|
216
|
+
getDocManager(): IDocumentManager;
|
|
199
217
|
}
|
|
200
218
|
export interface IJGISExternalCommand {
|
|
201
219
|
name: string;
|
|
@@ -227,8 +245,8 @@ export interface IJGISLayerBrowserRegistry {
|
|
|
227
245
|
export interface IAnnotationModel {
|
|
228
246
|
updateSignal: ISignal<this, null>;
|
|
229
247
|
user: User.IIdentity | undefined;
|
|
230
|
-
|
|
231
|
-
|
|
248
|
+
model: IJupyterGISModel | undefined;
|
|
249
|
+
modelChanged: ISignal<this, void>;
|
|
232
250
|
update(): void;
|
|
233
251
|
getAnnotation(id: string): IAnnotation | undefined;
|
|
234
252
|
getAnnotationIds(): string[];
|
package/lib/model.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { MapChange } from '@jupyter/ydoc';
|
|
2
2
|
import { IChangedArgs } from '@jupyterlab/coreutils';
|
|
3
3
|
import { DocumentRegistry } from '@jupyterlab/docregistry';
|
|
4
|
+
import { Contents } from '@jupyterlab/services';
|
|
4
5
|
import { PartialJSONObject } from '@lumino/coreutils';
|
|
5
6
|
import { ISignal, Signal } from '@lumino/signaling';
|
|
6
|
-
import { GeoJSON } from './_interface/geojsonsource';
|
|
7
7
|
import { IJGISContent, IJGISLayer, IJGISLayerGroup, IJGISLayerTree, IJGISLayers, IJGISOptions, IJGISSource, IJGISSources } from './_interface/jgis';
|
|
8
|
-
import {
|
|
9
|
-
import { Contents } from '@jupyterlab/services';
|
|
8
|
+
import { IAnnotationModel, IDict, IJGISLayerDocChange, IJGISLayerTreeDocChange, IJGISSourceDocChange, IJupyterGISClientState, IJupyterGISDoc, IJupyterGISModel, ISelection, IUserData, IViewPortState, Pointer } from './interfaces';
|
|
10
9
|
export declare class JupyterGISModel implements IJupyterGISModel {
|
|
11
10
|
constructor(options: JupyterGISModel.IOptions);
|
|
12
11
|
private _onSharedModelChanged;
|
|
@@ -31,10 +30,12 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
31
30
|
get sharedSourcesChanged(): ISignal<IJupyterGISDoc, IJGISSourceDocChange>;
|
|
32
31
|
get disposed(): ISignal<JupyterGISModel, void>;
|
|
33
32
|
get sharedMetadataChanged(): ISignal<this, MapChange>;
|
|
34
|
-
get
|
|
33
|
+
get zoomToPositionSignal(): ISignal<this, string>;
|
|
35
34
|
set isIdentifying(isIdentifying: boolean);
|
|
36
35
|
get isIdentifying(): boolean;
|
|
37
|
-
|
|
36
|
+
set isTemporalControllerActive(isActive: boolean);
|
|
37
|
+
get isTemporalControllerActive(): boolean;
|
|
38
|
+
centerOnPosition(id: string): void;
|
|
38
39
|
private _metadataChangedHandler;
|
|
39
40
|
addMetadata(key: string, value: string): void;
|
|
40
41
|
removeMetadata(key: string): void;
|
|
@@ -46,7 +47,23 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
46
47
|
initialize(): void;
|
|
47
48
|
getWorker(): Worker;
|
|
48
49
|
getContent(): IJGISContent;
|
|
49
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Getter for the contents manager.
|
|
52
|
+
*/
|
|
53
|
+
get contentsManager(): Contents.IManager | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Setter for the contents manager.
|
|
56
|
+
* Also updates the file path.
|
|
57
|
+
*/
|
|
58
|
+
set contentsManager(manager: Contents.IManager | undefined);
|
|
59
|
+
/**
|
|
60
|
+
* Getter for the file path associated with the contents manager.
|
|
61
|
+
*/
|
|
62
|
+
get filePath(): string;
|
|
63
|
+
/**
|
|
64
|
+
* Setter for the file path associated with the contents manager.
|
|
65
|
+
*/
|
|
66
|
+
set filePath(path: string);
|
|
50
67
|
getLayers(): IJGISLayers;
|
|
51
68
|
getSources(): IJGISSources;
|
|
52
69
|
getLayerTree(): IJGISLayerTree;
|
|
@@ -66,13 +83,6 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
66
83
|
* @returns a list of layer ids that use the source.
|
|
67
84
|
*/
|
|
68
85
|
getLayersBySource(id: string): string[];
|
|
69
|
-
/**
|
|
70
|
-
* Read a GeoJSON file.
|
|
71
|
-
*
|
|
72
|
-
* @param filepath - the path of the GeoJSON file.
|
|
73
|
-
* @returns a promise to the GeoJSON data.
|
|
74
|
-
*/
|
|
75
|
-
readGeoJSON(filepath: string): Promise<GeoJSON | undefined>;
|
|
76
86
|
/**
|
|
77
87
|
* Add a layer group in the layer tree.
|
|
78
88
|
*
|
|
@@ -126,8 +136,13 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
126
136
|
renameLayerGroup(groupName: string, newName: string): void;
|
|
127
137
|
removeLayerGroup(groupName: string): void;
|
|
128
138
|
toggleIdentify(): void;
|
|
139
|
+
toggleTemporalController(): void;
|
|
129
140
|
private _getLayerTreeInfo;
|
|
130
141
|
private _onClientStateChanged;
|
|
142
|
+
addFeatureAsMs: (id: string, selectedFeature: string) => void;
|
|
143
|
+
get addFeatureAsMsSignal(): Signal<this, string>;
|
|
144
|
+
get updateLayerSignal(): Signal<this, string>;
|
|
145
|
+
triggerLayerUpdate: (layerId: string, layer: IJGISLayer) => void;
|
|
131
146
|
readonly defaultKernelName: string;
|
|
132
147
|
readonly defaultKernelLanguage: string;
|
|
133
148
|
readonly annotationModel?: IAnnotationModel;
|
|
@@ -145,8 +160,11 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
145
160
|
private _themeChanged;
|
|
146
161
|
private _clientStateChanged;
|
|
147
162
|
private _sharedMetadataChanged;
|
|
148
|
-
private
|
|
163
|
+
private _zoomToPositionSignal;
|
|
164
|
+
private _addFeatureAsMsSignal;
|
|
165
|
+
private _updateLayerSignal;
|
|
149
166
|
private _isIdentifying;
|
|
167
|
+
private _isTemporalControllerActive;
|
|
150
168
|
static worker: Worker;
|
|
151
169
|
}
|
|
152
170
|
export declare namespace JupyterGISModel {
|
package/lib/model.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PathExt } from '@jupyterlab/coreutils';
|
|
2
1
|
import { Signal } from '@lumino/signaling';
|
|
3
2
|
import Ajv from 'ajv';
|
|
4
3
|
import { JupyterGISDoc } from './doc';
|
|
@@ -20,6 +19,12 @@ export class JupyterGISModel {
|
|
|
20
19
|
this._userChanged.emit(this.users);
|
|
21
20
|
}
|
|
22
21
|
};
|
|
22
|
+
this.addFeatureAsMs = (id, selectedFeature) => {
|
|
23
|
+
this.addFeatureAsMsSignal.emit(JSON.stringify({ id, selectedFeature }));
|
|
24
|
+
};
|
|
25
|
+
this.triggerLayerUpdate = (layerId, layer) => {
|
|
26
|
+
this.updateLayerSignal.emit(JSON.stringify({ layerId, layer }));
|
|
27
|
+
};
|
|
23
28
|
this.defaultKernelName = '';
|
|
24
29
|
this.defaultKernelLanguage = '';
|
|
25
30
|
this._dirty = false;
|
|
@@ -32,8 +37,11 @@ export class JupyterGISModel {
|
|
|
32
37
|
this._themeChanged = new Signal(this);
|
|
33
38
|
this._clientStateChanged = new Signal(this);
|
|
34
39
|
this._sharedMetadataChanged = new Signal(this);
|
|
35
|
-
this.
|
|
40
|
+
this._zoomToPositionSignal = new Signal(this);
|
|
41
|
+
this._addFeatureAsMsSignal = new Signal(this);
|
|
42
|
+
this._updateLayerSignal = new Signal(this);
|
|
36
43
|
this._isIdentifying = false;
|
|
44
|
+
this._isTemporalControllerActive = false;
|
|
37
45
|
const { annotationModel, sharedModel } = options;
|
|
38
46
|
if (sharedModel) {
|
|
39
47
|
this._sharedModel = sharedModel;
|
|
@@ -115,8 +123,8 @@ export class JupyterGISModel {
|
|
|
115
123
|
get sharedMetadataChanged() {
|
|
116
124
|
return this._sharedMetadataChanged;
|
|
117
125
|
}
|
|
118
|
-
get
|
|
119
|
-
return this.
|
|
126
|
+
get zoomToPositionSignal() {
|
|
127
|
+
return this._zoomToPositionSignal;
|
|
120
128
|
}
|
|
121
129
|
set isIdentifying(isIdentifying) {
|
|
122
130
|
this._isIdentifying = isIdentifying;
|
|
@@ -124,8 +132,14 @@ export class JupyterGISModel {
|
|
|
124
132
|
get isIdentifying() {
|
|
125
133
|
return this._isIdentifying;
|
|
126
134
|
}
|
|
127
|
-
|
|
128
|
-
this.
|
|
135
|
+
set isTemporalControllerActive(isActive) {
|
|
136
|
+
this._isTemporalControllerActive = isActive;
|
|
137
|
+
}
|
|
138
|
+
get isTemporalControllerActive() {
|
|
139
|
+
return this._isTemporalControllerActive;
|
|
140
|
+
}
|
|
141
|
+
centerOnPosition(id) {
|
|
142
|
+
this._zoomToPositionSignal.emit(id);
|
|
129
143
|
}
|
|
130
144
|
_metadataChangedHandler(_, args) {
|
|
131
145
|
this._sharedMetadataChanged.emit(args);
|
|
@@ -198,9 +212,30 @@ export class JupyterGISModel {
|
|
|
198
212
|
metadata: this.sharedModel.metadata
|
|
199
213
|
};
|
|
200
214
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
215
|
+
/**
|
|
216
|
+
* Getter for the contents manager.
|
|
217
|
+
*/
|
|
218
|
+
get contentsManager() {
|
|
219
|
+
return this._contentsManager;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Setter for the contents manager.
|
|
223
|
+
* Also updates the file path.
|
|
224
|
+
*/
|
|
225
|
+
set contentsManager(manager) {
|
|
226
|
+
this._contentsManager = manager;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Getter for the file path associated with the contents manager.
|
|
230
|
+
*/
|
|
231
|
+
get filePath() {
|
|
232
|
+
return this._filePath;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Setter for the file path associated with the contents manager.
|
|
236
|
+
*/
|
|
237
|
+
set filePath(path) {
|
|
238
|
+
this._filePath = path;
|
|
204
239
|
}
|
|
205
240
|
getLayers() {
|
|
206
241
|
return this.sharedModel.layers;
|
|
@@ -247,25 +282,6 @@ export class JupyterGISModel {
|
|
|
247
282
|
});
|
|
248
283
|
return usingLayers;
|
|
249
284
|
}
|
|
250
|
-
/**
|
|
251
|
-
* Read a GeoJSON file.
|
|
252
|
-
*
|
|
253
|
-
* @param filepath - the path of the GeoJSON file.
|
|
254
|
-
* @returns a promise to the GeoJSON data.
|
|
255
|
-
*/
|
|
256
|
-
async readGeoJSON(filepath) {
|
|
257
|
-
if (!this._contentsManager) {
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
const absolutePath = PathExt.resolve(PathExt.dirname(this._filePath), filepath);
|
|
261
|
-
const file = await this._contentsManager.get(absolutePath, {
|
|
262
|
-
content: true
|
|
263
|
-
});
|
|
264
|
-
if (typeof file.content === 'string') {
|
|
265
|
-
return JSON.parse(file.content);
|
|
266
|
-
}
|
|
267
|
-
return file.content;
|
|
268
|
-
}
|
|
269
285
|
/**
|
|
270
286
|
* Add a layer group in the layer tree.
|
|
271
287
|
*
|
|
@@ -488,6 +504,10 @@ export class JupyterGISModel {
|
|
|
488
504
|
toggleIdentify() {
|
|
489
505
|
this._isIdentifying = !this._isIdentifying;
|
|
490
506
|
}
|
|
507
|
+
toggleTemporalController() {
|
|
508
|
+
this._isTemporalControllerActive = !this._isTemporalControllerActive;
|
|
509
|
+
this.sharedModel.awareness.setLocalStateField('isTemporalControllerActive', this._isTemporalControllerActive);
|
|
510
|
+
}
|
|
491
511
|
_getLayerTreeInfo(groupName) {
|
|
492
512
|
const layerTree = this.getLayerTree();
|
|
493
513
|
const indexesPath = Private.findItemPath(layerTree, groupName);
|
|
@@ -514,6 +534,12 @@ export class JupyterGISModel {
|
|
|
514
534
|
mainGroupIndex
|
|
515
535
|
};
|
|
516
536
|
}
|
|
537
|
+
get addFeatureAsMsSignal() {
|
|
538
|
+
return this._addFeatureAsMsSignal;
|
|
539
|
+
}
|
|
540
|
+
get updateLayerSignal() {
|
|
541
|
+
return this._updateLayerSignal;
|
|
542
|
+
}
|
|
517
543
|
}
|
|
518
544
|
(function (JupyterGISModel) {
|
|
519
545
|
/**
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"description": "HeatmapLayer",
|
|
4
|
+
"title": "IHeatmapLayer",
|
|
5
|
+
"required": ["source", "blur", "radius"],
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"source": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The id of the source"
|
|
11
|
+
},
|
|
12
|
+
"opacity": {
|
|
13
|
+
"type": "number",
|
|
14
|
+
"description": "The opacity of the source",
|
|
15
|
+
"default": 1,
|
|
16
|
+
"multipleOf": 0.1,
|
|
17
|
+
"minimum": 0,
|
|
18
|
+
"maximum": 1
|
|
19
|
+
},
|
|
20
|
+
"radius": {
|
|
21
|
+
"type": "number",
|
|
22
|
+
"description": "Radius size in pixels",
|
|
23
|
+
"default": 8
|
|
24
|
+
},
|
|
25
|
+
"blur": {
|
|
26
|
+
"type": "number",
|
|
27
|
+
"description": "Blur size in pixels",
|
|
28
|
+
"default": 15
|
|
29
|
+
},
|
|
30
|
+
"color": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"items": {
|
|
33
|
+
"type": "string"
|
|
34
|
+
},
|
|
35
|
+
"default": ["#00f", "#0ff", "#0f0", "#ff0", "#f00"]
|
|
36
|
+
},
|
|
37
|
+
"symbologyState": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"description": "The state of the symbology panel options",
|
|
40
|
+
"required": ["renderType"],
|
|
41
|
+
"properties": {
|
|
42
|
+
"renderType": {
|
|
43
|
+
"type": "string"
|
|
44
|
+
},
|
|
45
|
+
"colorRamp": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"default": "cool"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"type": "object",
|
|
3
3
|
"description": "ImageSource",
|
|
4
4
|
"title": "IImageSource",
|
|
5
|
-
"required": ["
|
|
5
|
+
"required": ["path", "coordinates"],
|
|
6
6
|
"additionalProperties": false,
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"path": {
|
|
9
9
|
"type": "string",
|
|
10
10
|
"readOnly": true,
|
|
11
|
-
"description": "
|
|
11
|
+
"description": "Path that points to an image"
|
|
12
12
|
},
|
|
13
13
|
"coordinates": {
|
|
14
14
|
"type": "array",
|
package/lib/schema/jgis.json
CHANGED
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"VectorTileLayer",
|
|
36
36
|
"HillshadeLayer",
|
|
37
37
|
"WebGlLayer",
|
|
38
|
-
"ImageLayer"
|
|
38
|
+
"ImageLayer",
|
|
39
|
+
"HeatmapLayer"
|
|
39
40
|
]
|
|
40
41
|
},
|
|
41
42
|
"sourceType": {
|
|
@@ -205,7 +206,7 @@
|
|
|
205
206
|
"properties": {
|
|
206
207
|
"operator": {
|
|
207
208
|
"type": "string",
|
|
208
|
-
"enum": ["==", "!=", ">", "<", ">=", "<="],
|
|
209
|
+
"enum": ["==", "!=", ">", "<", ">=", "<=", "between"],
|
|
209
210
|
"default": "=="
|
|
210
211
|
},
|
|
211
212
|
"feature": {
|
|
@@ -214,6 +215,12 @@
|
|
|
214
215
|
},
|
|
215
216
|
"value": {
|
|
216
217
|
"type": ["string", "number"]
|
|
218
|
+
},
|
|
219
|
+
"betweenMin": {
|
|
220
|
+
"type": ["number"]
|
|
221
|
+
},
|
|
222
|
+
"betweenMax": {
|
|
223
|
+
"type": ["number"]
|
|
217
224
|
}
|
|
218
225
|
}
|
|
219
226
|
},
|
|
@@ -9,20 +9,10 @@
|
|
|
9
9
|
"type": "string",
|
|
10
10
|
"description": "The url to the tile provider"
|
|
11
11
|
},
|
|
12
|
-
"tileSize": {
|
|
13
|
-
"type": "number",
|
|
14
|
-
"description": " The tile size",
|
|
15
|
-
"default": 512
|
|
16
|
-
},
|
|
17
12
|
"attribution": {
|
|
18
13
|
"type": "string",
|
|
19
14
|
"description": "The attribution for the raster-dem source"
|
|
20
15
|
},
|
|
21
|
-
"encoding": {
|
|
22
|
-
"type": "string",
|
|
23
|
-
"enum": ["terrarium", "mapbox"],
|
|
24
|
-
"default": "mapbox"
|
|
25
|
-
},
|
|
26
16
|
"urlParameters": {
|
|
27
17
|
"type": "object",
|
|
28
18
|
"additionalProperties": {
|
|
@@ -51,14 +51,7 @@
|
|
|
51
51
|
"symbologyState": {
|
|
52
52
|
"type": "object",
|
|
53
53
|
"description": "The state of the symbology panel options",
|
|
54
|
-
"required": [
|
|
55
|
-
"renderType",
|
|
56
|
-
"band",
|
|
57
|
-
"interpolation",
|
|
58
|
-
"colorRamp",
|
|
59
|
-
"nClasses",
|
|
60
|
-
"mode"
|
|
61
|
-
],
|
|
54
|
+
"required": ["renderType"],
|
|
62
55
|
"properties": {
|
|
63
56
|
"renderType": {
|
|
64
57
|
"type": "string"
|
|
@@ -66,6 +59,15 @@
|
|
|
66
59
|
"band": {
|
|
67
60
|
"type": "number"
|
|
68
61
|
},
|
|
62
|
+
"redBand": {
|
|
63
|
+
"type": "number"
|
|
64
|
+
},
|
|
65
|
+
"greenBand": {
|
|
66
|
+
"type": "number"
|
|
67
|
+
},
|
|
68
|
+
"blueBand": {
|
|
69
|
+
"type": "number"
|
|
70
|
+
},
|
|
69
71
|
"interpolation": {
|
|
70
72
|
"type": "string",
|
|
71
73
|
"enum": ["discrete", "linear", "exact"]
|
package/lib/types.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './_interface/vectorlayer';
|
|
|
13
13
|
export * from './_interface/vectorTileLayer';
|
|
14
14
|
export * from './_interface/webGlLayer';
|
|
15
15
|
export * from './_interface/imageLayer';
|
|
16
|
+
export * from './_interface/heatmapLayer';
|
|
16
17
|
export * from './doc';
|
|
17
18
|
export * from './interfaces';
|
|
18
19
|
export * from './model';
|
package/lib/types.js
CHANGED
|
@@ -15,6 +15,7 @@ export * from './_interface/vectorlayer';
|
|
|
15
15
|
export * from './_interface/vectorTileLayer';
|
|
16
16
|
export * from './_interface/webGlLayer';
|
|
17
17
|
export * from './_interface/imageLayer';
|
|
18
|
+
export * from './_interface/heatmapLayer';
|
|
18
19
|
// Other
|
|
19
20
|
export * from './doc';
|
|
20
21
|
export * from './interfaces';
|