@jupytergis/base 0.15.0 → 0.16.0-alpha.1
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 +5 -0
- package/lib/commands/BaseCommandIDs.js +5 -0
- package/lib/commands/index.js +218 -48
- package/lib/commands/operationCommands.js +2 -2
- package/lib/constants.js +9 -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/{formbuilder/objectform/layer/heatmapLayerForm.d.ts → features/layers/forms/layer/geoTiffLayerForm.d.ts} +1 -1
- package/lib/{formbuilder/objectform/layer/webGlLayerForm.js → features/layers/forms/layer/geoTiffLayerForm.js} +5 -5
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/hillshadeLayerForm.js +4 -4
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/index.d.ts +1 -2
- package/lib/{formbuilder/objectform → features/layers/forms}/layer/index.js +1 -2
- 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 +1 -0
- package/lib/{formbuilder/objectform → features/layers/forms}/source/index.js +1 -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/{formbuilder/objectform → features/layers/forms}/source/wmsTileSource.d.ts +1 -1
- package/lib/{formbuilder/objectform → features/layers/forms}/source/wmsTileSource.js +6 -6
- 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 +316 -0
- package/lib/{dialogs → features/layers}/symbology/classificationModes.d.ts +6 -6
- package/lib/{dialogs → features/layers}/symbology/classificationModes.js +48 -44
- package/lib/{dialogs → features/layers}/symbology/colorRampUtils.d.ts +1 -0
- package/lib/{dialogs → features/layers}/symbology/colorRampUtils.js +12 -1
- package/lib/features/layers/symbology/components/MappingRow.d.ts +40 -0
- package/lib/features/layers/symbology/components/MappingRow.js +520 -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 +4 -3
- 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 +6 -1
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ModeSelectRow.d.ts +1 -1
- package/lib/{dialogs → features/layers}/symbology/components/color_ramp/RgbaColorPicker.js +39 -9
- package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopContainer.js +1 -1
- package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopRow.d.ts +1 -1
- package/lib/{dialogs → features/layers}/symbology/components/color_stops/StopRow.js +14 -2
- 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 +487 -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 +24 -0
- package/lib/features/layers/symbology/styleBuilder.js +158 -0
- package/lib/{dialogs → features/layers}/symbology/symbologyDialog.d.ts +1 -1
- package/lib/{dialogs → features/layers}/symbology/symbologyDialog.js +11 -13
- package/lib/{dialogs → features/layers}/symbology/symbologyUtils.d.ts +18 -10
- package/lib/{dialogs → features/layers}/symbology/symbologyUtils.js +0 -84
- 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 +5 -5
- 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.js +3 -3
- package/lib/{stacBrowser → features/stac-browser}/hooks/useStacSearch.js +1 -1
- 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 +11 -0
- package/lib/features/story/components/ListStoryStageOverlay.js +150 -0
- package/lib/features/story/components/ListStoryTitleBar.d.ts +7 -0
- package/lib/features/story/components/ListStoryTitleBar.js +20 -0
- package/lib/features/story/components/ListStoryTitleBarDesktop.d.ts +2 -0
- package/lib/features/story/components/ListStoryTitleBarDesktop.js +55 -0
- package/lib/features/story/components/ListStoryTitleBarMobile.d.ts +2 -0
- package/lib/features/story/components/ListStoryTitleBarMobile.js +41 -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/features/story/components/SpectaMobileListModeContent.d.ts +13 -0
- package/lib/features/story/components/SpectaMobileListModeContent.js +36 -0
- package/lib/features/story/components/SpectaMobileSingleModeContent.d.ts +14 -0
- package/lib/{panelview/story-maps/components/SpectaMobileView.js → features/story/components/SpectaMobileSingleModeContent.js} +4 -6
- package/lib/{panelview/story-maps → features/story}/components/SpectaMobileView.d.ts +5 -3
- package/lib/features/story/components/SpectaMobileView.js +12 -0
- 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 +19 -0
- package/lib/features/story/context/ListStoryScrollTrackContext.js +186 -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 +21 -60
- 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 +43 -0
- package/lib/features/story/types/types.js +1 -0
- package/lib/features/story/utils/computeListStoryScrollState.d.ts +14 -0
- package/lib/features/story/utils/computeListStoryScrollState.js +79 -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/components/MainViewMapSurface.d.ts +15 -0
- package/lib/mainview/components/MainViewMapSurface.js +13 -0
- package/lib/mainview/components/MainViewOverlayLayer.d.ts +9 -0
- package/lib/mainview/components/MainViewOverlayLayer.js +11 -0
- package/lib/mainview/components/MainViewSidePanels.d.ts +17 -0
- package/lib/mainview/components/MainViewSidePanels.js +10 -0
- package/lib/mainview/components/MainViewSpectaPanel.d.ts +17 -0
- package/lib/mainview/components/MainViewSpectaPanel.js +8 -0
- package/lib/mainview/components/MainViewStoryStage.d.ts +13 -0
- package/lib/mainview/components/MainViewStoryStage.js +17 -0
- package/lib/mainview/components/PositionedFloater.d.ts +10 -0
- package/lib/mainview/components/PositionedFloater.js +7 -0
- package/lib/mainview/geoJsonFeaturePatch.d.ts +9 -0
- package/lib/mainview/geoJsonFeaturePatch.js +43 -0
- package/lib/mainview/mainView.d.ts +93 -14
- package/lib/mainview/mainView.js +1216 -686
- 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 +10 -7
- 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/{formbuilder → shared/formbuilder}/objectform/components/WmsTileSourceUrlInput.js +4 -4
- 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 +1 -1
- 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 +2 -0
- package/lib/tools.js +138 -4
- package/lib/types.d.ts +6 -1
- package/lib/types.js +6 -2
- package/lib/{menus.js → workspace/menus.js} +10 -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 +63 -18
- 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 +16 -4
- package/style/base.css +124 -2
- 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 +29 -1
- 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 +1 -1
- package/style/spectaProgressBar.css +0 -1
- package/style/storyPanel.css +330 -9
- package/style/storySpectaArticleOverlay.css +129 -0
- package/style/symbologyDialog.css +522 -27
- 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 -313
- 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 -130
- package/lib/dialogs/symbology/vector_layer/types/Categorized.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/types/Categorized.js +0 -243
- package/lib/dialogs/symbology/vector_layer/types/Graduated.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/types/Graduated.js +0 -362
- package/lib/dialogs/symbology/vector_layer/types/Heatmap.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/types/Heatmap.js +0 -89
- package/lib/dialogs/symbology/vector_layer/types/SimpleSymbol.d.ts +0 -4
- package/lib/dialogs/symbology/vector_layer/types/SimpleSymbol.js +0 -120
- package/lib/formbuilder/index.d.ts +0 -4
- package/lib/formbuilder/index.js +0 -4
- package/lib/formbuilder/objectform/layer/heatmapLayerForm.js +0 -96
- 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 -210
- 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/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/ColorRampSelectorEntry.d.ts +0 -0
- /package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ColorRampSelectorEntry.js +0 -0
- /package/lib/{dialogs → features/layers}/symbology/components/color_ramp/ModeSelectRow.js +0 -0
- /package/lib/{dialogs → features/layers}/symbology/components/color_ramp/RgbaColorPicker.d.ts +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}/hooks/useStacFilterExtension.d.ts +0 -0
- /package/lib/{stacBrowser → features/stac-browser}/hooks/useStacSearch.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/components/WmsTileSourceUrlInput.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
|
@@ -0,0 +1,158 @@
|
|
|
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
|
+
/** Sentinel stop values for missing data. */
|
|
16
|
+
export const STOP_NULL = '__null__';
|
|
17
|
+
export const STOP_UNDEFINED = '__undefined__';
|
|
18
|
+
// Stop computation helpers — used by the Grammar compiler
|
|
19
|
+
/**
|
|
20
|
+
* Compute color stops for Graduated symbology from the config + feature values.
|
|
21
|
+
*/
|
|
22
|
+
export function computeGraduatedColorStops(state, numericValues) {
|
|
23
|
+
var _a, _b, _c, _d;
|
|
24
|
+
const nClasses = (_a = state.nClasses) !== null && _a !== void 0 ? _a : 9;
|
|
25
|
+
const nStops = nClasses + 1; // classification functions use anchor-point count
|
|
26
|
+
const mode = (_b = state.mode) !== null && _b !== void 0 ? _b : 'equal interval';
|
|
27
|
+
const rampName = (_c = state.colorRamp) !== null && _c !== void 0 ? _c : 'viridis';
|
|
28
|
+
const reverse = (_d = state.reverseRamp) !== null && _d !== void 0 ? _d : false;
|
|
29
|
+
const parsedVmin = state.vmin !== undefined ? state.vmin : undefined;
|
|
30
|
+
const parsedVmax = state.vmax !== undefined ? state.vmax : undefined;
|
|
31
|
+
const values = numericValues.filter(v => {
|
|
32
|
+
if (parsedVmin !== undefined && v < parsedVmin) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
if (parsedVmax !== undefined && v > parsedVmax) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
});
|
|
40
|
+
// If no feature values are in range but vmin/vmax are explicitly set (e.g.
|
|
41
|
+
// for VectorTile sources where getFeatures() is unavailable), use them as a
|
|
42
|
+
// synthetic range so stops can still be computed.
|
|
43
|
+
const effectiveValues = values.length > 0
|
|
44
|
+
? values
|
|
45
|
+
: parsedVmin !== undefined && parsedVmax !== undefined
|
|
46
|
+
? [parsedVmin, parsedVmax]
|
|
47
|
+
: [];
|
|
48
|
+
if (effectiveValues.length === 0) {
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
const dataMin = Math.min(...effectiveValues);
|
|
52
|
+
const dataMax = Math.max(...effectiveValues);
|
|
53
|
+
const rangeMin = parsedVmin !== null && parsedVmin !== void 0 ? parsedVmin : dataMin;
|
|
54
|
+
const rangeMax = parsedVmax !== null && parsedVmax !== void 0 ? parsedVmax : dataMax;
|
|
55
|
+
const rangeValues = [rangeMin, rangeMax];
|
|
56
|
+
let stops;
|
|
57
|
+
switch (mode) {
|
|
58
|
+
case 'quantile':
|
|
59
|
+
stops = VectorClassifications.calculateQuantileBreaks(effectiveValues, nStops);
|
|
60
|
+
break;
|
|
61
|
+
case 'equal interval':
|
|
62
|
+
stops = VectorClassifications.calculateEqualIntervalBreaks(rangeValues, nStops);
|
|
63
|
+
break;
|
|
64
|
+
case 'jenks':
|
|
65
|
+
stops = VectorClassifications.calculateJenksBreaks(effectiveValues, nStops);
|
|
66
|
+
break;
|
|
67
|
+
case 'pretty':
|
|
68
|
+
stops = VectorClassifications.calculatePrettyBreaks(rangeValues, nStops);
|
|
69
|
+
break;
|
|
70
|
+
case 'logarithmic':
|
|
71
|
+
stops = VectorClassifications.calculateLogarithmicBreaks(rangeValues, nStops);
|
|
72
|
+
break;
|
|
73
|
+
default:
|
|
74
|
+
stops = VectorClassifications.calculateEqualIntervalBreaks(rangeValues, nStops);
|
|
75
|
+
}
|
|
76
|
+
return mapStopsToColors(stops, rampName, stops.length, reverse);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Compute color stops for Categorized symbology from the config + feature values.
|
|
80
|
+
*/
|
|
81
|
+
export function computeCategorizedColorStops(state, featureValues) {
|
|
82
|
+
var _a, _b;
|
|
83
|
+
const rampName = (_a = state.colorRamp) !== null && _a !== void 0 ? _a : 'viridis';
|
|
84
|
+
const reverse = (_b = state.reverseRamp) !== null && _b !== void 0 ? _b : false;
|
|
85
|
+
const uniqueValues = [
|
|
86
|
+
...new Set(featureValues.map(v => v === null ? STOP_NULL : v === undefined ? STOP_UNDEFINED : v)),
|
|
87
|
+
].sort((a, b) => {
|
|
88
|
+
const aIsSentinel = a === STOP_NULL || a === STOP_UNDEFINED;
|
|
89
|
+
const bIsSentinel = b === STOP_NULL || b === STOP_UNDEFINED;
|
|
90
|
+
if (aIsSentinel && !bIsSentinel) {
|
|
91
|
+
return 1;
|
|
92
|
+
}
|
|
93
|
+
if (!aIsSentinel && bIsSentinel) {
|
|
94
|
+
return -1;
|
|
95
|
+
}
|
|
96
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
97
|
+
});
|
|
98
|
+
if (uniqueValues.length === 0) {
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
const colorRamp = getColorMapList().find(c => c.name === rampName);
|
|
102
|
+
if (!colorRamp) {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
const colors = generateColors(colorRamp, uniqueValues.length, reverse);
|
|
106
|
+
return uniqueValues.map((v, i) => ({
|
|
107
|
+
value: v,
|
|
108
|
+
color: colors[i],
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
// Color ramp helpers
|
|
112
|
+
function mapStopsToColors(stops, rampName, nClasses, reverse) {
|
|
113
|
+
const colorRamp = getColorMapList().find(c => c.name === rampName);
|
|
114
|
+
if (!colorRamp) {
|
|
115
|
+
return [];
|
|
116
|
+
}
|
|
117
|
+
const colors = generateColors(colorRamp, nClasses, reverse);
|
|
118
|
+
return stops.map((v, i) => ({
|
|
119
|
+
value: v,
|
|
120
|
+
color: colors[Math.min(i, colors.length - 1)],
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
123
|
+
function generateColors(colorRamp, nClasses, reverse) {
|
|
124
|
+
let colorMap;
|
|
125
|
+
if (colorRamp.type === 'categorical') {
|
|
126
|
+
let rawColors = [...colorRamp.colors];
|
|
127
|
+
if (rawColors.length < nClasses) {
|
|
128
|
+
rawColors = Array.from({ length: nClasses }, (_, i) => rawColors[i % rawColors.length]);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
rawColors = rawColors.slice(0, nClasses);
|
|
132
|
+
}
|
|
133
|
+
// Parse categorical colors to RGBA. D3 categorical schemes produce hex
|
|
134
|
+
// strings (#rrggbb); continuous colormaps produce rgb() strings.
|
|
135
|
+
// colorToRgba handles both formats.
|
|
136
|
+
colorMap = rawColors.map(c => typeof c === 'string' ? colorToRgba(c) : c);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
const nShades = Math.max(nClasses, 9);
|
|
140
|
+
colorMap = colormap({
|
|
141
|
+
colormap: colorRamp.name,
|
|
142
|
+
nshades: nShades,
|
|
143
|
+
format: 'rgba',
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
if (reverse) {
|
|
147
|
+
colorMap = [...colorMap].reverse();
|
|
148
|
+
}
|
|
149
|
+
// Sample nClasses colors evenly from the map.
|
|
150
|
+
const result = [];
|
|
151
|
+
for (let i = 0; i < nClasses; i++) {
|
|
152
|
+
const idx = colorRamp.type === 'categorical'
|
|
153
|
+
? i
|
|
154
|
+
: Math.round((i / (nClasses - 1)) * (colorMap.length - 1));
|
|
155
|
+
result.push(colorMap[idx]);
|
|
156
|
+
}
|
|
157
|
+
return result;
|
|
158
|
+
}
|
|
@@ -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>>;
|
|
@@ -2,14 +2,13 @@ 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 VectorRendering from './vector_layer/VectorRendering';
|
|
5
|
+
import Grammar from './Grammar';
|
|
7
6
|
const SymbologyDialog = ({ model, okSignalPromise, isStorySegmentOverride, segmentId, }) => {
|
|
8
7
|
const [selectedLayer, setSelectedLayer] = useState(null);
|
|
9
8
|
const [componentToRender, setComponentToRender] = useState(null);
|
|
10
9
|
let LayerSymbology;
|
|
11
10
|
useEffect(() => {
|
|
12
|
-
const
|
|
11
|
+
const handleSelectedChanged = () => {
|
|
13
12
|
var _a, _b;
|
|
14
13
|
if (!((_b = (_a = model.localState) === null || _a === void 0 ? void 0 : _a.selected) === null || _b === void 0 ? void 0 : _b.value)) {
|
|
15
14
|
return;
|
|
@@ -18,10 +17,10 @@ const SymbologyDialog = ({ model, okSignalPromise, isStorySegmentOverride, segme
|
|
|
18
17
|
setSelectedLayer(currentLayer);
|
|
19
18
|
};
|
|
20
19
|
// Initial state
|
|
21
|
-
|
|
22
|
-
model.
|
|
20
|
+
handleSelectedChanged();
|
|
21
|
+
model.selectedChanged.connect(handleSelectedChanged);
|
|
23
22
|
return () => {
|
|
24
|
-
model.
|
|
23
|
+
model.selectedChanged.disconnect(handleSelectedChanged);
|
|
25
24
|
};
|
|
26
25
|
}, []);
|
|
27
26
|
useEffect(() => {
|
|
@@ -32,15 +31,12 @@ const SymbologyDialog = ({ model, okSignalPromise, isStorySegmentOverride, segme
|
|
|
32
31
|
if (!layer) {
|
|
33
32
|
return;
|
|
34
33
|
}
|
|
35
|
-
// TODO
|
|
34
|
+
// TODO GeoTiffLayers can also be used for other layers, need a better way to determine source + layer combo
|
|
36
35
|
switch (layer.type) {
|
|
37
36
|
case 'VectorLayer':
|
|
38
37
|
case 'VectorTileLayer':
|
|
39
|
-
case '
|
|
40
|
-
LayerSymbology = (React.createElement(
|
|
41
|
-
break;
|
|
42
|
-
case 'WebGlLayer':
|
|
43
|
-
LayerSymbology = (React.createElement(TiffRendering, { model: model, okSignalPromise: okSignalPromise, layerId: selectedLayer, isStorySegmentOverride: isStorySegmentOverride, segmentId: segmentId }));
|
|
38
|
+
case 'GeoTiffLayer':
|
|
39
|
+
LayerSymbology = (React.createElement(Grammar, { model: model, okSignalPromise: okSignalPromise, layerId: selectedLayer, isStorySegmentOverride: isStorySegmentOverride, segmentId: segmentId }));
|
|
44
40
|
break;
|
|
45
41
|
default:
|
|
46
42
|
LayerSymbology = React.createElement("div", null, "Layer Type Not Supported");
|
|
@@ -53,7 +49,9 @@ export class SymbologyWidget extends Dialog {
|
|
|
53
49
|
constructor(options) {
|
|
54
50
|
const okSignalPromise = new PromiseDelegate();
|
|
55
51
|
const body = (React.createElement(SymbologyDialog, { model: options.model, okSignalPromise: okSignalPromise, isStorySegmentOverride: options.isStorySegmentOverride, segmentId: options.segmentId }));
|
|
56
|
-
|
|
52
|
+
const layerId = Object.keys(options.model.localState.selected.value)[0];
|
|
53
|
+
const layerName = options.model.getLayer(layerId).name;
|
|
54
|
+
super({ title: `Symbology — ${layerName}`, body });
|
|
57
55
|
this.id = 'jupytergis::symbologyWidget';
|
|
58
56
|
this.okSignal = new Signal(this);
|
|
59
57
|
okSignalPromise.resolve(this.okSignal);
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
import { IJGISLayer, IJupyterGISModel, IVectorLayer,
|
|
1
|
+
import { IJGISLayer, IJupyterGISModel, IVectorLayer, IGeoTiffLayer } from '@jupytergis/schema';
|
|
2
2
|
import { IColorMap } from './colorRampUtils';
|
|
3
3
|
import { IStopRow } from './symbologyDialog';
|
|
4
|
-
/**
|
|
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
|
+
*/
|
|
5
11
|
export interface ISymbologyPayload {
|
|
6
|
-
symbologyState: IVectorLayer['symbologyState'] |
|
|
7
|
-
|
|
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;
|
|
8
20
|
}
|
|
9
21
|
export interface ISaveSymbologyOptions {
|
|
10
22
|
model: IJupyterGISModel;
|
|
@@ -15,19 +27,15 @@ export interface ISaveSymbologyOptions {
|
|
|
15
27
|
mutateLayerBeforeSave?: (layer: any) => void;
|
|
16
28
|
}
|
|
17
29
|
export type VectorSymbologyParams = Pick<IVectorLayer, 'symbologyState' | 'color'>;
|
|
18
|
-
export type
|
|
30
|
+
export type GeoTiffSymbologyParams = Pick<IGeoTiffLayer, 'symbologyState' | 'color'>;
|
|
19
31
|
/** Params-shaped object used for reading symbology (layer.parameters or segment override). */
|
|
20
|
-
export type IEffectiveSymbologyParams = VectorSymbologyParams |
|
|
32
|
+
export type IEffectiveSymbologyParams = VectorSymbologyParams | GeoTiffSymbologyParams;
|
|
21
33
|
/**
|
|
22
34
|
* Resolve the effective symbology params for this dialog: either the layer's
|
|
23
35
|
* parameters or the matching segment override when editing a story-segment override.
|
|
24
36
|
*/
|
|
25
37
|
export declare function getEffectiveSymbologyParams(model: IJupyterGISModel, layerId: string, layer: IJGISLayer | null | undefined, isStorySegmentOverride?: boolean, segmentId?: string): IEffectiveSymbologyParams | null;
|
|
26
38
|
export declare function saveSymbology(options: ISaveSymbologyOptions): void;
|
|
27
|
-
export declare namespace VectorUtils {
|
|
28
|
-
const buildColorInfo: (layerParamers: VectorSymbologyParams) => IStopRow[];
|
|
29
|
-
const buildRadiusInfo: (layer: IJGISLayer) => IStopRow[];
|
|
30
|
-
}
|
|
31
39
|
export declare namespace Utils {
|
|
32
40
|
const getValueColorPairs: (stops: number[], colorRamp: IColorMap, nClasses: number, reverse?: boolean) => IStopRow[];
|
|
33
41
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { UUID } from '@lumino/coreutils';
|
|
2
2
|
import colormap from 'colormap';
|
|
3
|
-
import { findExprNode } from './colorRampUtils';
|
|
4
|
-
const COLOR_EXPR_STOPS_START = 3;
|
|
5
3
|
/**
|
|
6
4
|
* Resolve the effective symbology params for this dialog: either the layer's
|
|
7
5
|
* parameters or the matching segment override when editing a story-segment override.
|
|
@@ -73,88 +71,6 @@ export function saveSymbology(options) {
|
|
|
73
71
|
}
|
|
74
72
|
model.sharedModel.updateLayer(segmentId, segment);
|
|
75
73
|
}
|
|
76
|
-
export var VectorUtils;
|
|
77
|
-
(function (VectorUtils) {
|
|
78
|
-
VectorUtils.buildColorInfo = (layerParamers) => {
|
|
79
|
-
// This it to parse a color object on the layer
|
|
80
|
-
if (!(layerParamers === null || layerParamers === void 0 ? void 0 : layerParamers.color)) {
|
|
81
|
-
return [];
|
|
82
|
-
}
|
|
83
|
-
const color = layerParamers.color;
|
|
84
|
-
// If color is a string we don't need to parse
|
|
85
|
-
if (typeof color === 'string') {
|
|
86
|
-
return [];
|
|
87
|
-
}
|
|
88
|
-
const keys = ['fill-color', 'circle-fill-color'];
|
|
89
|
-
const valueColorPairs = [];
|
|
90
|
-
const seenPairs = new Set();
|
|
91
|
-
for (const key of keys) {
|
|
92
|
-
if (!color[key]) {
|
|
93
|
-
continue;
|
|
94
|
-
}
|
|
95
|
-
const interpolate = findExprNode(color[key], 'interpolate');
|
|
96
|
-
if (interpolate) {
|
|
97
|
-
// Graduated: value:color pairs starting at index 3
|
|
98
|
-
for (let i = COLOR_EXPR_STOPS_START; i < interpolate.length; i += 2) {
|
|
99
|
-
const pairKey = `${interpolate[i]}-${interpolate[i + 1]}`;
|
|
100
|
-
if (!seenPairs.has(pairKey)) {
|
|
101
|
-
valueColorPairs.push({
|
|
102
|
-
id: UUID.uuid4(),
|
|
103
|
-
stop: interpolate[i],
|
|
104
|
-
output: interpolate[i + 1],
|
|
105
|
-
});
|
|
106
|
-
seenPairs.add(pairKey);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
const caseExpr = findExprNode(color[key], 'case');
|
|
112
|
-
if (caseExpr) {
|
|
113
|
-
// Categorized: alternating [condition, color] pairs, last element is fallback
|
|
114
|
-
for (let i = 1; i < caseExpr.length - 1; i += 2) {
|
|
115
|
-
const condition = caseExpr[i];
|
|
116
|
-
const pairKey = `${condition[2]}-${caseExpr[i + 1]}`;
|
|
117
|
-
if (!seenPairs.has(pairKey)) {
|
|
118
|
-
valueColorPairs.push({
|
|
119
|
-
id: UUID.uuid4(),
|
|
120
|
-
stop: condition[2],
|
|
121
|
-
output: caseExpr[i + 1],
|
|
122
|
-
});
|
|
123
|
-
seenPairs.add(pairKey);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return valueColorPairs;
|
|
130
|
-
};
|
|
131
|
-
VectorUtils.buildRadiusInfo = (layer) => {
|
|
132
|
-
var _a;
|
|
133
|
-
if (!((_a = layer.parameters) === null || _a === void 0 ? void 0 : _a.color)) {
|
|
134
|
-
return [];
|
|
135
|
-
}
|
|
136
|
-
const color = layer.parameters.color;
|
|
137
|
-
// If color is a string we don't need to parse
|
|
138
|
-
if (typeof color === 'string') {
|
|
139
|
-
return [];
|
|
140
|
-
}
|
|
141
|
-
const stopOutputPairs = [];
|
|
142
|
-
const circleRadius = color['circle-radius'];
|
|
143
|
-
if (!Array.isArray(circleRadius) ||
|
|
144
|
-
circleRadius.length <= COLOR_EXPR_STOPS_START) {
|
|
145
|
-
return [];
|
|
146
|
-
}
|
|
147
|
-
for (let i = COLOR_EXPR_STOPS_START; i < circleRadius.length; i += 2) {
|
|
148
|
-
const obj = {
|
|
149
|
-
id: UUID.uuid4(),
|
|
150
|
-
stop: circleRadius[i],
|
|
151
|
-
output: circleRadius[i + 1],
|
|
152
|
-
};
|
|
153
|
-
stopOutputPairs.push(obj);
|
|
154
|
-
}
|
|
155
|
-
return stopOutputPairs;
|
|
156
|
-
};
|
|
157
|
-
})(VectorUtils || (VectorUtils = {}));
|
|
158
74
|
export var Utils;
|
|
159
75
|
(function (Utils) {
|
|
160
76
|
Utils.getValueColorPairs = (stops, colorRamp, nClasses, reverse = false) => {
|
|
@@ -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;
|