@jupytergis/base 0.14.1 → 0.16.0-alpha.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 +6 -0
- package/lib/commands/BaseCommandIDs.js +6 -0
- package/lib/commands/index.js +245 -55
- package/lib/commands/operationCommands.js +2 -2
- package/lib/constants.js +6 -1
- package/lib/{panelview/annotationPanel.js → features/annotations/AnnotationsPanel.js} +1 -1
- package/lib/{annotations → features/annotations}/index.d.ts +1 -0
- package/lib/{annotations → features/annotations}/index.js +1 -0
- package/lib/{console → features/console}/consoleview.js +1 -1
- package/lib/{panelview/filter-panel → features/filter}/Filter.js +4 -4
- package/lib/{panelview/filter-panel → features/filter}/FilterRow.d.ts +3 -2
- package/lib/{panelview/filter-panel → features/filter}/FilterRow.js +2 -1
- package/lib/{panelview/identify-panel → features/identify}/IdentifyPanel.d.ts +2 -0
- package/lib/features/identify/IdentifyPanel.js +102 -0
- package/lib/features/identify/components/FeatureCard.d.ts +17 -0
- package/lib/features/identify/components/FeatureCard.js +26 -0
- package/lib/features/identify/components/FeatureCardHeader.d.ts +11 -0
- package/lib/features/identify/components/FeatureCardHeader.js +30 -0
- package/lib/features/identify/components/FeatureFloater.d.ts +7 -0
- package/lib/features/identify/components/FeatureFloater.js +19 -0
- package/lib/features/identify/components/FeaturePropertyList.d.ts +11 -0
- package/lib/features/identify/components/FeaturePropertyList.js +18 -0
- package/lib/features/identify/components/FeatureRow.d.ts +13 -0
- package/lib/features/identify/components/FeatureRow.js +25 -0
- package/lib/features/identify/components/PropertyEditors.d.ts +44 -0
- package/lib/features/identify/components/PropertyEditors.js +56 -0
- package/lib/features/identify/hooks/useIdentifyPropertyEditor.d.ts +11 -0
- package/lib/features/identify/hooks/useIdentifyPropertyEditor.js +132 -0
- package/lib/features/identify/types/editorTypes.d.ts +21 -0
- package/lib/features/identify/utils/getFeatureIdentifier.d.ts +5 -0
- package/lib/features/identify/utils/getFeatureIdentifier.js +14 -0
- package/lib/features/identify/utils/highlightLayer.d.ts +11 -0
- package/lib/features/identify/utils/highlightLayer.js +57 -0
- package/lib/features/identify/utils/highlightStyle.d.ts +7 -0
- package/lib/features/identify/utils/highlightStyle.js +40 -0
- package/lib/{dialogs/layerBrowserDialog.js → features/layer-browser/index.js} +2 -2
- package/lib/features/layers/forms/layer/geoTiffLayerForm.d.ts +3 -0
- package/lib/{formbuilder/objectform/layer/webGlLayerForm.js → features/layers/forms/layer/geoTiffLayerForm.js} +5 -5
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/heatmapLayerForm.js +4 -4
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/hillshadeLayerForm.js +4 -4
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/index.d.ts +1 -1
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/index.js +1 -1
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/layerform.d.ts +1 -1
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/layerform.js +4 -4
- package/lib/features/layers/forms/layer/storySegmentLayerForm.js +150 -0
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/vectorlayerform.js +4 -4
- package/lib/{formbuilder/objectform → features/layers/forms}/source/geojsonsource.js +5 -5
- package/lib/features/layers/forms/source/geopackagesource.d.ts +3 -0
- package/lib/features/layers/forms/source/geopackagesource.js +93 -0
- package/lib/{formbuilder/objectform → features/layers/forms}/source/geotiffsource.js +5 -5
- package/lib/{formbuilder/objectform → features/layers/forms}/source/index.d.ts +2 -0
- package/lib/{formbuilder/objectform → features/layers/forms}/source/index.js +2 -0
- package/lib/{formbuilder/objectform → features/layers/forms}/source/pathbasedsource.js +5 -5
- package/lib/{formbuilder/objectform → features/layers/forms}/source/sourceform.d.ts +1 -1
- package/lib/{formbuilder/objectform → features/layers/forms}/source/sourceform.js +4 -4
- package/lib/{formbuilder/objectform → features/layers/forms}/source/tilesourceform.js +4 -4
- package/lib/features/layers/forms/source/wmsTileSource.d.ts +4 -0
- package/lib/features/layers/forms/source/wmsTileSource.js +78 -0
- package/lib/{dialogs → features/layers}/layerCreationFormDialog.d.ts +1 -1
- package/lib/{dialogs → features/layers}/layerCreationFormDialog.js +1 -1
- package/lib/features/layers/symbology/Grammar.d.ts +11 -0
- package/lib/features/layers/symbology/Grammar.js +235 -0
- package/lib/{dialogs/symbology/vector_layer/types → features/layers/symbology}/Heatmap.d.ts +1 -1
- package/lib/{dialogs/symbology/vector_layer/types → features/layers/symbology}/Heatmap.js +30 -10
- package/lib/{dialogs → features/layers}/symbology/classificationModes.d.ts +6 -6
- package/lib/{dialogs → features/layers}/symbology/classificationModes.js +57 -57
- package/lib/features/layers/symbology/colorRampUtils.d.ts +65 -0
- package/lib/features/layers/symbology/colorRampUtils.js +242 -0
- package/lib/features/layers/symbology/components/MappingRow.d.ts +40 -0
- package/lib/features/layers/symbology/components/MappingRow.js +516 -0
- package/lib/features/layers/symbology/components/NumericInput.d.ts +20 -0
- package/lib/features/layers/symbology/components/NumericInput.js +44 -0
- package/lib/features/layers/symbology/components/ScaleEditor.d.ts +33 -0
- package/lib/features/layers/symbology/components/ScaleEditor.js +221 -0
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampControls.d.ts +1 -1
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampControls.js +3 -2
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampSelector.d.ts +2 -1
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampSelector.js +12 -15
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampSelectorEntry.d.ts +2 -2
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampSelectorEntry.js +3 -11
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ModeSelectRow.d.ts +1 -1
- package/lib/features/layers/symbology/components/color_ramp/RgbaColorPicker.d.ts +13 -0
- package/lib/features/layers/symbology/components/color_ramp/RgbaColorPicker.js +128 -0
- package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopContainer.js +3 -1
- package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopRow.d.ts +2 -2
- package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopRow.js +12 -7
- package/lib/features/layers/symbology/grammarToOLLayer.d.ts +27 -0
- package/lib/features/layers/symbology/grammarToOLLayer.js +145 -0
- package/lib/features/layers/symbology/grammarToOLStyle.d.ts +32 -0
- package/lib/features/layers/symbology/grammarToOLStyle.js +467 -0
- package/lib/{dialogs → features/layers}/symbology/hooks/useGetBandInfo.d.ts +1 -1
- package/lib/{dialogs → features/layers}/symbology/hooks/useGetBandInfo.js +1 -1
- package/lib/{dialogs → features/layers}/symbology/hooks/useGetProperties.js +1 -1
- package/lib/{dialogs → features/layers}/symbology/hooks/useGetSymbology.js +4 -2
- package/lib/features/layers/symbology/styleBuilder.d.ts +21 -0
- package/lib/features/layers/symbology/styleBuilder.js +145 -0
- package/lib/{dialogs → features/layers}/symbology/symbologyDialog.d.ts +3 -2
- package/lib/{dialogs → features/layers}/symbology/symbologyDialog.js +12 -12
- package/lib/features/layers/symbology/symbologyUtils.d.ts +41 -0
- package/lib/features/layers/symbology/symbologyUtils.js +114 -0
- package/lib/{panelview/objectproperties.d.ts → features/objectproperties/index.d.ts} +1 -1
- package/lib/{panelview/objectproperties.js → features/objectproperties/index.js} +5 -10
- package/lib/{dialogs → features/processing}/ProcessingFormDialog.d.ts +1 -1
- package/lib/{dialogs → features/processing}/ProcessingFormDialog.js +28 -14
- package/lib/features/processing/forms/MapExtentToggle.d.ts +13 -0
- package/lib/features/processing/forms/MapExtentToggle.js +20 -0
- package/lib/features/processing/forms/clipRasterByExtentForm.d.ts +10 -0
- package/lib/features/processing/forms/clipRasterByExtentForm.js +99 -0
- package/lib/{formbuilder/objectform/process → features/processing/forms}/dissolveProcessForm.js +5 -5
- package/lib/{formbuilder/objectform → features/processing/forms}/processingForm.d.ts +1 -1
- package/lib/{formbuilder/objectform → features/processing/forms}/processingForm.js +6 -6
- package/lib/features/processing/forms/rasterizeForm.d.ts +10 -0
- package/lib/features/processing/forms/rasterizeForm.js +75 -0
- package/lib/features/processing/forms/useMapExtent.d.ts +22 -0
- package/lib/features/processing/forms/useMapExtent.js +57 -0
- package/lib/{processing → features/processing}/index.d.ts +19 -2
- package/lib/features/processing/index.js +1246 -0
- package/lib/{processing → features/processing}/processingCommands.d.ts +1 -1
- package/lib/features/processing/processingCommands.js +168 -0
- package/lib/features/processing/serverProcessing.d.ts +51 -0
- package/lib/features/processing/serverProcessing.js +99 -0
- package/lib/{stacBrowser → features/stac-browser}/components/StacPanel.js +2 -2
- package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/QueryableComboBox.js +64 -21
- package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/QueryableRow.js +1 -1
- package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/StacFilterExtensionPanel.js +2 -2
- package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/StacQueryableFilters.js +1 -1
- package/lib/{stacBrowser → features/stac-browser}/components/geodes/StacFilterSection.js +3 -3
- package/lib/{stacBrowser → features/stac-browser}/components/shared/StacPanelResults.js +3 -3
- package/lib/{stacBrowser → features/stac-browser}/components/shared/StacSpatialExtent.js +1 -1
- package/lib/{stacBrowser → features/stac-browser}/components/shared/StacTemporalExtent.js +1 -1
- package/lib/{stacBrowser → features/stac-browser}/context/StacResultsContext.js +2 -2
- package/lib/{stacBrowser → features/stac-browser}/hooks/useGeodesSearch.js +2 -2
- package/lib/{stacBrowser → features/stac-browser}/hooks/useStacFilterExtension.d.ts +1 -1
- package/lib/{stacBrowser → features/stac-browser}/hooks/useStacFilterExtension.js +198 -114
- package/lib/{stacBrowser → features/stac-browser}/hooks/useStacSearch.d.ts +1 -0
- package/lib/{stacBrowser → features/stac-browser}/hooks/useStacSearch.js +19 -11
- package/lib/features/stac-browser/types/types.js +1 -0
- package/lib/{panelview/story-maps → features/story}/SpectaPanel.d.ts +4 -1
- package/lib/{panelview/story-maps → features/story}/SpectaPanel.js +3 -4
- package/lib/{panelview/story-maps → features/story}/StoryEditorPanel.js +1 -1
- package/lib/{panelview/story-maps → features/story}/StoryViewerPanel.d.ts +12 -11
- package/lib/features/story/StoryViewerPanel.js +64 -0
- package/lib/features/story/__tests__/fixtures/listStoryTestItems.d.ts +9 -0
- package/lib/features/story/__tests__/fixtures/listStoryTestItems.js +21 -0
- package/lib/features/story/components/ListStoryMapOverlayPanel.d.ts +10 -0
- package/lib/features/story/components/ListStoryMapOverlayPanel.js +11 -0
- package/lib/features/story/components/ListStoryMarkdownMeasurePane.d.ts +11 -0
- package/lib/features/story/components/ListStoryMarkdownMeasurePane.js +55 -0
- package/lib/features/story/components/ListStoryOverlayMarkdown.d.ts +15 -0
- package/lib/features/story/components/ListStoryOverlayMarkdown.js +93 -0
- package/lib/features/story/components/ListStoryStageOverlay.d.ts +12 -0
- package/lib/features/story/components/ListStoryStageOverlay.js +132 -0
- package/lib/features/story/components/ListStoryVirtualScrollTrack.d.ts +6 -0
- package/lib/features/story/components/ListStoryVirtualScrollTrack.js +7 -0
- package/lib/{panelview/story-maps → features/story}/components/SpectaDesktopView.d.ts +4 -2
- package/lib/features/story/components/SpectaDesktopView.js +67 -0
- package/lib/{panelview/story-maps → features/story}/components/SpectaMobileView.d.ts +2 -4
- package/lib/{panelview/story-maps → features/story}/components/SpectaMobileView.js +3 -3
- package/lib/features/story/components/SpectaSingleModeContent.d.ts +18 -0
- package/lib/features/story/components/SpectaSingleModeContent.js +8 -0
- package/lib/features/story/context/ListStoryScrollTrackContext.d.ts +15 -0
- package/lib/features/story/context/ListStoryScrollTrackContext.js +142 -0
- package/lib/features/story/hooks/useCurrentSegmentIndex.d.ts +3 -0
- package/lib/features/story/hooks/useCurrentSegmentIndex.js +17 -0
- package/lib/features/story/hooks/useListStoryScroll.d.ts +15 -0
- package/lib/features/story/hooks/useListStoryScroll.js +107 -0
- package/lib/features/story/hooks/useQueuedMarkdownHeightMeasure.d.ts +19 -0
- package/lib/features/story/hooks/useQueuedMarkdownHeightMeasure.js +56 -0
- package/lib/features/story/hooks/useStoryImagePreload.d.ts +1 -0
- package/lib/features/story/hooks/useStoryImagePreload.js +24 -0
- package/lib/{panelview/story-maps → features/story}/hooks/useStoryMap.d.ts +2 -7
- package/lib/{panelview/story-maps → features/story}/hooks/useStoryMap.js +20 -44
- package/lib/features/story/hooks/useStoryScrollState.d.ts +21 -0
- package/lib/features/story/hooks/useStoryScrollState.js +39 -0
- package/lib/features/story/hooks/useStorySegmentSync.d.ts +8 -0
- package/lib/features/story/hooks/useStorySegmentSync.js +51 -0
- package/lib/features/story/types/types.d.ts +38 -0
- package/lib/features/story/types/types.js +1 -0
- package/lib/features/story/utils/computeListStoryScrollState.d.ts +12 -0
- package/lib/features/story/utils/computeListStoryScrollState.js +70 -0
- package/lib/features/story/utils/listStoryMeasureQueue.d.ts +11 -0
- package/lib/features/story/utils/listStoryMeasureQueue.js +14 -0
- package/lib/features/story/utils/listStoryScrollTrack.d.ts +17 -0
- package/lib/features/story/utils/listStoryScrollTrack.js +72 -0
- package/lib/features/story/utils/spectaPresentation.d.ts +9 -0
- package/lib/features/story/utils/spectaPresentation.js +37 -0
- package/lib/features/story/utils/storySegmentViewItems.d.ts +5 -0
- package/lib/features/story/utils/storySegmentViewItems.js +30 -0
- package/lib/index.d.ts +11 -9
- package/lib/index.js +11 -9
- package/lib/keybindings.json +5 -0
- package/lib/mainview/OpenEOTileLayer.d.ts +49 -0
- package/lib/mainview/OpenEOTileLayer.js +179 -0
- package/lib/mainview/TemporalSlider.js +11 -9
- package/lib/mainview/geoJsonFeaturePatch.d.ts +9 -0
- package/lib/mainview/geoJsonFeaturePatch.js +43 -0
- package/lib/mainview/mainView.d.ts +93 -8
- package/lib/mainview/mainView.js +1286 -529
- package/lib/mainview/mainviewwidget.d.ts +5 -1
- package/lib/mainview/mainviewwidget.js +4 -2
- package/lib/shared/components/Button.d.ts +1 -1
- package/lib/shared/components/DropdownMenu.d.ts +1 -0
- package/lib/shared/components/DropdownMenu.js +3 -2
- package/lib/shared/components/NativeSelect.d.ts +8 -0
- package/lib/shared/components/NativeSelect.js +29 -0
- package/lib/shared/components/Tabs.d.ts +3 -3
- package/lib/shared/components/Tabs.js +5 -5
- package/lib/{formbuilder → shared/formbuilder}/creationform.js +71 -4
- package/lib/{formbuilder → shared/formbuilder}/editform.js +1 -1
- package/lib/{formbuilder → shared/formbuilder}/formselectors.d.ts +2 -2
- package/lib/{formbuilder → shared/formbuilder}/formselectors.js +13 -4
- package/lib/shared/formbuilder/index.d.ts +4 -0
- package/lib/shared/formbuilder/index.js +4 -0
- package/lib/{formbuilder → shared/formbuilder}/objectform/SchemaForm.d.ts +1 -1
- package/lib/{formbuilder → shared/formbuilder}/objectform/StoryEditorForm.d.ts +1 -1
- package/lib/{formbuilder → shared/formbuilder}/objectform/StoryEditorForm.js +1 -1
- package/lib/{formbuilder → shared/formbuilder}/objectform/components/LayerSelect.js +1 -1
- package/lib/{formbuilder → shared/formbuilder}/objectform/components/SegmentFormSymbology.js +4 -4
- package/lib/{formbuilder → shared/formbuilder}/objectform/components/SourcePropertiesField.js +1 -1
- package/lib/{formbuilder → shared/formbuilder}/objectform/components/StorySegmentReset.js +1 -1
- package/lib/shared/formbuilder/objectform/components/WmsTileSourceUrlInput.d.ts +3 -0
- package/lib/shared/formbuilder/objectform/components/WmsTileSourceUrlInput.js +84 -0
- package/lib/{formbuilder → shared/formbuilder}/objectform/fileselectorwidget.js +8 -1
- package/lib/{formbuilder → shared/formbuilder}/objectform/schemaUtils.d.ts +3 -1
- package/lib/{formbuilder → shared/formbuilder}/objectform/schemaUtils.js +11 -0
- package/lib/{formbuilder → shared/formbuilder}/objectform/useSchemaFormState.d.ts +2 -2
- package/lib/{formbuilder → shared/formbuilder}/objectform/useSchemaFormState.js +1 -1
- package/lib/{icons.d.ts → shared/icons.d.ts} +2 -0
- package/lib/{icons.js → shared/icons.js} +28 -18
- package/lib/tools.d.ts +3 -1
- package/lib/tools.js +140 -6
- package/lib/types.d.ts +12 -1
- package/lib/types.js +6 -1
- package/lib/{menus.js → workspace/menus.js} +14 -2
- package/lib/workspace/panels/components/TabbedPanel.d.ts +17 -0
- package/lib/workspace/panels/components/TabbedPanel.js +19 -0
- package/lib/{panelview → workspace/panels}/components/layers.js +82 -20
- package/lib/workspace/panels/components/legendItem.js +680 -0
- package/lib/workspace/panels/hooks/useLayerTree.d.ts +19 -0
- package/lib/workspace/panels/hooks/useLayerTree.js +103 -0
- package/lib/workspace/panels/hooks/useRightPanelOptions.d.ts +27 -0
- package/lib/workspace/panels/hooks/useRightPanelOptions.js +72 -0
- package/lib/workspace/panels/hooks/useUIState.d.ts +2 -0
- package/lib/workspace/panels/hooks/useUIState.js +25 -0
- package/lib/{panelview → workspace/panels}/index.d.ts +1 -1
- package/lib/{panelview → workspace/panels}/index.js +1 -1
- package/lib/{panelview → workspace/panels}/leftpanel.d.ts +1 -1
- package/lib/workspace/panels/leftpanel.js +70 -0
- package/lib/{panelview/rightpanel.d.ts → workspace/panels/mergedpanel.d.ts} +6 -5
- package/lib/workspace/panels/mergedpanel.js +166 -0
- package/lib/workspace/panels/rightpanel.d.ts +25 -0
- package/lib/{panelview → workspace/panels}/rightpanel.js +53 -63
- package/lib/{statusbar → workspace/statusbar}/StatusBar.js +5 -4
- package/lib/{toolbar → workspace/toolbar}/widget.d.ts +2 -0
- package/lib/{toolbar → workspace/toolbar}/widget.js +33 -5
- package/lib/{widget.d.ts → workspace/widget.d.ts} +7 -5
- package/lib/{widget.js → workspace/widget.js} +16 -7
- package/package.json +19 -4
- package/style/base.css +109 -1
- package/style/icons/geopackage.svg +95 -0
- package/style/icons/pencil_solid.svg +7 -0
- package/style/identify.css +95 -0
- package/style/layerBrowser.css +28 -0
- package/style/leftPanel.css +25 -0
- package/style/shared/button.css +12 -0
- package/style/shared/dropdownMenu.css +9 -0
- package/style/shared/nativeSelect.css +75 -0
- package/style/shared/tabs.css +3 -3
- package/style/spectaProgressBar.css +0 -1
- package/style/storyPanel.css +142 -9
- package/style/storySpectaArticleOverlay.css +129 -0
- package/style/symbologyDialog.css +330 -28
- package/lib/dialogs/symbology/colorRampUtils.d.ts +0 -20
- package/lib/dialogs/symbology/colorRampUtils.js +0 -132
- package/lib/dialogs/symbology/symbologyUtils.d.ts +0 -33
- package/lib/dialogs/symbology/symbologyUtils.js +0 -180
- package/lib/dialogs/symbology/tiff_layer/TiffRendering.d.ts +0 -4
- package/lib/dialogs/symbology/tiff_layer/TiffRendering.js +0 -42
- package/lib/dialogs/symbology/tiff_layer/components/BandRow.d.ts +0 -23
- package/lib/dialogs/symbology/tiff_layer/components/BandRow.js +0 -59
- package/lib/dialogs/symbology/tiff_layer/types/MultibandColor.d.ts +0 -4
- package/lib/dialogs/symbology/tiff_layer/types/MultibandColor.js +0 -92
- package/lib/dialogs/symbology/tiff_layer/types/SingleBandPseudoColor.d.ts +0 -5
- package/lib/dialogs/symbology/tiff_layer/types/SingleBandPseudoColor.js +0 -301
- package/lib/dialogs/symbology/vector_layer/VectorRendering.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/VectorRendering.js +0 -112
- package/lib/dialogs/symbology/vector_layer/components/ValueSelect.d.ts +0 -8
- package/lib/dialogs/symbology/vector_layer/components/ValueSelect.js +0 -9
- package/lib/dialogs/symbology/vector_layer/types/Canonical.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/types/Canonical.js +0 -65
- package/lib/dialogs/symbology/vector_layer/types/Categorized.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/types/Categorized.js +0 -196
- package/lib/dialogs/symbology/vector_layer/types/Graduated.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/types/Graduated.js +0 -250
- package/lib/dialogs/symbology/vector_layer/types/SimpleSymbol.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/types/SimpleSymbol.js +0 -105
- package/lib/formbuilder/index.d.ts +0 -4
- package/lib/formbuilder/index.js +0 -4
- package/lib/formbuilder/objectform/layer/storySegmentLayerForm.js +0 -95
- package/lib/formbuilder/objectform/layer/webGlLayerForm.d.ts +0 -3
- package/lib/formbuilder/objectform/process/index.d.ts +0 -1
- package/lib/formbuilder/objectform/process/index.js +0 -1
- package/lib/panelview/components/legendItem.js +0 -200
- package/lib/panelview/identify-panel/IdentifyPanel.js +0 -102
- package/lib/panelview/leftpanel.js +0 -139
- package/lib/panelview/story-maps/StoryViewerPanel.js +0 -116
- package/lib/panelview/story-maps/components/SpectaDesktopView.js +0 -49
- package/lib/processing/index.js +0 -200
- package/lib/processing/processingCommands.js +0 -67
- /package/lib/{panelview/annotationPanel.d.ts → features/annotations/AnnotationsPanel.d.ts} +0 -0
- /package/lib/{annotations → features/annotations}/components/Annotation.d.ts +0 -0
- /package/lib/{annotations → features/annotations}/components/Annotation.js +0 -0
- /package/lib/{annotations → features/annotations}/components/AnnotationFloater.d.ts +0 -0
- /package/lib/{annotations → features/annotations}/components/AnnotationFloater.js +0 -0
- /package/lib/{annotations → features/annotations}/components/Message.d.ts +0 -0
- /package/lib/{annotations → features/annotations}/components/Message.js +0 -0
- /package/lib/{annotations → features/annotations}/model.d.ts +0 -0
- /package/lib/{annotations → features/annotations}/model.js +0 -0
- /package/lib/{console → features/console}/consoleview.d.ts +0 -0
- /package/lib/{console → features/console}/index.d.ts +0 -0
- /package/lib/{console → features/console}/index.js +0 -0
- /package/lib/{panelview/filter-panel → features/filter}/Filter.d.ts +0 -0
- /package/lib/{stacBrowser/types/types.js → features/identify/types/editorTypes.js} +0 -0
- /package/lib/{dialogs/layerBrowserDialog.d.ts → features/layer-browser/index.d.ts} +0 -0
- /package/lib/{formbuilder/objectform → features/layers/forms}/layer/heatmapLayerForm.d.ts +0 -0
- /package/lib/{formbuilder/objectform → features/layers/forms}/layer/hillshadeLayerForm.d.ts +0 -0
- /package/lib/{formbuilder/objectform → features/layers/forms}/layer/storySegmentLayerForm.d.ts +0 -0
- /package/lib/{formbuilder/objectform → features/layers/forms}/layer/vectorlayerform.d.ts +0 -0
- /package/lib/{formbuilder/objectform → features/layers/forms}/source/geojsonsource.d.ts +0 -0
- /package/lib/{formbuilder/objectform → features/layers/forms}/source/geotiffsource.d.ts +0 -0
- /package/lib/{formbuilder/objectform → features/layers/forms}/source/pathbasedsource.d.ts +0 -0
- /package/lib/{formbuilder/objectform → features/layers/forms}/source/tilesourceform.d.ts +0 -0
- /package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ModeSelectRow.js +0 -0
- /package/lib/{dialogs → features/layers}/symbology/components/color_ramp/cmocean.json +0 -0
- /package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopContainer.d.ts +0 -0
- /package/lib/{dialogs → features/layers}/symbology/hooks/useEffectiveSymbologyParams.d.ts +0 -0
- /package/lib/{dialogs → features/layers}/symbology/hooks/useEffectiveSymbologyParams.js +0 -0
- /package/lib/{dialogs → features/layers}/symbology/hooks/useGetProperties.d.ts +0 -0
- /package/lib/{dialogs → features/layers}/symbology/hooks/useGetSymbology.d.ts +0 -0
- /package/lib/{dialogs → features/layers}/symbology/hooks/useOkSignal.d.ts +0 -0
- /package/lib/{dialogs → features/layers}/symbology/hooks/useOkSignal.js +0 -0
- /package/lib/{formbuilder/objectform/process → features/processing/forms}/dissolveProcessForm.d.ts +0 -0
- /package/lib/{processing → features/processing}/processingFormToParam.d.ts +0 -0
- /package/lib/{processing → features/processing}/processingFormToParam.js +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/StacPanel.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/QueryableComboBox.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/QueryableRow.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/StacFilterExtensionPanel.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/filter-extension/StacQueryableFilters.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/geodes/StacFilterSection.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/geodes/StacGeodesFilterPanel.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/geodes/StacGeodesFilterPanel.js +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/shared/StacPanelResults.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/shared/StacSpatialExtent.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/components/shared/StacTemporalExtent.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/constants.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/constants.js +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/context/StacResultsContext.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/hooks/useGeodesSearch.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/index.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/index.js +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/types/types.d.ts +0 -0
- /package/lib/{panelview/story-maps → features/story}/StoryEditorPanel.d.ts +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/PreviewModeSwitch.d.ts +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/PreviewModeSwitch.js +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StoryContentSection.d.ts +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StoryContentSection.js +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StoryImageSection.d.ts +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StoryImageSection.js +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StoryNavBar.d.ts +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StoryNavBar.js +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StorySubtitleSection.d.ts +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StorySubtitleSection.js +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StoryTitleSection.d.ts +0 -0
- /package/lib/{panelview/story-maps → features/story}/components/StoryTitleSection.js +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/creationform.d.ts +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/editform.d.ts +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/objectform/SchemaForm.js +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/objectform/components/LayerSelect.d.ts +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/objectform/components/OpacitySlider.d.ts +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/objectform/components/OpacitySlider.js +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/objectform/components/SegmentFormSymbology.d.ts +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/objectform/components/SourcePropertiesField.d.ts +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/objectform/components/StorySegmentReset.d.ts +0 -0
- /package/lib/{formbuilder → shared/formbuilder}/objectform/fileselectorwidget.d.ts +0 -0
- /package/lib/{store.d.ts → shared/store.d.ts} +0 -0
- /package/lib/{store.js → shared/store.js} +0 -0
- /package/lib/{menus.d.ts → workspace/menus.d.ts} +0 -0
- /package/lib/{panelview → workspace/panels}/components/layers.d.ts +0 -0
- /package/lib/{panelview → workspace/panels}/components/legendItem.d.ts +0 -0
- /package/lib/{panelview → workspace/panels}/header.d.ts +0 -0
- /package/lib/{panelview → workspace/panels}/header.js +0 -0
- /package/lib/{statusbar → workspace/statusbar}/SpectaPresentationProgressBar.d.ts +0 -0
- /package/lib/{statusbar → workspace/statusbar}/SpectaPresentationProgressBar.js +0 -0
- /package/lib/{statusbar → workspace/statusbar}/StatusBar.d.ts +0 -0
- /package/lib/{toolbar → workspace/toolbar}/index.d.ts +0 -0
- /package/lib/{toolbar → workspace/toolbar}/index.js +0 -0
|
@@ -54,11 +54,13 @@ export const useGetSymbology = ({ layerId, model, }) => {
|
|
|
54
54
|
};
|
|
55
55
|
// initial load
|
|
56
56
|
fetchSymbology();
|
|
57
|
-
|
|
57
|
+
const handleLayersChanged = () => {
|
|
58
58
|
fetchSymbology();
|
|
59
|
-
}
|
|
59
|
+
};
|
|
60
|
+
model.sharedLayersChanged.connect(handleLayersChanged);
|
|
60
61
|
return () => {
|
|
61
62
|
disposed = true;
|
|
63
|
+
model.sharedLayersChanged.disconnect(handleLayersChanged);
|
|
62
64
|
};
|
|
63
65
|
}, [layerId, model]);
|
|
64
66
|
return { symbology, isLoading, error };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IVectorLayer } from '@jupytergis/schema';
|
|
2
|
+
import { FlatStyle } from 'ol/style/flat';
|
|
3
|
+
import { DEFAULT_STROKE_WIDTH, RgbaColor } from './colorRampUtils';
|
|
4
|
+
export { DEFAULT_STROKE_WIDTH };
|
|
5
|
+
export type SymbologyState = NonNullable<IVectorLayer['symbologyState']>;
|
|
6
|
+
export type GeometryType = 'fill' | 'circle' | 'line';
|
|
7
|
+
/** Default OL flat style used when no Grammar rules produce output. */
|
|
8
|
+
export declare const DEFAULT_FLAT_STYLE: FlatStyle;
|
|
9
|
+
/** A computed stop: value → RGBA color. */
|
|
10
|
+
export interface IComputedStop {
|
|
11
|
+
value: number | string | boolean;
|
|
12
|
+
color: RgbaColor;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Compute color stops for Graduated symbology from the config + feature values.
|
|
16
|
+
*/
|
|
17
|
+
export declare function computeGraduatedColorStops(state: SymbologyState, numericValues: number[]): IComputedStop[];
|
|
18
|
+
/**
|
|
19
|
+
* Compute color stops for Categorized symbology from the config + feature values.
|
|
20
|
+
*/
|
|
21
|
+
export declare function computeCategorizedColorStops(state: SymbologyState, featureValues: unknown[]): IComputedStop[];
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import colormap from 'colormap';
|
|
2
|
+
import { VectorClassifications } from './classificationModes';
|
|
3
|
+
import { colorToRgba, DEFAULT_STROKE_WIDTH, getColorMapList, } from './colorRampUtils';
|
|
4
|
+
export { DEFAULT_STROKE_WIDTH };
|
|
5
|
+
/** Default OL flat style used when no Grammar rules produce output. */
|
|
6
|
+
export const DEFAULT_FLAT_STYLE = {
|
|
7
|
+
'fill-color': 'rgba(255,255,255,0.4)',
|
|
8
|
+
'stroke-color': '#3399CC',
|
|
9
|
+
'stroke-width': 1.25,
|
|
10
|
+
'circle-radius': 5,
|
|
11
|
+
'circle-fill-color': 'rgba(255,255,255,0.4)',
|
|
12
|
+
'circle-stroke-width': 1.25,
|
|
13
|
+
'circle-stroke-color': '#3399CC',
|
|
14
|
+
};
|
|
15
|
+
// Stop computation helpers — used by the Grammar compiler
|
|
16
|
+
/**
|
|
17
|
+
* Compute color stops for Graduated symbology from the config + feature values.
|
|
18
|
+
*/
|
|
19
|
+
export function computeGraduatedColorStops(state, numericValues) {
|
|
20
|
+
var _a, _b, _c, _d;
|
|
21
|
+
const nClasses = (_a = state.nClasses) !== null && _a !== void 0 ? _a : 9;
|
|
22
|
+
const nStops = nClasses + 1; // classification functions use anchor-point count
|
|
23
|
+
const mode = (_b = state.mode) !== null && _b !== void 0 ? _b : 'equal interval';
|
|
24
|
+
const rampName = (_c = state.colorRamp) !== null && _c !== void 0 ? _c : 'viridis';
|
|
25
|
+
const reverse = (_d = state.reverseRamp) !== null && _d !== void 0 ? _d : false;
|
|
26
|
+
const parsedVmin = state.vmin !== undefined ? state.vmin : undefined;
|
|
27
|
+
const parsedVmax = state.vmax !== undefined ? state.vmax : undefined;
|
|
28
|
+
const values = numericValues.filter(v => {
|
|
29
|
+
if (parsedVmin !== undefined && v < parsedVmin) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
if (parsedVmax !== undefined && v > parsedVmax) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
});
|
|
37
|
+
// If no feature values are in range but vmin/vmax are explicitly set (e.g.
|
|
38
|
+
// for VectorTile sources where getFeatures() is unavailable), use them as a
|
|
39
|
+
// synthetic range so stops can still be computed.
|
|
40
|
+
const effectiveValues = values.length > 0
|
|
41
|
+
? values
|
|
42
|
+
: parsedVmin !== undefined && parsedVmax !== undefined
|
|
43
|
+
? [parsedVmin, parsedVmax]
|
|
44
|
+
: [];
|
|
45
|
+
if (effectiveValues.length === 0) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
const dataMin = Math.min(...effectiveValues);
|
|
49
|
+
const dataMax = Math.max(...effectiveValues);
|
|
50
|
+
const rangeMin = parsedVmin !== null && parsedVmin !== void 0 ? parsedVmin : dataMin;
|
|
51
|
+
const rangeMax = parsedVmax !== null && parsedVmax !== void 0 ? parsedVmax : dataMax;
|
|
52
|
+
const rangeValues = [rangeMin, rangeMax];
|
|
53
|
+
let stops;
|
|
54
|
+
switch (mode) {
|
|
55
|
+
case 'quantile':
|
|
56
|
+
stops = VectorClassifications.calculateQuantileBreaks(effectiveValues, nStops);
|
|
57
|
+
break;
|
|
58
|
+
case 'equal interval':
|
|
59
|
+
stops = VectorClassifications.calculateEqualIntervalBreaks(rangeValues, nStops);
|
|
60
|
+
break;
|
|
61
|
+
case 'jenks':
|
|
62
|
+
stops = VectorClassifications.calculateJenksBreaks(effectiveValues, nStops);
|
|
63
|
+
break;
|
|
64
|
+
case 'pretty':
|
|
65
|
+
stops = VectorClassifications.calculatePrettyBreaks(rangeValues, nStops);
|
|
66
|
+
break;
|
|
67
|
+
case 'logarithmic':
|
|
68
|
+
stops = VectorClassifications.calculateLogarithmicBreaks(rangeValues, nStops);
|
|
69
|
+
break;
|
|
70
|
+
default:
|
|
71
|
+
stops = VectorClassifications.calculateEqualIntervalBreaks(rangeValues, nStops);
|
|
72
|
+
}
|
|
73
|
+
return mapStopsToColors(stops, rampName, stops.length, reverse);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Compute color stops for Categorized symbology from the config + feature values.
|
|
77
|
+
*/
|
|
78
|
+
export function computeCategorizedColorStops(state, featureValues) {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
const rampName = (_a = state.colorRamp) !== null && _a !== void 0 ? _a : 'viridis';
|
|
81
|
+
const reverse = (_b = state.reverseRamp) !== null && _b !== void 0 ? _b : false;
|
|
82
|
+
const uniqueValues = [
|
|
83
|
+
...new Set(featureValues.filter(v => v !== undefined && v !== null)),
|
|
84
|
+
].sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));
|
|
85
|
+
if (uniqueValues.length === 0) {
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
88
|
+
const colorRamp = getColorMapList().find(c => c.name === rampName);
|
|
89
|
+
if (!colorRamp) {
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
const colors = generateColors(colorRamp, uniqueValues.length, reverse);
|
|
93
|
+
return uniqueValues.map((v, i) => ({
|
|
94
|
+
value: v,
|
|
95
|
+
color: colors[i],
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
// Color ramp helpers
|
|
99
|
+
function mapStopsToColors(stops, rampName, nClasses, reverse) {
|
|
100
|
+
const colorRamp = getColorMapList().find(c => c.name === rampName);
|
|
101
|
+
if (!colorRamp) {
|
|
102
|
+
return [];
|
|
103
|
+
}
|
|
104
|
+
const colors = generateColors(colorRamp, nClasses, reverse);
|
|
105
|
+
return stops.map((v, i) => ({
|
|
106
|
+
value: v,
|
|
107
|
+
color: colors[Math.min(i, colors.length - 1)],
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
function generateColors(colorRamp, nClasses, reverse) {
|
|
111
|
+
let colorMap;
|
|
112
|
+
if (colorRamp.type === 'categorical') {
|
|
113
|
+
let rawColors = [...colorRamp.colors];
|
|
114
|
+
if (rawColors.length < nClasses) {
|
|
115
|
+
rawColors = Array.from({ length: nClasses }, (_, i) => rawColors[i % rawColors.length]);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
rawColors = rawColors.slice(0, nClasses);
|
|
119
|
+
}
|
|
120
|
+
// Parse categorical colors to RGBA. D3 categorical schemes produce hex
|
|
121
|
+
// strings (#rrggbb); continuous colormaps produce rgb() strings.
|
|
122
|
+
// colorToRgba handles both formats.
|
|
123
|
+
colorMap = rawColors.map(c => typeof c === 'string' ? colorToRgba(c) : c);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
const nShades = Math.max(nClasses, 9);
|
|
127
|
+
colorMap = colormap({
|
|
128
|
+
colormap: colorRamp.name,
|
|
129
|
+
nshades: nShades,
|
|
130
|
+
format: 'rgba',
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
if (reverse) {
|
|
134
|
+
colorMap = [...colorMap].reverse();
|
|
135
|
+
}
|
|
136
|
+
// Sample nClasses colors evenly from the map.
|
|
137
|
+
const result = [];
|
|
138
|
+
for (let i = 0; i < nClasses; i++) {
|
|
139
|
+
const idx = colorRamp.type === 'categorical'
|
|
140
|
+
? i
|
|
141
|
+
: Math.round((i / (nClasses - 1)) * (colorMap.length - 1));
|
|
142
|
+
result.push(colorMap[idx]);
|
|
143
|
+
}
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
@@ -3,7 +3,7 @@ import { Dialog } from '@jupyterlab/apputils';
|
|
|
3
3
|
import { IStateDB } from '@jupyterlab/statedb';
|
|
4
4
|
import { PromiseDelegate } from '@lumino/coreutils';
|
|
5
5
|
import { Signal } from '@lumino/signaling';
|
|
6
|
-
import { SymbologyTab, SymbologyValue } from "
|
|
6
|
+
import { SymbologyTab, SymbologyValue } from "../../../types";
|
|
7
7
|
export interface ISymbologyDialogProps {
|
|
8
8
|
model: IJupyterGISModel;
|
|
9
9
|
okSignalPromise: PromiseDelegate<Signal<SymbologyWidget, null>>;
|
|
@@ -25,7 +25,8 @@ export interface ISymbologyWidgetOptions {
|
|
|
25
25
|
segmentId?: string;
|
|
26
26
|
}
|
|
27
27
|
export interface IStopRow {
|
|
28
|
-
|
|
28
|
+
id: string;
|
|
29
|
+
stop: number | string;
|
|
29
30
|
output: SymbologyValue;
|
|
30
31
|
}
|
|
31
32
|
export declare class SymbologyWidget extends Dialog<boolean> {
|
|
@@ -2,14 +2,14 @@ import { Dialog } from '@jupyterlab/apputils';
|
|
|
2
2
|
import { PromiseDelegate } from '@lumino/coreutils';
|
|
3
3
|
import { Signal } from '@lumino/signaling';
|
|
4
4
|
import React, { useEffect, useState } from 'react';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import Grammar from './Grammar';
|
|
6
|
+
import Heatmap from './Heatmap';
|
|
7
7
|
const SymbologyDialog = ({ model, okSignalPromise, isStorySegmentOverride, segmentId, }) => {
|
|
8
8
|
const [selectedLayer, setSelectedLayer] = useState(null);
|
|
9
9
|
const [componentToRender, setComponentToRender] = useState(null);
|
|
10
10
|
let LayerSymbology;
|
|
11
11
|
useEffect(() => {
|
|
12
|
-
const
|
|
12
|
+
const handleSelectedChanged = () => {
|
|
13
13
|
var _a, _b;
|
|
14
14
|
if (!((_b = (_a = model.localState) === null || _a === void 0 ? void 0 : _a.selected) === null || _b === void 0 ? void 0 : _b.value)) {
|
|
15
15
|
return;
|
|
@@ -18,10 +18,10 @@ const SymbologyDialog = ({ model, okSignalPromise, isStorySegmentOverride, segme
|
|
|
18
18
|
setSelectedLayer(currentLayer);
|
|
19
19
|
};
|
|
20
20
|
// Initial state
|
|
21
|
-
|
|
22
|
-
model.
|
|
21
|
+
handleSelectedChanged();
|
|
22
|
+
model.selectedChanged.connect(handleSelectedChanged);
|
|
23
23
|
return () => {
|
|
24
|
-
model.
|
|
24
|
+
model.selectedChanged.disconnect(handleSelectedChanged);
|
|
25
25
|
};
|
|
26
26
|
}, []);
|
|
27
27
|
useEffect(() => {
|
|
@@ -32,15 +32,15 @@ const SymbologyDialog = ({ model, okSignalPromise, isStorySegmentOverride, segme
|
|
|
32
32
|
if (!layer) {
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
-
// TODO
|
|
35
|
+
// TODO GeoTiffLayers can also be used for other layers, need a better way to determine source + layer combo
|
|
36
36
|
switch (layer.type) {
|
|
37
|
-
case 'VectorLayer':
|
|
38
|
-
case 'VectorTileLayer':
|
|
39
37
|
case 'HeatmapLayer':
|
|
40
|
-
LayerSymbology = (React.createElement(
|
|
38
|
+
LayerSymbology = (React.createElement(Heatmap, { model: model, okSignalPromise: okSignalPromise, layerId: selectedLayer, isStorySegmentOverride: isStorySegmentOverride, segmentId: segmentId }));
|
|
41
39
|
break;
|
|
42
|
-
case '
|
|
43
|
-
|
|
40
|
+
case 'VectorLayer':
|
|
41
|
+
case 'VectorTileLayer':
|
|
42
|
+
case 'GeoTiffLayer':
|
|
43
|
+
LayerSymbology = (React.createElement(Grammar, { model: model, okSignalPromise: okSignalPromise, layerId: selectedLayer, isStorySegmentOverride: isStorySegmentOverride, segmentId: segmentId }));
|
|
44
44
|
break;
|
|
45
45
|
default:
|
|
46
46
|
LayerSymbology = React.createElement("div", null, "Layer Type Not Supported");
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { IJGISLayer, IJupyterGISModel, IVectorLayer, IGeoTiffLayer } from '@jupytergis/schema';
|
|
2
|
+
import { IColorMap } from './colorRampUtils';
|
|
3
|
+
import { IStopRow } from './symbologyDialog';
|
|
4
|
+
/**
|
|
5
|
+
* Payload when saving symbology. As of #698, only `symbologyState` is persisted
|
|
6
|
+
* for vector layers — the OpenLayers FlatStyle is derived at render time from
|
|
7
|
+
* `symbologyState` via `styleBuilder.buildVectorFlatStyle`. GeoTiff layers still
|
|
8
|
+
* accept an optional `color` because their `color` field is used for band-math
|
|
9
|
+
* expressions, not symbology duplication.
|
|
10
|
+
*/
|
|
11
|
+
export interface ISymbologyPayload {
|
|
12
|
+
symbologyState: IVectorLayer['symbologyState'] | IGeoTiffLayer['symbologyState'];
|
|
13
|
+
/**
|
|
14
|
+
* Only used by GeoTiff band-math (`IGeoTiffLayer['color']`); never set for
|
|
15
|
+
* vector layers. Typed as `unknown` because the GeoTiff schema's color type
|
|
16
|
+
* is a nested numeric-array expression that doesn't round-trip cleanly
|
|
17
|
+
* through the JSON-schema generator.
|
|
18
|
+
*/
|
|
19
|
+
color?: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface ISaveSymbologyOptions {
|
|
22
|
+
model: IJupyterGISModel;
|
|
23
|
+
layerId: string;
|
|
24
|
+
isStorySegmentOverride?: boolean;
|
|
25
|
+
segmentId?: string;
|
|
26
|
+
payload: ISymbologyPayload;
|
|
27
|
+
mutateLayerBeforeSave?: (layer: any) => void;
|
|
28
|
+
}
|
|
29
|
+
export type VectorSymbologyParams = Pick<IVectorLayer, 'symbologyState' | 'color'>;
|
|
30
|
+
export type GeoTiffSymbologyParams = Pick<IGeoTiffLayer, 'symbologyState' | 'color'>;
|
|
31
|
+
/** Params-shaped object used for reading symbology (layer.parameters or segment override). */
|
|
32
|
+
export type IEffectiveSymbologyParams = VectorSymbologyParams | GeoTiffSymbologyParams;
|
|
33
|
+
/**
|
|
34
|
+
* Resolve the effective symbology params for this dialog: either the layer's
|
|
35
|
+
* parameters or the matching segment override when editing a story-segment override.
|
|
36
|
+
*/
|
|
37
|
+
export declare function getEffectiveSymbologyParams(model: IJupyterGISModel, layerId: string, layer: IJGISLayer | null | undefined, isStorySegmentOverride?: boolean, segmentId?: string): IEffectiveSymbologyParams | null;
|
|
38
|
+
export declare function saveSymbology(options: ISaveSymbologyOptions): void;
|
|
39
|
+
export declare namespace Utils {
|
|
40
|
+
const getValueColorPairs: (stops: number[], colorRamp: IColorMap, nClasses: number, reverse?: boolean) => IStopRow[];
|
|
41
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { UUID } from '@lumino/coreutils';
|
|
2
|
+
import colormap from 'colormap';
|
|
3
|
+
/**
|
|
4
|
+
* Resolve the effective symbology params for this dialog: either the layer's
|
|
5
|
+
* parameters or the matching segment override when editing a story-segment override.
|
|
6
|
+
*/
|
|
7
|
+
export function getEffectiveSymbologyParams(model, layerId, layer, isStorySegmentOverride, segmentId) {
|
|
8
|
+
var _a, _b, _c;
|
|
9
|
+
if (!(layer === null || layer === void 0 ? void 0 : layer.parameters)) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
if (!isStorySegmentOverride) {
|
|
13
|
+
return layer.parameters;
|
|
14
|
+
}
|
|
15
|
+
if (!segmentId) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
const segment = model.getLayer(segmentId);
|
|
19
|
+
const override = (_b = (_a = segment === null || segment === void 0 ? void 0 : segment.parameters) === null || _a === void 0 ? void 0 : _a.layerOverride) === null || _b === void 0 ? void 0 : _b.find((override) => override.targetLayer === layerId);
|
|
20
|
+
if (!override.symbologyState) {
|
|
21
|
+
override.symbologyState = {};
|
|
22
|
+
}
|
|
23
|
+
return (_c = override) !== null && _c !== void 0 ? _c : null;
|
|
24
|
+
}
|
|
25
|
+
export function saveSymbology(options) {
|
|
26
|
+
const { model, layerId, isStorySegmentOverride, segmentId, payload, mutateLayerBeforeSave, } = options;
|
|
27
|
+
if (!isStorySegmentOverride) {
|
|
28
|
+
const layer = model.getLayer(layerId);
|
|
29
|
+
if (!(layer === null || layer === void 0 ? void 0 : layer.parameters)) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
layer.parameters.symbologyState = payload.symbologyState;
|
|
33
|
+
if (payload.color !== undefined) {
|
|
34
|
+
layer.parameters.color = payload.color;
|
|
35
|
+
}
|
|
36
|
+
mutateLayerBeforeSave === null || mutateLayerBeforeSave === void 0 ? void 0 : mutateLayerBeforeSave(layer);
|
|
37
|
+
model.sharedModel.updateLayer(layerId, layer);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (!segmentId) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const segment = model.getLayer(segmentId);
|
|
44
|
+
if (!(segment === null || segment === void 0 ? void 0 : segment.parameters)) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (!segment.parameters.layerOverride) {
|
|
48
|
+
segment.parameters.layerOverride = [];
|
|
49
|
+
}
|
|
50
|
+
// Find the override for the target layer (from the selected layer in the dialog)
|
|
51
|
+
const targetLayerId = model.selected
|
|
52
|
+
? Object.keys(model.selected).find(id => { var _a; return id !== segmentId && ((_a = model.getLayer(id)) === null || _a === void 0 ? void 0 : _a.type) !== 'StorySegmentLayer'; })
|
|
53
|
+
: undefined;
|
|
54
|
+
if (!targetLayerId) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const overrides = segment.parameters.layerOverride;
|
|
58
|
+
let override = overrides.find((override) => override.targetLayer === targetLayerId);
|
|
59
|
+
if (!override) {
|
|
60
|
+
// Create new override entry
|
|
61
|
+
override = {
|
|
62
|
+
targetLayer: targetLayerId,
|
|
63
|
+
visible: true,
|
|
64
|
+
opacity: 1,
|
|
65
|
+
};
|
|
66
|
+
overrides.push(override);
|
|
67
|
+
}
|
|
68
|
+
override.symbologyState = payload.symbologyState;
|
|
69
|
+
if (payload.color !== undefined) {
|
|
70
|
+
override.color = payload.color;
|
|
71
|
+
}
|
|
72
|
+
model.sharedModel.updateLayer(segmentId, segment);
|
|
73
|
+
}
|
|
74
|
+
export var Utils;
|
|
75
|
+
(function (Utils) {
|
|
76
|
+
Utils.getValueColorPairs = (stops, colorRamp, nClasses, reverse = false) => {
|
|
77
|
+
const isCategorical = colorRamp.type === 'categorical';
|
|
78
|
+
let colorMap;
|
|
79
|
+
if (isCategorical) {
|
|
80
|
+
colorMap = [...colorRamp.colors];
|
|
81
|
+
if (colorMap.length < nClasses) {
|
|
82
|
+
colorMap = Array.from({ length: nClasses }, (_, i) => {
|
|
83
|
+
return colorMap[i % colorMap.length];
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
colorMap = colorMap.slice(0, nClasses);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
const nShades = Math.max(nClasses, 9);
|
|
92
|
+
colorMap = colormap({
|
|
93
|
+
colormap: colorRamp.name,
|
|
94
|
+
nshades: nShades,
|
|
95
|
+
format: 'rgba',
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (reverse) {
|
|
99
|
+
colorMap = [...colorMap].reverse();
|
|
100
|
+
}
|
|
101
|
+
const valueColorPairs = [];
|
|
102
|
+
for (let i = 0; i < nClasses; i++) {
|
|
103
|
+
const colorIndex = isCategorical
|
|
104
|
+
? i
|
|
105
|
+
: Math.round((i / (nClasses - 1)) * (colorMap.length - 1));
|
|
106
|
+
valueColorPairs.push({
|
|
107
|
+
id: UUID.uuid4(),
|
|
108
|
+
stop: stops[i],
|
|
109
|
+
output: colorMap[colorIndex],
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
return valueColorPairs;
|
|
113
|
+
};
|
|
114
|
+
})(Utils || (Utils = {}));
|
|
@@ -16,7 +16,7 @@ interface IProps {
|
|
|
16
16
|
export declare class ObjectPropertiesReact extends React.Component<IProps, IStates> {
|
|
17
17
|
constructor(props: IProps);
|
|
18
18
|
private _sharedJGISModelChanged;
|
|
19
|
-
private
|
|
19
|
+
private _onSelectedChanged;
|
|
20
20
|
render(): React.ReactNode;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UUID } from '@lumino/coreutils';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { EditForm } from "
|
|
3
|
+
import { EditForm } from "../../shared/formbuilder/editform";
|
|
4
4
|
export class ObjectPropertiesReact extends React.Component {
|
|
5
5
|
constructor(props) {
|
|
6
6
|
var _a, _b;
|
|
@@ -8,19 +8,14 @@ export class ObjectPropertiesReact extends React.Component {
|
|
|
8
8
|
this._sharedJGISModelChanged = () => {
|
|
9
9
|
this.forceUpdate();
|
|
10
10
|
};
|
|
11
|
-
this.
|
|
11
|
+
this._onSelectedChanged = () => {
|
|
12
12
|
var _a, _b;
|
|
13
|
-
|
|
14
|
-
const clientId = this.state.clientId;
|
|
15
|
-
const localState = clientId ? clients.get(clientId) : null;
|
|
13
|
+
const localState = this.props.model.localState;
|
|
16
14
|
if (localState &&
|
|
17
15
|
((_a = localState.selected) === null || _a === void 0 ? void 0 : _a.emitter) &&
|
|
18
16
|
localState.selected.emitter !== this.state.id &&
|
|
19
17
|
((_b = localState.selected) === null || _b === void 0 ? void 0 : _b.value)) {
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
if (newState) {
|
|
23
|
-
const selection = newState.selected.value;
|
|
18
|
+
const selection = localState.selected.value;
|
|
24
19
|
const selectedObjectIds = Object.keys(selection || {});
|
|
25
20
|
// Only show object properties if ONE object is selected
|
|
26
21
|
if (selection === undefined || selectedObjectIds.length !== 1) {
|
|
@@ -42,7 +37,7 @@ export class ObjectPropertiesReact extends React.Component {
|
|
|
42
37
|
selectedObject: props.selectedObject,
|
|
43
38
|
setSelectedObject: props.setSelectedObject,
|
|
44
39
|
};
|
|
45
|
-
this.props.model.
|
|
40
|
+
this.props.model.selectedChanged.connect(this._onSelectedChanged);
|
|
46
41
|
(_a = this.props.model) === null || _a === void 0 ? void 0 : _a.sharedLayersChanged.connect(this._sharedJGISModelChanged);
|
|
47
42
|
(_b = this.props.model) === null || _b === void 0 ? void 0 : _b.sharedSourcesChanged.connect(this._sharedJGISModelChanged);
|
|
48
43
|
}
|
|
@@ -2,7 +2,7 @@ import { ProcessingType, IDict, IJupyterGISModel } from '@jupytergis/schema';
|
|
|
2
2
|
import { Dialog } from '@jupyterlab/apputils';
|
|
3
3
|
import { PromiseDelegate } from '@lumino/coreutils';
|
|
4
4
|
import { Signal } from '@lumino/signaling';
|
|
5
|
-
import type { IBaseFormProps } from "
|
|
5
|
+
import type { IBaseFormProps } from "../../types";
|
|
6
6
|
export interface IProcessingFormDialogOptions extends IBaseFormProps {
|
|
7
7
|
formContext: 'update' | 'create';
|
|
8
8
|
schema: IDict;
|
|
@@ -2,8 +2,10 @@ import { Dialog } from '@jupyterlab/apputils';
|
|
|
2
2
|
import { PromiseDelegate } from '@lumino/coreutils';
|
|
3
3
|
import { Signal } from '@lumino/signaling';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { ClipRasterByExtentForm } from './forms/clipRasterByExtentForm';
|
|
6
|
+
import { DissolveForm } from './forms/dissolveProcessForm';
|
|
7
|
+
import { DefaultProcessingForm } from './forms/processingForm';
|
|
8
|
+
import { RasterizeForm } from './forms/rasterizeForm';
|
|
7
9
|
const ProcessingFormWrapper = props => {
|
|
8
10
|
var _a;
|
|
9
11
|
const [ready, setReady] = React.useState(false);
|
|
@@ -22,6 +24,12 @@ const ProcessingFormWrapper = props => {
|
|
|
22
24
|
case 'Dissolve':
|
|
23
25
|
FormComponent = DissolveForm;
|
|
24
26
|
break;
|
|
27
|
+
case 'Rasterize':
|
|
28
|
+
FormComponent = RasterizeForm;
|
|
29
|
+
break;
|
|
30
|
+
case 'ClipRasterByExtent':
|
|
31
|
+
FormComponent = ClipRasterByExtentForm;
|
|
32
|
+
break;
|
|
25
33
|
default:
|
|
26
34
|
FormComponent = DefaultProcessingForm;
|
|
27
35
|
}
|
|
@@ -32,25 +40,37 @@ const ProcessingFormWrapper = props => {
|
|
|
32
40
|
*/
|
|
33
41
|
export class ProcessingFormDialog extends Dialog {
|
|
34
42
|
constructor(options) {
|
|
35
|
-
var _a, _b, _c;
|
|
43
|
+
var _a, _b, _c, _d, _e, _f;
|
|
36
44
|
// Extract layers from the shared model
|
|
37
45
|
const layers = (_a = options.model.sharedModel.layers) !== null && _a !== void 0 ? _a : {};
|
|
38
46
|
const layerOptions = Object.keys(layers).map(layerId => ({
|
|
39
47
|
value: layerId,
|
|
40
48
|
label: layers[layerId].name,
|
|
41
49
|
}));
|
|
50
|
+
const vectorLayerOptions = Object.keys(layers)
|
|
51
|
+
.filter(layerId => layers[layerId].type === 'VectorLayer')
|
|
52
|
+
.map(layerId => ({ value: layerId, label: layers[layerId].name }));
|
|
42
53
|
// Modify schema to include layer options and layer name field
|
|
43
54
|
if (options.schema) {
|
|
44
55
|
if ((_b = options.schema.properties) === null || _b === void 0 ? void 0 : _b.inputLayer) {
|
|
45
56
|
options.schema.properties.inputLayer.enum = layerOptions.map(option => option.value);
|
|
46
57
|
options.schema.properties.inputLayer.enumNames = layerOptions.map(option => option.label);
|
|
47
58
|
}
|
|
48
|
-
|
|
49
|
-
|
|
59
|
+
if ((_c = options.schema.properties) === null || _c === void 0 ? void 0 : _c.clipLayer) {
|
|
60
|
+
const selectedInputLayer = (_d = options.sourceData) === null || _d === void 0 ? void 0 : _d.inputLayer;
|
|
61
|
+
const clipLayerOptions = selectedInputLayer
|
|
62
|
+
? vectorLayerOptions.filter(o => o.value !== selectedInputLayer)
|
|
63
|
+
: vectorLayerOptions;
|
|
64
|
+
options.schema.properties.clipLayer.enum = clipLayerOptions.map(option => option.value);
|
|
65
|
+
options.schema.properties.clipLayer.enumNames = clipLayerOptions.map(option => option.label);
|
|
66
|
+
}
|
|
67
|
+
// Ensure outputLayerName field exists in schema. Skip if the schema
|
|
68
|
+
// already produces a file output (e.g. raster outputs use outputFileName).
|
|
69
|
+
if (!((_e = options.schema.properties) === null || _e === void 0 ? void 0 : _e.outputLayerName) &&
|
|
70
|
+
!((_f = options.schema.properties) === null || _f === void 0 ? void 0 : _f.outputFileName)) {
|
|
50
71
|
options.schema.properties.outputLayerName = {
|
|
51
72
|
type: 'string',
|
|
52
|
-
title: '
|
|
53
|
-
// default: ''
|
|
73
|
+
title: 'Output Layer Name',
|
|
54
74
|
};
|
|
55
75
|
}
|
|
56
76
|
}
|
|
@@ -58,16 +78,10 @@ export class ProcessingFormDialog extends Dialog {
|
|
|
58
78
|
const jgisModel = options.model;
|
|
59
79
|
const okSignalPromise = new PromiseDelegate();
|
|
60
80
|
const formErrorSignalPromise = new PromiseDelegate();
|
|
61
|
-
// Custom syncData function to update layer name in the model
|
|
62
81
|
const syncData = (props) => {
|
|
63
|
-
if (props.outputLayerName &&
|
|
64
|
-
props.inputLayer &&
|
|
65
|
-
layers[props.inputLayer]) {
|
|
66
|
-
layers[props.inputLayer].name = props.outputLayerName;
|
|
67
|
-
}
|
|
68
82
|
options.syncData(props);
|
|
69
83
|
};
|
|
70
|
-
const body = (React.createElement("div", { style: {
|
|
84
|
+
const body = (React.createElement("div", { style: { overflowX: 'hidden', overflowY: 'auto' } },
|
|
71
85
|
React.createElement(ProcessingFormWrapper, Object.assign({}, options, { filePath: filePath, model: jgisModel, okSignalPromise: okSignalPromise, formErrorSignalPromise: formErrorSignalPromise, syncData: syncData }))));
|
|
72
86
|
super({
|
|
73
87
|
title: options.title,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IMapExtentToggleProps {
|
|
3
|
+
isActive: boolean;
|
|
4
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Checkbox that locks the extent fields to the current map viewport.
|
|
9
|
+
* When active, the children (extent fields) are visually dimmed and
|
|
10
|
+
* pointer-events are disabled so the user cannot edit them.
|
|
11
|
+
*/
|
|
12
|
+
export declare function MapExtentToggle({ isActive, onChange, children, }: IMapExtentToggleProps): React.ReactElement;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Checkbox that locks the extent fields to the current map viewport.
|
|
4
|
+
* When active, the children (extent fields) are visually dimmed and
|
|
5
|
+
* pointer-events are disabled so the user cannot edit them.
|
|
6
|
+
*/
|
|
7
|
+
export function MapExtentToggle({ isActive, onChange, children, }) {
|
|
8
|
+
return (React.createElement(React.Fragment, null,
|
|
9
|
+
React.createElement("label", { style: {
|
|
10
|
+
display: 'flex',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
gap: '6px',
|
|
13
|
+
margin: '4px 0 8px',
|
|
14
|
+
cursor: 'pointer',
|
|
15
|
+
fontSize: 'var(--jp-ui-font-size1)',
|
|
16
|
+
} },
|
|
17
|
+
React.createElement("input", { type: "checkbox", checked: isActive, onChange: onChange }),
|
|
18
|
+
"Use current map extent"),
|
|
19
|
+
React.createElement("div", { style: isActive ? { pointerEvents: 'none', opacity: 0.4 } : undefined }, children)));
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IJupyterGISModel } from '@jupytergis/schema';
|
|
2
|
+
import { Dialog } from '@jupyterlab/apputils';
|
|
3
|
+
import { Signal } from '@lumino/signaling';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import type { IBaseFormProps } from "../../../types";
|
|
6
|
+
export interface IClipRasterByExtentFormProps extends IBaseFormProps {
|
|
7
|
+
ok?: Signal<Dialog<any>, number>;
|
|
8
|
+
model: IJupyterGISModel;
|
|
9
|
+
}
|
|
10
|
+
export declare function ClipRasterByExtentForm(props: IClipRasterByExtentFormProps): React.ReactElement | null;
|