@jbrowse/core 5.0.0-beta.8 → 5.0.0-beta.9
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/README.md +427 -130
- package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +5 -3
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +3 -5
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +8 -9
- package/esm/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +8 -13
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +2 -1
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +3 -3
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.d.ts +8 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.js +24 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +5 -3
- package/esm/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +1 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/index.js +1 -4
- package/esm/BaseFeatureWidget/BaseFeatureDetail/jexlFilterActions.d.ts +16 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/jexlFilterActions.js +53 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/util.d.ts +0 -8
- package/esm/BaseFeatureWidget/BaseFeatureDetail/util.js +0 -16
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.js +7 -34
- package/esm/BaseFeatureWidget/configSchema.d.ts +1 -1
- package/esm/BaseFeatureWidget/formatDetails.d.ts +13 -29
- package/esm/BaseFeatureWidget/formatDetails.js +46 -79
- package/esm/BaseFeatureWidget/index.d.ts +1 -0
- package/esm/BaseFeatureWidget/stateModelFactory.d.ts +35 -28
- package/esm/BaseFeatureWidget/stateModelFactory.js +94 -102
- package/esm/BaseFeatureWidget/types.d.ts +3 -0
- package/esm/BaseFeatureWidget/util.d.ts +0 -3
- package/esm/BaseFeatureWidget/util.js +0 -17
- package/esm/PluginLoader.d.ts +14 -9
- package/esm/PluginLoader.js +34 -26
- package/esm/PluginManager.d.ts +4 -4
- package/esm/PluginManager.js +1 -1
- package/esm/ReExports/coreModules.generated.d.ts +2 -0
- package/esm/ReExports/coreModules.generated.js +492 -0
- package/esm/ReExports/coreWorkerModules.generated.d.ts +2 -0
- package/esm/ReExports/coreWorkerModules.generated.js +453 -0
- package/esm/ReExports/frameworkModules.d.ts +2 -0
- package/esm/ReExports/frameworkModules.js +67 -0
- package/esm/ReExports/frameworkShared.d.ts +12 -0
- package/esm/ReExports/frameworkShared.js +16 -0
- package/esm/ReExports/frameworkWorkerModules.generated.d.ts +2 -0
- package/esm/ReExports/frameworkWorkerModules.generated.js +130 -0
- package/esm/ReExports/list.js +493 -79
- package/esm/ReExports/modules.d.ts +1 -1
- package/esm/ReExports/modules.js +10 -87
- package/esm/ReExports/registry.d.ts +1 -0
- package/esm/ReExports/registry.js +23 -5
- package/esm/ReExports/uiStub.d.ts +2 -1
- package/esm/ReExports/uiStub.js +24 -2
- package/esm/ReExports/workerModules.js +8 -12
- package/esm/TextSearch/TextSearchManager.d.ts +3 -12
- package/esm/TextSearch/TextSearchManager.js +22 -10
- package/esm/assemblyManager/assembly.d.ts +10 -14
- package/esm/assemblyManager/assembly.js +10 -14
- package/esm/assemblyManager/assemblyConfigSchema.d.ts +23 -81
- package/esm/assemblyManager/assemblyManager.d.ts +10 -16
- package/esm/assemblyManager/assemblyManager.js +7 -10
- package/esm/assemblyManager/loadRefNameMap.js +3 -3
- package/esm/configuration/configurationSchema.d.ts +75 -31
- package/esm/configuration/configurationSchema.js +74 -40
- package/esm/configuration/configurationSchemaUnion.d.ts +39 -0
- package/esm/configuration/configurationSchemaUnion.js +59 -0
- package/esm/configuration/configurationSlot.d.ts +37 -12
- package/esm/configuration/configurationSlot.js +83 -22
- package/esm/configuration/formatAboutConfigSchema.d.ts +7 -21
- package/esm/configuration/formatDetailsConfigSchema.d.ts +11 -37
- package/esm/configuration/formatDetailsConfigSchema.js +10 -13
- package/esm/configuration/getConf.d.ts +17 -9
- package/esm/configuration/getConf.js +52 -7
- package/esm/configuration/index.d.ts +11 -4
- package/esm/configuration/index.js +7 -4
- package/esm/configuration/mergeFormatCallbacks.d.ts +6 -7
- package/esm/configuration/mergeFormatCallbacks.js +13 -10
- package/esm/configuration/readConfObject.d.ts +2 -22
- package/esm/configuration/readConfObject.js +15 -49
- package/esm/configuration/requirements.d.ts +37 -0
- package/esm/configuration/requirements.js +88 -0
- package/esm/configuration/schemaRegistry.d.ts +21 -1
- package/esm/configuration/schemaRegistry.js +11 -0
- package/esm/configuration/schemaTypes.d.ts +3 -0
- package/esm/configuration/schemaTypes.js +10 -0
- package/esm/configuration/slotFacade.d.ts +35 -4
- package/esm/configuration/slotFacade.js +96 -9
- package/esm/configuration/snapshotPreprocess.d.ts +27 -0
- package/esm/configuration/snapshotPreprocess.js +102 -0
- package/esm/configuration/types.d.ts +161 -22
- package/esm/data_adapters/BaseAdapter/BaseAdapter.d.ts +2 -2
- package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +11 -2
- package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +12 -1
- package/esm/data_adapters/BaseAdapter/featureDensity.d.ts +2 -3
- package/esm/data_adapters/BaseAdapter/featureDensity.js +2 -3
- package/esm/data_adapters/BaseAdapter/index.d.ts +22 -3
- package/esm/data_adapters/BaseAdapter/types.d.ts +3 -4
- package/esm/data_adapters/BaseAdapter/zoomRange.d.ts +10 -0
- package/esm/data_adapters/BaseAdapter/zoomRange.js +1 -0
- package/esm/data_adapters/CytobandAdapter/configSchema.d.ts +9 -11
- package/esm/data_adapters/getSequenceSubAdapter.d.ts +1 -3
- package/esm/data_adapters/getSequenceSubAdapter.js +1 -3
- package/esm/pluggableElementTypes/AdapterType.d.ts +7 -7
- package/esm/pluggableElementTypes/RpcMethodType.d.ts +1 -1
- package/esm/pluggableElementTypes/RpcMethodType.js +3 -8
- package/esm/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.d.ts +1 -2
- package/esm/pluggableElementTypes/TextSearchAdapterType.d.ts +7 -7
- package/esm/pluggableElementTypes/index.d.ts +1 -1
- package/esm/pluggableElementTypes/index.js +1 -1
- package/esm/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +17 -7
- package/esm/pluggableElementTypes/models/BaseDisplayModel.d.ts +45 -48
- package/esm/pluggableElementTypes/models/BaseDisplayModel.js +40 -36
- package/esm/pluggableElementTypes/models/BaseTrackModel.d.ts +10 -13
- package/esm/pluggableElementTypes/models/BaseTrackModel.js +6 -6
- package/esm/pluggableElementTypes/models/BaseViewModel.d.ts +37 -17
- package/esm/pluggableElementTypes/models/BaseViewModel.js +25 -10
- package/esm/pluggableElementTypes/models/InternetAccountModel.d.ts +26 -16
- package/esm/pluggableElementTypes/models/assertDisplayContract.d.ts +1 -1
- package/esm/pluggableElementTypes/models/baseConnectionConfig.d.ts +22 -18
- package/esm/pluggableElementTypes/models/baseConnectionConfig.js +5 -5
- package/esm/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +26 -31
- package/esm/pluggableElementTypes/models/baseTrackConfig.d.ts +57 -141
- package/esm/pluggableElementTypes/models/baseTrackConfig.js +22 -26
- package/esm/pluggableElementTypes/models/components/SaveTrackData.js +2 -2
- package/esm/pluggableElementTypes/models/components/fetchTrackData.d.ts +3 -4
- package/esm/pluggableElementTypes/models/components/fetchTrackData.js +3 -3
- package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.d.ts +15 -7
- package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.js +38 -29
- package/esm/pluggableElementTypes/models/index.d.ts +1 -2
- package/esm/pluggableElementTypes/models/index.js +1 -2
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/genbank.d.ts +3 -3
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/genbank.js +4 -4
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/types.d.ts +3 -3
- package/esm/rpc/BaseRpcDriver.d.ts +1 -2
- package/esm/rpc/BaseRpcDriver.js +23 -30
- package/esm/rpc/MainThreadRpcDriver.d.ts +2 -2
- package/esm/rpc/MainThreadRpcDriver.js +13 -8
- package/esm/rpc/RpcClient.d.ts +17 -6
- package/esm/rpc/RpcClient.js +42 -12
- package/esm/rpc/RpcManager.d.ts +8 -10
- package/esm/rpc/RpcManager.js +1 -1
- package/esm/rpc/RpcRegistry.d.ts +8 -2
- package/esm/rpc/RpcServer.d.ts +3 -1
- package/esm/rpc/RpcServer.js +19 -12
- package/esm/rpc/WebWorkerRpcDriver.d.ts +3 -3
- package/esm/rpc/WebWorkerRpcDriver.js +9 -47
- package/esm/rpc/byteBudget.d.ts +3 -5
- package/esm/rpc/byteBudget.js +4 -4
- package/esm/rpc/configSchema.d.ts +7 -21
- package/esm/rpc/coreRpcMethods.d.ts +1 -0
- package/esm/rpc/coreRpcMethods.js +1 -0
- package/esm/rpc/methods/CoreEncodeFeatures.d.ts +6 -5
- package/esm/rpc/methods/CoreEncodeFeatures.js +26 -31
- package/esm/rpc/methods/CoreGetEncodedFeature.d.ts +13 -0
- package/esm/rpc/methods/CoreGetEncodedFeature.js +31 -0
- package/esm/rpc/methods/CoreGetExportData.js +2 -2
- package/esm/rpc/methods/CoreGetFeatureDensity.js +2 -2
- package/esm/rpc/methods/CoreGetFeatures.js +2 -2
- package/esm/rpc/methods/CoreGetSequence.js +2 -2
- package/esm/rpc/methods/layerFeatures.d.ts +26 -0
- package/esm/rpc/methods/layerFeatures.js +40 -0
- package/esm/svg/SvgExport.js +3 -4
- package/esm/svg/SvgThemeProviders.d.ts +12 -0
- package/esm/svg/SvgThemeProviders.js +15 -0
- package/esm/svg/exportViewSvg.d.ts +32 -0
- package/esm/svg/exportViewSvg.js +13 -0
- package/esm/svg/normalizeSvgMarkup.d.ts +7 -0
- package/esm/svg/normalizeSvgMarkup.js +99 -0
- package/esm/svg/serializeSvg.d.ts +7 -0
- package/esm/svg/serializeSvg.js +11 -0
- package/esm/svg/svgReady.d.ts +8 -7
- package/esm/svg/svgReady.js +8 -7
- package/esm/svg/trackNames.d.ts +5 -5
- package/esm/svg/trackNames.js +6 -6
- package/esm/svg/wrapSvgExport.js +6 -74
- package/esm/ui/CascadingMenu.js +83 -86
- package/esm/ui/ErrorMessageStackTraceDialog.js +0 -5
- package/esm/ui/FileSelector/useInternetAccounts.d.ts +156 -96
- package/esm/ui/HoverMenu.d.ts +1 -2
- package/esm/ui/HoverMenu.js +6 -3
- package/esm/ui/JexlFilterDialog.d.ts +13 -10
- package/esm/ui/JexlFilterDialog.js +122 -49
- package/esm/ui/JexlFilterRowEditors.d.ts +15 -0
- package/esm/ui/JexlFilterRowEditors.js +90 -0
- package/esm/ui/LazyBaseTooltip.d.ts +4 -0
- package/esm/ui/LazyBaseTooltip.js +9 -0
- package/esm/ui/LoadingOverlay.js +3 -1
- package/esm/ui/MonospaceTextField.d.ts +2 -1
- package/esm/ui/MonospaceTextField.js +21 -19
- package/esm/ui/PaletteContext.d.ts +7 -9
- package/esm/ui/PaletteContext.js +24 -10
- package/esm/ui/RefNameAutocomplete/index.d.ts +1 -2
- package/esm/ui/RefNameAutocomplete/index.js +1 -1
- package/esm/ui/ScrollChrome.d.ts +6 -9
- package/esm/ui/ScrollChrome.js +5 -6
- package/esm/ui/ScrollEdgeShadow.d.ts +6 -9
- package/esm/ui/ScrollEdgeShadow.js +9 -24
- package/esm/ui/SettingsChangesTable.js +3 -3
- package/esm/ui/VerticalScrollbar.d.ts +13 -34
- package/esm/ui/VerticalScrollbar.js +29 -83
- package/esm/ui/ViewLoadingScreen.d.ts +2 -2
- package/esm/ui/ViewLoadingScreen.js +3 -3
- package/esm/ui/colorScale.d.ts +26 -1
- package/esm/ui/colorScale.js +28 -5
- package/esm/ui/colors.d.ts +49 -1
- package/esm/ui/colors.js +139 -4
- package/esm/ui/hoverBoxStyle.d.ts +14 -2
- package/esm/ui/hoverBoxStyle.js +17 -2
- package/esm/ui/index.d.ts +5 -3
- package/esm/ui/index.js +9 -7
- package/esm/ui/launchViewMenu.js +3 -3
- package/esm/ui/legendSpec.d.ts +2 -0
- package/esm/ui/legendSpec.js +3 -0
- package/esm/ui/palette.d.ts +0 -1
- package/esm/ui/palette.js +3 -27
- package/esm/ui/replaceViewAction.d.ts +1 -1
- package/esm/ui/replaceViewAction.js +1 -1
- package/esm/ui/theme.d.ts +1 -1
- package/esm/ui/theme.js +6 -40
- package/esm/ui/viewHeaderHeight.d.ts +1 -0
- package/esm/ui/viewHeaderHeight.js +1 -0
- package/esm/util/Base1DUtils.d.ts +1 -1
- package/esm/util/Base1DUtils.js +2 -2
- package/esm/util/SvgCanvas.d.ts +15 -13
- package/esm/util/SvgCanvas.js +72 -53
- package/esm/util/aborting.d.ts +39 -0
- package/esm/util/aborting.js +84 -0
- package/esm/util/adapterMetadata.d.ts +1 -1
- package/esm/util/adapterMetadata.js +6 -6
- package/esm/util/addAndShowTrack.d.ts +1 -4
- package/esm/util/addRelativeUris.d.ts +10 -2
- package/esm/util/addRelativeUris.js +22 -7
- package/esm/util/addTrackFromWidget.d.ts +2 -5
- package/esm/util/animationAllowed.d.ts +9 -0
- package/esm/util/animationAllowed.js +13 -0
- package/esm/util/applyRowResizeWheel.d.ts +10 -5
- package/esm/util/applyRowResizeWheel.js +10 -21
- package/esm/util/bandLayout.d.ts +4 -4
- package/esm/util/bandLayout.js +4 -4
- package/esm/util/bezierConnector.js +5 -4
- package/esm/util/bgzfWorkerPool.d.ts +20 -74
- package/esm/util/bgzfWorkerPool.js +20 -74
- package/esm/util/cachedSetup.d.ts +1 -1
- package/esm/util/cachedSetup.js +2 -2
- package/esm/util/categoricalField.d.ts +37 -0
- package/esm/util/categoricalField.js +52 -0
- package/esm/util/color/cssColorsLevel4.d.ts +1 -0
- package/esm/util/color/cssColorsLevel4.js +1 -0
- package/esm/util/color/index.d.ts +5 -3
- package/esm/util/color/index.js +7 -4
- package/esm/util/colorBits.d.ts +1 -2
- package/esm/util/colorBits.js +17 -39
- package/esm/util/colorRamp.d.ts +27 -1
- package/esm/util/colorRamp.js +56 -2
- package/esm/util/colorSchemes.d.ts +9 -0
- package/esm/util/colorSchemes.js +7 -0
- package/esm/util/{createStopTokenRotation.d.ts → createAbortRotation.d.ts} +11 -14
- package/esm/util/{createStopTokenRotation.js → createAbortRotation.js} +14 -26
- package/esm/util/cssColorParse.d.ts +15 -0
- package/esm/util/cssColorParse.js +53 -0
- package/esm/util/diagonalizeRegions.d.ts +2 -3
- package/esm/util/diagonalizeRegions.js +7 -12
- package/esm/util/expandLooseSearchIndex.d.ts +7 -0
- package/esm/util/expandLooseSearchIndex.js +25 -0
- package/esm/util/featureTransforms.d.ts +30 -3
- package/esm/util/featureTransforms.js +233 -36
- package/esm/util/fetchAndMaybeUnzip.js +5 -6
- package/esm/util/fetchContext.d.ts +5 -6
- package/esm/util/fetchContext.js +1 -1
- package/esm/util/fetchHub.d.ts +3 -1
- package/esm/util/fetchHub.js +2 -2
- package/esm/util/fetchSeq.d.ts +2 -3
- package/esm/util/fetchSeq.js +2 -2
- package/esm/util/fieldReader.d.ts +17 -0
- package/esm/util/fieldReader.js +62 -0
- package/esm/util/groupKeys.d.ts +75 -0
- package/esm/util/groupKeys.js +152 -0
- package/esm/util/highlights.d.ts +6 -4
- package/esm/util/highlights.js +12 -25
- package/esm/util/hooks.d.ts +1 -2
- package/esm/util/hooks.js +1 -2
- package/esm/util/index.d.ts +3 -3
- package/esm/util/index.js +4 -3
- package/esm/util/indexCandidates.js +1 -1
- package/esm/util/installFetch.d.ts +13 -10
- package/esm/util/installFetch.js +11 -10
- package/esm/util/installPrerequisiteFetch.d.ts +5 -3
- package/esm/util/installPrerequisiteFetch.js +3 -4
- package/esm/util/io/index.js +12 -12
- package/esm/util/isDataCurrent.d.ts +7 -5
- package/esm/util/isDataCurrent.js +9 -6
- package/esm/util/jexl.js +24 -21
- package/esm/util/jexlFilterRows.d.ts +89 -0
- package/esm/util/jexlFilterRows.js +252 -0
- package/esm/util/jexlFilters.d.ts +7 -5
- package/esm/util/jexlStrings.d.ts +3 -4
- package/esm/util/jexlStrings.js +2 -3
- package/esm/util/legendCandidates.d.ts +31 -27
- package/esm/util/legendCandidates.js +79 -53
- package/esm/util/localStorage.js +4 -4
- package/esm/util/markEncoding.d.ts +32 -16
- package/esm/util/markEncoding.js +177 -150
- package/esm/util/markEncodingTypes.d.ts +137 -66
- package/esm/util/mstUtils.d.ts +19 -22
- package/esm/util/mstUtils.js +19 -22
- package/esm/util/numericUtils.d.ts +7 -0
- package/esm/util/numericUtils.js +16 -0
- package/esm/util/numericValue.d.ts +14 -0
- package/esm/util/numericValue.js +34 -0
- package/esm/util/openFeatureWidget.js +1 -2
- package/esm/util/openViews.d.ts +1 -0
- package/esm/util/openViews.js +3 -3
- package/esm/util/parseLineByLine.d.ts +3 -4
- package/esm/util/parseLineByLine.js +7 -13
- package/esm/util/progress.d.ts +21 -21
- package/esm/util/progress.js +27 -26
- package/esm/util/renameRegions.d.ts +1 -2
- package/esm/util/renderToStaticMarkup.js +16 -16
- package/esm/util/rxjs.d.ts +7 -8
- package/esm/util/rxjs.js +12 -15
- package/esm/util/simpleFeature.d.ts +0 -1
- package/esm/util/svgColorProps.d.ts +11 -0
- package/esm/util/svgColorProps.js +28 -1
- package/esm/util/tabix.d.ts +3 -4
- package/esm/util/tabix.js +6 -7
- package/esm/util/thresholdScale.d.ts +54 -0
- package/esm/util/thresholdScale.js +112 -0
- package/esm/util/timeGate.d.ts +4 -5
- package/esm/util/timeGate.js +4 -5
- package/esm/util/trackConfigDelta.d.ts +22 -18
- package/esm/util/trackConfigDelta.js +40 -38
- package/esm/util/tracks.d.ts +27 -4
- package/esm/util/tracks.js +116 -43
- package/esm/util/translateTranscript.d.ts +44 -0
- package/esm/util/translateTranscript.js +102 -0
- package/esm/util/types/index.d.ts +19 -7
- package/esm/util/types/services.d.ts +1 -1
- package/esm/util/unknownSnapshotKeys.d.ts +15 -0
- package/esm/util/unknownSnapshotKeys.js +13 -0
- package/esm/util/useFeatureSequence.js +4 -4
- package/esm/util/useFetch.d.ts +3 -4
- package/esm/util/useFetch.js +5 -6
- package/esm/util/usePanelVirtualScroll.d.ts +7 -39
- package/esm/util/usePanelVirtualScroll.js +9 -40
- package/esm/util/useRowVirtualScroll.d.ts +6 -29
- package/esm/util/useRowVirtualScroll.js +8 -49
- package/esm/util/useVirtualScrollWheel.d.ts +20 -4
- package/esm/util/useVirtualScrollWheel.js +40 -84
- package/esm/util/viewHighlights.d.ts +3 -0
- package/esm/util/viewHighlights.js +5 -0
- package/esm/util/viewStatus.d.ts +24 -15
- package/esm/util/viewStatus.js +17 -0
- package/esm/util/withLaunchInput.d.ts +1 -1
- package/esm/util/withLaunchInput.js +0 -4
- package/package.json +26 -12
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.d.ts +0 -80
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.js +0 -583
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.d.ts +0 -141
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.js +0 -1116
- package/esm/ReExports/BaseFeatureDetails.d.ts +0 -1
- package/esm/ReExports/BaseFeatureDetails.js +0 -10
- package/esm/ReExports/barrelOnlyNames.d.ts +0 -5
- package/esm/ReExports/barrelOnlyNames.js +0 -63
- package/esm/ReExports/index.d.ts +0 -1
- package/esm/ReExports/index.js +0 -1
- package/esm/ReExports/publicTracks.d.ts +0 -1
- package/esm/ReExports/publicTracks.js +0 -14
- package/esm/ReExports/publicUi.d.ts +0 -4
- package/esm/ReExports/publicUi.js +0 -33
- package/esm/ReExports/publicUtil.d.ts +0 -1
- package/esm/ReExports/publicUtil.js +0 -32
- package/esm/ReExports/sharedModules.d.ts +0 -96
- package/esm/ReExports/sharedModules.js +0 -66
- package/esm/ReExports/workerNamespaceNames.d.ts +0 -11
- package/esm/ReExports/workerNamespaceNames.js +0 -275
- package/esm/pluggableElementTypes/models/HighlightsMixin.d.ts +0 -51
- package/esm/pluggableElementTypes/models/HighlightsMixin.js +0 -78
- package/esm/ui/highlightChipReveal.d.ts +0 -32
- package/esm/ui/highlightChipReveal.js +0 -39
- package/esm/util/adapterConfigKey.d.ts +0 -12
- package/esm/util/adapterConfigKey.js +0 -14
- package/esm/util/stopToken.d.ts +0 -212
- package/esm/util/stopToken.js +0 -438
package/esm/util/progress.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { StopToken, StopTokenChecker } from './stopToken.ts';
|
|
2
1
|
/**
|
|
3
2
|
* Indeterminate phase: set `label` on the status channel, run `fn`, then restore
|
|
4
|
-
* whatever phase encloses it — `''` when there is none. Pass `
|
|
3
|
+
* whatever phase encloses it — `''` when there is none. Pass `signal` and the
|
|
5
4
|
* phase becomes a cancellation boundary too: this is the labelled form of
|
|
6
|
-
* {@link
|
|
5
|
+
* {@link withAbortCheck}, so `fn` is checked on both sides of its await and
|
|
7
6
|
* neither check has to be remembered at the call site. The determinate
|
|
8
7
|
* counterpart is {@link withProgress}.
|
|
9
8
|
*
|
|
@@ -15,7 +14,7 @@ import type { StopToken, StopTokenChecker } from './stopToken.ts';
|
|
|
15
14
|
* fetching — `downloadPhase(label, location)` builds one — and a plain string
|
|
16
15
|
* everywhere else. It nests and retires identically either way.
|
|
17
16
|
*/
|
|
18
|
-
export declare function updateStatus<U>(msg: string | StatusPhase, cb: StatusCallback | undefined, fn: () => U | Promise<U>,
|
|
17
|
+
export declare function updateStatus<U>(msg: string | StatusPhase, cb: StatusCallback | undefined, fn: () => U | Promise<U>, signal?: AbortSignal): Promise<U>;
|
|
19
18
|
/**
|
|
20
19
|
* A determinate reading on the status channel: a phase label plus how far
|
|
21
20
|
* through it the operation is. The loading UI renders the message and a bar.
|
|
@@ -238,7 +237,7 @@ export declare function throttleStatusEmits(emit: StatusCallback): (status: RpcS
|
|
|
238
237
|
* of a burst, not each one in turn.
|
|
239
238
|
*
|
|
240
239
|
* Both fetch families own one: `FetchMixin` for the LGV displays, and
|
|
241
|
-
* `
|
|
240
|
+
* `createAbortRotation` for the bare-autorun fetches (dotplot, synteny)
|
|
242
241
|
* that compose no fetch mixin — and a display that has both lends the mixin's
|
|
243
242
|
* to the rotation rather than opening a second on one field. A plain function
|
|
244
243
|
* rather than shared model state because the two families declare their status
|
|
@@ -298,13 +297,13 @@ declare function downloadStatusReporter(statusCallback: StatusCallback | undefin
|
|
|
298
297
|
* which: bytes for the index readers, blocks and expected-value chunks for
|
|
299
298
|
* `@gmod/hic`. All of them report `(current, total?)`.
|
|
300
299
|
*
|
|
301
|
-
* `
|
|
300
|
+
* `signal` makes the phase a cancellation boundary, exactly as it does on
|
|
302
301
|
* {@link updateStatus} — `fn` is checked on both sides of its await.
|
|
303
302
|
*
|
|
304
303
|
* A {@link StatusPhase} `label` carries its source onto the readings too, so a
|
|
305
304
|
* download that stalls part-way through still names the file it was reading.
|
|
306
305
|
*/
|
|
307
|
-
export declare function downloadStatus<T>(label: string | StatusPhase, statusCallback: StatusCallback | undefined, fn: (onProgress: ReturnType<typeof downloadStatusReporter>) => T | Promise<T>,
|
|
306
|
+
export declare function downloadStatus<T>(label: string | StatusPhase, statusCallback: StatusCallback | undefined, fn: (onProgress: ReturnType<typeof downloadStatusReporter>) => T | Promise<T>, signal?: AbortSignal): Promise<T>;
|
|
308
307
|
/**
|
|
309
308
|
* One concurrent operation's contribution to a fan-out's shared status: what it
|
|
310
309
|
* is reporting right now, plus how much of each phase it has already finished
|
|
@@ -415,20 +414,22 @@ export declare function createStatusFanOut(statusCallback: StatusCallback | unde
|
|
|
415
414
|
*/
|
|
416
415
|
export type ProgressReporter = (current?: number) => void;
|
|
417
416
|
/**
|
|
418
|
-
* The single per-iteration callback for long
|
|
419
|
-
*
|
|
420
|
-
*
|
|
417
|
+
* The single per-iteration callback for long worker loops. The returned
|
|
418
|
+
* `report(current)` is called once per outer-loop iteration and does two jobs
|
|
419
|
+
* on each call:
|
|
421
420
|
*
|
|
422
|
-
* - checks
|
|
423
|
-
*
|
|
424
|
-
* of only at phase boundaries, and
|
|
421
|
+
* - checks `signal`, which sees only an abort that landed at the loop's last
|
|
422
|
+
* await, and
|
|
425
423
|
* - emits a {@link StatusWithProgress} through `statusCallback` at most once per
|
|
426
424
|
* `throttleMs`, so the main thread gets a live percentage without flooding
|
|
427
425
|
* the postMessage channel.
|
|
428
426
|
*
|
|
427
|
+
* `report()` never yields, so it does not make a loop interruptible. A loop
|
|
428
|
+
* that can run for seconds takes `createAbortBreakpoint` beside it.
|
|
429
|
+
*
|
|
429
430
|
* Both jobs are optional: with no `statusCallback`/`total` this is purely a
|
|
430
|
-
*
|
|
431
|
-
*
|
|
431
|
+
* cancellation tick, so a loop has exactly one inner callback whether or not
|
|
432
|
+
* it drives the progress UI.
|
|
432
433
|
*
|
|
433
434
|
* Emission is gated on wall-clock time (`throttleMs`) through {@link
|
|
434
435
|
* createTimeGate}, which thins the `Date.now()` reads as well as the emits —
|
|
@@ -436,24 +437,23 @@ export type ProgressReporter = (current?: number) => void;
|
|
|
436
437
|
* plain `for` and call `report()` once per item (it owns the counter), or
|
|
437
438
|
* `report(n)` for an explicit position.
|
|
438
439
|
*/
|
|
439
|
-
export declare function createProgressReporter({ label, total, statusCallback,
|
|
440
|
+
export declare function createProgressReporter({ label, total, statusCallback, signal, throttleMs, }: {
|
|
440
441
|
label?: string;
|
|
441
442
|
total?: number;
|
|
442
443
|
statusCallback?: (status: RpcStatus) => void;
|
|
443
|
-
|
|
444
|
-
stopTokenCheck?: StopTokenChecker;
|
|
444
|
+
signal?: AbortSignal;
|
|
445
445
|
throttleMs?: number;
|
|
446
446
|
}): ProgressReporter;
|
|
447
447
|
/**
|
|
448
448
|
* Run a measurable phase: shows `label` at 0%, hands `fn` a {@link
|
|
449
|
-
* ProgressReporter} to drive during the work, then checks the
|
|
449
|
+
* ProgressReporter} to drive during the work, then checks the signal once
|
|
450
450
|
* more and restores the enclosing phase. The determinate counterpart to
|
|
451
451
|
* `updateStatus`, and it nests the same way — see {@link openPhase}.
|
|
452
452
|
*/
|
|
453
|
-
export declare function withProgress<T>({ label, total, statusCallback,
|
|
453
|
+
export declare function withProgress<T>({ label, total, statusCallback, signal, }: {
|
|
454
454
|
label: string;
|
|
455
455
|
total: number;
|
|
456
456
|
statusCallback?: (status: RpcStatus) => void;
|
|
457
|
-
|
|
457
|
+
signal?: AbortSignal;
|
|
458
458
|
}, fn: (report: ProgressReporter) => T | Promise<T>): Promise<T>;
|
|
459
459
|
export {};
|
package/esm/util/progress.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { checkAbortSignal, withAbortCheck } from './aborting.js';
|
|
2
2
|
import { createTimeGate } from './timeGate.js';
|
|
3
3
|
const openPhases = new WeakMap();
|
|
4
4
|
/**
|
|
@@ -41,9 +41,9 @@ function openPhase(cb, label) {
|
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Indeterminate phase: set `label` on the status channel, run `fn`, then restore
|
|
44
|
-
* whatever phase encloses it — `''` when there is none. Pass `
|
|
44
|
+
* whatever phase encloses it — `''` when there is none. Pass `signal` and the
|
|
45
45
|
* phase becomes a cancellation boundary too: this is the labelled form of
|
|
46
|
-
* {@link
|
|
46
|
+
* {@link withAbortCheck}, so `fn` is checked on both sides of its await and
|
|
47
47
|
* neither check has to be remembered at the call site. The determinate
|
|
48
48
|
* counterpart is {@link withProgress}.
|
|
49
49
|
*
|
|
@@ -55,7 +55,7 @@ function openPhase(cb, label) {
|
|
|
55
55
|
* fetching — `downloadPhase(label, location)` builds one — and a plain string
|
|
56
56
|
* everywhere else. It nests and retires identically either way.
|
|
57
57
|
*/
|
|
58
|
-
export async function updateStatus(msg, cb, fn,
|
|
58
|
+
export async function updateStatus(msg, cb, fn, signal) {
|
|
59
59
|
const endPhase = openPhase(cb, msg);
|
|
60
60
|
// pessimistic, so anything leaving this scope other than a value — a throw, a
|
|
61
61
|
// cancel — retires the phase as unfinished
|
|
@@ -65,7 +65,7 @@ export async function updateStatus(msg, cb, fn, stopToken) {
|
|
|
65
65
|
// forever — the error surfaces under a stale "Downloading file"
|
|
66
66
|
try {
|
|
67
67
|
cb?.(msg);
|
|
68
|
-
const result = await
|
|
68
|
+
const result = await withAbortCheck(signal, fn);
|
|
69
69
|
outcome = 'completed';
|
|
70
70
|
return result;
|
|
71
71
|
}
|
|
@@ -341,7 +341,7 @@ export function throttleStatusEmits(emit) {
|
|
|
341
341
|
* of a burst, not each one in turn.
|
|
342
342
|
*
|
|
343
343
|
* Both fetch families own one: `FetchMixin` for the LGV displays, and
|
|
344
|
-
* `
|
|
344
|
+
* `createAbortRotation` for the bare-autorun fetches (dotplot, synteny)
|
|
345
345
|
* that compose no fetch mixin — and a display that has both lends the mixin's
|
|
346
346
|
* to the rotation rather than opening a second on one field. A plain function
|
|
347
347
|
* rather than shared model state because the two families declare their status
|
|
@@ -531,14 +531,14 @@ function downloadStatusReporter(statusCallback, label) {
|
|
|
531
531
|
* which: bytes for the index readers, blocks and expected-value chunks for
|
|
532
532
|
* `@gmod/hic`. All of them report `(current, total?)`.
|
|
533
533
|
*
|
|
534
|
-
* `
|
|
534
|
+
* `signal` makes the phase a cancellation boundary, exactly as it does on
|
|
535
535
|
* {@link updateStatus} — `fn` is checked on both sides of its await.
|
|
536
536
|
*
|
|
537
537
|
* A {@link StatusPhase} `label` carries its source onto the readings too, so a
|
|
538
538
|
* download that stalls part-way through still names the file it was reading.
|
|
539
539
|
*/
|
|
540
|
-
export async function downloadStatus(label, statusCallback, fn,
|
|
541
|
-
return updateStatus(label, statusCallback, () => fn(downloadStatusReporter(statusCallback, label)),
|
|
540
|
+
export async function downloadStatus(label, statusCallback, fn, signal) {
|
|
541
|
+
return updateStatus(label, statusCallback, () => fn(downloadStatusReporter(statusCallback, label)), signal);
|
|
542
542
|
}
|
|
543
543
|
/** How much of `message` this slot has already finished. */
|
|
544
544
|
function finished(slot, message) {
|
|
@@ -751,20 +751,22 @@ function continuesPhase(previous, status) {
|
|
|
751
751
|
reading.current >= previous.current);
|
|
752
752
|
}
|
|
753
753
|
/**
|
|
754
|
-
* The single per-iteration callback for long
|
|
755
|
-
*
|
|
756
|
-
*
|
|
754
|
+
* The single per-iteration callback for long worker loops. The returned
|
|
755
|
+
* `report(current)` is called once per outer-loop iteration and does two jobs
|
|
756
|
+
* on each call:
|
|
757
757
|
*
|
|
758
|
-
* - checks
|
|
759
|
-
*
|
|
760
|
-
* of only at phase boundaries, and
|
|
758
|
+
* - checks `signal`, which sees only an abort that landed at the loop's last
|
|
759
|
+
* await, and
|
|
761
760
|
* - emits a {@link StatusWithProgress} through `statusCallback` at most once per
|
|
762
761
|
* `throttleMs`, so the main thread gets a live percentage without flooding
|
|
763
762
|
* the postMessage channel.
|
|
764
763
|
*
|
|
764
|
+
* `report()` never yields, so it does not make a loop interruptible. A loop
|
|
765
|
+
* that can run for seconds takes `createAbortBreakpoint` beside it.
|
|
766
|
+
*
|
|
765
767
|
* Both jobs are optional: with no `statusCallback`/`total` this is purely a
|
|
766
|
-
*
|
|
767
|
-
*
|
|
768
|
+
* cancellation tick, so a loop has exactly one inner callback whether or not
|
|
769
|
+
* it drives the progress UI.
|
|
768
770
|
*
|
|
769
771
|
* Emission is gated on wall-clock time (`throttleMs`) through {@link
|
|
770
772
|
* createTimeGate}, which thins the `Date.now()` reads as well as the emits —
|
|
@@ -772,13 +774,12 @@ function continuesPhase(previous, status) {
|
|
|
772
774
|
* plain `for` and call `report()` once per item (it owns the counter), or
|
|
773
775
|
* `report(n)` for an explicit position.
|
|
774
776
|
*/
|
|
775
|
-
export function createProgressReporter({ label = '', total, statusCallback,
|
|
776
|
-
const checker = stopTokenCheck ?? createStopTokenChecker(stopToken);
|
|
777
|
+
export function createProgressReporter({ label = '', total, statusCallback, signal, throttleMs = 100, }) {
|
|
777
778
|
const emitDue = createTimeGate();
|
|
778
779
|
let count = 0;
|
|
779
780
|
return (current = count) => {
|
|
780
781
|
count = current + 1;
|
|
781
|
-
|
|
782
|
+
checkAbortSignal(signal);
|
|
782
783
|
if (statusCallback !== undefined &&
|
|
783
784
|
total !== undefined &&
|
|
784
785
|
emitDue(throttleMs)) {
|
|
@@ -788,29 +789,29 @@ export function createProgressReporter({ label = '', total, statusCallback, stop
|
|
|
788
789
|
}
|
|
789
790
|
/**
|
|
790
791
|
* Run a measurable phase: shows `label` at 0%, hands `fn` a {@link
|
|
791
|
-
* ProgressReporter} to drive during the work, then checks the
|
|
792
|
+
* ProgressReporter} to drive during the work, then checks the signal once
|
|
792
793
|
* more and restores the enclosing phase. The determinate counterpart to
|
|
793
794
|
* `updateStatus`, and it nests the same way — see {@link openPhase}.
|
|
794
795
|
*/
|
|
795
|
-
export async function withProgress({ label, total, statusCallback,
|
|
796
|
+
export async function withProgress({ label, total, statusCallback, signal, }, fn) {
|
|
796
797
|
const report = createProgressReporter({
|
|
797
798
|
label,
|
|
798
799
|
total,
|
|
799
800
|
statusCallback,
|
|
800
|
-
|
|
801
|
+
signal,
|
|
801
802
|
});
|
|
802
803
|
const endPhase = openPhase(statusCallback, label);
|
|
803
804
|
// pessimistic for the same reason as `updateStatus`: a phase that leaves this
|
|
804
805
|
// scope any way other than returning did not finish its work
|
|
805
806
|
let outcome = 'failed';
|
|
806
807
|
try {
|
|
807
|
-
// inside the try, because `report` checks the
|
|
808
|
-
// so throws here on
|
|
808
|
+
// inside the try, because `report` checks the signal before it emits and
|
|
809
|
+
// so throws here on one already aborted. Outside, that threw past the
|
|
809
810
|
// close and left the phase open on the channel — a slot whose last word is a
|
|
810
811
|
// label is one `aggregateStatus` counts as in flight for the rest of the
|
|
811
812
|
// batch.
|
|
812
813
|
report(0);
|
|
813
|
-
const result = await
|
|
814
|
+
const result = await withAbortCheck(signal, () => fn(report));
|
|
814
815
|
outcome = 'completed';
|
|
815
816
|
return result;
|
|
816
817
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { StatusCallback } from './progress.ts';
|
|
2
|
-
import type { StopToken } from './stopToken.ts';
|
|
3
2
|
import type { AssemblyManager, Region } from './types/index.ts';
|
|
4
3
|
import type { Region as MUIRegion } from './types/mst.ts';
|
|
5
4
|
import type { Instance } from '@jbrowse/mobx-state-tree';
|
|
@@ -9,7 +8,7 @@ export declare function renameRegionIfNeeded(refNameMap: Record<string, string>
|
|
|
9
8
|
export declare function renameRegionsIfNeeded<ARGTYPE extends {
|
|
10
9
|
assemblyName?: string;
|
|
11
10
|
regions?: Region[];
|
|
12
|
-
|
|
11
|
+
signal?: AbortSignal;
|
|
13
12
|
adapterConfig: Record<string, unknown>;
|
|
14
13
|
sessionId: string;
|
|
15
14
|
statusCallback?: StatusCallback;
|
|
@@ -14,8 +14,10 @@ import { createRoot } from 'react-dom/client';
|
|
|
14
14
|
// (packages/lib/src/renderToStaticMarkup.ts there) -- because a rendering
|
|
15
15
|
// library asking its host for a renderer was the coupling worth removing, and
|
|
16
16
|
// because react-dom is a host external for a plugin anyway, so it costs them a
|
|
17
|
-
// few hundred bytes rather than a duplicate react.
|
|
18
|
-
//
|
|
17
|
+
// few hundred bytes rather than a duplicate react. Re-exporting it from the
|
|
18
|
+
// barrel would also stub `@jbrowse/core/util` in the worker, since the
|
|
19
|
+
// generator stubs a module whose graph reaches react-dom; workerModules.test.ts
|
|
20
|
+
// fails on that.
|
|
19
21
|
//
|
|
20
22
|
// https://react.dev/reference/react-dom/server/renderToString#removing-rendertostring-from-the-client-code
|
|
21
23
|
export function renderToStaticMarkup(node) {
|
|
@@ -25,13 +27,23 @@ export function renderToStaticMarkup(node) {
|
|
|
25
27
|
// jbrowse-img) loads @emotion/react before `document` exists, so its default
|
|
26
28
|
// cache context is null — provide one explicitly here.
|
|
27
29
|
const cache = createCache({ key: 'css' });
|
|
28
|
-
|
|
30
|
+
// a client root reports a render error and unmounts, so without this the
|
|
31
|
+
// export is an empty string its caller writes as a file
|
|
32
|
+
const uncaught = [];
|
|
33
|
+
const root = createRoot(div, {
|
|
34
|
+
onUncaughtError: error => {
|
|
35
|
+
uncaught.push(error);
|
|
36
|
+
},
|
|
37
|
+
});
|
|
29
38
|
let html;
|
|
30
39
|
try {
|
|
31
40
|
// eslint-disable-next-line @eslint-react/dom-no-flush-sync
|
|
32
41
|
flushSync(() => {
|
|
33
42
|
root.render(React.createElement(CacheProvider, { value: cache }, node));
|
|
34
43
|
});
|
|
44
|
+
if (uncaught.length > 0) {
|
|
45
|
+
throw uncaught[0];
|
|
46
|
+
}
|
|
35
47
|
html = div.innerHTML;
|
|
36
48
|
}
|
|
37
49
|
finally {
|
|
@@ -44,17 +56,5 @@ export function renderToStaticMarkup(node) {
|
|
|
44
56
|
// once the markup is a string, which no longer depends on the DOM.
|
|
45
57
|
root.unmount();
|
|
46
58
|
}
|
|
47
|
-
|
|
48
|
-
// does not include rgba() — alpha belongs in a separate fill-opacity /
|
|
49
|
-
// stroke-opacity. Illustrator and older Inkscape drop an element whose fill
|
|
50
|
-
// they cannot parse, so the alpha is stripped rather than left to break the
|
|
51
|
-
// whole shape. It is *dropped*, not converted, so a translucent color exports
|
|
52
|
-
// fully opaque: components that need transparency to survive set a separate
|
|
53
|
-
// opacity attribute instead (`CrossHatches`, `RowSeparatorLines`).
|
|
54
|
-
//
|
|
55
|
-
// Rewriting `fill="rgba(r,g,b,a)"` into `fill="rgb(r,g,b)" fill-opacity="a"`
|
|
56
|
-
// would preserve the appearance and let those two drop their workarounds, but
|
|
57
|
-
// it changes the pixels of every export carrying an rgba color, so it needs a
|
|
58
|
-
// visual pass before the snapshots are regenerated.
|
|
59
|
-
return html.replaceAll(/\brgba\((.+?),[^,]+?\)/g, 'rgb($1)');
|
|
59
|
+
return html;
|
|
60
60
|
}
|
package/esm/util/rxjs.d.ts
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import type { StopToken } from './stopToken.ts';
|
|
3
2
|
import type { Observer } from 'rxjs';
|
|
4
3
|
/**
|
|
5
4
|
* Wrapper for rxjs Observable.create with improved error handling and aborting
|
|
6
5
|
* support.
|
|
7
6
|
*
|
|
8
|
-
* A `
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
7
|
+
* A `signal` errors the subscriber with an abort error the moment it aborts,
|
|
8
|
+
* rather than waiting for `func` to finish work whose result is already
|
|
9
|
+
* discarded. The fetch paths filter abort errors out (`isAbortException`) so a
|
|
10
|
+
* cancel does not surface as a track error. It cannot interrupt `func` itself
|
|
11
|
+
* — a body doing long synchronous work still needs its own `checkAbortSignal`
|
|
12
|
+
* ticks — but it does stop delivery downstream.
|
|
14
13
|
*
|
|
15
14
|
* @param func - observer function, could be async
|
|
16
15
|
*/
|
|
17
|
-
export declare function ObservableCreate<T>(func: (arg: Observer<T>) => void | Promise<void>,
|
|
16
|
+
export declare function ObservableCreate<T>(func: (arg: Observer<T>) => void | Promise<void>, signal?: AbortSignal): Observable<T>;
|
|
18
17
|
/**
|
|
19
18
|
* Subscribe to an observable and resolve when it completes, running `onNext` per
|
|
20
19
|
* item as it arrives — the streaming shape for parsing items out of a feature
|
package/esm/util/rxjs.js
CHANGED
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { stopTokenSignal } from './stopToken.js';
|
|
3
2
|
/**
|
|
4
3
|
* Wrapper for rxjs Observable.create with improved error handling and aborting
|
|
5
4
|
* support.
|
|
6
5
|
*
|
|
7
|
-
* A `
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
6
|
+
* A `signal` errors the subscriber with an abort error the moment it aborts,
|
|
7
|
+
* rather than waiting for `func` to finish work whose result is already
|
|
8
|
+
* discarded. The fetch paths filter abort errors out (`isAbortException`) so a
|
|
9
|
+
* cancel does not surface as a track error. It cannot interrupt `func` itself
|
|
10
|
+
* — a body doing long synchronous work still needs its own `checkAbortSignal`
|
|
11
|
+
* ticks — but it does stop delivery downstream.
|
|
13
12
|
*
|
|
14
13
|
* @param func - observer function, could be async
|
|
15
14
|
*/
|
|
16
|
-
export function ObservableCreate(func,
|
|
15
|
+
export function ObservableCreate(func, signal) {
|
|
17
16
|
return new Observable((observer) => {
|
|
18
|
-
const { signal, dispose } = stopTokenSignal(stopToken);
|
|
19
17
|
const stop = () => {
|
|
20
|
-
observer.error(signal
|
|
18
|
+
observer.error(signal?.reason);
|
|
21
19
|
};
|
|
22
|
-
if (signal
|
|
23
|
-
//
|
|
20
|
+
if (signal?.aborted) {
|
|
21
|
+
// aborted before subscribe: no 'abort' event is coming
|
|
24
22
|
stop();
|
|
25
23
|
}
|
|
26
24
|
else {
|
|
27
|
-
signal
|
|
25
|
+
signal?.addEventListener('abort', stop);
|
|
28
26
|
try {
|
|
29
27
|
const ret = func(observer);
|
|
30
28
|
if (ret?.catch) {
|
|
@@ -38,8 +36,7 @@ export function ObservableCreate(func, stopToken) {
|
|
|
38
36
|
}
|
|
39
37
|
}
|
|
40
38
|
return () => {
|
|
41
|
-
signal
|
|
42
|
-
dispose();
|
|
39
|
+
signal?.removeEventListener('abort', stop);
|
|
43
40
|
};
|
|
44
41
|
});
|
|
45
42
|
}
|
|
@@ -5,3 +5,14 @@ export declare function getStrokeProps(str: string): {
|
|
|
5
5
|
export declare function getFillProps(str: string): {
|
|
6
6
|
[x: string]: string | number;
|
|
7
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* A paint value split into the `rgb()` an SVG 1.1 `<color>` can carry and the
|
|
10
|
+
* alpha it cannot, for a separate `*-opacity`. Illustrator and older Inkscape
|
|
11
|
+
* drop an element whose fill they cannot parse, so `rgba()`, `hsl()`, `#rgba`
|
|
12
|
+
* and `transparent` have to be split before they reach a file. Undefined for a
|
|
13
|
+
* value that is already an SVG color, `none` or a `url()`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function splitPaintAlpha(value: string): {
|
|
16
|
+
color: string;
|
|
17
|
+
opacity: number;
|
|
18
|
+
} | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { formatHEX, getAlpha, newColor, parseCssColorOr } from './colorBits.js';
|
|
1
|
+
import { formatHEX, getAlpha, getBlue, getGreen, getRed, newColor, parseCssColorOr, } from './colorBits.js';
|
|
2
2
|
// Matches colord()'s fallback for unparsable input.
|
|
3
3
|
const FALLBACK = newColor(0, 0, 0, 255);
|
|
4
4
|
// Works on the packed Color directly rather than via colord(): these run per
|
|
@@ -26,3 +26,30 @@ export function getStrokeProps(str) {
|
|
|
26
26
|
export function getFillProps(str) {
|
|
27
27
|
return svgColorProps(str, 'fill', 'fillOpacity');
|
|
28
28
|
}
|
|
29
|
+
// four channels, comma- or slash-separated, so a three-channel `rgb(4,5,6)`
|
|
30
|
+
// never reads its blue as an alpha
|
|
31
|
+
const FUNCTIONAL_ALPHA = /^(?:rgb|hsl)a?\((?:[^,/)]+,){3}\s*([\d.]+)(%?)\s*\)$|^(?:rgb|hsl)a?\([^,/)]+\/\s*([\d.]+)(%?)\s*\)$/i;
|
|
32
|
+
const HEX_ALPHA = /^#(?:[\da-f]{4}|[\da-f]{8})$/i;
|
|
33
|
+
const NOT_SVG_COLOR = /^(?:rgba|hsla?)\(|^transparent$/i;
|
|
34
|
+
/**
|
|
35
|
+
* A paint value split into the `rgb()` an SVG 1.1 `<color>` can carry and the
|
|
36
|
+
* alpha it cannot, for a separate `*-opacity`. Illustrator and older Inkscape
|
|
37
|
+
* drop an element whose fill they cannot parse, so `rgba()`, `hsl()`, `#rgba`
|
|
38
|
+
* and `transparent` have to be split before they reach a file. Undefined for a
|
|
39
|
+
* value that is already an SVG color, `none` or a `url()`.
|
|
40
|
+
*/
|
|
41
|
+
export function splitPaintAlpha(value) {
|
|
42
|
+
const m = FUNCTIONAL_ALPHA.exec(value);
|
|
43
|
+
if (!m && !HEX_ALPHA.test(value) && !NOT_SVG_COLOR.test(value)) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
const c = parseCssColorOr(value, FALLBACK);
|
|
47
|
+
const digits = m?.[1] ?? m?.[3];
|
|
48
|
+
const percent = (m?.[2] ?? m?.[4]) === '%';
|
|
49
|
+
return {
|
|
50
|
+
color: `rgb(${getRed(c)},${getGreen(c)},${getBlue(c)})`,
|
|
51
|
+
opacity: digits === undefined
|
|
52
|
+
? getAlpha(c) / 255
|
|
53
|
+
: Math.min(1, Number(digits) / (percent ? 100 : 1)),
|
|
54
|
+
};
|
|
55
|
+
}
|
package/esm/util/tabix.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { StatusCallback } from './progress.ts';
|
|
2
|
-
import type { StopToken } from './stopToken.ts';
|
|
3
2
|
/**
|
|
4
3
|
* A raw tabix line paired with the metadata the GFF3/GTF adapters need before
|
|
5
4
|
* parsing: `offset` (the tabix byte offset) mints a stable per-feature id that
|
|
@@ -34,13 +33,13 @@ interface TabixLineSource {
|
|
|
34
33
|
* label, capturing each line's byte offset, indexed start/end, and feature type
|
|
35
34
|
* into a {@link TabixLine}. Shared by the GFF3 and GTF tabix adapters.
|
|
36
35
|
*
|
|
37
|
-
* The
|
|
36
|
+
* The signal becomes the read's `AbortSignal`, so a cancelled fetch drops
|
|
38
37
|
* its block reads at the socket instead of downloading them and discarding the
|
|
39
38
|
* lines. @gmod/tabix aborts a block shared between callers only once every
|
|
40
39
|
* joined caller has aborted (`AggregateAbortController`), so this can't cancel a
|
|
41
40
|
* chunk another region still needs.
|
|
42
41
|
*/
|
|
43
|
-
export declare function readTabixLines(gff: TabixLineSource, refName: string, start: number, end: number, statusCallback?: StatusCallback,
|
|
42
|
+
export declare function readTabixLines(gff: TabixLineSource, refName: string, start: number, end: number, statusCallback?: StatusCallback, signal?: AbortSignal): Promise<TabixLine[]>;
|
|
44
43
|
/**
|
|
45
44
|
* Read a region's tabix lines, then — if any feature found there extends past
|
|
46
45
|
* the query — read the overhang on either side, so a parent line's children (a
|
|
@@ -84,7 +83,7 @@ export declare function readTabixLinesRedispatched(file: TabixLineSource, query:
|
|
|
84
83
|
end: number;
|
|
85
84
|
}, expands: (line: TabixLine) => boolean, opts?: {
|
|
86
85
|
statusCallback?: StatusCallback;
|
|
87
|
-
|
|
86
|
+
signal?: AbortSignal;
|
|
88
87
|
}): Promise<TabixLine[]>;
|
|
89
88
|
/**
|
|
90
89
|
* Minimal structural view of the `@gmod/tabix` call a header read needs, kept
|
package/esm/util/tabix.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createStatusFanOut, downloadStatus } from './progress.js';
|
|
2
2
|
import { calculateRedispatchRange } from './range.js';
|
|
3
|
-
import { withStopTokenSignal } from './stopToken.js';
|
|
4
3
|
/**
|
|
5
4
|
* Read the feature type (column 3) from a raw GFF3/GTF line without a full
|
|
6
5
|
* split. Used only to classify a line for redispatch.
|
|
@@ -18,15 +17,15 @@ function extractType(line) {
|
|
|
18
17
|
* label, capturing each line's byte offset, indexed start/end, and feature type
|
|
19
18
|
* into a {@link TabixLine}. Shared by the GFF3 and GTF tabix adapters.
|
|
20
19
|
*
|
|
21
|
-
* The
|
|
20
|
+
* The signal becomes the read's `AbortSignal`, so a cancelled fetch drops
|
|
22
21
|
* its block reads at the socket instead of downloading them and discarding the
|
|
23
22
|
* lines. @gmod/tabix aborts a block shared between callers only once every
|
|
24
23
|
* joined caller has aborted (`AggregateAbortController`), so this can't cancel a
|
|
25
24
|
* chunk another region still needs.
|
|
26
25
|
*/
|
|
27
|
-
export function readTabixLines(gff, refName, start, end, statusCallback,
|
|
26
|
+
export function readTabixLines(gff, refName, start, end, statusCallback, signal) {
|
|
28
27
|
const lines = [];
|
|
29
|
-
return
|
|
28
|
+
return downloadStatus('Downloading features', statusCallback, onProgress => gff.getLines(refName, start, end, {
|
|
30
29
|
lineCallback: (line, offset, s, e) => {
|
|
31
30
|
lines.push({
|
|
32
31
|
line,
|
|
@@ -38,7 +37,7 @@ export function readTabixLines(gff, refName, start, end, statusCallback, stopTok
|
|
|
38
37
|
},
|
|
39
38
|
onProgress,
|
|
40
39
|
signal,
|
|
41
|
-
}))
|
|
40
|
+
})).then(() => lines);
|
|
42
41
|
}
|
|
43
42
|
/**
|
|
44
43
|
* Read a region's tabix lines, then — if any feature found there extends past
|
|
@@ -81,10 +80,10 @@ export async function readTabixLinesRedispatched(file,
|
|
|
81
80
|
// the region's locus only — kept structural, like TabixLineSource above, so
|
|
82
81
|
// this module stays free of the `types` barrel and its MST models
|
|
83
82
|
query, expands, opts = {}) {
|
|
84
|
-
const { statusCallback,
|
|
83
|
+
const { statusCallback, signal } = opts;
|
|
85
84
|
// `cb` is not optional: each read decides where it reports, and the flanks
|
|
86
85
|
// report somewhere the first read does not
|
|
87
|
-
const read = (start, end, cb) => readTabixLines(file, query.refName, start, end, cb,
|
|
86
|
+
const read = (start, end, cb) => readTabixLines(file, query.refName, start, end, cb, signal);
|
|
88
87
|
const lines = await read(query.start, query.end, statusCallback);
|
|
89
88
|
const redispatch = calculateRedispatchRange(lines, expands, query.start, query.end);
|
|
90
89
|
if (redispatch) {
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { CategoricalField } from './categoricalField.ts';
|
|
2
|
+
/**
|
|
3
|
+
* #api
|
|
4
|
+
* A domain written as strings — the shared `domain` slot is a `stringArray` —
|
|
5
|
+
* read back as the numbers it names. A member that is not a number reads NaN,
|
|
6
|
+
* which every comparison against it declines.
|
|
7
|
+
*/
|
|
8
|
+
export declare function numericDomain(domain: readonly (string | number)[]): number[];
|
|
9
|
+
/**
|
|
10
|
+
* #api
|
|
11
|
+
* A threshold scale's cut points as {@link thresholdIndex} walks them: the
|
|
12
|
+
* numbers the domain names, ascending. Cuts written high to low, as p-value
|
|
13
|
+
* thresholds often are, left the middle interval unreachable, the walk stopping
|
|
14
|
+
* at the first cut a value is under.
|
|
15
|
+
*/
|
|
16
|
+
export declare function thresholdCuts(domain: readonly (string | number)[]): number[];
|
|
17
|
+
/**
|
|
18
|
+
* #api
|
|
19
|
+
* The bin a value falls in: how many of the ascending cut points it is at or
|
|
20
|
+
* past, so a palette with one more entry than the domain paints it as
|
|
21
|
+
* `palette[thresholdIndex(value, domain)]`. A value that is not a finite
|
|
22
|
+
* number is in no bin and answers -1.
|
|
23
|
+
*/
|
|
24
|
+
export declare function thresholdIndex(value: unknown, domain: readonly number[]): number;
|
|
25
|
+
/**
|
|
26
|
+
* #api
|
|
27
|
+
* The colour of each interval, in order: the declared palette, and the
|
|
28
|
+
* default categorical palette where it runs out.
|
|
29
|
+
*/
|
|
30
|
+
export declare function thresholdPalette(bins: number, palette?: readonly string[]): string[];
|
|
31
|
+
/**
|
|
32
|
+
* #api
|
|
33
|
+
* What a threshold scale's bins are called in a key, one label per palette
|
|
34
|
+
* entry: `< a` below the first cut, `a – b` between two, `≥ b` past the last.
|
|
35
|
+
*/
|
|
36
|
+
export declare function thresholdLabels(domain: readonly number[]): string[];
|
|
37
|
+
/**
|
|
38
|
+
* #api
|
|
39
|
+
* The key a value holding text that is no number files under on a threshold
|
|
40
|
+
* scale, painted the misconfiguration grey rather than passing for a missing
|
|
41
|
+
* value.
|
|
42
|
+
*/
|
|
43
|
+
export declare const NOT_A_NUMBER_LABEL = "(not a number)";
|
|
44
|
+
/**
|
|
45
|
+
* #api
|
|
46
|
+
* A threshold scale read the way every categorical channel reads its field: a
|
|
47
|
+
* value files under the label of the bin it falls in, a feature with no value
|
|
48
|
+
* under `''`, and text that is no number under {@link NOT_A_NUMBER_LABEL}.
|
|
49
|
+
* The bins are the whole domain, so a key lists each one.
|
|
50
|
+
*/
|
|
51
|
+
export declare function thresholdField(field: string, { domain, range, }?: {
|
|
52
|
+
domain?: readonly string[];
|
|
53
|
+
range?: readonly string[];
|
|
54
|
+
}): CategoricalField;
|