@jupytergis/base 0.10.1 → 0.12.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/commands/BaseCommandIDs.d.ts +2 -0
- package/lib/commands/BaseCommandIDs.js +3 -0
- package/lib/commands/index.js +66 -0
- package/lib/constants.js +4 -0
- package/lib/dialogs/symbology/hooks/useGetBandInfo.d.ts +0 -6
- package/lib/dialogs/symbology/hooks/useGetBandInfo.js +2 -2
- package/lib/dialogs/symbology/tiff_layer/types/MultibandColor.js +4 -4
- package/lib/dialogs/symbology/vector_layer/types/Categorized.js +1 -5
- package/lib/formbuilder/formselectors.js +5 -1
- package/lib/formbuilder/objectform/StoryEditorForm.d.ts +9 -0
- package/lib/formbuilder/objectform/StoryEditorForm.js +16 -0
- package/lib/formbuilder/objectform/components/StorySegmentReset.d.ts +8 -0
- package/lib/formbuilder/objectform/components/StorySegmentReset.js +24 -0
- package/lib/formbuilder/objectform/layer/index.d.ts +1 -0
- package/lib/formbuilder/objectform/layer/index.js +1 -0
- package/lib/formbuilder/objectform/layer/storySegmentLayerForm.d.ts +5 -0
- package/lib/formbuilder/objectform/layer/storySegmentLayerForm.js +32 -0
- package/lib/mainview/mainView.d.ts +18 -0
- package/lib/mainview/mainView.js +293 -14
- package/lib/panelview/components/layers.d.ts +2 -1
- package/lib/panelview/components/layers.js +31 -23
- package/lib/panelview/{components/filter-panel → filter-panel}/Filter.js +1 -1
- package/lib/panelview/leftpanel.js +89 -7
- package/lib/panelview/rightpanel.d.ts +2 -0
- package/lib/panelview/rightpanel.js +41 -4
- package/lib/panelview/story-maps/PreviewModeSwitch.d.ts +7 -0
- package/lib/panelview/story-maps/PreviewModeSwitch.js +13 -0
- package/lib/panelview/story-maps/StoryEditorPanel.d.ts +9 -0
- package/lib/panelview/story-maps/StoryEditorPanel.js +34 -0
- package/lib/panelview/story-maps/StoryNavBar.d.ts +10 -0
- package/lib/panelview/story-maps/StoryNavBar.js +11 -0
- package/lib/panelview/story-maps/StoryViewerPanel.d.ts +13 -0
- package/lib/panelview/story-maps/StoryViewerPanel.js +179 -0
- package/lib/panelview/story-maps/components/StoryContentSection.d.ts +6 -0
- package/lib/panelview/story-maps/components/StoryContentSection.js +10 -0
- package/lib/panelview/story-maps/components/StoryImageSection.d.ts +15 -0
- package/lib/panelview/story-maps/components/StoryImageSection.js +13 -0
- package/lib/panelview/story-maps/components/StorySubtitleSection.d.ts +11 -0
- package/lib/panelview/story-maps/components/StorySubtitleSection.js +9 -0
- package/lib/panelview/story-maps/components/StoryTitleSection.d.ts +12 -0
- package/lib/panelview/story-maps/components/StoryTitleSection.js +8 -0
- package/lib/shared/components/Calendar.d.ts +1 -1
- package/lib/shared/components/Combobox.d.ts +21 -0
- package/lib/shared/components/Combobox.js +32 -0
- package/lib/shared/components/Command.d.ts +18 -0
- package/lib/shared/components/Command.js +60 -0
- package/lib/shared/components/Dialog.d.ts +15 -0
- package/lib/shared/components/Dialog.js +62 -0
- package/lib/shared/components/Input.d.ts +3 -0
- package/lib/shared/components/Input.js +18 -0
- package/lib/shared/components/Pagination.js +3 -2
- package/lib/shared/components/RadioGroup.d.ts +5 -0
- package/lib/shared/components/RadioGroup.js +26 -0
- package/lib/shared/components/Select.d.ts +19 -0
- package/lib/shared/components/Select.js +28 -0
- package/lib/shared/components/SingleDatePicker.d.ts +11 -0
- package/lib/shared/components/SingleDatePicker.js +16 -0
- package/lib/shared/components/Switch.d.ts +4 -0
- package/lib/shared/components/Switch.js +20 -0
- package/lib/stacBrowser/components/StacPanel.d.ts +9 -1
- package/lib/stacBrowser/components/StacPanel.js +53 -9
- package/lib/stacBrowser/components/filter-extension/QueryableComboBox.d.ts +9 -0
- package/lib/stacBrowser/components/filter-extension/QueryableComboBox.js +179 -0
- package/lib/stacBrowser/components/filter-extension/QueryableRow.d.ts +16 -0
- package/lib/stacBrowser/components/filter-extension/QueryableRow.js +16 -0
- package/lib/stacBrowser/components/filter-extension/StacFilterExtensionPanel.d.ts +7 -0
- package/lib/stacBrowser/components/filter-extension/StacFilterExtensionPanel.js +49 -0
- package/lib/stacBrowser/components/filter-extension/StacQueryableFilters.d.ts +11 -0
- package/lib/stacBrowser/components/filter-extension/StacQueryableFilters.js +19 -0
- package/lib/stacBrowser/components/{StacFilterSection.d.ts → geodes/StacFilterSection.d.ts} +1 -1
- package/lib/stacBrowser/components/{StacFilterSection.js → geodes/StacFilterSection.js} +3 -3
- package/lib/stacBrowser/components/geodes/StacGeodesFilterPanel.d.ts +7 -0
- package/lib/stacBrowser/components/geodes/StacGeodesFilterPanel.js +69 -0
- package/lib/stacBrowser/components/shared/StacPanelResults.d.ts +3 -0
- package/lib/stacBrowser/components/shared/StacPanelResults.js +68 -0
- package/lib/stacBrowser/components/shared/StacSpatialExtent.d.ts +8 -0
- package/lib/stacBrowser/components/shared/StacSpatialExtent.js +10 -0
- package/lib/stacBrowser/components/shared/StacTemporalExtent.d.ts +9 -0
- package/lib/stacBrowser/components/shared/StacTemporalExtent.js +9 -0
- package/lib/stacBrowser/context/StacResultsContext.d.ts +33 -0
- package/lib/stacBrowser/context/StacResultsContext.js +269 -0
- package/lib/stacBrowser/hooks/useGeodesSearch.d.ts +24 -0
- package/lib/stacBrowser/hooks/useGeodesSearch.js +178 -0
- package/lib/stacBrowser/hooks/useStacFilterExtension.d.ts +30 -0
- package/lib/stacBrowser/hooks/useStacFilterExtension.js +262 -0
- package/lib/stacBrowser/hooks/useStacSearch.d.ts +5 -16
- package/lib/stacBrowser/hooks/useStacSearch.js +30 -184
- package/lib/stacBrowser/types/types.d.ts +86 -3
- package/lib/toolbar/widget.d.ts +15 -0
- package/lib/toolbar/widget.js +70 -0
- package/lib/tools.d.ts +0 -7
- package/lib/tools.js +56 -15
- package/package.json +8 -3
- package/style/base.css +42 -3
- package/style/leftPanel.css +18 -0
- package/style/shared/button.css +6 -5
- package/style/shared/calendar.css +7 -1
- package/style/shared/combobox.css +75 -0
- package/style/shared/command.css +178 -0
- package/style/shared/dialog.css +177 -0
- package/style/shared/input.css +59 -0
- package/style/shared/pagination.css +1 -1
- package/style/shared/popover.css +1 -0
- package/style/shared/radioGroup.css +55 -0
- package/style/shared/switch.css +63 -0
- package/style/shared/tabs.css +4 -3
- package/style/shared/toggle.css +1 -1
- package/style/stacBrowser.css +169 -16
- package/style/statusBar.css +1 -0
- package/style/storyPanel.css +185 -0
- package/style/tabPanel.css +1 -88
- package/lib/stacBrowser/components/StacPanelFilters.d.ts +0 -14
- package/lib/stacBrowser/components/StacPanelFilters.js +0 -81
- package/lib/stacBrowser/components/StacPanelResults.d.ts +0 -13
- package/lib/stacBrowser/components/StacPanelResults.js +0 -48
- /package/lib/panelview/{components/filter-panel → filter-panel}/Filter.d.ts +0 -0
- /package/lib/panelview/{components/filter-panel → filter-panel}/FilterRow.d.ts +0 -0
- /package/lib/panelview/{components/filter-panel → filter-panel}/FilterRow.js +0 -0
- /package/lib/panelview/{components/identify-panel → identify-panel}/IdentifyPanel.d.ts +0 -0
- /package/lib/panelview/{components/identify-panel → identify-panel}/IdentifyPanel.js +0 -0
|
@@ -40,3 +40,5 @@ export declare const showFiltersTab = "jupytergis:showFiltersTab";
|
|
|
40
40
|
export declare const showObjectPropertiesTab = "jupytergis:showObjectPropertiesTab";
|
|
41
41
|
export declare const showAnnotationsTab = "jupytergis:showAnnotationsTab";
|
|
42
42
|
export declare const showIdentifyPanelTab = "jupytergis:showIdentifyPanelTab";
|
|
43
|
+
export declare const addStorySegment = "jupytergis:addStorySegment";
|
|
44
|
+
export declare const toggleStoryPresentationMode = "jupytergis:toggleStoryPresentationMode";
|
|
@@ -55,3 +55,6 @@ export const showFiltersTab = 'jupytergis:showFiltersTab';
|
|
|
55
55
|
export const showObjectPropertiesTab = 'jupytergis:showObjectPropertiesTab';
|
|
56
56
|
export const showAnnotationsTab = 'jupytergis:showAnnotationsTab';
|
|
57
57
|
export const showIdentifyPanelTab = 'jupytergis:showIdentifyPanelTab';
|
|
58
|
+
// Story maps
|
|
59
|
+
export const addStorySegment = 'jupytergis:addStorySegment';
|
|
60
|
+
export const toggleStoryPresentationMode = 'jupytergis:toggleStoryPresentationMode';
|
package/lib/commands/index.js
CHANGED
|
@@ -28,6 +28,31 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
28
28
|
var _a;
|
|
29
29
|
const trans = translator.load('jupyterlab');
|
|
30
30
|
const { commands } = app;
|
|
31
|
+
/**
|
|
32
|
+
* Wraps a command definition to automatically disable it in Specta mode
|
|
33
|
+
*/
|
|
34
|
+
const createSpectaAwareCommand = (command) => {
|
|
35
|
+
const originalIsEnabled = command.isEnabled;
|
|
36
|
+
return Object.assign(Object.assign({}, command), { isEnabled: (args) => {
|
|
37
|
+
var _a;
|
|
38
|
+
// First check if we're in Specta mode
|
|
39
|
+
const currentModel = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.model;
|
|
40
|
+
if (currentModel === null || currentModel === void 0 ? void 0 : currentModel.isSpectaMode()) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
// Then check the original isEnabled if it exists
|
|
44
|
+
if (originalIsEnabled) {
|
|
45
|
+
return originalIsEnabled(args !== null && args !== void 0 ? args : {});
|
|
46
|
+
}
|
|
47
|
+
// Default to enabled if no original check
|
|
48
|
+
return true;
|
|
49
|
+
} });
|
|
50
|
+
};
|
|
51
|
+
// Override addCommand to automatically wrap all commands
|
|
52
|
+
const originalAddCommand = commands.addCommand.bind(commands);
|
|
53
|
+
commands.addCommand = (id, options) => {
|
|
54
|
+
return originalAddCommand(id, createSpectaAwareCommand(options));
|
|
55
|
+
};
|
|
31
56
|
commands.addCommand(CommandIDs.symbology, Object.assign({ label: trans.__('Edit Symbology'), isEnabled: () => {
|
|
32
57
|
var _a, _b;
|
|
33
58
|
const model = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.model;
|
|
@@ -356,6 +381,7 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
356
381
|
Private.removeSelectedItems(model, 'layer', selection => {
|
|
357
382
|
model === null || model === void 0 ? void 0 : model.removeLayer(selection);
|
|
358
383
|
});
|
|
384
|
+
commands.notifyCommandChanged(CommandIDs.toggleStoryPresentationMode);
|
|
359
385
|
},
|
|
360
386
|
});
|
|
361
387
|
commands.addCommand(CommandIDs.renameGroup, {
|
|
@@ -818,6 +844,46 @@ export function addCommands(app, tracker, translator, formSchemaRegistry, layerB
|
|
|
818
844
|
current.model.toggleMode('marking');
|
|
819
845
|
commands.notifyCommandChanged(CommandIDs.addMarker);
|
|
820
846
|
} }, icons.get(CommandIDs.addMarker)));
|
|
847
|
+
commands.addCommand(CommandIDs.addStorySegment, Object.assign({ label: trans.__('Add Story Segment'), isEnabled: () => {
|
|
848
|
+
const current = tracker.currentWidget;
|
|
849
|
+
if (!current) {
|
|
850
|
+
return false;
|
|
851
|
+
}
|
|
852
|
+
return (current.model.sharedModel.editable &&
|
|
853
|
+
!current.model.jgisSettings.storyMapsDisabled);
|
|
854
|
+
}, execute: args => {
|
|
855
|
+
const current = tracker.currentWidget;
|
|
856
|
+
if (!current) {
|
|
857
|
+
return;
|
|
858
|
+
}
|
|
859
|
+
current.model.addStorySegment();
|
|
860
|
+
commands.notifyCommandChanged(CommandIDs.toggleStoryPresentationMode);
|
|
861
|
+
} }, icons.get(CommandIDs.addStorySegment)));
|
|
862
|
+
commands.addCommand(CommandIDs.toggleStoryPresentationMode, Object.assign({ label: trans.__('Toggle Story Presentation Mode'), isToggled: () => {
|
|
863
|
+
const current = tracker.currentWidget;
|
|
864
|
+
if (!current) {
|
|
865
|
+
return false;
|
|
866
|
+
}
|
|
867
|
+
const { storyMapPresentationMode } = current.model.getOptions();
|
|
868
|
+
return storyMapPresentationMode !== null && storyMapPresentationMode !== void 0 ? storyMapPresentationMode : false;
|
|
869
|
+
}, isEnabled: () => {
|
|
870
|
+
var _a, _b, _c;
|
|
871
|
+
const storySegments = (_b = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.model.getSelectedStory().story) === null || _b === void 0 ? void 0 : _b.storySegments;
|
|
872
|
+
if (((_c = tracker.currentWidget) === null || _c === void 0 ? void 0 : _c.model.jgisSettings.storyMapsDisabled) ||
|
|
873
|
+
!storySegments ||
|
|
874
|
+
storySegments.length < 1) {
|
|
875
|
+
return false;
|
|
876
|
+
}
|
|
877
|
+
return true;
|
|
878
|
+
}, execute: args => {
|
|
879
|
+
const current = tracker.currentWidget;
|
|
880
|
+
if (!current) {
|
|
881
|
+
return;
|
|
882
|
+
}
|
|
883
|
+
const currentOptions = current.model.getOptions();
|
|
884
|
+
current.model.setOptions(Object.assign(Object.assign({}, currentOptions), { storyMapPresentationMode: !currentOptions.storyMapPresentationMode }));
|
|
885
|
+
commands.notifyCommandChanged(CommandIDs.toggleStoryPresentationMode);
|
|
886
|
+
} }, icons.get(CommandIDs.toggleStoryPresentationMode)));
|
|
821
887
|
loadKeybindings(commands, keybindings);
|
|
822
888
|
}
|
|
823
889
|
var Private;
|
package/lib/constants.js
CHANGED
|
@@ -35,6 +35,10 @@ const iconObject = {
|
|
|
35
35
|
[CommandIDs.identify]: { icon: infoIcon },
|
|
36
36
|
[CommandIDs.temporalController]: { icon: clockIcon },
|
|
37
37
|
[CommandIDs.addMarker]: { icon: markerIcon },
|
|
38
|
+
[CommandIDs.addStorySegment]: { iconClass: 'fa fa-link' },
|
|
39
|
+
[CommandIDs.toggleStoryPresentationMode]: {
|
|
40
|
+
iconClass: 'fa fa-book jgis-icon-adjust',
|
|
41
|
+
},
|
|
38
42
|
};
|
|
39
43
|
/**
|
|
40
44
|
* The registered icons
|
|
@@ -10,7 +10,6 @@ const useGetBandInfo = (model, layer) => {
|
|
|
10
10
|
setLoading(true);
|
|
11
11
|
setError(null);
|
|
12
12
|
try {
|
|
13
|
-
const bandsArr = [];
|
|
14
13
|
const source = model.getSource((_a = layer === null || layer === void 0 ? void 0 : layer.parameters) === null || _a === void 0 ? void 0 : _a.source);
|
|
15
14
|
const sourceInfo = (_b = source === null || source === void 0 ? void 0 : source.parameters) === null || _b === void 0 ? void 0 : _b.urls[0];
|
|
16
15
|
if (!(sourceInfo === null || sourceInfo === void 0 ? void 0 : sourceInfo.url)) {
|
|
@@ -40,9 +39,10 @@ const useGetBandInfo = (model, layer) => {
|
|
|
40
39
|
}
|
|
41
40
|
const image = await tiff.getImage();
|
|
42
41
|
const numberOfBands = image.getSamplesPerPixel();
|
|
42
|
+
const bandsArr = [];
|
|
43
43
|
for (let i = 0; i < numberOfBands; i++) {
|
|
44
44
|
bandsArr.push({
|
|
45
|
-
band: i,
|
|
45
|
+
band: i + 1,
|
|
46
46
|
stats: {
|
|
47
47
|
minimum: (_c = sourceInfo.min) !== null && _c !== void 0 ? _c : 0,
|
|
48
48
|
maximum: (_d = sourceInfo.max) !== null && _d !== void 0 ? _d : 100,
|
|
@@ -87,9 +87,9 @@ const MultibandColor = ({ model, okSignalPromise, cancel, layerId, }) => {
|
|
|
87
87
|
return (React.createElement("div", { className: "jp-gis-layer-symbology-container" },
|
|
88
88
|
React.createElement("div", { className: "jp-gis-band-container" },
|
|
89
89
|
React.createElement(LoadingOverlay, { loading: loading }),
|
|
90
|
-
React.createElement(BandRow, { label: "Red Band", index: selectedBands.red - 1, bandRow: bandRows[selectedBands.red - 1], bandRows: bandRows, setSelectedBand: val => updateBand('red', val >= 0 ? val
|
|
91
|
-
React.createElement(BandRow, { label: "Green Band", index: selectedBands.green - 1, bandRow: bandRows[selectedBands.green - 1], bandRows: bandRows, setSelectedBand: val => updateBand('green', val >= 0 ? val
|
|
92
|
-
React.createElement(BandRow, { label: "Blue Band", index: selectedBands.blue - 1, bandRow: bandRows[selectedBands.blue - 1], bandRows: bandRows, setSelectedBand: val => updateBand('blue', val >= 0 ? val
|
|
93
|
-
React.createElement(BandRow, { label: "Alpha Band", index: selectedBands.alpha - 1, bandRow: bandRows[selectedBands.alpha - 1], bandRows: bandRows, setSelectedBand: val => updateBand('alpha', val >= 0 ? val
|
|
90
|
+
React.createElement(BandRow, { label: "Red Band", index: selectedBands.red - 1, bandRow: bandRows[selectedBands.red - 1], bandRows: bandRows, setSelectedBand: val => updateBand('red', val >= 0 ? val : 0), setBandRows: setBandRows, isMultibandColor: true }),
|
|
91
|
+
React.createElement(BandRow, { label: "Green Band", index: selectedBands.green - 1, bandRow: bandRows[selectedBands.green - 1], bandRows: bandRows, setSelectedBand: val => updateBand('green', val >= 0 ? val : 0), setBandRows: setBandRows, isMultibandColor: true }),
|
|
92
|
+
React.createElement(BandRow, { label: "Blue Band", index: selectedBands.blue - 1, bandRow: bandRows[selectedBands.blue - 1], bandRows: bandRows, setSelectedBand: val => updateBand('blue', val >= 0 ? val : 0), setBandRows: setBandRows, isMultibandColor: true }),
|
|
93
|
+
React.createElement(BandRow, { label: "Alpha Band", index: selectedBands.alpha - 1, bandRow: bandRows[selectedBands.alpha - 1], bandRows: bandRows, setSelectedBand: val => updateBand('alpha', val >= 0 ? val : 0), setBandRows: setBandRows, isMultibandColor: true }))));
|
|
94
94
|
};
|
|
95
95
|
export default MultibandColor;
|
|
@@ -90,7 +90,7 @@ const Categorized = ({ model, state, okSignalPromise, cancel, layerId, symbology
|
|
|
90
90
|
setStopRows(valueColorPairs);
|
|
91
91
|
};
|
|
92
92
|
const handleOk = () => {
|
|
93
|
-
var _a
|
|
93
|
+
var _a;
|
|
94
94
|
if (!layer.parameters) {
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
@@ -122,8 +122,6 @@ const Categorized = ({ model, state, okSignalPromise, cancel, layerId, symbology
|
|
|
122
122
|
renderType: 'Categorized',
|
|
123
123
|
value: selectedAttributeRef.current,
|
|
124
124
|
colorRamp: (_a = colorRampOptionsRef.current) === null || _a === void 0 ? void 0 : _a.selectedRamp,
|
|
125
|
-
nClasses: (_b = colorRampOptionsRef.current) === null || _b === void 0 ? void 0 : _b.numberOfShades,
|
|
126
|
-
mode: (_c = colorRampOptionsRef.current) === null || _c === void 0 ? void 0 : _c.selectedMode,
|
|
127
125
|
symbologyTab,
|
|
128
126
|
reverse: reverseRamp,
|
|
129
127
|
};
|
|
@@ -149,8 +147,6 @@ const Categorized = ({ model, state, okSignalPromise, cancel, layerId, symbology
|
|
|
149
147
|
// Reset color classification options
|
|
150
148
|
if (layer.parameters.symbologyState) {
|
|
151
149
|
layer.parameters.symbologyState.colorRamp = undefined;
|
|
152
|
-
layer.parameters.symbologyState.nClasses = undefined;
|
|
153
|
-
layer.parameters.symbologyState.mode = undefined;
|
|
154
150
|
}
|
|
155
151
|
}
|
|
156
152
|
if (method === 'radius') {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HeatmapLayerPropertiesForm, HillshadeLayerPropertiesForm, LayerPropertiesForm, VectorLayerPropertiesForm, WebGlLayerPropertiesForm, } from './objectform/layer';
|
|
1
|
+
import { HeatmapLayerPropertiesForm, HillshadeLayerPropertiesForm, StorySegmentLayerPropertiesForm, LayerPropertiesForm, VectorLayerPropertiesForm, WebGlLayerPropertiesForm, } from './objectform/layer';
|
|
2
2
|
import { GeoJSONSourcePropertiesForm, GeoTiffSourcePropertiesForm, PathBasedSourcePropertiesForm, TileSourcePropertiesForm, SourcePropertiesForm, } from './objectform/source';
|
|
3
3
|
export function getLayerTypeForm(layerType) {
|
|
4
4
|
let LayerForm = LayerPropertiesForm;
|
|
@@ -15,6 +15,10 @@ export function getLayerTypeForm(layerType) {
|
|
|
15
15
|
break;
|
|
16
16
|
case 'HeatmapLayer':
|
|
17
17
|
LayerForm = HeatmapLayerPropertiesForm;
|
|
18
|
+
break;
|
|
19
|
+
case 'StorySegmentLayer':
|
|
20
|
+
LayerForm = StorySegmentLayerPropertiesForm;
|
|
21
|
+
break;
|
|
18
22
|
// ADD MORE FORM TYPES HERE
|
|
19
23
|
}
|
|
20
24
|
return LayerForm;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IDict } from '@jupytergis/schema';
|
|
2
|
+
import { RJSFSchema, UiSchema } from '@rjsf/utils';
|
|
3
|
+
import { BaseForm } from './baseform';
|
|
4
|
+
/**
|
|
5
|
+
* The form to modify story map properties.
|
|
6
|
+
*/
|
|
7
|
+
export declare class StoryEditorPropertiesForm extends BaseForm {
|
|
8
|
+
protected processSchema(data: IDict<any> | undefined, schema: RJSFSchema, uiSchema: UiSchema): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseForm } from './baseform';
|
|
2
|
+
/**
|
|
3
|
+
* The form to modify story map properties.
|
|
4
|
+
*/
|
|
5
|
+
export class StoryEditorPropertiesForm extends BaseForm {
|
|
6
|
+
processSchema(data, schema, uiSchema) {
|
|
7
|
+
super.processSchema(data, schema, uiSchema);
|
|
8
|
+
this.removeFormEntry('storySegments', data, schema, uiSchema);
|
|
9
|
+
uiSchema.presentaionBgColor = {
|
|
10
|
+
'ui:widget': 'color',
|
|
11
|
+
};
|
|
12
|
+
uiSchema.presentaionTextColor = {
|
|
13
|
+
'ui:widget': 'color',
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IJupyterGISModel } from '@jupytergis/schema';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface IStorySegmentResetProps {
|
|
4
|
+
model?: IJupyterGISModel;
|
|
5
|
+
layerId?: string;
|
|
6
|
+
}
|
|
7
|
+
declare function StorySegmentReset({ model, layerId }: IStorySegmentResetProps): React.JSX.Element;
|
|
8
|
+
export default StorySegmentReset;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LabIcon } from '@jupyterlab/ui-components';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { targetWithCenterIcon } from "../../../icons";
|
|
4
|
+
import { Button } from "../../../shared/components/Button";
|
|
5
|
+
function StorySegmentReset({ model, layerId }) {
|
|
6
|
+
const handleSetStorySegmentToCurrentView = () => {
|
|
7
|
+
if (!model || !layerId) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const layer = model.getLayer(layerId);
|
|
11
|
+
if (!layer) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const { zoom, extent } = model.getOptions();
|
|
15
|
+
const updatedLayer = Object.assign(Object.assign({}, layer), { parameters: Object.assign(Object.assign({}, layer.parameters), { zoom,
|
|
16
|
+
extent }) });
|
|
17
|
+
model.sharedModel.updateLayer(layerId, updatedLayer);
|
|
18
|
+
};
|
|
19
|
+
return (React.createElement("div", null,
|
|
20
|
+
React.createElement(Button, { title: "Set story segment to current viewport", onClick: handleSetStorySegmentToCurrentView },
|
|
21
|
+
React.createElement(LabIcon.resolveReact, { icon: targetWithCenterIcon, className: "jp-gis-layerIcon", tag: "span" }),
|
|
22
|
+
"Set Story Segment Extent")));
|
|
23
|
+
}
|
|
24
|
+
export default StorySegmentReset;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IDict } from '@jupytergis/schema';
|
|
2
|
+
import { LayerPropertiesForm } from './layerform';
|
|
3
|
+
export declare class StorySegmentLayerPropertiesForm extends LayerPropertiesForm {
|
|
4
|
+
protected processSchema(data: IDict<any> | undefined, schema: IDict, uiSchema: IDict): void;
|
|
5
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { LayerPropertiesForm } from './layerform';
|
|
3
|
+
import StorySegmentReset from '../components/StorySegmentReset';
|
|
4
|
+
export class StorySegmentLayerPropertiesForm extends LayerPropertiesForm {
|
|
5
|
+
processSchema(data, schema, uiSchema) {
|
|
6
|
+
super.processSchema(data, schema, uiSchema);
|
|
7
|
+
if (!this.props.model.selected) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
let layerId = undefined;
|
|
11
|
+
const selectedKeys = Object.keys(this.props.model.selected);
|
|
12
|
+
// Find the first selected story segment
|
|
13
|
+
// ! TODO we still need to handle selections better, like there should at least be a getFirstSelected
|
|
14
|
+
for (const key of selectedKeys) {
|
|
15
|
+
const layer = this.props.model.getLayer(key);
|
|
16
|
+
if (layer && layer.type === 'StorySegmentLayer') {
|
|
17
|
+
layerId = key;
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
uiSchema['extent'] = {
|
|
22
|
+
'ui:field': (props) => React.createElement(StorySegmentReset, Object.assign(Object.assign({}, props), { model: this.props.model, layerId })),
|
|
23
|
+
};
|
|
24
|
+
uiSchema['content'] = Object.assign(Object.assign({}, uiSchema['content']), { markdown: {
|
|
25
|
+
'ui:widget': 'textarea',
|
|
26
|
+
'ui:options': {
|
|
27
|
+
rows: 10,
|
|
28
|
+
},
|
|
29
|
+
} });
|
|
30
|
+
this.removeFormEntry('zoom', data, schema, uiSchema);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -31,10 +31,12 @@ interface IStates {
|
|
|
31
31
|
}>;
|
|
32
32
|
displayTemporalController: boolean;
|
|
33
33
|
filterStates: IDict<IJGISFilterItem | undefined>;
|
|
34
|
+
isSpectaPresentation: boolean;
|
|
34
35
|
}
|
|
35
36
|
export declare class MainView extends React.Component<IProps, IStates> {
|
|
36
37
|
constructor(props: IProps);
|
|
37
38
|
componentDidMount(): Promise<void>;
|
|
39
|
+
componentDidUpdate(prevProps: IProps, prevState: IStates): void;
|
|
38
40
|
componentWillUnmount(): void;
|
|
39
41
|
generateMap(center: number[], zoom: number): Promise<void>;
|
|
40
42
|
updateCenter: () => void;
|
|
@@ -134,6 +136,7 @@ export declare class MainView extends React.Component<IProps, IStates> {
|
|
|
134
136
|
removeLayer(id: string): void;
|
|
135
137
|
private _onClientSharedStateChanged;
|
|
136
138
|
private _onSharedOptionsChanged;
|
|
139
|
+
private _onSettingsChanged;
|
|
137
140
|
private updateOptions;
|
|
138
141
|
private _onViewChanged;
|
|
139
142
|
/**
|
|
@@ -167,6 +170,15 @@ export declare class MainView extends React.Component<IProps, IStates> {
|
|
|
167
170
|
private _onLayerTreeChange;
|
|
168
171
|
private _onSourcesChange;
|
|
169
172
|
private _onSharedModelStateChange;
|
|
173
|
+
/**
|
|
174
|
+
* Handler for when story maps change in the model.
|
|
175
|
+
* Updates specta state and presentation colors when story data becomes available.
|
|
176
|
+
*/
|
|
177
|
+
private _setupSpectaMode;
|
|
178
|
+
private _removeAllInteractions;
|
|
179
|
+
private _setupStoryScrollListener;
|
|
180
|
+
private _cleanupStoryScrollListener;
|
|
181
|
+
private _updateSpectaPresentationColors;
|
|
170
182
|
private _onSharedMetadataChanged;
|
|
171
183
|
private _computeAnnotationPosition;
|
|
172
184
|
private _updateAnnotation;
|
|
@@ -187,7 +199,11 @@ export declare class MainView extends React.Component<IProps, IStates> {
|
|
|
187
199
|
private _commands;
|
|
188
200
|
private _isPositionInitialized;
|
|
189
201
|
private divRef;
|
|
202
|
+
private controlsToolbarRef;
|
|
203
|
+
private spectaContainerRef;
|
|
204
|
+
private storyViewerPanelRef;
|
|
190
205
|
private _Map;
|
|
206
|
+
private _zoomControl?;
|
|
191
207
|
private _model;
|
|
192
208
|
private _mainViewModel;
|
|
193
209
|
private _ready;
|
|
@@ -203,5 +219,7 @@ export declare class MainView extends React.Component<IProps, IStates> {
|
|
|
203
219
|
private _formSchemaRegistry?;
|
|
204
220
|
private _annotationModel?;
|
|
205
221
|
private _featurePropertyCache;
|
|
222
|
+
private _isSpectaPresentationInitialized;
|
|
223
|
+
private _storyScrollHandler;
|
|
206
224
|
}
|
|
207
225
|
export {};
|