@jupytergis/schema 0.1.4 → 0.1.6

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.
@@ -294,9 +294,8 @@
294
294
  "description": "The source layer to use"
295
295
  },
296
296
  "color": {
297
- "type": "string",
298
- "description": "The color of the the object",
299
- "default": "#FF0000"
297
+ "type": "object",
298
+ "description": "The color of the the object"
300
299
  },
301
300
  "opacity": {
302
301
  "type": "number",
@@ -335,9 +334,8 @@
335
334
  "description": "The source layer to use"
336
335
  },
337
336
  "color": {
338
- "type": "string",
339
- "description": "The color of the the object",
340
- "default": "#FF0000"
337
+ "type": "object",
338
+ "description": "The color of the the object"
341
339
  },
342
340
  "opacity": {
343
341
  "type": "number",
@@ -44,7 +44,6 @@ export interface IJGISContent {
44
44
  layers: IJGISLayers;
45
45
  sources: IJGISSources;
46
46
  layerTree?: IJGISLayerTree;
47
- terrain?: IJGISTerrain;
48
47
  options?: IJGISOptions;
49
48
  }
50
49
  /**
@@ -114,17 +113,6 @@ export interface IJGISLayerGroup {
114
113
  [k: string]: any;
115
114
  };
116
115
  }
117
- /**
118
- * This interface was referenced by `IJGISContent`'s JSON-Schema
119
- * via the `definition` "jGISTerrain".
120
- */
121
- export interface IJGISTerrain {
122
- /**
123
- * The id of the DEM source
124
- */
125
- source: string;
126
- exaggeration: number;
127
- }
128
116
  /**
129
117
  * This interface was referenced by `IJGISContent`'s JSON-Schema
130
118
  * via the `definition` "jGISOptions".
@@ -24,7 +24,9 @@ export interface IVectorTileLayer {
24
24
  /**
25
25
  * The color of the the object
26
26
  */
27
- color?: string;
27
+ color?: {
28
+ [k: string]: any;
29
+ };
28
30
  /**
29
31
  * The opacity of the the object
30
32
  */
@@ -24,7 +24,9 @@ export interface IVectorLayer {
24
24
  /**
25
25
  * The color of the the object
26
26
  */
27
- color?: string;
27
+ color?: {
28
+ [k: string]: any;
29
+ };
28
30
  /**
29
31
  * The opacity of the the object
30
32
  */
package/lib/doc.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { MapChange, YDocument } from '@jupyter/ydoc';
2
2
  import { ISignal } from '@lumino/signaling';
3
- import { IJGISLayer, IJGISLayerItem, IJGISLayerTree, IJGISLayers, IJGISOptions, IJGISSource, IJGISSources, IJGISTerrain } from './_interface/jgis';
3
+ import { IJGISLayer, IJGISLayerItem, IJGISLayerTree, IJGISLayers, IJGISOptions, IJGISSource, IJGISSources } from './_interface/jgis';
4
4
  import { IDict, IJGISLayerDocChange, IJGISLayerTreeDocChange, IJGISSourceDocChange, IJupyterGISDoc, IJupyterGISDocChange } from './interfaces';
5
5
  export declare class JupyterGISDoc extends YDocument<IJupyterGISDocChange> implements IJupyterGISDoc {
6
6
  constructor();
@@ -12,8 +12,6 @@ export declare class JupyterGISDoc extends YDocument<IJupyterGISDocChange> imple
12
12
  get sources(): IJGISSources;
13
13
  get layerTree(): IJGISLayerTree;
14
14
  set layerTree(layerTree: IJGISLayerTree);
15
- get terrain(): IJGISTerrain;
16
- set terrain(terrain: IJGISTerrain);
17
15
  getLayer(id: string): IJGISLayer | undefined;
18
16
  getSource(id: string): IJGISSource | undefined;
19
17
  set options(options: IJGISOptions);
@@ -22,7 +20,6 @@ export declare class JupyterGISDoc extends YDocument<IJupyterGISDocChange> imple
22
20
  get layerTreeChanged(): ISignal<IJupyterGISDoc, IJGISLayerTreeDocChange>;
23
21
  get sourcesChanged(): ISignal<IJupyterGISDoc, IJGISSourceDocChange>;
24
22
  get optionsChanged(): ISignal<IJupyterGISDoc, MapChange>;
25
- get terrainChanged(): ISignal<IJupyterGISDoc, IJGISTerrain>;
26
23
  layerExists(id: string): boolean;
27
24
  removeLayer(id: string): void;
28
25
  addLayer(id: string, value: IJGISLayer): void;
@@ -44,16 +41,13 @@ export declare class JupyterGISDoc extends YDocument<IJupyterGISDocChange> imple
44
41
  private _layersObserver;
45
42
  private _layerTreeObserver;
46
43
  private _sourcesObserver;
47
- private _terrainObserver;
48
44
  private _optionsObserver;
49
45
  private _layers;
50
46
  private _layerTree;
51
47
  private _sources;
52
48
  private _options;
53
- private _terrain;
54
49
  private _optionsChanged;
55
50
  private _layersChanged;
56
51
  private _layerTreeChanged;
57
52
  private _sourcesChanged;
58
- private _terrainChanged;
59
53
  }
package/lib/doc.js CHANGED
@@ -12,19 +12,16 @@ export class JupyterGISDoc extends YDocument {
12
12
  this._layersChanged = new Signal(this);
13
13
  this._layerTreeChanged = new Signal(this);
14
14
  this._sourcesChanged = new Signal(this);
15
- this._terrainChanged = new Signal(this);
16
15
  this._options = this.ydoc.getMap('options');
17
16
  this._layers = this.ydoc.getMap('layers');
18
17
  this._layerTree = this.ydoc.getArray('layerTree');
19
18
  this._sources = this.ydoc.getMap('sources');
20
- this._terrain = this.ydoc.getMap('terrain');
21
19
  this.undoManager.addToScope(this._layers);
22
20
  this.undoManager.addToScope(this._sources);
23
21
  this.undoManager.addToScope(this._layerTree);
24
22
  this._layers.observeDeep(this._layersObserver.bind(this));
25
23
  this._layerTree.observe(this._layerTreeObserver.bind(this));
26
24
  this._sources.observeDeep(this._sourcesObserver.bind(this));
27
- this._terrain.observe(this._terrainObserver.bind(this));
28
25
  this._options.observe(this._optionsObserver.bind(this));
29
26
  }
30
27
  dispose() {
@@ -62,16 +59,6 @@ export class JupyterGISDoc extends YDocument {
62
59
  this._layerTree.push(layerTree);
63
60
  });
64
61
  }
65
- get terrain() {
66
- return JSONExt.deepCopy(this._terrain.toJSON());
67
- }
68
- set terrain(terrain) {
69
- this.transact(() => {
70
- for (const [key, value] of Object.entries(terrain)) {
71
- this._terrain.set(key, value);
72
- }
73
- });
74
- }
75
62
  getLayer(id) {
76
63
  if (!this._layers.has(id)) {
77
64
  return undefined;
@@ -106,9 +93,6 @@ export class JupyterGISDoc extends YDocument {
106
93
  get optionsChanged() {
107
94
  return this._optionsChanged;
108
95
  }
109
- get terrainChanged() {
110
- return this._terrainChanged;
111
- }
112
96
  layerExists(id) {
113
97
  return Boolean(this._getLayerAsYMap(id));
114
98
  }
@@ -245,7 +229,4 @@ export class JupyterGISDoc extends YDocument {
245
229
  this._sourcesChanged.emit({ sourceChange: changes });
246
230
  }
247
231
  }
248
- _terrainObserver(event) {
249
- this._terrainChanged.emit(this.terrain);
250
- }
251
232
  }
@@ -7,7 +7,7 @@ import { User } from '@jupyterlab/services';
7
7
  import { ISignal, Signal } from '@lumino/signaling';
8
8
  import { SplitPanel } from '@lumino/widgets';
9
9
  import { GeoJSON } from './_interface/geojsonsource';
10
- import { IJGISContent, IJGISLayer, IJGISLayerGroup, IJGISLayerItem, IJGISLayers, IJGISLayerTree, IJGISOptions, IJGISSource, IJGISSources, IJGISTerrain, SourceType } from './_interface/jgis';
10
+ import { IJGISContent, IJGISLayer, IJGISLayerGroup, IJGISLayerItem, IJGISLayers, IJGISLayerTree, IJGISOptions, IJGISSource, IJGISSources, SourceType } from './_interface/jgis';
11
11
  import { IRasterSource } from './_interface/rastersource';
12
12
  export { IGeoJSONSource } from './_interface/geojsonsource';
13
13
  export interface IDict<T = any> {
@@ -50,7 +50,6 @@ export interface IJupyterGISDoc extends YDocument<IJupyterGISDocChange> {
50
50
  layers: IJGISLayers;
51
51
  sources: IJGISSources;
52
52
  layerTree: IJGISLayerTree;
53
- terrain: IJGISTerrain;
54
53
  readonly editable: boolean;
55
54
  readonly toJGISEndpoint?: string;
56
55
  layerExists(id: string): boolean;
@@ -73,7 +72,6 @@ export interface IJupyterGISDoc extends YDocument<IJupyterGISDocChange> {
73
72
  layersChanged: ISignal<IJupyterGISDoc, IJGISLayerDocChange>;
74
73
  sourcesChanged: ISignal<IJupyterGISDoc, IJGISSourceDocChange>;
75
74
  layerTreeChanged: ISignal<IJupyterGISDoc, IJGISLayerTreeDocChange>;
76
- terrainChanged: ISignal<IJupyterGISDoc, IJGISTerrain>;
77
75
  }
78
76
  export interface IJupyterGISDocChange extends DocumentChange {
79
77
  contextChange?: MapChange;
@@ -97,7 +95,6 @@ export interface IJupyterGISModel extends DocumentRegistry.IModel {
97
95
  sharedLayersChanged: ISignal<IJupyterGISDoc, IJGISLayerDocChange>;
98
96
  sharedLayerTreeChanged: ISignal<IJupyterGISDoc, IJGISLayerTreeDocChange>;
99
97
  sharedSourcesChanged: ISignal<IJupyterGISDoc, IJGISSourceDocChange>;
100
- terrainChanged: ISignal<IJupyterGISDoc, IJGISTerrain>;
101
98
  setDrive(value: ICollaborativeDrive, filePath: string): void;
102
99
  getContent(): IJGISContent;
103
100
  getLayers(): IJGISLayers;
@@ -114,7 +111,6 @@ export interface IJupyterGISModel extends DocumentRegistry.IModel {
114
111
  getOptions(): IJGISOptions;
115
112
  setOptions(value: IJGISOptions): void;
116
113
  readGeoJSON(filepath: string): Promise<GeoJSON | undefined>;
117
- setTerrain(terrain: IJGISTerrain): void;
118
114
  removeLayerGroup(groupName: string): void;
119
115
  renameLayerGroup(groupName: string, newName: string): void;
120
116
  moveItemsToGroup(items: string[], groupName: string, index?: number): void;
package/lib/model.d.ts CHANGED
@@ -5,7 +5,7 @@ import { DocumentRegistry } from '@jupyterlab/docregistry';
5
5
  import { PartialJSONObject } from '@lumino/coreutils';
6
6
  import { ISignal, Signal } from '@lumino/signaling';
7
7
  import { GeoJSON } from './_interface/geojsonsource';
8
- import { IJGISContent, IJGISLayer, IJGISLayerGroup, IJGISLayerTree, IJGISLayers, IJGISOptions, IJGISSource, IJGISSources, IJGISTerrain } from './_interface/jgis';
8
+ import { IJGISContent, IJGISLayer, IJGISLayerGroup, IJGISLayerTree, IJGISLayers, IJGISOptions, IJGISSource, IJGISSources } from './_interface/jgis';
9
9
  import { IJGISLayerDocChange, IJGISLayerTreeDocChange, IJGISSourceDocChange, IJupyterGISClientState, IJupyterGISDoc, IJupyterGISModel, ISelection, IUserData } from './interfaces';
10
10
  export declare class JupyterGISModel implements IJupyterGISModel {
11
11
  constructor(options: DocumentRegistry.IModelOptions<IJupyterGISDoc>);
@@ -29,7 +29,6 @@ export declare class JupyterGISModel implements IJupyterGISModel {
29
29
  get sharedLayersChanged(): ISignal<IJupyterGISDoc, IJGISLayerDocChange>;
30
30
  get sharedLayerTreeChanged(): ISignal<IJupyterGISDoc, IJGISLayerTreeDocChange>;
31
31
  get sharedSourcesChanged(): ISignal<IJupyterGISDoc, IJGISSourceDocChange>;
32
- get terrainChanged(): ISignal<IJupyterGISDoc, IJGISTerrain>;
33
32
  get disposed(): ISignal<JupyterGISModel, void>;
34
33
  dispose(): void;
35
34
  toString(): string;
@@ -88,7 +87,6 @@ export declare class JupyterGISModel implements IJupyterGISModel {
88
87
  */
89
88
  addLayer(id: string, layer: IJGISLayer, groupName?: string, position?: number): void;
90
89
  removeLayer(layer_id: string): void;
91
- setTerrain(terrain: IJGISTerrain): void;
92
90
  setOptions(value: IJGISOptions): void;
93
91
  getOptions(): IJGISOptions;
94
92
  syncSelected(value: {
package/lib/model.js CHANGED
@@ -106,9 +106,6 @@ export class JupyterGISModel {
106
106
  get sharedSourcesChanged() {
107
107
  return this.sharedModel.sourcesChanged;
108
108
  }
109
- get terrainChanged() {
110
- return this.sharedModel.terrainChanged;
111
- }
112
109
  get disposed() {
113
110
  return this._disposed;
114
111
  }
@@ -137,15 +134,11 @@ export class JupyterGISModel {
137
134
  throw Error(errorMsg);
138
135
  }
139
136
  this.sharedModel.transact(() => {
140
- var _a, _b, _c, _d, _e;
137
+ var _a, _b, _c, _d;
141
138
  this.sharedModel.sources = (_a = jsonData.sources) !== null && _a !== void 0 ? _a : {};
142
139
  this.sharedModel.layers = (_b = jsonData.layers) !== null && _b !== void 0 ? _b : {};
143
140
  this.sharedModel.layerTree = (_c = jsonData.layerTree) !== null && _c !== void 0 ? _c : [];
144
- this.sharedModel.terrain = (_d = jsonData.terrain) !== null && _d !== void 0 ? _d : {
145
- source: '',
146
- exaggeration: 0
147
- };
148
- this.sharedModel.options = (_e = jsonData.options) !== null && _e !== void 0 ? _e : {
141
+ this.sharedModel.options = (_d = jsonData.options) !== null && _d !== void 0 ? _d : {
149
142
  latitude: 0,
150
143
  longitude: 0,
151
144
  zoom: 0,
@@ -173,8 +166,7 @@ export class JupyterGISModel {
173
166
  sources: this.sharedModel.sources,
174
167
  layers: this.sharedModel.layers,
175
168
  layerTree: this.sharedModel.layerTree,
176
- options: this.sharedModel.options,
177
- terrain: this.sharedModel.terrain
169
+ options: this.sharedModel.options
178
170
  };
179
171
  }
180
172
  setDrive(value, filePath) {
@@ -291,9 +283,6 @@ export class JupyterGISModel {
291
283
  this._removeLayerTreeLayer(this.getLayerTree(), layer_id);
292
284
  this.sharedModel.removeLayer(layer_id);
293
285
  }
294
- setTerrain(terrain) {
295
- this._sharedModel.terrain = terrain;
296
- }
297
286
  setOptions(value) {
298
287
  this._sharedModel.options = value;
299
288
  }
@@ -13,9 +13,6 @@
13
13
  "layerTree": {
14
14
  "$ref": "#/definitions/jGISLayerTree"
15
15
  },
16
- "terrain": {
17
- "$ref": "#/definitions/jGISTerrain"
18
- },
19
16
  "options": {
20
17
  "$ref": "#/definitions/jGISOptions"
21
18
  }
@@ -146,24 +143,6 @@
146
143
  "$ref": "#/definitions/jGISLayerItem"
147
144
  }
148
145
  },
149
- "jGISTerrain": {
150
- "title": "IJGISTerrain",
151
- "type": "object",
152
- "default": {},
153
- "required": ["source", "exaggeration"],
154
- "additionalProperties": false,
155
- "properties": {
156
- "source": {
157
- "type": "string",
158
- "description": "The id of the DEM source",
159
- "default": ""
160
- },
161
- "exaggeration": {
162
- "type": "number",
163
- "default": 1
164
- }
165
- }
166
- },
167
146
  "jGISOptions": {
168
147
  "title": "IJGISOptions",
169
148
  "type": "object",
@@ -20,9 +20,8 @@
20
20
  "description": "The source layer to use"
21
21
  },
22
22
  "color": {
23
- "type": "string",
24
- "description": "The color of the the object",
25
- "default": "#FF0000"
23
+ "type": "object",
24
+ "description": "The color of the the object"
26
25
  },
27
26
  "opacity": {
28
27
  "type": "number",
@@ -20,9 +20,8 @@
20
20
  "description": "The source layer to use"
21
21
  },
22
22
  "color": {
23
- "type": "string",
24
- "description": "The color of the the object",
25
- "default": "#FF0000"
23
+ "type": "object",
24
+ "description": "The color of the the object"
26
25
  },
27
26
  "opacity": {
28
27
  "type": "number",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupytergis/schema",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "A JupyterGIS schema package.",
5
5
  "keywords": [
6
6
  "jupytergis"