@jupytergis/base 0.6.1 → 0.7.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/annotations/components/Annotation.d.ts +2 -3
- package/lib/annotations/components/Annotation.js +2 -9
- package/lib/commands/BaseCommandIDs.d.ts +1 -0
- package/lib/commands/BaseCommandIDs.js +1 -0
- package/lib/commands/index.js +15 -0
- package/lib/constants.js +1 -0
- package/lib/dialogs/symbology/components/color_ramp/ColorRamp.js +1 -1
- package/lib/dialogs/symbology/vector_layer/types/Heatmap.js +2 -2
- package/lib/formbuilder/formselectors.js +3 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/keybindings.json +2 -2
- package/lib/mainview/mainView.d.ts +8 -1
- package/lib/mainview/mainView.js +24 -1
- package/lib/mainview/mainviewwidget.d.ts +11 -4
- package/lib/mainview/mainviewwidget.js +3 -2
- package/lib/menus.js +4 -0
- package/lib/panelview/annotationPanel.d.ts +3 -17
- package/lib/panelview/annotationPanel.js +5 -22
- package/lib/panelview/components/filter-panel/Filter.d.ts +2 -19
- package/lib/panelview/components/filter-panel/Filter.js +26 -59
- package/lib/panelview/components/identify-panel/IdentifyPanel.d.ts +6 -14
- package/lib/panelview/components/identify-panel/IdentifyPanel.js +14 -52
- package/lib/panelview/components/layers.d.ts +10 -12
- package/lib/panelview/components/layers.js +109 -79
- package/lib/panelview/index.d.ts +0 -1
- package/lib/panelview/index.js +0 -1
- package/lib/panelview/leftpanel.d.ts +8 -47
- package/lib/panelview/leftpanel.js +32 -154
- package/lib/panelview/objectproperties.d.ts +20 -15
- package/lib/panelview/objectproperties.js +12 -34
- package/lib/panelview/rightpanel.d.ts +8 -22
- package/lib/panelview/rightpanel.js +32 -77
- package/lib/processing/index.js +4 -3
- package/lib/shared/components/Tabs.d.ts +7 -1
- package/lib/shared/components/Tabs.js +6 -1
- package/lib/stacBrowser/components/{StacPanelView.d.ts → StacPanel.d.ts} +2 -2
- package/lib/stacBrowser/components/{StacPanelView.js → StacPanel.js} +3 -3
- package/lib/stacBrowser/index.d.ts +1 -1
- package/lib/stacBrowser/index.js +1 -1
- package/lib/tools.js +26 -0
- package/lib/types.d.ts +1 -9
- package/lib/widget.d.ts +8 -3
- package/lib/widget.js +8 -4
- package/package.json +7 -5
- package/style/base.css +18 -2
- package/style/shared/tabs.css +16 -2
- package/style/stacBrowser.css +0 -6
- package/style/tabPanel.css +91 -0
- package/style/temporalSlider.css +1 -0
- package/lib/panelview/model.d.ts +0 -19
- package/lib/panelview/model.js +0 -30
- package/lib/stacBrowser/StacBrowser.d.ts +0 -7
- package/lib/stacBrowser/StacBrowser.js +0 -16
- package/lib/stacBrowser/StacPanel.d.ts +0 -14
- package/lib/stacBrowser/StacPanel.js +0 -16
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
import { IJGISFormSchemaRegistry,
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { IJGISFormSchemaRegistry, IJupyterGISModel } from '@jupytergis/schema';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface IStates {
|
|
4
|
+
model: IJupyterGISModel | undefined;
|
|
5
|
+
clientId: number | null;
|
|
6
|
+
id: string;
|
|
7
|
+
selectedObject?: string;
|
|
8
|
+
setSelectedObject: any;
|
|
7
9
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
controlPanelModel: IControlPanelModel;
|
|
14
|
-
formSchemaRegistry: IJGISFormSchemaRegistry;
|
|
15
|
-
tracker: IJupyterGISTracker;
|
|
16
|
-
}
|
|
10
|
+
interface IProps {
|
|
11
|
+
formSchemaRegistry: IJGISFormSchemaRegistry;
|
|
12
|
+
model: IJupyterGISModel;
|
|
13
|
+
selectedObject: string | undefined;
|
|
14
|
+
setSelectedObject: any;
|
|
17
15
|
}
|
|
16
|
+
export declare class ObjectPropertiesReact extends React.Component<IProps, IStates> {
|
|
17
|
+
constructor(props: IProps);
|
|
18
|
+
private _sharedJGISModelChanged;
|
|
19
|
+
private _onClientSharedStateChanged;
|
|
20
|
+
render(): React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import { ReactWidget } from '@jupyterlab/apputils';
|
|
2
|
-
import { PanelWithToolbar } from '@jupyterlab/ui-components';
|
|
3
1
|
import * as React from 'react';
|
|
4
2
|
import { v4 as uuid } from 'uuid';
|
|
5
3
|
import { EditForm } from "../formbuilder/editform";
|
|
6
|
-
export class
|
|
7
|
-
constructor(params) {
|
|
8
|
-
super(params);
|
|
9
|
-
this.title.label = 'Objects Properties';
|
|
10
|
-
const body = ReactWidget.create(React.createElement(ObjectPropertiesReact, { cpModel: params.controlPanelModel, tracker: params.tracker, formSchemaRegistry: params.formSchemaRegistry }));
|
|
11
|
-
this.addWidget(body);
|
|
12
|
-
this.addClass('jGIS-sidebar-propertiespanel');
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
class ObjectPropertiesReact extends React.Component {
|
|
4
|
+
export class ObjectPropertiesReact extends React.Component {
|
|
16
5
|
constructor(props) {
|
|
17
|
-
var _a, _b
|
|
6
|
+
var _a, _b;
|
|
18
7
|
super(props);
|
|
19
8
|
this._sharedJGISModelChanged = () => {
|
|
20
9
|
this.forceUpdate();
|
|
@@ -35,44 +24,33 @@ class ObjectPropertiesReact extends React.Component {
|
|
|
35
24
|
const selectedObjectIds = Object.keys(selection || {});
|
|
36
25
|
// Only show object properties if ONE object is selected
|
|
37
26
|
if (selection === undefined || selectedObjectIds.length !== 1) {
|
|
27
|
+
this.state.setSelectedObject(undefined);
|
|
38
28
|
this.setState(old => (Object.assign(Object.assign({}, old), { selectedObject: undefined })));
|
|
39
29
|
return;
|
|
40
30
|
}
|
|
41
31
|
const selectedObject = selectedObjectIds[0];
|
|
42
32
|
if (selectedObject !== this.state.selectedObject) {
|
|
33
|
+
this.state.setSelectedObject(selectedObject);
|
|
43
34
|
this.setState(old => (Object.assign(Object.assign({}, old), { selectedObject })));
|
|
44
35
|
}
|
|
45
36
|
}
|
|
46
37
|
};
|
|
47
38
|
this.state = {
|
|
48
|
-
|
|
49
|
-
clientId: null,
|
|
39
|
+
clientId: props.model.getClientId(),
|
|
50
40
|
id: uuid(),
|
|
41
|
+
model: props.model,
|
|
42
|
+
selectedObject: props.selectedObject,
|
|
43
|
+
setSelectedObject: props.setSelectedObject,
|
|
51
44
|
};
|
|
52
|
-
|
|
53
|
-
(
|
|
54
|
-
this.props.
|
|
55
|
-
if (changed) {
|
|
56
|
-
this.props.cpModel.disconnect(this._sharedJGISModelChanged);
|
|
57
|
-
this.props.cpModel.disconnect(this._onClientSharedStateChanged);
|
|
58
|
-
changed.model.sharedLayersChanged.connect(this._sharedJGISModelChanged);
|
|
59
|
-
changed.model.sharedSourcesChanged.connect(this._sharedJGISModelChanged);
|
|
60
|
-
changed.model.clientStateChanged.connect(this._onClientSharedStateChanged);
|
|
61
|
-
this.setState(old => (Object.assign(Object.assign({}, old), { model: changed.model, filePath: changed.model.filePath, clientId: changed.model.getClientId() })));
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
this.setState({
|
|
65
|
-
model: undefined,
|
|
66
|
-
selectedObject: undefined,
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
});
|
|
45
|
+
this.props.model.clientStateChanged.connect(this._onClientSharedStateChanged);
|
|
46
|
+
(_a = this.props.model) === null || _a === void 0 ? void 0 : _a.sharedLayersChanged.connect(this._sharedJGISModelChanged);
|
|
47
|
+
(_b = this.props.model) === null || _b === void 0 ? void 0 : _b.sharedSourcesChanged.connect(this._sharedJGISModelChanged);
|
|
70
48
|
}
|
|
71
49
|
render() {
|
|
72
50
|
var _a;
|
|
73
51
|
const selectedObject = this.state.selectedObject;
|
|
74
52
|
if (!selectedObject || !this.state.model) {
|
|
75
|
-
return React.createElement("div",
|
|
53
|
+
return React.createElement("div", { style: { textAlign: 'center' } }, "No layer selected");
|
|
76
54
|
}
|
|
77
55
|
let layerId = undefined;
|
|
78
56
|
let sourceId = undefined;
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import { IAnnotationModel, IJGISFormSchemaRegistry,
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
private _currentModel;
|
|
8
|
-
private _handleFileChange;
|
|
9
|
-
private _model;
|
|
10
|
-
private _annotationModel;
|
|
11
|
-
}
|
|
12
|
-
export declare namespace RightPanelWidget {
|
|
13
|
-
interface IOptions {
|
|
14
|
-
model: IControlPanelModel;
|
|
15
|
-
tracker: IJupyterGISTracker;
|
|
16
|
-
formSchemaRegistry: IJGISFormSchemaRegistry;
|
|
17
|
-
annotationModel: IAnnotationModel;
|
|
18
|
-
}
|
|
19
|
-
interface IProps {
|
|
20
|
-
filePath?: string;
|
|
21
|
-
sharedModel?: JupyterGISDoc;
|
|
22
|
-
}
|
|
1
|
+
import { IAnnotationModel, IJGISFormSchemaRegistry, IJupyterGISModel } from '@jupytergis/schema';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface IRightPanelProps {
|
|
4
|
+
formSchemaRegistry: IJGISFormSchemaRegistry;
|
|
5
|
+
annotationModel: IAnnotationModel;
|
|
6
|
+
model: IJupyterGISModel;
|
|
23
7
|
}
|
|
8
|
+
export declare const RightPanel: React.FC<IRightPanelProps>;
|
|
9
|
+
export {};
|
|
@@ -1,77 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
identifyPanel.addClass('jgis-scrollable');
|
|
34
|
-
this.addWidget(identifyPanel);
|
|
35
|
-
this._handleFileChange = () => {
|
|
36
|
-
var _a;
|
|
37
|
-
header.title.label = ((_a = this._currentModel) === null || _a === void 0 ? void 0 : _a.filePath) || '-';
|
|
38
|
-
};
|
|
39
|
-
this._model.documentChanged.connect((_, changed) => {
|
|
40
|
-
if (changed) {
|
|
41
|
-
if (changed.model.sharedModel.editable) {
|
|
42
|
-
header.title.label = changed.model.filePath;
|
|
43
|
-
properties.show();
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
header.title.label = `${changed.model.filePath} - Read Only`;
|
|
47
|
-
properties.hide();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
header.title.label = '-';
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
options.tracker.currentChanged.connect(async (_, changed) => {
|
|
55
|
-
var _a;
|
|
56
|
-
if (changed) {
|
|
57
|
-
if (this._currentModel) {
|
|
58
|
-
this._currentModel.pathChanged.disconnect(this._handleFileChange);
|
|
59
|
-
}
|
|
60
|
-
this._currentModel = changed.model;
|
|
61
|
-
header.title.label = this._currentModel.filePath;
|
|
62
|
-
this._currentModel.pathChanged.connect(this._handleFileChange);
|
|
63
|
-
this._annotationModel.model =
|
|
64
|
-
((_a = options.tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.model) || undefined;
|
|
65
|
-
// await changed.context.ready;
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
header.title.label = '-';
|
|
69
|
-
this._currentModel = null;
|
|
70
|
-
this._annotationModel.model = undefined;
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
dispose() {
|
|
75
|
-
super.dispose();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AnnotationsPanel } from './annotationPanel';
|
|
3
|
+
import { IdentifyPanelComponent } from './components/identify-panel/IdentifyPanel';
|
|
4
|
+
import { ObjectPropertiesReact } from './objectproperties';
|
|
5
|
+
import { PanelTabs, TabsContent, TabsList, TabsTrigger, } from '../shared/components/Tabs';
|
|
6
|
+
export const RightPanel = props => {
|
|
7
|
+
const [selectedObjectProperties, setSelectedObjectProperties] = React.useState(undefined);
|
|
8
|
+
const tabInfo = [
|
|
9
|
+
{ name: 'objectProperties', title: 'Object Properties' },
|
|
10
|
+
{ name: 'annotations', title: 'Annotations' },
|
|
11
|
+
{ name: 'identifyPanel', title: 'Identify Features' },
|
|
12
|
+
];
|
|
13
|
+
const [curTab, setCurTab] = React.useState(tabInfo[0].name);
|
|
14
|
+
return (React.createElement("div", { className: "jgis-right-panel-container" },
|
|
15
|
+
React.createElement(PanelTabs, { className: "jgis-panel-tabs", curTab: curTab },
|
|
16
|
+
React.createElement(TabsList, null, tabInfo.map(e => {
|
|
17
|
+
return (React.createElement(TabsTrigger, { className: "jGIS-layer-browser-category", value: e.name, onClick: () => {
|
|
18
|
+
if (curTab !== e.name) {
|
|
19
|
+
setCurTab(e.name);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
setCurTab('');
|
|
23
|
+
}
|
|
24
|
+
} }, e.title));
|
|
25
|
+
})),
|
|
26
|
+
React.createElement(TabsContent, { value: "objectProperties", className: "jgis-panel-tab-content" },
|
|
27
|
+
React.createElement(ObjectPropertiesReact, { setSelectedObject: setSelectedObjectProperties, selectedObject: selectedObjectProperties, formSchemaRegistry: props.formSchemaRegistry, model: props.model })),
|
|
28
|
+
React.createElement(TabsContent, { value: "annotations" },
|
|
29
|
+
React.createElement(AnnotationsPanel, { annotationModel: props.annotationModel, jgisModel: props.model })),
|
|
30
|
+
React.createElement(TabsContent, { value: "identifyPanel", className: "jgis-panel-tab-content" },
|
|
31
|
+
React.createElement(IdentifyPanelComponent, { model: props.model })))));
|
|
32
|
+
};
|
package/lib/processing/index.js
CHANGED
|
@@ -121,6 +121,7 @@ export async function executeSQLProcessing(model, geojsonString, gdalFunction, o
|
|
|
121
121
|
const processedBytes = await Gdal.getFileBytes(outputFilePath);
|
|
122
122
|
const processedGeoJSONString = new TextDecoder().decode(processedBytes);
|
|
123
123
|
Gdal.close(dataset);
|
|
124
|
+
const layerName = `${layerNamePrefix} ${processingType.charAt(0).toUpperCase() + processingType.slice(1)}`;
|
|
124
125
|
if (!embedOutputLayer) {
|
|
125
126
|
// Save the output as a file
|
|
126
127
|
const jgisFilePath = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.model.filePath;
|
|
@@ -146,7 +147,7 @@ export async function executeSQLProcessing(model, geojsonString, gdalFunction, o
|
|
|
146
147
|
type: 'VectorLayer',
|
|
147
148
|
parameters: { source: newSourceId },
|
|
148
149
|
visible: true,
|
|
149
|
-
name:
|
|
150
|
+
name: layerName,
|
|
150
151
|
};
|
|
151
152
|
model.sharedModel.addSource(newSourceId, sourceModel);
|
|
152
153
|
model.addLayer(UUID.uuid4(), layerModel);
|
|
@@ -157,14 +158,14 @@ export async function executeSQLProcessing(model, geojsonString, gdalFunction, o
|
|
|
157
158
|
const newSourceId = UUID.uuid4();
|
|
158
159
|
const sourceModel = {
|
|
159
160
|
type: 'GeoJSONSource',
|
|
160
|
-
name: `${
|
|
161
|
+
name: `${layerName} Source`,
|
|
161
162
|
parameters: { data: processedGeoJSON },
|
|
162
163
|
};
|
|
163
164
|
const layerModel = {
|
|
164
165
|
type: 'VectorLayer',
|
|
165
166
|
parameters: { source: newSourceId },
|
|
166
167
|
visible: true,
|
|
167
|
-
name:
|
|
168
|
+
name: layerName,
|
|
168
169
|
};
|
|
169
170
|
model.sharedModel.addSource(newSourceId, sourceModel);
|
|
170
171
|
model.addLayer(UUID.uuid4(), layerModel);
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
interface IPanelTabProps {
|
|
4
|
+
className: string;
|
|
5
|
+
curTab: string | undefined;
|
|
6
|
+
children: any;
|
|
7
|
+
}
|
|
3
8
|
declare const Tabs: React.FC<React.ComponentProps<typeof TabsPrimitive.Root>>;
|
|
9
|
+
declare const PanelTabs: React.FC<IPanelTabProps>;
|
|
4
10
|
declare const TabsList: React.FC<React.ComponentProps<typeof TabsPrimitive.List>>;
|
|
5
11
|
declare const TabsTrigger: React.FC<React.ComponentProps<typeof TabsPrimitive.Trigger>>;
|
|
6
12
|
declare const TabsContent: React.FC<React.ComponentProps<typeof TabsPrimitive.Content>>;
|
|
7
|
-
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
13
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger, PanelTabs };
|
|
@@ -16,6 +16,11 @@ const Tabs = (_a) => {
|
|
|
16
16
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
17
17
|
return (React.createElement(TabsPrimitive.Root, Object.assign({ "data-slot": "tabs", className: cn('TabsList', className) }, props)));
|
|
18
18
|
};
|
|
19
|
+
const PanelTabs = ({ className, curTab, children, }) => {
|
|
20
|
+
return (React.createElement(TabsPrimitive.Root, { "data-slot": "tabs", className: cn('TabsList', className), value: curTab, onValueChange: () => {
|
|
21
|
+
return;
|
|
22
|
+
}, children: children }));
|
|
23
|
+
};
|
|
19
24
|
const TabsList = (_a) => {
|
|
20
25
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
21
26
|
return (React.createElement(TabsPrimitive.List, Object.assign({ "data-slot": "tabs-list", className: cn('jgis-tabs-list', className) }, props)));
|
|
@@ -28,4 +33,4 @@ const TabsContent = (_a) => {
|
|
|
28
33
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
29
34
|
return (React.createElement(TabsPrimitive.Content, Object.assign({ "data-slot": "tabs-content", className: cn('jgis-tabs-content', className) }, props)));
|
|
30
35
|
};
|
|
31
|
-
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
36
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger, PanelTabs };
|
|
@@ -3,5 +3,5 @@ import React from 'react';
|
|
|
3
3
|
interface IStacViewProps {
|
|
4
4
|
model?: IJupyterGISModel;
|
|
5
5
|
}
|
|
6
|
-
declare const
|
|
7
|
-
export default
|
|
6
|
+
declare const StacPanel: ({ model }: IStacViewProps) => React.JSX.Element | null;
|
|
7
|
+
export default StacPanel;
|
|
@@ -3,12 +3,12 @@ import { Tabs, TabsContent, TabsList, TabsTrigger, } from "../../shared/componen
|
|
|
3
3
|
import useStacSearch from "../hooks/useStacSearch";
|
|
4
4
|
import StacPanelFilters from './StacPanelFilters';
|
|
5
5
|
import StacPanelResults from './StacPanelResults';
|
|
6
|
-
const
|
|
6
|
+
const StacPanel = ({ model }) => {
|
|
7
7
|
const { filterState, filterSetters, results, startTime, setStartTime, endTime, setEndTime, totalPages, currentPage, totalResults, handlePaginationClick, handleResultClick, formatResult, isLoading, useWorldBBox, setUseWorldBBox, } = useStacSearch({ model });
|
|
8
8
|
if (!model) {
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
|
-
return (React.createElement(Tabs, { defaultValue: "filters", className: "jgis-
|
|
11
|
+
return (React.createElement(Tabs, { defaultValue: "filters", className: "jgis-panel-tabs" },
|
|
12
12
|
React.createElement(TabsList, { style: { borderRadius: 0 } },
|
|
13
13
|
React.createElement(TabsTrigger, { className: "jGIS-layer-browser-category", value: "filters" }, "Filters"),
|
|
14
14
|
React.createElement(TabsTrigger, { className: "jGIS-layer-browser-category", value: "results" }, `Results (${totalResults})`)),
|
|
@@ -17,4 +17,4 @@ const StacPanelView = ({ model }) => {
|
|
|
17
17
|
React.createElement(TabsContent, { value: "results" },
|
|
18
18
|
React.createElement(StacPanelResults, { results: results, currentPage: currentPage, totalPages: totalPages, handlePaginationClick: handlePaginationClick, handleResultClick: handleResultClick, formatResult: formatResult, isLoading: isLoading }))));
|
|
19
19
|
};
|
|
20
|
-
export default
|
|
20
|
+
export default StacPanel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './components/StacPanel';
|
package/lib/stacBrowser/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './components/StacPanel';
|
package/lib/tools.js
CHANGED
|
@@ -3,6 +3,7 @@ import { PathExt, URLExt } from '@jupyterlab/coreutils';
|
|
|
3
3
|
import { ServerConnection } from '@jupyterlab/services';
|
|
4
4
|
import { VectorTile } from '@mapbox/vector-tile';
|
|
5
5
|
import * as d3Color from 'd3-color';
|
|
6
|
+
import { compressors } from 'hyparquet-compressors';
|
|
6
7
|
import Protobuf from 'pbf';
|
|
7
8
|
import shp from 'shpjs';
|
|
8
9
|
import RASTER_LAYER_GALLERY from "../rasterlayer_gallery/raster_layer_gallery.json";
|
|
@@ -411,6 +412,21 @@ export const loadFile = async (fileInfo) => {
|
|
|
411
412
|
showErrorMessage('Network error', `Failed to fetch ${filepath}`);
|
|
412
413
|
throw new Error(`Failed to fetch ${filepath}`);
|
|
413
414
|
}
|
|
415
|
+
case 'GeoParquetSource': {
|
|
416
|
+
const cached = await getFromIndexedDB(filepath);
|
|
417
|
+
if (cached) {
|
|
418
|
+
return cached.file;
|
|
419
|
+
}
|
|
420
|
+
const { asyncBufferFromUrl, toGeoJson } = await import('geoparquet');
|
|
421
|
+
const file = await asyncBufferFromUrl({ url: filepath });
|
|
422
|
+
const geojson = await toGeoJson({ file });
|
|
423
|
+
if (geojson) {
|
|
424
|
+
await saveToIndexedDB(filepath, geojson);
|
|
425
|
+
return geojson;
|
|
426
|
+
}
|
|
427
|
+
showErrorMessage('Network error', `Failed to fetch ${filepath}`);
|
|
428
|
+
throw new Error(`Failed to fetch ${filepath}`);
|
|
429
|
+
}
|
|
414
430
|
default: {
|
|
415
431
|
throw new Error(`Unsupported URL handling for source type: ${type}`);
|
|
416
432
|
}
|
|
@@ -467,6 +483,16 @@ export const loadFile = async (fileInfo) => {
|
|
|
467
483
|
throw new Error('Invalid file format for tiff content.');
|
|
468
484
|
}
|
|
469
485
|
}
|
|
486
|
+
case 'GeoParquetSource': {
|
|
487
|
+
if (typeof file.content === 'string') {
|
|
488
|
+
const { toGeoJson } = await import('geoparquet');
|
|
489
|
+
const arrayBuffer = await stringToArrayBuffer(file.content);
|
|
490
|
+
return await toGeoJson({ file: arrayBuffer, compressors });
|
|
491
|
+
}
|
|
492
|
+
else {
|
|
493
|
+
throw new Error('Invalid file format for GeoParquet content.');
|
|
494
|
+
}
|
|
495
|
+
}
|
|
470
496
|
default: {
|
|
471
497
|
throw new Error(`Unsupported source type: ${type}`);
|
|
472
498
|
}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import { IDict,
|
|
1
|
+
import { IDict, IJupyterGISWidget } from '@jupytergis/schema';
|
|
2
2
|
import { WidgetTracker } from '@jupyterlab/apputils';
|
|
3
|
-
import { ISignal } from '@lumino/signaling';
|
|
4
3
|
import { Map } from 'ol';
|
|
5
4
|
export { IDict };
|
|
6
5
|
export type ValueOf<T> = T[keyof T];
|
|
7
6
|
export type JupyterGISTracker = WidgetTracker<IJupyterGISWidget>;
|
|
8
|
-
export interface IControlPanelModel {
|
|
9
|
-
disconnect(f: any): void;
|
|
10
|
-
documentChanged: ISignal<IJupyterGISTracker, IJupyterGISWidget | null>;
|
|
11
|
-
filePath: string | undefined;
|
|
12
|
-
jGISModel: IJupyterGISModel | undefined;
|
|
13
|
-
sharedModel: IJupyterGISDoc | undefined;
|
|
14
|
-
}
|
|
15
7
|
export type SymbologyTab = 'color' | 'radius';
|
|
16
8
|
export type VectorRenderType = 'Single Symbol' | 'Canonical' | 'Graduated' | 'Categorized' | 'Heatmap';
|
|
17
9
|
/**
|
package/lib/widget.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { IJupyterGISDocumentWidget, IJupyterGISModel, IJupyterGISOutputWidget } from '@jupytergis/schema';
|
|
1
|
+
import { IAnnotationModel, IJGISFormSchemaRegistry, IJupyterGISDocumentWidget, IJupyterGISModel, IJupyterGISOutputWidget } from '@jupytergis/schema';
|
|
2
2
|
import { MainAreaWidget } from '@jupyterlab/apputils';
|
|
3
3
|
import { ConsolePanel, IConsoleTracker } from '@jupyterlab/console';
|
|
4
4
|
import { DocumentWidget } from '@jupyterlab/docregistry';
|
|
5
5
|
import { IObservableMap, ObservableMap } from '@jupyterlab/observables';
|
|
6
|
+
import { IStateDB } from '@jupyterlab/statedb';
|
|
6
7
|
import { CommandRegistry } from '@lumino/commands';
|
|
7
8
|
import { JSONValue } from '@lumino/coreutils';
|
|
8
9
|
import { ISignal } from '@lumino/signaling';
|
|
@@ -39,12 +40,12 @@ export declare namespace JupyterGISOutputWidget {
|
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
export declare class JupyterGISPanel extends SplitPanel {
|
|
42
|
-
constructor(
|
|
43
|
+
constructor({ model, consoleTracker, state, commandRegistry, formSchemaRegistry, annotationModel, ...consoleOption }: JupyterGISPanel.IOptions);
|
|
43
44
|
_initModel(options: {
|
|
44
45
|
model: IJupyterGISModel;
|
|
45
46
|
commandRegistry: CommandRegistry;
|
|
46
47
|
}): void;
|
|
47
|
-
_initView(): void;
|
|
48
|
+
_initView(formSchemaRegistry?: IJGISFormSchemaRegistry, annotationModel?: IAnnotationModel): void;
|
|
48
49
|
get jupyterGISMainViewPanel(): JupyterGISMainViewPanel;
|
|
49
50
|
get viewChanged(): ISignal<ObservableMap<JSONValue>, IObservableMap.IChangedArgs<JSONValue>>;
|
|
50
51
|
/**
|
|
@@ -57,6 +58,7 @@ export declare class JupyterGISPanel extends SplitPanel {
|
|
|
57
58
|
executeConsole(): void;
|
|
58
59
|
removeConsole(): void;
|
|
59
60
|
toggleConsole(jgisPath: string): Promise<void>;
|
|
61
|
+
private _state;
|
|
60
62
|
private _mainViewModel;
|
|
61
63
|
private _view;
|
|
62
64
|
private _jupyterGISMainViewPanel;
|
|
@@ -69,6 +71,9 @@ export declare namespace JupyterGISPanel {
|
|
|
69
71
|
interface IOptions extends Partial<ConsoleView.IOptions> {
|
|
70
72
|
model: IJupyterGISModel;
|
|
71
73
|
commandRegistry: CommandRegistry;
|
|
74
|
+
state?: IStateDB;
|
|
72
75
|
consoleTracker?: IConsoleTracker;
|
|
76
|
+
formSchemaRegistry?: IJGISFormSchemaRegistry;
|
|
77
|
+
annotationModel?: IAnnotationModel;
|
|
73
78
|
}
|
|
74
79
|
}
|
package/lib/widget.js
CHANGED
|
@@ -65,12 +65,13 @@ export class JupyterGISOutputWidget extends MainAreaWidget {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
export class JupyterGISPanel extends SplitPanel {
|
|
68
|
-
constructor(
|
|
68
|
+
constructor(_a) {
|
|
69
|
+
var { model, consoleTracker, state, commandRegistry, formSchemaRegistry, annotationModel } = _a, consoleOption = __rest(_a, ["model", "consoleTracker", "state", "commandRegistry", "formSchemaRegistry", "annotationModel"]);
|
|
69
70
|
super({ orientation: 'vertical', spacing: 0 });
|
|
70
71
|
this._consoleOpened = false;
|
|
71
|
-
|
|
72
|
+
this._state = state;
|
|
72
73
|
this._initModel({ model, commandRegistry });
|
|
73
|
-
this._initView();
|
|
74
|
+
this._initView(formSchemaRegistry, annotationModel);
|
|
74
75
|
this._consoleOption = Object.assign({ commandRegistry }, consoleOption);
|
|
75
76
|
this._consoleTracker = consoleTracker;
|
|
76
77
|
}
|
|
@@ -82,9 +83,12 @@ export class JupyterGISPanel extends SplitPanel {
|
|
|
82
83
|
commands: options.commandRegistry,
|
|
83
84
|
});
|
|
84
85
|
}
|
|
85
|
-
_initView() {
|
|
86
|
+
_initView(formSchemaRegistry, annotationModel) {
|
|
86
87
|
this._jupyterGISMainViewPanel = new JupyterGISMainViewPanel({
|
|
87
88
|
mainViewModel: this._mainViewModel,
|
|
89
|
+
state: this._state,
|
|
90
|
+
formSchemaRegistry: formSchemaRegistry,
|
|
91
|
+
annotationModel: annotationModel,
|
|
88
92
|
});
|
|
89
93
|
this.addWidget(this._jupyterGISMainViewPanel);
|
|
90
94
|
SplitPanel.setStretch(this._jupyterGISMainViewPanel, 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupytergis/base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "A JupyterLab extension for 3D modelling.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@jupyter/collaboration": "^3.1.0",
|
|
45
45
|
"@jupyter/react-components": "^0.16.6",
|
|
46
46
|
"@jupyter/ydoc": "^2.0.0 || ^3.0.0",
|
|
47
|
-
"@jupytergis/schema": "^0.
|
|
47
|
+
"@jupytergis/schema": "^0.7.0",
|
|
48
48
|
"@jupyterlab/application": "^4.3.0",
|
|
49
49
|
"@jupyterlab/apputils": "^4.3.0",
|
|
50
50
|
"@jupyterlab/completer": "^4.3.0",
|
|
@@ -80,15 +80,17 @@
|
|
|
80
80
|
"date-fns": "^4.1.0",
|
|
81
81
|
"gdal3.js": "^2.8.1",
|
|
82
82
|
"geojson-vt": "^4.0.2",
|
|
83
|
+
"geoparquet": "^0.3.0",
|
|
83
84
|
"geotiff": "^2.1.3",
|
|
85
|
+
"hyparquet-compressors": "^1.1.1",
|
|
84
86
|
"lucide-react": "^0.513.0",
|
|
85
87
|
"ol": "^10.1.0",
|
|
86
88
|
"ol-pmtiles": "^0.5.0",
|
|
87
89
|
"ol-stac": "^1.0.0-rc.10",
|
|
88
90
|
"pbf": "^4.0.1",
|
|
89
91
|
"pmtiles": "^3.0.7",
|
|
90
|
-
"proj4": "
|
|
91
|
-
"proj4-list": "
|
|
92
|
+
"proj4": "2.19.3",
|
|
93
|
+
"proj4-list": "1.0.4",
|
|
92
94
|
"react": "^18.0.1",
|
|
93
95
|
"react-day-picker": "^9.7.0",
|
|
94
96
|
"shpjs": "^6.1.0",
|
|
@@ -102,7 +104,7 @@
|
|
|
102
104
|
"@types/colormap": "^2.3.4",
|
|
103
105
|
"@types/d3-color": "^3.1.0",
|
|
104
106
|
"@types/node": "^18.15.11",
|
|
105
|
-
"@types/proj4": "
|
|
107
|
+
"@types/proj4": "2.19.0",
|
|
106
108
|
"@types/shpjs": "^3.4.7",
|
|
107
109
|
"@types/uuid": "^10.0.0",
|
|
108
110
|
"rimraf": "^3.0.2",
|
package/style/base.css
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
@import url('./symbologyDialog.css');
|
|
11
11
|
@import url('./statusBar.css');
|
|
12
12
|
@import url('./temporalSlider.css');
|
|
13
|
-
@import url('./
|
|
13
|
+
@import url('./tabPanel.css');
|
|
14
14
|
@import url('ol/ol.css');
|
|
15
15
|
@import url('./shared/button.css');
|
|
16
16
|
@import url('./shared/toggle.css');
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
/* Overwrite forms CSS */
|
|
35
35
|
.jGIS-property-panel .array-item-list {
|
|
36
36
|
display: flex;
|
|
37
|
-
|
|
37
|
+
background-color: var(--jp-layout-color0);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.jGIS-property-panel .rjsf .array-item:not(:last-child) {
|
|
@@ -85,3 +85,19 @@ button.jp-mod-styled.jp-mod-reject {
|
|
|
85
85
|
white-space: nowrap;
|
|
86
86
|
border-width: 0;
|
|
87
87
|
}
|
|
88
|
+
|
|
89
|
+
.jgis-right-panel-container {
|
|
90
|
+
width: 330px;
|
|
91
|
+
top: 30px;
|
|
92
|
+
right: 0px;
|
|
93
|
+
position: absolute;
|
|
94
|
+
margin: 5px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.jgis-left-panel-container {
|
|
98
|
+
position: absolute;
|
|
99
|
+
width: 250px;
|
|
100
|
+
top: 30px;
|
|
101
|
+
left: 0px;
|
|
102
|
+
margin: 5px;
|
|
103
|
+
}
|
package/style/shared/tabs.css
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
|
+
.jgis-panel-tabs {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 1rem;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
background-color: var(--jp-layout-color0);
|
|
8
|
+
box-shadow:
|
|
9
|
+
0 4px 8px 0 rgba(0, 0, 0, 0.2),
|
|
10
|
+
0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
|
11
|
+
border-radius: 5px;
|
|
12
|
+
}
|
|
1
13
|
.jgis-tabs-list {
|
|
2
14
|
display: inline-flex;
|
|
3
15
|
height: 2.5rem;
|
|
4
16
|
align-items: center;
|
|
5
17
|
justify-content: space-evenly;
|
|
6
|
-
border-radius: 0.375rem;
|
|
7
18
|
background-color: var(--jp-layout-color2);
|
|
8
|
-
padding: 0.25rem;
|
|
9
19
|
color: var(--jp-ui-font-color0);
|
|
10
20
|
gap: 1rem;
|
|
11
21
|
width: 100%;
|
|
22
|
+
font-size: 9px;
|
|
23
|
+
border-radius: 5px;
|
|
12
24
|
}
|
|
13
25
|
|
|
14
26
|
.jgis-tabs-trigger {
|
|
@@ -47,6 +59,8 @@
|
|
|
47
59
|
.jgis-tabs-content {
|
|
48
60
|
outline: none;
|
|
49
61
|
width: 100%;
|
|
62
|
+
overflow-y: scroll;
|
|
63
|
+
max-height: 480px;
|
|
50
64
|
}
|
|
51
65
|
|
|
52
66
|
.jgis-tabs-content:focus-visible {
|