@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
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { Pool, fromUrl } from 'geotiff';
|
|
3
3
|
export var VectorClassifications;
|
|
4
4
|
(function (VectorClassifications) {
|
|
5
|
-
VectorClassifications.calculateQuantileBreaks = (values,
|
|
5
|
+
VectorClassifications.calculateQuantileBreaks = (values, nStops) => {
|
|
6
|
+
// Returns nStops anchor points: vmin, (nStops-2) interior quantile boundaries, vmax.
|
|
6
7
|
// q-th quantile of a data set:
|
|
7
8
|
// value where q fraction of data is below and (1-q) fraction is above this value
|
|
8
9
|
// Xq = (1 - r) * X_NI1 + r * X_NI2
|
|
@@ -11,54 +12,56 @@ export var VectorClassifications;
|
|
|
11
12
|
// r = q * (n+1) - (int) (q * (n+1))
|
|
12
13
|
// (indices of X: 1...n)
|
|
13
14
|
const sortedValues = [...values].sort((a, b) => a - b);
|
|
14
|
-
|
|
15
|
-
if (!sortedValues) {
|
|
15
|
+
if (sortedValues.length === 0) {
|
|
16
16
|
return [];
|
|
17
17
|
}
|
|
18
18
|
const n = sortedValues.length;
|
|
19
|
-
|
|
20
|
-
for (let i = 1; i <
|
|
19
|
+
const breaks = [sortedValues[0]]; // vmin
|
|
20
|
+
for (let i = 1; i < nStops - 1; i++) {
|
|
21
21
|
if (n > 1) {
|
|
22
|
-
const q = i /
|
|
22
|
+
const q = i / (nStops - 1);
|
|
23
23
|
const a = q * (n - 1);
|
|
24
24
|
const aa = Math.floor(a);
|
|
25
25
|
const r = a - aa;
|
|
26
|
-
xq = (1 - r) * sortedValues[aa] +
|
|
26
|
+
const xq = (1 - r) * sortedValues[aa] +
|
|
27
|
+
r * sortedValues[Math.min(aa + 1, n - 1)];
|
|
28
|
+
breaks.push(xq);
|
|
27
29
|
}
|
|
28
|
-
breaks.push(xq);
|
|
29
30
|
}
|
|
30
|
-
breaks.push(sortedValues[n - 1]);
|
|
31
|
+
breaks.push(sortedValues[n - 1]); // vmax
|
|
31
32
|
return breaks;
|
|
32
33
|
};
|
|
33
|
-
VectorClassifications.calculateEqualIntervalBreaks = (values,
|
|
34
|
+
VectorClassifications.calculateEqualIntervalBreaks = (values, nStops) => {
|
|
35
|
+
// Returns nStops evenly-spaced anchor points from vmin to vmax (linspace contract).
|
|
34
36
|
const minimum = Math.min(...values);
|
|
35
37
|
const maximum = Math.max(...values);
|
|
38
|
+
if (nStops <= 1) {
|
|
39
|
+
return [minimum];
|
|
40
|
+
}
|
|
36
41
|
const breaks = [];
|
|
37
|
-
const step = (maximum - minimum) /
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
value += step;
|
|
41
|
-
breaks.push(value);
|
|
42
|
+
const step = (maximum - minimum) / (nStops - 1);
|
|
43
|
+
for (let i = 0; i < nStops; i++) {
|
|
44
|
+
breaks.push(minimum + i * step);
|
|
42
45
|
}
|
|
43
|
-
breaks[
|
|
46
|
+
breaks[nStops - 1] = maximum; // pin to avoid floating-point drift
|
|
44
47
|
return breaks;
|
|
45
48
|
};
|
|
46
|
-
VectorClassifications.calculateJenksBreaks = (values,
|
|
49
|
+
VectorClassifications.calculateJenksBreaks = (values, nStops) => {
|
|
47
50
|
const maximum = Math.max(...values);
|
|
48
51
|
if (values.length === 0) {
|
|
49
52
|
return [];
|
|
50
53
|
}
|
|
51
|
-
if (
|
|
54
|
+
if (nStops <= 1) {
|
|
52
55
|
return [maximum];
|
|
53
56
|
}
|
|
54
|
-
if (
|
|
57
|
+
if (nStops >= values.length) {
|
|
55
58
|
return values;
|
|
56
59
|
}
|
|
57
60
|
const sample = [...values].sort((a, b) => a - b);
|
|
58
61
|
const n = sample.length;
|
|
59
|
-
const matrixOne = Array.from({ length: n + 1 }, () => Array(
|
|
60
|
-
const matrixTwo = Array.from({ length: n + 1 }, () => Array(
|
|
61
|
-
for (let i = 1; i <=
|
|
62
|
+
const matrixOne = Array.from({ length: n + 1 }, () => Array(nStops + 1).fill(0));
|
|
63
|
+
const matrixTwo = Array.from({ length: n + 1 }, () => Array(nStops + 1).fill(Number.MAX_VALUE));
|
|
64
|
+
for (let i = 1; i <= nStops; i++) {
|
|
62
65
|
matrixOne[0][i] = 1;
|
|
63
66
|
matrixOne[1][i] = 1;
|
|
64
67
|
matrixTwo[0][i] = 0.0;
|
|
@@ -80,7 +83,7 @@ export var VectorClassifications;
|
|
|
80
83
|
v = s2 - (s1 * s1) / w;
|
|
81
84
|
const i4 = i3 - 1;
|
|
82
85
|
if (i4 !== 0) {
|
|
83
|
-
for (let j = 2; j <=
|
|
86
|
+
for (let j = 2; j <= nStops; j++) {
|
|
84
87
|
if (matrixTwo[l][j] >= v + matrixTwo[i4][j - 1]) {
|
|
85
88
|
matrixOne[l][j] = i4;
|
|
86
89
|
matrixTwo[l][j] = v + matrixTwo[i4][j - 1];
|
|
@@ -91,28 +94,33 @@ export var VectorClassifications;
|
|
|
91
94
|
matrixOne[l][1] = 1;
|
|
92
95
|
matrixTwo[l][1] = v;
|
|
93
96
|
}
|
|
94
|
-
|
|
95
|
-
breaks
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
// Returns nStops anchor points: vmin, (nStops-2) natural-break upper bounds, vmax.
|
|
98
|
+
// Interior breaks use the upper bound of each class (last element before the next
|
|
99
|
+
// class starts) rather than the lower bound (first element of the next class).
|
|
100
|
+
const breaks = Array(nStops);
|
|
101
|
+
breaks[0] = sample[0]; // vmin
|
|
102
|
+
breaks[nStops - 1] = sample[n - 1]; // vmax
|
|
103
|
+
let k = n;
|
|
104
|
+
for (let j = nStops; j >= 3; j--) {
|
|
105
|
+
const id = matrixOne[k][j] - 1; // 0-based start index of class j
|
|
106
|
+
breaks[j - 2] = sample[id - 1]; // upper bound of class j-1
|
|
107
|
+
k = id;
|
|
100
108
|
}
|
|
101
109
|
return breaks;
|
|
102
110
|
};
|
|
103
|
-
VectorClassifications.calculatePrettyBreaks = (values,
|
|
111
|
+
VectorClassifications.calculatePrettyBreaks = (values, nStops) => {
|
|
104
112
|
const minimum = Math.min(...values);
|
|
105
113
|
const maximum = Math.max(...values);
|
|
106
114
|
const breaks = [];
|
|
107
|
-
if (
|
|
115
|
+
if (nStops < 1) {
|
|
108
116
|
breaks.push(maximum);
|
|
109
117
|
return breaks;
|
|
110
118
|
}
|
|
111
|
-
const minimumCount = Math.floor(
|
|
119
|
+
const minimumCount = Math.floor(nStops / 3);
|
|
112
120
|
const shrink = 0.75;
|
|
113
121
|
const highBias = 1.5;
|
|
114
122
|
const adjustBias = 0.5 + 1.5 * highBias;
|
|
115
|
-
const divisions =
|
|
123
|
+
const divisions = nStops;
|
|
116
124
|
const h = highBias;
|
|
117
125
|
let cell;
|
|
118
126
|
let small = false;
|
|
@@ -177,18 +185,14 @@ export var VectorClassifications;
|
|
|
177
185
|
}
|
|
178
186
|
const minimumBreak = start * unit;
|
|
179
187
|
const count = end - start;
|
|
180
|
-
|
|
188
|
+
// Include the pretty lower bound (i=0) so all stops snap to round values,
|
|
189
|
+
// even when minimumBreak < vmin (that is the point of pretty breaks).
|
|
190
|
+
for (let i = 0; i < count + 1; i++) {
|
|
181
191
|
breaks.push(minimumBreak + i * unit);
|
|
182
192
|
}
|
|
183
193
|
if (breaks.length === 0) {
|
|
184
194
|
return breaks;
|
|
185
195
|
}
|
|
186
|
-
if (breaks[0] < minimum) {
|
|
187
|
-
breaks[0] = minimum;
|
|
188
|
-
}
|
|
189
|
-
if (breaks[breaks.length - 1] > maximum) {
|
|
190
|
-
breaks[breaks.length - 1] = maximum;
|
|
191
|
-
}
|
|
192
196
|
if (minimum < 0.0 && maximum > 0.0) {
|
|
193
197
|
const breaksMinusZero = breaks.map(b => b - 0.0);
|
|
194
198
|
let posOfMin = 0;
|
|
@@ -201,23 +205,19 @@ export var VectorClassifications;
|
|
|
201
205
|
}
|
|
202
206
|
return breaks;
|
|
203
207
|
};
|
|
204
|
-
VectorClassifications.calculateLogarithmicBreaks = (values,
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
const logMax = Math.
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
breaks = prettyBreaks;
|
|
219
|
-
for (let i = 0; i < breaks.length; i++) {
|
|
220
|
-
breaks[i] = Math.pow(10, breaks[i]);
|
|
208
|
+
VectorClassifications.calculateLogarithmicBreaks = (values, nStops) => {
|
|
209
|
+
const positiveValues = values.filter(v => v > 0);
|
|
210
|
+
if (positiveValues.length === 0 || nStops < 1) {
|
|
211
|
+
return [];
|
|
212
|
+
}
|
|
213
|
+
const minimum = Math.min(...positiveValues);
|
|
214
|
+
const maximum = Math.max(...positiveValues);
|
|
215
|
+
const logMin = Math.log10(minimum);
|
|
216
|
+
const logMax = Math.log10(maximum);
|
|
217
|
+
const breaks = [];
|
|
218
|
+
for (let i = 0; i < nStops; i++) {
|
|
219
|
+
const t = nStops === 1 ? 0 : i / (nStops - 1);
|
|
220
|
+
breaks.push(Math.pow(10, logMin + t * (logMax - logMin)));
|
|
221
221
|
}
|
|
222
222
|
return breaks;
|
|
223
223
|
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export type RgbaColor = [number, number, number, number];
|
|
2
|
+
export declare const RGBA_INDEX: {
|
|
3
|
+
readonly r: 0;
|
|
4
|
+
readonly g: 1;
|
|
5
|
+
readonly b: 2;
|
|
6
|
+
readonly a: 3;
|
|
7
|
+
};
|
|
8
|
+
export type RgbaChannel = keyof typeof RGBA_INDEX;
|
|
9
|
+
/** OpenLayers default blue, used as the fallback color throughout symbology dialogs. */
|
|
10
|
+
export declare const DEFAULT_COLOR: RgbaColor;
|
|
11
|
+
/** Default stroke width in pixels, used as the initial value in all symbology dialogs. */
|
|
12
|
+
export declare const DEFAULT_STROKE_WIDTH = 1.25;
|
|
13
|
+
/**
|
|
14
|
+
* Returns true if `val` is a usable solid color: either a hex string or a
|
|
15
|
+
* plain [r,g,b,a] number array. Returns false for OL expression arrays like
|
|
16
|
+
* ['interpolate', ...] whose first element is a string.
|
|
17
|
+
*/
|
|
18
|
+
export declare function isColor(val: unknown): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Recursively searches an OL expression tree for the first node whose first
|
|
21
|
+
* element matches `operator` (e.g. `'interpolate'`, `'case'`).
|
|
22
|
+
* Returns the matching sub-expression, or `null` if not found.
|
|
23
|
+
*/
|
|
24
|
+
export declare function findExprNode(expr: unknown, operator: string): unknown[] | null;
|
|
25
|
+
export interface IColorMap {
|
|
26
|
+
name: ColorRampName;
|
|
27
|
+
colors: string[];
|
|
28
|
+
type: 'continuous' | 'categorical';
|
|
29
|
+
}
|
|
30
|
+
export declare const COLOR_RAMP_NAMES: readonly ["jet", "hsv", "hot", "cool", "spring", "summer", "autumn", "winter", "bone", "copper", "greys", "YiGnBu", "greens", "YiOrRd", "bluered", "RdBu", "picnic", "rainbow", "portland", "blackbody", "earth", "electric", "viridis", "inferno", "magma", "plasma", "warm", "rainbow-soft", "bathymetry", "cdom", "chlorophyll", "density", "freesurface-blue", "freesurface-red", "oxygen", "par", "phase", "salinity", "temperature", "turbidity", "velocity-blue", "velocity-green", "cubehelix", "ice", "oxy", "matter", "amp", "tempo", "rain", "topo", "balance", "delta", "curl", "diff", "tarn"];
|
|
31
|
+
export declare const COLOR_RAMP_DEFAULTS: Partial<Record<ColorRampName, number>>;
|
|
32
|
+
export declare const D3_CATEGORICAL_SCHEMES: {
|
|
33
|
+
readonly schemeCategory10: readonly string[];
|
|
34
|
+
readonly schemeAccent: readonly string[];
|
|
35
|
+
readonly schemeDark2: readonly string[];
|
|
36
|
+
readonly schemeObservable10: readonly string[];
|
|
37
|
+
readonly schemePaired: readonly string[];
|
|
38
|
+
readonly schemePastel1: readonly string[];
|
|
39
|
+
readonly schemePastel2: readonly string[];
|
|
40
|
+
readonly schemeSet1: readonly string[];
|
|
41
|
+
readonly schemeSet2: readonly string[];
|
|
42
|
+
readonly schemeSet3: readonly string[];
|
|
43
|
+
readonly schemeTableau10: readonly string[];
|
|
44
|
+
};
|
|
45
|
+
export type D3SchemeName = keyof typeof D3_CATEGORICAL_SCHEMES;
|
|
46
|
+
export type ColorRampName = (typeof COLOR_RAMP_NAMES)[number] | D3SchemeName;
|
|
47
|
+
export declare const getColorMapList: () => IColorMap[];
|
|
48
|
+
/**
|
|
49
|
+
* Hook that loads and sets color maps.
|
|
50
|
+
*/
|
|
51
|
+
export declare const useColorMapList: (setColorMaps: (maps: IColorMap[]) => void) => void;
|
|
52
|
+
export declare const getColorMap: (name: ColorRampName) => IColorMap | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Ensure we always get a valid hex string from either an RGB(A) array or string.
|
|
55
|
+
*/
|
|
56
|
+
export declare const ensureHexColorCode: (color: number[] | string) => string;
|
|
57
|
+
/**
|
|
58
|
+
* Convert any color value (hex string or [r,g,b,a] array) to RgbaColor.
|
|
59
|
+
* Alpha must be in 0-1 range; a warning is logged if it is not.
|
|
60
|
+
*/
|
|
61
|
+
export declare function colorToRgba(color: unknown): RgbaColor;
|
|
62
|
+
/**
|
|
63
|
+
* Draw a color ramp to a canvas.
|
|
64
|
+
*/
|
|
65
|
+
export declare const drawColorRamp: (canvas: HTMLCanvasElement, colorRamp: IColorMap) => void;
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import colormap from 'colormap';
|
|
13
|
+
import colorScale from 'colormap/colorScale.js';
|
|
14
|
+
import * as d3Chromatic from 'd3-scale-chromatic';
|
|
15
|
+
import { useEffect } from 'react';
|
|
16
|
+
import rawCmocean from "./components/color_ramp/cmocean.json";
|
|
17
|
+
import { objectEntries } from "../../../tools";
|
|
18
|
+
export const RGBA_INDEX = { r: 0, g: 1, b: 2, a: 3 };
|
|
19
|
+
/** OpenLayers default blue, used as the fallback color throughout symbology dialogs. */
|
|
20
|
+
export const DEFAULT_COLOR = [51, 153, 204, 1];
|
|
21
|
+
/** Default stroke width in pixels, used as the initial value in all symbology dialogs. */
|
|
22
|
+
export const DEFAULT_STROKE_WIDTH = 1.25;
|
|
23
|
+
/**
|
|
24
|
+
* Returns true if `val` is a usable solid color: either a hex string or a
|
|
25
|
+
* plain [r,g,b,a] number array. Returns false for OL expression arrays like
|
|
26
|
+
* ['interpolate', ...] whose first element is a string.
|
|
27
|
+
*/
|
|
28
|
+
export function isColor(val) {
|
|
29
|
+
if (typeof val === 'string') {
|
|
30
|
+
return /^#?[0-9A-Fa-f]{3,8}$/.test(val);
|
|
31
|
+
}
|
|
32
|
+
return Array.isArray(val) && val.length >= 3 && typeof val[0] === 'number';
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Recursively searches an OL expression tree for the first node whose first
|
|
36
|
+
* element matches `operator` (e.g. `'interpolate'`, `'case'`).
|
|
37
|
+
* Returns the matching sub-expression, or `null` if not found.
|
|
38
|
+
*/
|
|
39
|
+
export function findExprNode(expr, operator) {
|
|
40
|
+
if (!Array.isArray(expr)) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
if (expr[0] === operator) {
|
|
44
|
+
return expr;
|
|
45
|
+
}
|
|
46
|
+
for (const child of expr) {
|
|
47
|
+
const found = findExprNode(child, operator);
|
|
48
|
+
if (found) {
|
|
49
|
+
return found;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
const { __license__: _ } = rawCmocean, cmocean = __rest(rawCmocean, ["__license__"]);
|
|
55
|
+
Object.assign(colorScale, cmocean);
|
|
56
|
+
export const COLOR_RAMP_NAMES = [
|
|
57
|
+
'jet',
|
|
58
|
+
'hsv',
|
|
59
|
+
'hot',
|
|
60
|
+
'cool',
|
|
61
|
+
'spring',
|
|
62
|
+
'summer',
|
|
63
|
+
'autumn',
|
|
64
|
+
'winter',
|
|
65
|
+
'bone',
|
|
66
|
+
'copper',
|
|
67
|
+
'greys',
|
|
68
|
+
'YiGnBu',
|
|
69
|
+
'greens',
|
|
70
|
+
'YiOrRd',
|
|
71
|
+
'bluered',
|
|
72
|
+
'RdBu',
|
|
73
|
+
'picnic',
|
|
74
|
+
'rainbow',
|
|
75
|
+
'portland',
|
|
76
|
+
'blackbody',
|
|
77
|
+
'earth',
|
|
78
|
+
'electric',
|
|
79
|
+
'viridis',
|
|
80
|
+
'inferno',
|
|
81
|
+
'magma',
|
|
82
|
+
'plasma',
|
|
83
|
+
'warm',
|
|
84
|
+
'rainbow-soft',
|
|
85
|
+
'bathymetry',
|
|
86
|
+
'cdom',
|
|
87
|
+
'chlorophyll',
|
|
88
|
+
'density',
|
|
89
|
+
'freesurface-blue',
|
|
90
|
+
'freesurface-red',
|
|
91
|
+
'oxygen',
|
|
92
|
+
'par',
|
|
93
|
+
'phase',
|
|
94
|
+
'salinity',
|
|
95
|
+
'temperature',
|
|
96
|
+
'turbidity',
|
|
97
|
+
'velocity-blue',
|
|
98
|
+
'velocity-green',
|
|
99
|
+
'cubehelix',
|
|
100
|
+
'ice',
|
|
101
|
+
'oxy',
|
|
102
|
+
'matter',
|
|
103
|
+
'amp',
|
|
104
|
+
'tempo',
|
|
105
|
+
'rain',
|
|
106
|
+
'topo',
|
|
107
|
+
'balance',
|
|
108
|
+
'delta',
|
|
109
|
+
'curl',
|
|
110
|
+
'diff',
|
|
111
|
+
'tarn',
|
|
112
|
+
];
|
|
113
|
+
export const COLOR_RAMP_DEFAULTS = {
|
|
114
|
+
hsv: 11,
|
|
115
|
+
picnic: 11,
|
|
116
|
+
'rainbow-soft': 11,
|
|
117
|
+
cubehelix: 16,
|
|
118
|
+
};
|
|
119
|
+
export const D3_CATEGORICAL_SCHEMES = {
|
|
120
|
+
schemeCategory10: d3Chromatic.schemeCategory10,
|
|
121
|
+
schemeAccent: d3Chromatic.schemeAccent,
|
|
122
|
+
schemeDark2: d3Chromatic.schemeDark2,
|
|
123
|
+
schemeObservable10: d3Chromatic.schemeObservable10,
|
|
124
|
+
schemePaired: d3Chromatic.schemePaired,
|
|
125
|
+
schemePastel1: d3Chromatic.schemePastel1,
|
|
126
|
+
schemePastel2: d3Chromatic.schemePastel2,
|
|
127
|
+
schemeSet1: d3Chromatic.schemeSet1,
|
|
128
|
+
schemeSet2: d3Chromatic.schemeSet2,
|
|
129
|
+
schemeSet3: d3Chromatic.schemeSet3,
|
|
130
|
+
schemeTableau10: d3Chromatic.schemeTableau10,
|
|
131
|
+
};
|
|
132
|
+
export const getColorMapList = () => {
|
|
133
|
+
const colorMapList = [];
|
|
134
|
+
COLOR_RAMP_NAMES.forEach(name => {
|
|
135
|
+
const colorRamp = colormap({
|
|
136
|
+
colormap: name,
|
|
137
|
+
nshades: 255,
|
|
138
|
+
format: 'rgbaString',
|
|
139
|
+
});
|
|
140
|
+
colorMapList.push({ name, colors: colorRamp, type: 'continuous' });
|
|
141
|
+
});
|
|
142
|
+
objectEntries(D3_CATEGORICAL_SCHEMES).forEach(([name, colors]) => {
|
|
143
|
+
colorMapList.push({
|
|
144
|
+
name,
|
|
145
|
+
colors: colors.map(c => c.toString()),
|
|
146
|
+
type: 'categorical',
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
return colorMapList;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Hook that loads and sets color maps.
|
|
153
|
+
*/
|
|
154
|
+
export const useColorMapList = (setColorMaps) => {
|
|
155
|
+
useEffect(() => {
|
|
156
|
+
setColorMaps(getColorMapList());
|
|
157
|
+
}, [setColorMaps]);
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Get a color map by name.
|
|
161
|
+
* Caches the full list on first call for efficiency, since generating color ramps is expensive.
|
|
162
|
+
*/
|
|
163
|
+
let colorMapCache = null;
|
|
164
|
+
export const getColorMap = (name) => {
|
|
165
|
+
if (!colorMapCache) {
|
|
166
|
+
colorMapCache = getColorMapList();
|
|
167
|
+
}
|
|
168
|
+
return colorMapCache.find(c => c.name === name);
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Ensure we always get a valid hex string from either an RGB(A) array or string.
|
|
172
|
+
*/
|
|
173
|
+
export const ensureHexColorCode = (color) => {
|
|
174
|
+
if (typeof color === 'string') {
|
|
175
|
+
return color;
|
|
176
|
+
}
|
|
177
|
+
// color must be an RGBA array
|
|
178
|
+
const hex = color
|
|
179
|
+
.slice(0, -1) // Color input doesn't support hex alpha values so cut that out
|
|
180
|
+
.map((val) => {
|
|
181
|
+
return val.toString(16).padStart(2, '0');
|
|
182
|
+
})
|
|
183
|
+
.join('');
|
|
184
|
+
return '#' + hex;
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* Convert any color value (hex string or [r,g,b,a] array) to RgbaColor.
|
|
188
|
+
* Alpha must be in 0-1 range; a warning is logged if it is not.
|
|
189
|
+
*/
|
|
190
|
+
export function colorToRgba(color) {
|
|
191
|
+
if (typeof color === 'string') {
|
|
192
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(color);
|
|
193
|
+
if (!result) {
|
|
194
|
+
console.warn('Unable to parse hex color, using default');
|
|
195
|
+
return DEFAULT_COLOR;
|
|
196
|
+
}
|
|
197
|
+
return [
|
|
198
|
+
parseInt(result[1], 16),
|
|
199
|
+
parseInt(result[2], 16),
|
|
200
|
+
parseInt(result[3], 16),
|
|
201
|
+
1,
|
|
202
|
+
];
|
|
203
|
+
}
|
|
204
|
+
if (isColor(color)) {
|
|
205
|
+
const [r, g, b, a] = color;
|
|
206
|
+
const alpha = a !== null && a !== void 0 ? a : 1;
|
|
207
|
+
if (alpha > 1) {
|
|
208
|
+
console.warn(`Color alpha ${alpha} is out of 0-1 range`);
|
|
209
|
+
}
|
|
210
|
+
return [r, g, b, alpha];
|
|
211
|
+
}
|
|
212
|
+
return DEFAULT_COLOR;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Draw a color ramp to a canvas.
|
|
216
|
+
*/
|
|
217
|
+
export const drawColorRamp = (canvas, colorRamp) => {
|
|
218
|
+
const ctx = canvas.getContext('2d');
|
|
219
|
+
const colors = colorRamp.colors;
|
|
220
|
+
if (!ctx || !colors || colors.length === 0) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const width = canvas.width;
|
|
224
|
+
const height = canvas.height;
|
|
225
|
+
if (colorRamp.type === 'categorical') {
|
|
226
|
+
const blockWidth = width / colors.length;
|
|
227
|
+
colors.forEach((color, i) => {
|
|
228
|
+
ctx.beginPath();
|
|
229
|
+
ctx.fillStyle = color;
|
|
230
|
+
ctx.fillRect(i * blockWidth, 0, blockWidth, height);
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
const gradient = ctx.createLinearGradient(0, 0, width, 0);
|
|
235
|
+
const step = 1 / (colors.length - 1);
|
|
236
|
+
colors.forEach((color, i) => {
|
|
237
|
+
gradient.addColorStop(i * step, color);
|
|
238
|
+
});
|
|
239
|
+
ctx.fillStyle = gradient;
|
|
240
|
+
ctx.fillRect(0, 0, width, height);
|
|
241
|
+
}
|
|
242
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single grammar mapping row: field → scale → channels (fan-out tree).
|
|
3
|
+
* The scale preview spans all channel rows. Additional channels branch below.
|
|
4
|
+
* "when" predicates are shown as chips below the grid.
|
|
5
|
+
*/
|
|
6
|
+
import { IPredicate, IScale, StyleChannel } from '@jupytergis/schema';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
export declare function formatPredicate(pred: IPredicate): string;
|
|
9
|
+
interface IWhenAddFormProps {
|
|
10
|
+
availableFields: string[];
|
|
11
|
+
onAdd: (pred: IPredicate) => void;
|
|
12
|
+
onCancel: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const WhenAddForm: React.FC<IWhenAddFormProps>;
|
|
15
|
+
export interface IGrammarRow {
|
|
16
|
+
id: string;
|
|
17
|
+
/** Selected input field(s). Length is governed by fieldCountForScale(scale). */
|
|
18
|
+
fields?: string[];
|
|
19
|
+
scale: IScale;
|
|
20
|
+
channels: StyleChannel[];
|
|
21
|
+
when?: IPredicate[];
|
|
22
|
+
whenOp?: 'all' | 'any';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* How many input fields a scale accepts.
|
|
26
|
+
* 0 — constants (no field selector shown)
|
|
27
|
+
* 1 — all single-field scales
|
|
28
|
+
* 'any' — multi-field (expression scale, sub-channel assembly)
|
|
29
|
+
*/
|
|
30
|
+
export declare function fieldCountForScale(scheme: IScale['scheme']): 0 | 1 | 'any';
|
|
31
|
+
interface IMappingRowProps {
|
|
32
|
+
row: IGrammarRow;
|
|
33
|
+
availableFields: string[];
|
|
34
|
+
featureValues: Record<string, Set<any>>;
|
|
35
|
+
isRaster?: boolean;
|
|
36
|
+
onChange: (row: IGrammarRow) => void;
|
|
37
|
+
onDelete: () => void;
|
|
38
|
+
}
|
|
39
|
+
declare const MappingRow: React.FC<IMappingRowProps>;
|
|
40
|
+
export default MappingRow;
|