@jupytergis/base 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/annotations/components/Annotation.d.ts +2 -2
- package/lib/annotations/components/Annotation.js +3 -3
- package/lib/annotations/components/AnnotationFloater.d.ts +1 -1
- package/lib/annotations/components/AnnotationFloater.js +2 -2
- package/lib/annotations/components/Message.d.ts +2 -1
- package/lib/annotations/components/Message.js +3 -3
- package/lib/annotations/model.js +5 -5
- package/lib/commands/BaseCommandIDs.d.ts +32 -0
- package/lib/commands/BaseCommandIDs.js +43 -0
- package/lib/{commands.d.ts → commands/index.d.ts} +1 -1
- package/lib/{commands.js → commands/index.js} +59 -99
- package/lib/console/consoleview.d.ts +3 -3
- package/lib/console/consoleview.js +5 -5
- package/lib/constants.d.ts +2 -36
- package/lib/constants.js +5 -47
- package/lib/dialogs/ProcessingFormDialog.d.ts +4 -4
- package/lib/dialogs/ProcessingFormDialog.js +9 -11
- package/lib/dialogs/layerBrowserDialog.d.ts +1 -1
- package/lib/dialogs/layerBrowserDialog.js +7 -7
- package/lib/dialogs/layerCreationFormDialog.d.ts +4 -4
- package/lib/dialogs/layerCreationFormDialog.js +6 -6
- package/lib/dialogs/symbology/components/color_ramp/CanvasSelectComponent.d.ts +1 -1
- package/lib/dialogs/symbology/components/color_ramp/CanvasSelectComponent.js +3 -3
- package/lib/dialogs/symbology/components/color_ramp/ColorRamp.d.ts +3 -2
- package/lib/dialogs/symbology/components/color_ramp/ColorRamp.js +6 -7
- package/lib/dialogs/symbology/components/color_ramp/ColorRampEntry.d.ts +1 -1
- package/lib/dialogs/symbology/components/color_ramp/ColorRampEntry.js +1 -1
- package/lib/dialogs/symbology/components/color_ramp/ModeSelectRow.d.ts +1 -1
- package/lib/dialogs/symbology/components/color_ramp/ModeSelectRow.js +1 -1
- package/lib/dialogs/symbology/components/color_stops/StopContainer.d.ts +2 -2
- package/lib/dialogs/symbology/components/color_stops/StopContainer.js +4 -4
- package/lib/dialogs/symbology/components/color_stops/StopRow.d.ts +3 -3
- package/lib/dialogs/symbology/components/color_stops/StopRow.js +2 -2
- package/lib/dialogs/symbology/hooks/useGetBandInfo.js +5 -5
- package/lib/dialogs/symbology/hooks/useGetProperties.d.ts +1 -1
- package/lib/dialogs/symbology/hooks/useGetProperties.js +4 -4
- package/lib/dialogs/symbology/symbologyDialog.d.ts +8 -0
- package/lib/dialogs/symbology/symbologyDialog.js +1 -1
- package/lib/dialogs/symbology/symbologyUtils.js +38 -31
- package/lib/dialogs/symbology/tiff_layer/TiffRendering.d.ts +2 -2
- package/lib/dialogs/symbology/tiff_layer/TiffRendering.js +2 -2
- package/lib/dialogs/symbology/tiff_layer/components/BandRow.d.ts +2 -2
- package/lib/dialogs/symbology/tiff_layer/components/BandRow.js +4 -4
- package/lib/dialogs/symbology/tiff_layer/types/MultibandColor.d.ts +2 -2
- package/lib/dialogs/symbology/tiff_layer/types/MultibandColor.js +30 -20
- package/lib/dialogs/symbology/tiff_layer/types/SingleBandPseudoColor.d.ts +2 -2
- package/lib/dialogs/symbology/tiff_layer/types/SingleBandPseudoColor.js +23 -21
- package/lib/dialogs/symbology/vector_layer/VectorRendering.d.ts +2 -2
- package/lib/dialogs/symbology/vector_layer/VectorRendering.js +81 -39
- package/lib/dialogs/symbology/vector_layer/components/ValueSelect.d.ts +1 -1
- package/lib/dialogs/symbology/vector_layer/components/ValueSelect.js +1 -1
- package/lib/dialogs/symbology/vector_layer/types/Canonical.d.ts +4 -0
- package/lib/dialogs/symbology/vector_layer/types/Canonical.js +66 -0
- package/lib/dialogs/symbology/vector_layer/types/Categorized.d.ts +2 -2
- package/lib/dialogs/symbology/vector_layer/types/Categorized.js +142 -47
- package/lib/dialogs/symbology/vector_layer/types/Graduated.d.ts +2 -2
- package/lib/dialogs/symbology/vector_layer/types/Graduated.js +193 -99
- package/lib/dialogs/symbology/vector_layer/types/Heatmap.d.ts +2 -2
- package/lib/dialogs/symbology/vector_layer/types/Heatmap.js +7 -6
- package/lib/dialogs/symbology/vector_layer/types/SimpleSymbol.d.ts +2 -2
- package/lib/dialogs/symbology/vector_layer/types/SimpleSymbol.js +33 -30
- package/lib/formbuilder/creationform.js +3 -3
- package/lib/formbuilder/editform.js +3 -3
- package/lib/formbuilder/formselectors.d.ts +1 -1
- package/lib/formbuilder/formselectors.js +2 -2
- package/lib/formbuilder/objectform/baseform.d.ts +5 -4
- package/lib/formbuilder/objectform/baseform.js +16 -14
- package/lib/formbuilder/objectform/fileselectorwidget.d.ts +1 -1
- package/lib/formbuilder/objectform/fileselectorwidget.js +5 -5
- package/lib/formbuilder/objectform/layer/heatmapLayerForm.js +2 -2
- package/lib/formbuilder/objectform/layer/hillshadeLayerForm.js +1 -1
- package/lib/formbuilder/objectform/layer/layerform.d.ts +1 -1
- package/lib/formbuilder/objectform/layer/layerform.js +3 -2
- package/lib/formbuilder/objectform/process/dissolveProcessForm.d.ts +1 -1
- package/lib/formbuilder/objectform/process/dissolveProcessForm.js +5 -5
- package/lib/formbuilder/objectform/source/geojsonsource.js +4 -4
- package/lib/formbuilder/objectform/source/geotiffsource.js +4 -4
- package/lib/formbuilder/objectform/source/pathbasedsource.js +6 -6
- package/lib/formbuilder/objectform/source/sourceform.d.ts +1 -1
- package/lib/formbuilder/objectform/source/sourceform.js +1 -1
- package/lib/formbuilder/objectform/source/tilesourceform.js +3 -3
- package/lib/gdal.js +2 -2
- package/lib/icons.js +29 -29
- package/lib/index.d.ts +4 -3
- package/lib/index.js +4 -3
- package/lib/mainview/CollaboratorPointers.d.ts +1 -1
- package/lib/mainview/CollaboratorPointers.js +5 -5
- package/lib/mainview/FollowIndicator.d.ts +2 -2
- package/lib/mainview/FollowIndicator.js +3 -3
- package/lib/mainview/TemporalSlider.d.ts +1 -1
- package/lib/mainview/TemporalSlider.js +7 -7
- package/lib/mainview/mainView.d.ts +4 -2
- package/lib/mainview/mainView.js +232 -137
- package/lib/menus.d.ts +1 -1
- package/lib/menus.js +7 -7
- package/lib/panelview/annotationPanel.d.ts +2 -2
- package/lib/panelview/annotationPanel.js +1 -1
- package/lib/panelview/components/filter-panel/Filter.d.ts +2 -2
- package/lib/panelview/components/filter-panel/Filter.js +5 -5
- package/lib/panelview/components/filter-panel/FilterRow.d.ts +2 -2
- package/lib/panelview/components/identify-panel/IdentifyPanel.d.ts +1 -1
- package/lib/panelview/components/identify-panel/IdentifyPanel.js +5 -5
- package/lib/panelview/components/layers.d.ts +1 -1
- package/lib/panelview/components/layers.js +12 -12
- package/lib/panelview/leftpanel.d.ts +4 -2
- package/lib/panelview/leftpanel.js +24 -6
- package/lib/panelview/model.d.ts +1 -1
- package/lib/panelview/objectproperties.d.ts +1 -1
- package/lib/panelview/objectproperties.js +3 -3
- package/lib/panelview/rightpanel.d.ts +2 -1
- package/lib/panelview/rightpanel.js +13 -5
- package/lib/{processing.d.ts → processing/index.d.ts} +4 -4
- package/lib/{processing.js → processing/index.js} +19 -24
- package/lib/processing/processingCommands.d.ts +6 -0
- package/lib/processing/processingCommands.js +47 -0
- package/lib/processing/processingFormToParam.d.ts +2 -0
- package/lib/processing/processingFormToParam.js +15 -0
- package/lib/shared/components/Badge.d.ts +7 -0
- package/lib/shared/components/Badge.js +19 -0
- package/lib/shared/components/Button.d.ts +9 -0
- package/lib/shared/components/Button.js +20 -0
- package/lib/shared/components/Calendar.d.ts +47 -0
- package/lib/shared/components/Calendar.js +184 -0
- package/lib/shared/components/Checkbox.d.ts +4 -0
- package/lib/shared/components/Checkbox.js +25 -0
- package/lib/shared/components/DropdownMenu.d.ts +27 -0
- package/lib/shared/components/DropdownMenu.js +92 -0
- package/lib/shared/components/Pagination.d.ts +25 -0
- package/lib/shared/components/Pagination.js +68 -0
- package/lib/shared/components/Popover.d.ts +7 -0
- package/lib/shared/components/Popover.js +32 -0
- package/lib/shared/components/Tabs.d.ts +7 -0
- package/lib/shared/components/Tabs.js +31 -0
- package/lib/shared/components/ToggleGroup.d.ts +12 -0
- package/lib/shared/components/ToggleGroup.js +52 -0
- package/lib/shared/components/loading.d.ts +12 -0
- package/lib/shared/components/loading.js +6 -0
- package/lib/shared/components/utils.d.ts +2 -0
- package/lib/shared/components/utils.js +4 -0
- package/lib/shared/hooks/useIsFirstRender.d.ts +2 -0
- package/lib/shared/hooks/useIsFirstRender.js +10 -0
- package/lib/stacBrowser/StacBrowser.d.ts +7 -0
- package/lib/stacBrowser/StacBrowser.js +16 -0
- package/lib/stacBrowser/StacPanel.d.ts +14 -0
- package/lib/stacBrowser/StacPanel.js +16 -0
- package/lib/stacBrowser/components/StacFilterSection.d.ts +23 -0
- package/lib/stacBrowser/components/StacFilterSection.js +49 -0
- package/lib/stacBrowser/components/StacPanelFilters.d.ts +14 -0
- package/lib/stacBrowser/components/StacPanelFilters.js +65 -0
- package/lib/stacBrowser/components/StacPanelResults.d.ts +13 -0
- package/lib/stacBrowser/components/StacPanelResults.js +48 -0
- package/lib/stacBrowser/components/StacPanelView.d.ts +7 -0
- package/lib/stacBrowser/components/StacPanelView.js +20 -0
- package/lib/stacBrowser/constants.d.ts +25 -0
- package/lib/stacBrowser/constants.js +197 -0
- package/lib/stacBrowser/hooks/useStacSearch.d.ts +30 -0
- package/lib/stacBrowser/hooks/useStacSearch.js +221 -0
- package/lib/stacBrowser/index.d.ts +1 -0
- package/lib/stacBrowser/index.js +1 -0
- package/lib/stacBrowser/types/types.d.ts +124 -0
- package/lib/stacBrowser/types/types.js +1 -0
- package/lib/statusbar/StatusBar.d.ts +1 -1
- package/lib/statusbar/StatusBar.js +3 -3
- package/lib/toolbar/index.d.ts +0 -1
- package/lib/toolbar/index.js +0 -1
- package/lib/toolbar/widget.js +15 -15
- package/lib/tools.d.ts +29 -4
- package/lib/tools.js +74 -69
- package/lib/types.d.ts +2 -0
- package/lib/widget.d.ts +1 -1
- package/lib/widget.js +5 -5
- package/package.json +22 -8
- package/style/base.css +26 -0
- package/style/layerBrowser.css +10 -0
- package/style/shared/badge.css +61 -0
- package/style/shared/button.css +164 -0
- package/style/shared/calendar.css +274 -0
- package/style/shared/checkbox.css +28 -0
- package/style/shared/dropdownMenu.css +240 -0
- package/style/shared/pagination.css +167 -0
- package/style/shared/popover.css +53 -0
- package/style/shared/tabs.css +57 -0
- package/style/shared/toggle.css +85 -0
- package/style/stacBrowser.css +74 -0
- package/style/symbologyDialog.css +0 -7
- package/lib/mainview/spinner.d.ts +0 -6
- package/lib/mainview/spinner.js +0 -5
- package/lib/toolbar/usertoolbaritem.d.ts +0 -19
- package/lib/toolbar/usertoolbaritem.js +0 -59
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import colormap from 'colormap';
|
|
2
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import CanvasSelectComponent from
|
|
4
|
-
const Heatmap = ({ model, state, okSignalPromise, cancel, layerId }) => {
|
|
3
|
+
import CanvasSelectComponent from "../../components/color_ramp/CanvasSelectComponent";
|
|
4
|
+
const Heatmap = ({ model, state, okSignalPromise, cancel, layerId, }) => {
|
|
5
5
|
if (!layerId) {
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
@@ -12,12 +12,12 @@ const Heatmap = ({ model, state, okSignalPromise, cancel, layerId }) => {
|
|
|
12
12
|
const [selectedRamp, setSelectedRamp] = useState('');
|
|
13
13
|
const [heatmapOptions, setHetamapOptions] = useState({
|
|
14
14
|
radius: 8,
|
|
15
|
-
blur: 15
|
|
15
|
+
blur: 15,
|
|
16
16
|
});
|
|
17
17
|
const selectedRampRef = useRef('cool');
|
|
18
18
|
const heatmapOptionsRef = useRef({
|
|
19
19
|
radius: 8,
|
|
20
|
-
blur: 15
|
|
20
|
+
blur: 15,
|
|
21
21
|
});
|
|
22
22
|
useEffect(() => {
|
|
23
23
|
populateOptions();
|
|
@@ -49,11 +49,11 @@ const Heatmap = ({ model, state, okSignalPromise, cancel, layerId }) => {
|
|
|
49
49
|
const colorMap = colormap({
|
|
50
50
|
colormap: selectedRampRef.current,
|
|
51
51
|
nshades: 9,
|
|
52
|
-
format: 'hex'
|
|
52
|
+
format: 'hex',
|
|
53
53
|
});
|
|
54
54
|
const symbologyState = {
|
|
55
55
|
renderType: 'Heatmap',
|
|
56
|
-
colorRamp: selectedRampRef.current
|
|
56
|
+
colorRamp: selectedRampRef.current,
|
|
57
57
|
};
|
|
58
58
|
layer.parameters.symbologyState = symbologyState;
|
|
59
59
|
layer.parameters.color = colorMap;
|
|
@@ -64,6 +64,7 @@ const Heatmap = ({ model, state, okSignalPromise, cancel, layerId }) => {
|
|
|
64
64
|
cancel();
|
|
65
65
|
};
|
|
66
66
|
return (React.createElement("div", { className: "jp-gis-layer-symbology-container" },
|
|
67
|
+
React.createElement("p", null, "Represent features based on their density using a heatmap."),
|
|
67
68
|
React.createElement("div", { className: "jp-gis-symbology-row jp-gis-heatmap" },
|
|
68
69
|
React.createElement("label", { htmlFor: "color-ramp-select" }, "Color Ramp:"),
|
|
69
70
|
React.createElement(CanvasSelectComponent, { selectedRamp: selectedRamp, setSelected: setSelectedRamp })),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
declare const SimpleSymbol:
|
|
2
|
+
import { ISymbologyTabbedDialogProps } from "../../symbologyDialog";
|
|
3
|
+
declare const SimpleSymbol: React.FC<ISymbologyTabbedDialogProps>;
|
|
4
4
|
export default SimpleSymbol;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { parseColor } from
|
|
3
|
-
const SimpleSymbol = ({ model, state, okSignalPromise, cancel, layerId }) => {
|
|
2
|
+
import { parseColor } from "../../../../tools";
|
|
3
|
+
const SimpleSymbol = ({ model, state, okSignalPromise, cancel, layerId, symbologyTab, }) => {
|
|
4
4
|
const styleRef = useRef();
|
|
5
|
-
const [useCircleStuff, setUseCircleStuff] = useState(false);
|
|
6
5
|
const [style, setStyle] = useState({
|
|
7
6
|
fillColor: '#3399CC',
|
|
8
7
|
joinStyle: 'round',
|
|
9
8
|
strokeColor: '#3399CC',
|
|
10
9
|
capStyle: 'round',
|
|
11
10
|
strokeWidth: 1.25,
|
|
12
|
-
radius: 5
|
|
11
|
+
radius: 5,
|
|
13
12
|
});
|
|
14
13
|
const joinStyleOptions = ['bevel', 'round', 'miter'];
|
|
15
14
|
const capStyleOptions = ['butt', 'round', 'square'];
|
|
@@ -24,10 +23,6 @@ const SimpleSymbol = ({ model, state, okSignalPromise, cancel, layerId }) => {
|
|
|
24
23
|
if (!layer.parameters) {
|
|
25
24
|
return;
|
|
26
25
|
}
|
|
27
|
-
setUseCircleStuff(layer.parameters.type === 'circle');
|
|
28
|
-
// Mimicking QGIS here,
|
|
29
|
-
// Read values from file if we chose them using the single symbol thing
|
|
30
|
-
// but if we're switching to simple symbol, use defaults
|
|
31
26
|
const initStyle = async () => {
|
|
32
27
|
var _a;
|
|
33
28
|
if (!layer.parameters) {
|
|
@@ -35,8 +30,8 @@ const SimpleSymbol = ({ model, state, okSignalPromise, cancel, layerId }) => {
|
|
|
35
30
|
}
|
|
36
31
|
const renderType = (_a = layer.parameters) === null || _a === void 0 ? void 0 : _a.symbologyState.renderType;
|
|
37
32
|
if (renderType === 'Single Symbol') {
|
|
38
|
-
//
|
|
39
|
-
const parsedStyle = parseColor(layer.parameters.
|
|
33
|
+
// Parse with fallback logic inside
|
|
34
|
+
const parsedStyle = parseColor(layer.parameters.color);
|
|
40
35
|
if (parsedStyle) {
|
|
41
36
|
setStyle(parsedStyle);
|
|
42
37
|
}
|
|
@@ -56,33 +51,35 @@ const SimpleSymbol = ({ model, state, okSignalPromise, cancel, layerId }) => {
|
|
|
56
51
|
styleRef.current = style;
|
|
57
52
|
}, [style]);
|
|
58
53
|
const handleOk = () => {
|
|
59
|
-
var _a, _b, _c, _d, _e, _f;
|
|
54
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
60
55
|
if (!layer.parameters) {
|
|
61
56
|
return;
|
|
62
57
|
}
|
|
63
|
-
const styleExpr = {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
58
|
+
const styleExpr = {
|
|
59
|
+
'circle-radius': (_a = styleRef.current) === null || _a === void 0 ? void 0 : _a.radius,
|
|
60
|
+
'circle-fill-color': (_b = styleRef.current) === null || _b === void 0 ? void 0 : _b.fillColor,
|
|
61
|
+
'circle-stroke-color': (_c = styleRef.current) === null || _c === void 0 ? void 0 : _c.strokeColor,
|
|
62
|
+
'circle-stroke-width': (_d = styleRef.current) === null || _d === void 0 ? void 0 : _d.strokeWidth,
|
|
63
|
+
'circle-stroke-line-join': (_e = styleRef.current) === null || _e === void 0 ? void 0 : _e.joinStyle,
|
|
64
|
+
'circle-stroke-line-cap': (_f = styleRef.current) === null || _f === void 0 ? void 0 : _f.capStyle,
|
|
65
|
+
'fill-color': (_g = styleRef.current) === null || _g === void 0 ? void 0 : _g.fillColor,
|
|
66
|
+
'stroke-color': (_h = styleRef.current) === null || _h === void 0 ? void 0 : _h.strokeColor,
|
|
67
|
+
'stroke-width': (_j = styleRef.current) === null || _j === void 0 ? void 0 : _j.strokeWidth,
|
|
68
|
+
'stroke-line-join': (_k = styleRef.current) === null || _k === void 0 ? void 0 : _k.joinStyle,
|
|
69
|
+
'stroke-line-cap': (_l = styleRef.current) === null || _l === void 0 ? void 0 : _l.capStyle,
|
|
70
|
+
};
|
|
73
71
|
const symbologyState = {
|
|
74
|
-
renderType: 'Single Symbol'
|
|
72
|
+
renderType: 'Single Symbol',
|
|
75
73
|
};
|
|
76
74
|
layer.parameters.symbologyState = symbologyState;
|
|
77
75
|
layer.parameters.color = styleExpr;
|
|
78
|
-
layer.type
|
|
76
|
+
if (layer.type === 'HeatmapLayer') {
|
|
77
|
+
layer.type = 'VectorLayer';
|
|
78
|
+
}
|
|
79
79
|
model.sharedModel.updateLayer(layerId, layer);
|
|
80
80
|
cancel();
|
|
81
81
|
};
|
|
82
|
-
|
|
83
|
-
useCircleStuff ? (React.createElement("div", { className: "jp-gis-symbology-row" },
|
|
84
|
-
React.createElement("label", { htmlFor: 'vector-value-select' }, "Radius:"),
|
|
85
|
-
React.createElement("input", { type: "number", value: style.radius, className: "jp-mod-styled", onChange: event => setStyle(prevState => (Object.assign(Object.assign({}, prevState), { radius: +event.target.value }))) }))) : null,
|
|
82
|
+
const renderColorTab = () => (React.createElement(React.Fragment, null,
|
|
86
83
|
React.createElement("div", { className: "jp-gis-symbology-row" },
|
|
87
84
|
React.createElement("label", { htmlFor: 'vector-value-select' }, "Fill Color:"),
|
|
88
85
|
React.createElement("input", { type: "color", value: style.fillColor, className: "jp-mod-styled", onChange: event => setStyle(prevState => (Object.assign(Object.assign({}, prevState), { fillColor: event.target.value }))) })),
|
|
@@ -95,10 +92,16 @@ const SimpleSymbol = ({ model, state, okSignalPromise, cancel, layerId }) => {
|
|
|
95
92
|
React.createElement("div", { className: "jp-gis-symbology-row" },
|
|
96
93
|
React.createElement("label", { htmlFor: 'vector-join-select' }, "Join Style:"),
|
|
97
94
|
React.createElement("div", { className: "jp-select-wrapper" },
|
|
98
|
-
React.createElement("select", { name: 'vector-join-select', onChange: event => setStyle(prevState => (Object.assign(Object.assign({}, prevState), { joinStyle: event.target.value }))), className: "jp-mod-styled" }, joinStyleOptions.map((method, index) => (React.createElement("option", { key: index, value: method,
|
|
99
|
-
|
|
95
|
+
React.createElement("select", { name: 'vector-join-select', onChange: event => setStyle(prevState => (Object.assign(Object.assign({}, prevState), { joinStyle: event.target.value }))), className: "jp-mod-styled", value: style.joinStyle }, joinStyleOptions.map((method, index) => (React.createElement("option", { key: index, value: method, className: "jp-mod-styled" }, method)))))),
|
|
96
|
+
React.createElement("div", { className: "jp-gis-symbology-row" },
|
|
100
97
|
React.createElement("label", { htmlFor: 'vector-cap-select' }, "Cap Style:"),
|
|
101
98
|
React.createElement("div", { className: "jp-select-wrapper" },
|
|
102
|
-
React.createElement("select", { name: 'vector-cap-select', onChange: event => setStyle(prevState => (Object.assign(Object.assign({}, prevState), { capStyle: event.target.value }))), className: "jp-mod-styled" }, capStyleOptions.map((cap, index) => (React.createElement("option", { key: index, value: cap,
|
|
99
|
+
React.createElement("select", { name: 'vector-cap-select', onChange: event => setStyle(prevState => (Object.assign(Object.assign({}, prevState), { capStyle: event.target.value }))), className: "jp-mod-styled", value: style.capStyle }, capStyleOptions.map((cap, index) => (React.createElement("option", { key: index, value: cap, className: "jp-mod-styled" }, cap))))))));
|
|
100
|
+
const renderRadiusTab = () => (React.createElement("div", { className: "jp-gis-symbology-row" },
|
|
101
|
+
React.createElement("label", null, "Radius:"),
|
|
102
|
+
React.createElement("input", { type: "number", value: style.radius, className: "jp-mod-styled", onChange: e => setStyle(prev => (Object.assign(Object.assign({}, prev), { radius: +e.target.value }))) })));
|
|
103
|
+
return (React.createElement("div", { className: "jp-gis-layer-symbology-container" },
|
|
104
|
+
React.createElement("p", null, "Color all features the same way."),
|
|
105
|
+
symbologyTab === 'color' ? renderColorTab() : renderRadiusTab()));
|
|
103
106
|
};
|
|
104
107
|
export default SimpleSymbol;
|
|
@@ -9,10 +9,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { deepCopy } from '../tools';
|
|
13
12
|
import { PromiseDelegate, UUID } from '@lumino/coreutils';
|
|
14
13
|
import { Signal } from '@lumino/signaling';
|
|
15
14
|
import * as React from 'react';
|
|
15
|
+
import { deepCopy } from "../tools";
|
|
16
16
|
import { getLayerTypeForm, getSourceTypeForm } from './formselectors';
|
|
17
17
|
/**
|
|
18
18
|
* Form for creating a source, a layer or both at the same time
|
|
@@ -83,7 +83,7 @@ export class CreationForm extends React.Component {
|
|
|
83
83
|
const sourceModel = {
|
|
84
84
|
type: this.props.sourceType || 'RasterSource',
|
|
85
85
|
name: actualName,
|
|
86
|
-
parameters: sourceData
|
|
86
|
+
parameters: sourceData,
|
|
87
87
|
};
|
|
88
88
|
this.jGISModel.sharedModel.addSource(sourceId, sourceModel);
|
|
89
89
|
}
|
|
@@ -97,7 +97,7 @@ export class CreationForm extends React.Component {
|
|
|
97
97
|
type: this.props.layerType || 'RasterLayer',
|
|
98
98
|
parameters: layerData,
|
|
99
99
|
visible: true,
|
|
100
|
-
name: actualName
|
|
100
|
+
name: actualName,
|
|
101
101
|
};
|
|
102
102
|
this.jGISModel.addLayer(UUID.uuid4(), layerModel);
|
|
103
103
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Signal } from '@lumino/signaling';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { deepCopy } from
|
|
3
|
+
import { deepCopy } from "../tools";
|
|
4
4
|
import { getLayerTypeForm, getSourceTypeForm } from './formselectors';
|
|
5
5
|
/**
|
|
6
6
|
* Form for editing a source, a layer or both at the same time
|
|
@@ -53,12 +53,12 @@ export class EditForm extends React.Component {
|
|
|
53
53
|
return (React.createElement("div", null,
|
|
54
54
|
this.props.layer && LayerForm && (React.createElement("div", null,
|
|
55
55
|
React.createElement("h3", { style: { paddingLeft: '5px' } }, "Layer Properties"),
|
|
56
|
-
React.createElement(LayerForm, { formContext: "
|
|
56
|
+
React.createElement(LayerForm, { formContext: "update", sourceType: (source === null || source === void 0 ? void 0 : source.type) || 'RasterSource', model: this.props.model, filePath: this.props.model.filePath, schema: layerSchema, sourceData: layerData, syncData: (properties) => {
|
|
57
57
|
this.syncObjectProperties(this.props.layer, properties);
|
|
58
58
|
} }))),
|
|
59
59
|
this.props.source && SourceForm && (React.createElement("div", null,
|
|
60
60
|
React.createElement("h3", { style: { paddingLeft: '5px' } }, "Source Properties"),
|
|
61
|
-
React.createElement(SourceForm, { formContext: "
|
|
61
|
+
React.createElement(SourceForm, { formContext: "update", model: this.props.model, filePath: this.props.model.filePath, schema: sourceSchema, sourceData: sourceData, syncData: (properties) => {
|
|
62
62
|
this.syncObjectProperties(this.props.source, properties);
|
|
63
63
|
}, formChangedSignal: this.sourceFormChangedSignal, sourceType: (source === null || source === void 0 ? void 0 : source.type) || 'RasterSource' })))));
|
|
64
64
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LayerType, SourceType } from '@jupytergis/schema';
|
|
2
|
-
import { SourcePropertiesForm } from './objectform/source';
|
|
3
2
|
import { LayerPropertiesForm } from './objectform/layer';
|
|
3
|
+
import { SourcePropertiesForm } from './objectform/source';
|
|
4
4
|
export declare function getLayerTypeForm(layerType: LayerType): typeof LayerPropertiesForm;
|
|
5
5
|
export declare function getSourceTypeForm(sourceType: SourceType): typeof SourcePropertiesForm;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { HeatmapLayerPropertiesForm, HillshadeLayerPropertiesForm, LayerPropertiesForm, VectorLayerPropertiesForm, WebGlLayerPropertiesForm, } from './objectform/layer';
|
|
2
|
+
import { GeoJSONSourcePropertiesForm, GeoTiffSourcePropertiesForm, PathBasedSourcePropertiesForm, TileSourcePropertiesForm, SourcePropertiesForm, } from './objectform/source';
|
|
3
3
|
export function getLayerTypeForm(layerType) {
|
|
4
4
|
let LayerForm = LayerPropertiesForm;
|
|
5
5
|
switch (layerType) {
|
|
@@ -2,10 +2,11 @@ import { IJupyterGISModel } from '@jupytergis/schema';
|
|
|
2
2
|
import { Dialog } from '@jupyterlab/apputils';
|
|
3
3
|
import { Signal } from '@lumino/signaling';
|
|
4
4
|
import { IChangeEvent, ISubmitEvent } from '@rjsf/core';
|
|
5
|
+
import { RJSFSchema, UiSchema } from '@rjsf/utils';
|
|
5
6
|
import * as React from 'react';
|
|
6
|
-
import { IDict } from
|
|
7
|
+
import { IDict } from "../../types";
|
|
7
8
|
export interface IBaseFormStates {
|
|
8
|
-
schema?:
|
|
9
|
+
schema?: RJSFSchema;
|
|
9
10
|
extraErrors?: any;
|
|
10
11
|
}
|
|
11
12
|
export interface IBaseFormProps {
|
|
@@ -61,7 +62,7 @@ export declare class BaseForm extends React.Component<IBaseFormProps, IBaseFormS
|
|
|
61
62
|
constructor(props: IBaseFormProps);
|
|
62
63
|
componentDidUpdate(prevProps: IBaseFormProps, prevState: IBaseFormStates): void;
|
|
63
64
|
componentDidMount(): void;
|
|
64
|
-
protected processSchema(data: IDict<any> | undefined, schema:
|
|
65
|
+
protected processSchema(data: IDict<any> | undefined, schema: RJSFSchema, uiSchema: UiSchema): void;
|
|
65
66
|
/**
|
|
66
67
|
* Remove a specific entry from the form. Can be used in subclasses if needed while under processSchema.
|
|
67
68
|
* @param entry The entry name
|
|
@@ -69,7 +70,7 @@ export declare class BaseForm extends React.Component<IBaseFormProps, IBaseFormS
|
|
|
69
70
|
* @param schema The form schema
|
|
70
71
|
* @param uiSchema The form uiSchema
|
|
71
72
|
*/
|
|
72
|
-
protected removeFormEntry(entry: string, data: IDict<any> | undefined, schema:
|
|
73
|
+
protected removeFormEntry(entry: string, data: IDict<any> | undefined, schema: RJSFSchema, uiSchema: UiSchema): void;
|
|
73
74
|
protected syncData(properties: IDict<any> | undefined): void;
|
|
74
75
|
protected onFormChange(e: IChangeEvent): void;
|
|
75
76
|
protected onFormBlur(id: string, value: any): void;
|
|
@@ -13,8 +13,8 @@ import { Slider } from '@jupyter/react-components';
|
|
|
13
13
|
import { FormComponent } from '@jupyterlab/ui-components';
|
|
14
14
|
import validatorAjv8 from '@rjsf/validator-ajv8';
|
|
15
15
|
import * as React from 'react';
|
|
16
|
-
import { deepCopy } from
|
|
17
|
-
const WrappedFormComponent =
|
|
16
|
+
import { deepCopy } from "../../tools";
|
|
17
|
+
const WrappedFormComponent = props => {
|
|
18
18
|
const { fields } = props, rest = __rest(props, ["fields"]);
|
|
19
19
|
return (React.createElement(FormComponent, Object.assign({}, rest, { validator: validatorAjv8, fields: Object.assign({}, fields) })));
|
|
20
20
|
};
|
|
@@ -29,7 +29,7 @@ export class BaseForm extends React.Component {
|
|
|
29
29
|
this.currentFormData = deepCopy(this.props.sourceData);
|
|
30
30
|
this.state = {
|
|
31
31
|
schema: props.schema,
|
|
32
|
-
extraErrors: {}
|
|
32
|
+
extraErrors: {},
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
componentDidUpdate(prevProps, prevState) {
|
|
@@ -57,13 +57,13 @@ export class BaseForm extends React.Component {
|
|
|
57
57
|
uiSchema[k] = Object.assign({ 'ui:options': {
|
|
58
58
|
orderable: false,
|
|
59
59
|
removable: false,
|
|
60
|
-
addable: false
|
|
60
|
+
addable: false,
|
|
61
61
|
} }, uiSchema[k]);
|
|
62
62
|
if (v['items']['type'] === 'array') {
|
|
63
63
|
uiSchema[k] = Object.assign({ items: Object.assign({ 'ui:options': {
|
|
64
64
|
orderable: false,
|
|
65
65
|
removable: false,
|
|
66
|
-
addable: false
|
|
66
|
+
addable: false,
|
|
67
67
|
} }, uiSchema[k]['items']) }, uiSchema[k]);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -103,9 +103,9 @@ export class BaseForm extends React.Component {
|
|
|
103
103
|
border: '1px solid #ccc',
|
|
104
104
|
borderRadius: '4px',
|
|
105
105
|
padding: '4px',
|
|
106
|
-
marginBottom: '5px'
|
|
106
|
+
marginBottom: '5px',
|
|
107
107
|
} })));
|
|
108
|
-
}
|
|
108
|
+
},
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
// Don't show readOnly properties when it's a form for updating an object
|
|
@@ -130,7 +130,9 @@ export class BaseForm extends React.Component {
|
|
|
130
130
|
if (data) {
|
|
131
131
|
delete data[entry];
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
if (schema.properties) {
|
|
134
|
+
delete schema.properties[entry];
|
|
135
|
+
}
|
|
134
136
|
delete uiSchema[entry];
|
|
135
137
|
if (schema.required && schema.required.includes(entry)) {
|
|
136
138
|
schema.required.splice(schema.required.indexOf(entry), 1);
|
|
@@ -151,6 +153,9 @@ export class BaseForm extends React.Component {
|
|
|
151
153
|
const extraErrors = Object.keys(this.state.extraErrors).length > 0;
|
|
152
154
|
this.props.formErrorSignal.emit(extraErrors);
|
|
153
155
|
}
|
|
156
|
+
if (this.props.formContext === 'update') {
|
|
157
|
+
this.syncData(this.currentFormData);
|
|
158
|
+
}
|
|
154
159
|
}
|
|
155
160
|
onFormBlur(id, value) {
|
|
156
161
|
// This is a no-op here
|
|
@@ -168,8 +173,8 @@ export class BaseForm extends React.Component {
|
|
|
168
173
|
const uiSchema = {
|
|
169
174
|
additionalProperties: {
|
|
170
175
|
'ui:label': false,
|
|
171
|
-
classNames: 'jGIS-hidden-field'
|
|
172
|
-
}
|
|
176
|
+
classNames: 'jGIS-hidden-field',
|
|
177
|
+
},
|
|
173
178
|
};
|
|
174
179
|
this.processSchema(formData, schema, uiSchema);
|
|
175
180
|
const submitRef = React.createRef();
|
|
@@ -186,10 +191,7 @@ export class BaseForm extends React.Component {
|
|
|
186
191
|
(_a = submitRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
187
192
|
}
|
|
188
193
|
} },
|
|
189
|
-
React.createElement(WrappedFormComponent, { schema: schema, uiSchema: uiSchema, formData: formData, onSubmit: this.onFormSubmit.bind(this), onChange: this.onFormChange.bind(this), onBlur: this.onFormBlur.bind(this), ok: this.props.ok, cancel: this.props.cancel, liveValidate: true, children: React.createElement("button", { ref: submitRef, type: "submit", style: { display: 'none' } }), extraErrors: this.state.extraErrors }))
|
|
190
|
-
!this.props.ok && (React.createElement("div", { className: "jGIS-property-buttons" },
|
|
191
|
-
React.createElement("button", { className: "jp-Dialog-button jp-mod-accept jp-mod-styled", onClick: () => { var _a; return (_a = submitRef.current) === null || _a === void 0 ? void 0 : _a.click(); } },
|
|
192
|
-
React.createElement("div", { className: "jp-Dialog-buttonLabel" }, "Ok"))))));
|
|
194
|
+
React.createElement(WrappedFormComponent, { schema: schema, uiSchema: uiSchema, formData: formData, onSubmit: this.onFormSubmit.bind(this), onChange: this.onFormChange.bind(this), onBlur: this.onFormBlur.bind(this), ok: this.props.ok, cancel: this.props.cancel, liveValidate: true, children: React.createElement("button", { ref: submitRef, type: "submit", style: { display: 'none' } }), extraErrors: this.state.extraErrors }))));
|
|
193
195
|
}
|
|
194
196
|
}
|
|
195
197
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const FileSelectorWidget:
|
|
2
|
+
export declare const FileSelectorWidget: React.FC<any>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React, { useState, useEffect, useRef } from 'react';
|
|
2
|
-
import { FileDialog } from '@jupyterlab/filebrowser';
|
|
3
1
|
import { Dialog } from '@jupyterlab/apputils';
|
|
4
|
-
import { LayerCreationFormDialog } from '../../dialogs/layerCreationFormDialog';
|
|
5
2
|
import { PathExt } from '@jupyterlab/coreutils';
|
|
6
|
-
|
|
3
|
+
import { FileDialog } from '@jupyterlab/filebrowser';
|
|
4
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
5
|
+
import { LayerCreationFormDialog } from "../../dialogs/layerCreationFormDialog";
|
|
6
|
+
export const FileSelectorWidget = props => {
|
|
7
7
|
const { options } = props;
|
|
8
8
|
const { docManager, formOptions } = options;
|
|
9
9
|
const [serverFilePath, setServerFilePath] = useState('');
|
|
@@ -36,7 +36,7 @@ export const FileSelectorWidget = (props) => {
|
|
|
36
36
|
}
|
|
37
37
|
const output = await FileDialog.getOpenFiles({
|
|
38
38
|
title: `Select ${formOptions.sourceType.split('Source')[0]} File`,
|
|
39
|
-
manager: docManager
|
|
39
|
+
manager: docManager,
|
|
40
40
|
});
|
|
41
41
|
if (output.value && output.value.length > 0) {
|
|
42
42
|
const selectedFilePath = output.value[0].path;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { loadFile } from
|
|
1
|
+
import { loadFile } from "../../../tools";
|
|
2
2
|
import { LayerPropertiesForm } from './layerform';
|
|
3
3
|
export class HeatmapLayerPropertiesForm extends LayerPropertiesForm {
|
|
4
4
|
constructor(props) {
|
|
@@ -51,7 +51,7 @@ export class HeatmapLayerPropertiesForm extends LayerPropertiesForm {
|
|
|
51
51
|
const jsonData = await loadFile({
|
|
52
52
|
filepath: source.parameters.path,
|
|
53
53
|
type: 'GeoJSONSource',
|
|
54
|
-
model: this.props.model
|
|
54
|
+
model: this.props.model,
|
|
55
55
|
});
|
|
56
56
|
const featureProps = jsonData.features[0].properties;
|
|
57
57
|
this.features = Object.keys(featureProps);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IDict, SourceType } from '@jupytergis/schema';
|
|
2
|
-
import { BaseForm, IBaseFormProps } from '../baseform';
|
|
3
2
|
import { Signal } from '@lumino/signaling';
|
|
4
3
|
import { IChangeEvent } from '@rjsf/core';
|
|
4
|
+
import { BaseForm, IBaseFormProps } from "../baseform";
|
|
5
5
|
export interface ILayerProps extends IBaseFormProps {
|
|
6
6
|
/**
|
|
7
7
|
* The source type for the layer
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { BaseForm } from
|
|
1
|
+
import { BaseForm, } from "../baseform";
|
|
2
2
|
export class LayerPropertiesForm extends BaseForm {
|
|
3
3
|
constructor(props) {
|
|
4
4
|
super(props);
|
|
5
5
|
this.sourceFormChangedSignal = props.sourceFormChangedSignal;
|
|
6
6
|
}
|
|
7
7
|
processSchema(data, schema, uiSchema) {
|
|
8
|
+
var _a;
|
|
8
9
|
super.processSchema(data, schema, uiSchema);
|
|
9
|
-
if (!schema.properties.source) {
|
|
10
|
+
if (!((_a = schema.properties) === null || _a === void 0 ? void 0 : _a.source)) {
|
|
10
11
|
return;
|
|
11
12
|
}
|
|
12
13
|
// Replace the source text box by a dropdown menu
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseForm, IBaseFormProps } from '../baseform';
|
|
2
1
|
import { IDict, IJupyterGISModel } from '@jupytergis/schema';
|
|
3
2
|
import { IChangeEvent } from '@rjsf/core';
|
|
3
|
+
import { BaseForm, IBaseFormProps } from "../baseform";
|
|
4
4
|
interface IDissolveFormOptions extends IBaseFormProps {
|
|
5
5
|
schema: IDict;
|
|
6
6
|
sourceData: IDict;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseForm } from
|
|
2
|
-
import { loadFile } from
|
|
1
|
+
import { BaseForm, } from "../baseform"; // Ensure BaseForm imports states
|
|
2
|
+
import { loadFile } from "../../../tools";
|
|
3
3
|
export class DissolveForm extends BaseForm {
|
|
4
4
|
constructor(options) {
|
|
5
5
|
var _a;
|
|
@@ -8,7 +8,7 @@ export class DissolveForm extends BaseForm {
|
|
|
8
8
|
this.model = options.model;
|
|
9
9
|
// Ensure initial state matches IBaseFormStates
|
|
10
10
|
this.state = {
|
|
11
|
-
schema: (_a = options.schema) !== null && _a !== void 0 ? _a : {} // Ensure schema is never undefined
|
|
11
|
+
schema: (_a = options.schema) !== null && _a !== void 0 ? _a : {}, // Ensure schema is never undefined
|
|
12
12
|
};
|
|
13
13
|
this.onFormChange = this.handleFormChange.bind(this);
|
|
14
14
|
this.fetchFieldNames(options.sourceData.inputLayer);
|
|
@@ -31,7 +31,7 @@ export class DissolveForm extends BaseForm {
|
|
|
31
31
|
const jsonData = await loadFile({
|
|
32
32
|
filepath: sourceData.path,
|
|
33
33
|
type: 'GeoJSONSource',
|
|
34
|
-
model: this.model
|
|
34
|
+
model: this.model,
|
|
35
35
|
});
|
|
36
36
|
if (!((_b = jsonData === null || jsonData === void 0 ? void 0 : jsonData.features) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
37
37
|
return;
|
|
@@ -53,7 +53,7 @@ export class DissolveForm extends BaseForm {
|
|
|
53
53
|
this.setState((prevState) => {
|
|
54
54
|
var _a, _b, _c;
|
|
55
55
|
return ({
|
|
56
|
-
schema: Object.assign(Object.assign({}, prevState.schema), { properties: Object.assign(Object.assign({}, (_a = prevState.schema) === null || _a === void 0 ? void 0 : _a.properties), { dissolveField: Object.assign(Object.assign({}, (_c = (_b = prevState.schema) === null || _b === void 0 ? void 0 : _b.properties) === null || _c === void 0 ? void 0 : _c.dissolveField), { enum: [...this.features] }) }) })
|
|
56
|
+
schema: Object.assign(Object.assign({}, prevState.schema), { properties: Object.assign(Object.assign({}, (_a = prevState.schema) === null || _a === void 0 ? void 0 : _a.properties), { dissolveField: Object.assign(Object.assign({}, (_c = (_b = prevState.schema) === null || _b === void 0 ? void 0 : _b.properties) === null || _c === void 0 ? void 0 : _c.dissolveField), { enum: [...this.features] }) }) }),
|
|
57
57
|
});
|
|
58
58
|
}, () => {
|
|
59
59
|
this.forceUpdate();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Ajv } from 'ajv';
|
|
2
1
|
import * as geojson from '@jupytergis/schema/src/schema/geojson.json';
|
|
2
|
+
import { Ajv } from 'ajv';
|
|
3
|
+
import { loadFile } from "../../../tools";
|
|
3
4
|
import { PathBasedSourcePropertiesForm } from './pathbasedsource';
|
|
4
|
-
import { loadFile } from '../../../tools';
|
|
5
5
|
/**
|
|
6
6
|
* The form to modify a GeoJSON source.
|
|
7
7
|
*/
|
|
@@ -34,7 +34,7 @@ export class GeoJSONSourcePropertiesForm extends PathBasedSourcePropertiesForm {
|
|
|
34
34
|
const geoJSONData = await loadFile({
|
|
35
35
|
filepath: path,
|
|
36
36
|
type: this.props.sourceType,
|
|
37
|
-
model: this.props.model
|
|
37
|
+
model: this.props.model,
|
|
38
38
|
});
|
|
39
39
|
valid = this._validate(geoJSONData);
|
|
40
40
|
if (!valid) {
|
|
@@ -50,7 +50,7 @@ export class GeoJSONSourcePropertiesForm extends PathBasedSourcePropertiesForm {
|
|
|
50
50
|
}
|
|
51
51
|
if (!valid) {
|
|
52
52
|
extraErrors.path = {
|
|
53
|
-
__errors: [error]
|
|
53
|
+
__errors: [error],
|
|
54
54
|
};
|
|
55
55
|
(_a = this._validate.errors) === null || _a === void 0 ? void 0 : _a.reverse().forEach(error => {
|
|
56
56
|
extraErrors.path.__errors.push(error.message);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { showErrorMessage } from '@jupyterlab/apputils';
|
|
2
|
-
import {
|
|
2
|
+
import { FileSelectorWidget } from "../fileselectorwidget";
|
|
3
|
+
import { getMimeType } from "../../../tools";
|
|
3
4
|
import { SourcePropertiesForm } from './sourceform';
|
|
4
|
-
import { FileSelectorWidget } from '../fileselectorwidget';
|
|
5
5
|
/**
|
|
6
6
|
* The form to modify a GeoTiff source.
|
|
7
7
|
*/
|
|
@@ -25,8 +25,8 @@ export class GeoTiffSourcePropertiesForm extends SourcePropertiesForm {
|
|
|
25
25
|
'ui:widget': FileSelectorWidget,
|
|
26
26
|
'ui:options': {
|
|
27
27
|
docManager,
|
|
28
|
-
formOptions: this.props
|
|
29
|
-
}
|
|
28
|
+
formOptions: this.props,
|
|
29
|
+
},
|
|
30
30
|
} }) });
|
|
31
31
|
}
|
|
32
32
|
// This is not user-editable
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { showErrorMessage } from '@jupyterlab/apputils';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { FileSelectorWidget } from "../fileselectorwidget";
|
|
3
|
+
import { loadFile } from "../../../tools";
|
|
4
4
|
import { SourcePropertiesForm } from './sourceform';
|
|
5
5
|
/**
|
|
6
6
|
* The form to modify a PathBasedSource source.
|
|
@@ -26,8 +26,8 @@ export class PathBasedSourcePropertiesForm extends SourcePropertiesForm {
|
|
|
26
26
|
'ui:widget': FileSelectorWidget,
|
|
27
27
|
'ui:options': {
|
|
28
28
|
docManager,
|
|
29
|
-
formOptions: this.props
|
|
30
|
-
}
|
|
29
|
+
formOptions: this.props,
|
|
30
|
+
},
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
// This is not user-editable
|
|
@@ -74,7 +74,7 @@ export class PathBasedSourcePropertiesForm extends SourcePropertiesForm {
|
|
|
74
74
|
await loadFile({
|
|
75
75
|
filepath: path,
|
|
76
76
|
type: this.props.sourceType,
|
|
77
|
-
model: this.props.model
|
|
77
|
+
model: this.props.model,
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
catch (e) {
|
|
@@ -84,7 +84,7 @@ export class PathBasedSourcePropertiesForm extends SourcePropertiesForm {
|
|
|
84
84
|
}
|
|
85
85
|
if (!valid) {
|
|
86
86
|
extraErrors.path = {
|
|
87
|
-
__errors: [error]
|
|
87
|
+
__errors: [error],
|
|
88
88
|
};
|
|
89
89
|
this.setState(old => (Object.assign(Object.assign({}, old), { extraErrors })));
|
|
90
90
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IDict, SourceType } from '@jupytergis/schema';
|
|
2
|
-
import { BaseForm, IBaseFormProps } from '../baseform';
|
|
3
2
|
import { Signal } from '@lumino/signaling';
|
|
4
3
|
import { IChangeEvent } from '@rjsf/core';
|
|
4
|
+
import { BaseForm, IBaseFormProps } from "../baseform";
|
|
5
5
|
export interface ISourceFormProps extends IBaseFormProps {
|
|
6
6
|
/**
|
|
7
7
|
* The source type for this form.
|
|
@@ -29,7 +29,7 @@ export class TileSourcePropertiesForm extends SourcePropertiesForm {
|
|
|
29
29
|
schema.properties.urlParameters = {
|
|
30
30
|
type: 'object',
|
|
31
31
|
required: this._urlParameters,
|
|
32
|
-
properties: propertiesSchema
|
|
32
|
+
properties: propertiesSchema,
|
|
33
33
|
};
|
|
34
34
|
for (const parameterName of this._urlParameters) {
|
|
35
35
|
switch (parameterName) {
|
|
@@ -37,12 +37,12 @@ export class TileSourcePropertiesForm extends SourcePropertiesForm {
|
|
|
37
37
|
case 'time':
|
|
38
38
|
propertiesSchema[parameterName] = {
|
|
39
39
|
type: 'string',
|
|
40
|
-
format: 'date'
|
|
40
|
+
format: 'date',
|
|
41
41
|
};
|
|
42
42
|
break;
|
|
43
43
|
default:
|
|
44
44
|
propertiesSchema[parameterName] = {
|
|
45
|
-
type: 'string'
|
|
45
|
+
type: 'string',
|
|
46
46
|
};
|
|
47
47
|
break;
|
|
48
48
|
}
|