@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
|
@@ -4,14 +4,15 @@ import type { AnyConfigurationModel } from '../configuration/index.ts';
|
|
|
4
4
|
import type RpcMethodType from '../pluggableElementTypes/RpcMethodType.ts';
|
|
5
5
|
import type { PluginDefinition } from '../pluginDefinitions.ts';
|
|
6
6
|
import type { StatusCallback } from '../util/progress.ts';
|
|
7
|
+
import type { RpcHandles } from './RpcRegistry.ts';
|
|
7
8
|
export interface WorkerHandle {
|
|
8
9
|
destroy(): void;
|
|
9
10
|
onError?(callback: () => void): void;
|
|
10
|
-
notifyStopToken?(id: string): void;
|
|
11
11
|
on?(eventName: string, listener: (data: unknown) => void): void;
|
|
12
12
|
postMessage?(message: unknown): void;
|
|
13
13
|
call(functionName: string, args?: unknown, options?: {
|
|
14
14
|
statusCallback?: StatusCallback;
|
|
15
|
+
signal?: AbortSignal;
|
|
15
16
|
}): Promise<unknown>;
|
|
16
17
|
}
|
|
17
18
|
declare module '@jbrowse/core/PluginManager' {
|
|
@@ -43,7 +44,6 @@ export default class WebWorkerRpcDriver extends BaseRpcDriver {
|
|
|
43
44
|
private lastWorkerAssignment;
|
|
44
45
|
private workerAssignments;
|
|
45
46
|
private workerPool?;
|
|
46
|
-
private unregisterBroadcaster;
|
|
47
47
|
private destroyed;
|
|
48
48
|
constructor(pluginManager: PluginManager, config: AnyConfigurationModel, options: WebWorkerRpcDriverOptions);
|
|
49
49
|
/**
|
|
@@ -69,7 +69,7 @@ export default class WebWorkerRpcDriver extends BaseRpcDriver {
|
|
|
69
69
|
* plugin's wrapper per RPC; once per boot has nothing to memoize.
|
|
70
70
|
*/
|
|
71
71
|
extendWorker(worker: WorkerHandle): WorkerHandle;
|
|
72
|
-
protected transport(sessionId: string, rpcMethod: RpcMethodType, serializedArgs: Record<string, unknown>,
|
|
72
|
+
protected transport(sessionId: string, rpcMethod: RpcMethodType, serializedArgs: Record<string, unknown>, handles: RpcHandles): Promise<unknown>;
|
|
73
73
|
/**
|
|
74
74
|
* Boot one worker and run the configuration handshake. Overridable so a test
|
|
75
75
|
* can hand the pool a fake handle without a `Worker`; nothing in the app does.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { readConfObject } from '../configuration/index.js';
|
|
2
2
|
import { clamp } from '../util/index.js';
|
|
3
|
-
import { registerStopTokenBroadcaster } from '../util/stopToken.js';
|
|
4
3
|
import BaseRpcDriver, { CORE_FREE_RESOURCES } from './BaseRpcDriver.js';
|
|
5
4
|
import RpcClient from './RpcClient.js';
|
|
6
5
|
import { deserializeError } from './serializeError/index.js';
|
|
@@ -36,9 +35,6 @@ class WebWorkerHandle {
|
|
|
36
35
|
onError(callback) {
|
|
37
36
|
this.client.on('error', callback);
|
|
38
37
|
}
|
|
39
|
-
notifyStopToken(id) {
|
|
40
|
-
this.client.notifyStopToken(id);
|
|
41
|
-
}
|
|
42
38
|
// the two halves of {@link WorkerHandle}'s plugin-facing pair
|
|
43
39
|
on(eventName, listener) {
|
|
44
40
|
this.client.on(eventName, listener);
|
|
@@ -73,9 +69,9 @@ class WebWorkerHandle {
|
|
|
73
69
|
// `Core-extendWorker` wrapper written against that interface may well call
|
|
74
70
|
// `worker.call(name, args)` — which destructured `undefined` and threw
|
|
75
71
|
opts = {}) {
|
|
76
|
-
const { statusCallback } = opts;
|
|
72
|
+
const { statusCallback, signal } = opts;
|
|
77
73
|
if (!statusCallback) {
|
|
78
|
-
return this.client.call(funcName, args);
|
|
74
|
+
return this.client.call(funcName, args, signal);
|
|
79
75
|
}
|
|
80
76
|
const channel = `message-${++this.channelCount}`;
|
|
81
77
|
// RpcClient is a generic event emitter (it also carries 'error' events), so
|
|
@@ -87,8 +83,7 @@ class WebWorkerHandle {
|
|
|
87
83
|
};
|
|
88
84
|
this.client.on(channel, listener);
|
|
89
85
|
try {
|
|
90
|
-
|
|
91
|
-
return result;
|
|
86
|
+
return await this.client.call(funcName, { ...args, channel }, signal);
|
|
92
87
|
}
|
|
93
88
|
finally {
|
|
94
89
|
this.client.off(channel, listener);
|
|
@@ -151,24 +146,9 @@ class LazyWorker {
|
|
|
151
146
|
this.workerP = undefined;
|
|
152
147
|
}
|
|
153
148
|
/**
|
|
154
|
-
*
|
|
155
|
-
* slot
|
|
156
|
-
*
|
|
157
|
-
* still lands after the call it means to cancel rather than ahead of the
|
|
158
|
-
* worker's message listener existing.
|
|
159
|
-
*/
|
|
160
|
-
notifyStopToken(id) {
|
|
161
|
-
this.bootP
|
|
162
|
-
?.then(worker => {
|
|
163
|
-
worker.notifyStopToken?.(id);
|
|
164
|
-
})
|
|
165
|
-
.catch(() => { });
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Drop a session's cached adapters on this slot's worker — and, like
|
|
169
|
-
* {@link notifyStopToken}, never boot one to do it. A slot that never booted
|
|
170
|
-
* has no cache to free, and booting one there costs a whole worker bundle and
|
|
171
|
-
* every runtime plugin to say so.
|
|
149
|
+
* Drop a session's cached adapters on this slot's worker, and never boot one
|
|
150
|
+
* to do it. A slot that never booted has no cache to free, and booting one
|
|
151
|
+
* there costs a whole worker bundle and every runtime plugin to say so.
|
|
172
152
|
*
|
|
173
153
|
* Through the extended handle, because it is a `call`: a plugin that wraps
|
|
174
154
|
* calls should see this one.
|
|
@@ -197,17 +177,6 @@ export default class WebWorkerRpcDriver extends BaseRpcDriver {
|
|
|
197
177
|
// sessionId -> worker number
|
|
198
178
|
workerAssignments = new Map();
|
|
199
179
|
workerPool;
|
|
200
|
-
// a stopped token has to reach the thread actually running the work, and this
|
|
201
|
-
// is the seam that carries it. Broadcast rather than routed per call: one
|
|
202
|
-
// token is commonly in flight on several calls at once, and a worker holding
|
|
203
|
-
// nothing under that id ignores the frame.
|
|
204
|
-
//
|
|
205
|
-
// Registered with the POOL, not in the constructor, so that a driver which
|
|
206
|
-
// never boots a worker stays out of the module-global broadcaster set — and
|
|
207
|
-
// registered only once the pool exists to receive the broadcast, since a
|
|
208
|
-
// `createWorkerPool` that threw after registering left an entry no `destroy`
|
|
209
|
-
// could ever reach.
|
|
210
|
-
unregisterBroadcaster = () => { };
|
|
211
180
|
// `destroy` is terminal: `getWorkerPool` refuses rather than letting its `??=`
|
|
212
181
|
// build a second pool for a driver whose teardown already ran. ADR-086.
|
|
213
182
|
destroyed = false;
|
|
@@ -233,7 +202,6 @@ export default class WebWorkerRpcDriver extends BaseRpcDriver {
|
|
|
233
202
|
// discarding the driver so its worker threads don't outlive it
|
|
234
203
|
destroy() {
|
|
235
204
|
this.destroyed = true;
|
|
236
|
-
this.unregisterBroadcaster();
|
|
237
205
|
for (const worker of this.workerPool ?? []) {
|
|
238
206
|
worker.destroy();
|
|
239
207
|
}
|
|
@@ -245,13 +213,7 @@ export default class WebWorkerRpcDriver extends BaseRpcDriver {
|
|
|
245
213
|
// workerCount 0 (the config default) means "decide from hardware"
|
|
246
214
|
const workerCount = readConfObject(this.config, 'workerCount') ||
|
|
247
215
|
clamp(detectHardwareConcurrency() - 1, 1, 5);
|
|
248
|
-
|
|
249
|
-
this.unregisterBroadcaster = registerStopTokenBroadcaster(id => {
|
|
250
|
-
for (const worker of pool) {
|
|
251
|
-
worker.notifyStopToken(id);
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
return pool;
|
|
216
|
+
return Array.from({ length: workerCount }, () => new LazyWorker(this));
|
|
255
217
|
}
|
|
256
218
|
getWorkerPool() {
|
|
257
219
|
if (this.destroyed) {
|
|
@@ -285,9 +247,9 @@ export default class WebWorkerRpcDriver extends BaseRpcDriver {
|
|
|
285
247
|
'Core-extendWorker', worker);
|
|
286
248
|
}
|
|
287
249
|
// get this session's sticky worker and hand off the already-serialized args
|
|
288
|
-
async transport(sessionId, rpcMethod, serializedArgs,
|
|
250
|
+
async transport(sessionId, rpcMethod, serializedArgs, handles) {
|
|
289
251
|
const worker = await this.getWorker(sessionId);
|
|
290
|
-
return worker.call(rpcMethod.name, serializedArgs,
|
|
252
|
+
return worker.call(rpcMethod.name, serializedArgs, handles);
|
|
291
253
|
}
|
|
292
254
|
/**
|
|
293
255
|
* Boot one worker and run the configuration handshake. Overridable so a test
|
package/esm/rpc/byteBudget.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { StatusCallback } from '../util/progress.ts';
|
|
2
|
-
import type { StopToken, StopTokenChecker } from '../util/stopToken.ts';
|
|
3
2
|
import type { AugmentedRegion } from '../util/types/data.ts';
|
|
4
3
|
/**
|
|
5
4
|
* Which question a byte budget asks of a region set: the gate's per-region
|
|
@@ -17,7 +16,7 @@ export interface GatedFetchArgs {
|
|
|
17
16
|
}
|
|
18
17
|
export interface ByteMeasurableAdapter {
|
|
19
18
|
getRegionByteSize: (regions: AugmentedRegion[], opts?: {
|
|
20
|
-
|
|
19
|
+
signal?: AbortSignal;
|
|
21
20
|
statusCallback?: StatusCallback;
|
|
22
21
|
}) => Promise<number | undefined>;
|
|
23
22
|
}
|
|
@@ -45,13 +44,12 @@ export declare function measuredBytes(result: unknown): number | undefined;
|
|
|
45
44
|
* comes back either way; when `tooLarge` is set the caller returns it and
|
|
46
45
|
* fetches nothing. No budget means no measurement.
|
|
47
46
|
*/
|
|
48
|
-
export declare function measureRegionBytes({ dataAdapter, regions, byteLimit,
|
|
47
|
+
export declare function measureRegionBytes({ dataAdapter, regions, byteLimit, signal, statusCallback, }: {
|
|
49
48
|
dataAdapter: ByteMeasurableAdapter;
|
|
50
49
|
regions: AugmentedRegion[];
|
|
51
50
|
byteLimit: number | undefined;
|
|
52
|
-
|
|
51
|
+
signal?: AbortSignal;
|
|
53
52
|
statusCallback?: StatusCallback;
|
|
54
|
-
stopTokenCheck?: StopTokenChecker;
|
|
55
53
|
}): Promise<{
|
|
56
54
|
bytes?: number;
|
|
57
55
|
tooLarge?: RegionTooLargeResult;
|
package/esm/rpc/byteBudget.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { checkAbortSignal } from '../util/aborting.js';
|
|
1
2
|
import { updateStatus } from '../util/progress.js';
|
|
2
|
-
import { checkStopTokenThrottled } from '../util/stopToken.js';
|
|
3
3
|
export function isRegionRefused(result) {
|
|
4
4
|
return (typeof result === 'object' && result !== null && 'regionTooLarge' in result);
|
|
5
5
|
}
|
|
@@ -35,15 +35,15 @@ export function measuredBytes(result) {
|
|
|
35
35
|
* comes back either way; when `tooLarge` is set the caller returns it and
|
|
36
36
|
* fetches nothing. No budget means no measurement.
|
|
37
37
|
*/
|
|
38
|
-
export async function measureRegionBytes({ dataAdapter, regions, byteLimit,
|
|
38
|
+
export async function measureRegionBytes({ dataAdapter, regions, byteLimit, signal, statusCallback, }) {
|
|
39
39
|
if (byteLimit === undefined) {
|
|
40
40
|
return {};
|
|
41
41
|
}
|
|
42
42
|
const bytes = largestRegionBytes(await updateStatus('Checking region size', statusCallback, () => Promise.all(regions.map(region => dataAdapter.getRegionByteSize([region], {
|
|
43
|
-
|
|
43
|
+
signal,
|
|
44
44
|
statusCallback,
|
|
45
45
|
})))));
|
|
46
|
-
|
|
46
|
+
checkAbortSignal(signal);
|
|
47
47
|
return overByteBudget(bytes, byteLimit)
|
|
48
48
|
? { bytes, tooLarge: { regionTooLarge: true, bytes } }
|
|
49
49
|
: { bytes };
|
|
@@ -3,29 +3,15 @@
|
|
|
3
3
|
* #category root
|
|
4
4
|
*/
|
|
5
5
|
declare const _default: import("../configuration/configurationSchema.ts").ConfigurationSchemaType<{
|
|
6
|
-
/**
|
|
7
|
-
* #slot
|
|
8
|
-
* which RPC backend to use. Empty means "use the host application's
|
|
9
|
-
* default" (web/desktop default to the web worker driver, embedded/headless
|
|
10
|
-
* to the main thread). Every call in the session runs on the driver this
|
|
11
|
-
* names; there is no per-track or per-call override.
|
|
12
|
-
*/
|
|
13
6
|
readonly defaultDriver: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
readonly advanced: true;
|
|
7
|
+
type: "string";
|
|
8
|
+
} & {
|
|
9
|
+
defaultValue: string;
|
|
18
10
|
};
|
|
19
|
-
/**
|
|
20
|
-
* #slot
|
|
21
|
-
* number of web workers to spawn for the web worker RPC driver. 0 lets
|
|
22
|
-
* JBrowse pick based on hardware concurrency.
|
|
23
|
-
*/
|
|
24
11
|
readonly workerCount: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
readonly advanced: true;
|
|
12
|
+
type: "number";
|
|
13
|
+
} & {
|
|
14
|
+
defaultValue: number;
|
|
29
15
|
};
|
|
30
|
-
}, import("../configuration/configurationSchema.ts").ConfigurationSchemaOptions<undefined, undefined
|
|
16
|
+
}, import("../configuration/configurationSchema.ts").ConfigurationSchemaOptions<undefined, undefined, undefined, import("../configuration/requirements.ts").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>>>;
|
|
31
17
|
export default _default;
|
|
@@ -3,6 +3,7 @@ export { default as CoreGetMetadata } from './methods/CoreGetMetadata.ts';
|
|
|
3
3
|
export { default as CoreGetInfo } from './methods/CoreGetInfo.ts';
|
|
4
4
|
export { default as CoreGetFeatures } from './methods/CoreGetFeatures.ts';
|
|
5
5
|
export { default as CoreEncodeFeatures } from './methods/CoreEncodeFeatures.ts';
|
|
6
|
+
export { default as CoreGetEncodedFeature } from './methods/CoreGetEncodedFeature.ts';
|
|
6
7
|
export { default as CoreGetSequence } from './methods/CoreGetSequence.ts';
|
|
7
8
|
export { default as CoreFreeResources } from './methods/CoreFreeResources.ts';
|
|
8
9
|
export { default as CoreGetRegionByteEstimate } from './methods/CoreGetRegionByteEstimate.ts';
|
|
@@ -3,6 +3,7 @@ export { default as CoreGetMetadata } from './methods/CoreGetMetadata.js';
|
|
|
3
3
|
export { default as CoreGetInfo } from './methods/CoreGetInfo.js';
|
|
4
4
|
export { default as CoreGetFeatures } from './methods/CoreGetFeatures.js';
|
|
5
5
|
export { default as CoreEncodeFeatures } from './methods/CoreEncodeFeatures.js';
|
|
6
|
+
export { default as CoreGetEncodedFeature } from './methods/CoreGetEncodedFeature.js';
|
|
6
7
|
export { default as CoreGetSequence } from './methods/CoreGetSequence.js';
|
|
7
8
|
export { default as CoreFreeResources } from './methods/CoreFreeResources.js';
|
|
8
9
|
export { default as CoreGetRegionByteEstimate } from './methods/CoreGetRegionByteEstimate.js';
|
|
@@ -3,11 +3,12 @@ import type { EncodedFeaturesResult } from '../../util/markEncoding.ts';
|
|
|
3
3
|
import type { RpcExecuteArgs } from '../RpcRegistry.ts';
|
|
4
4
|
/**
|
|
5
5
|
* Fetch a region's features once, run the shared transform steps over them,
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* split them by the facet where the request names one, run each layer's own
|
|
7
|
+
* steps (per section, under a facet), and evaluate the layer's encoding over
|
|
8
|
+
* what is left in the worker, where the `Feature` objects are, filling the
|
|
9
|
+
* lanes its shape reads. The colours come back packed, the scale tables
|
|
10
|
+
* resolved, and the main thread reads the same table for its legend that the
|
|
11
|
+
* colours were drawn from.
|
|
11
12
|
*/
|
|
12
13
|
export default class CoreEncodeFeatures extends RpcMethodTypeWithRenameRegion<'CoreEncodeFeatures'> {
|
|
13
14
|
name: 'CoreEncodeFeatures';
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { getFeatureAdapterOrThrow } from '../../data_adapters/getFeatureAdapter.js';
|
|
2
2
|
import RpcMethodTypeWithRenameRegion from '../../pluggableElementTypes/RpcMethodTypeWithRenameRegion.js';
|
|
3
|
-
import { runTransforms } from '../../util/featureTransforms.js';
|
|
4
3
|
import { rpcResult } from '../../util/librpc.js';
|
|
5
4
|
import { encodeFeatures, encodedChannelTransferables, } from '../../util/markEncoding.js';
|
|
6
|
-
import { createProgressReporter
|
|
7
|
-
import { checkStopTokenThrottled, createStopTokenChecker, } from '../../util/stopToken.js';
|
|
5
|
+
import { createProgressReporter } from '../../util/progress.js';
|
|
8
6
|
import { measureRegionBytes } from '../byteBudget.js';
|
|
7
|
+
import { layerFeatures, layerRow } from './layerFeatures.js';
|
|
9
8
|
/**
|
|
10
9
|
* Fetch a region's features once, run the shared transform steps over them,
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
10
|
+
* split them by the facet where the request names one, run each layer's own
|
|
11
|
+
* steps (per section, under a facet), and evaluate the layer's encoding over
|
|
12
|
+
* what is left in the worker, where the `Feature` objects are, filling the
|
|
13
|
+
* lanes its shape reads. The colours come back packed, the scale tables
|
|
14
|
+
* resolved, and the main thread reads the same table for its legend that the
|
|
15
|
+
* colours were drawn from.
|
|
16
16
|
*/
|
|
17
17
|
export default class CoreEncodeFeatures extends RpcMethodTypeWithRenameRegion {
|
|
18
18
|
name = 'CoreEncodeFeatures';
|
|
19
19
|
async execute(args) {
|
|
20
|
-
const { sessionId, adapterConfig, sequenceAdapter, region, layers: requested,
|
|
20
|
+
const { sessionId, adapterConfig, sequenceAdapter, region, layers: requested, byteLimit, signal, statusCallback, } = args;
|
|
21
21
|
const { pluginManager } = this;
|
|
22
|
-
const stopTokenCheck = createStopTokenChecker(stopToken);
|
|
23
22
|
const dataAdapter = await getFeatureAdapterOrThrow({
|
|
24
23
|
pluginManager,
|
|
25
24
|
sessionId,
|
|
@@ -30,33 +29,29 @@ export default class CoreEncodeFeatures extends RpcMethodTypeWithRenameRegion {
|
|
|
30
29
|
dataAdapter,
|
|
31
30
|
regions: [region],
|
|
32
31
|
byteLimit,
|
|
33
|
-
|
|
32
|
+
signal,
|
|
34
33
|
statusCallback,
|
|
35
|
-
stopTokenCheck,
|
|
36
34
|
});
|
|
37
35
|
if (tooLarge) {
|
|
38
36
|
return tooLarge;
|
|
39
37
|
}
|
|
40
|
-
const fetched = await updateStatus('Downloading features', statusCallback, () => dataAdapter.getFeaturesArray(region, { statusCallback, stopToken }));
|
|
41
|
-
checkStopTokenThrottled(stopTokenCheck);
|
|
42
38
|
const { jexl } = pluginManager;
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
const result = { layers, bytes };
|
|
39
|
+
const { layers: features, rows, sections, zoomRange, } = await layerFeatures(dataAdapter, args, jexl);
|
|
40
|
+
const layers = requested.map((request, i) => encodeFeatures(features[i], { ...request.encoding, row: rows ? rows[i] : layerRow(request) }, request.lanes, {
|
|
41
|
+
jexl,
|
|
42
|
+
report: createProgressReporter({
|
|
43
|
+
label: 'Encoding features',
|
|
44
|
+
total: features[i].length,
|
|
45
|
+
statusCallback,
|
|
46
|
+
signal,
|
|
47
|
+
}),
|
|
48
|
+
}));
|
|
49
|
+
const result = {
|
|
50
|
+
layers,
|
|
51
|
+
facet: sections,
|
|
52
|
+
bytes,
|
|
53
|
+
zoomRange,
|
|
54
|
+
};
|
|
60
55
|
return rpcResult(result, layers.flatMap(l => encodedChannelTransferables(l)));
|
|
61
56
|
}
|
|
62
57
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import RpcMethodTypeWithRenameRegion from '../../pluggableElementTypes/RpcMethodTypeWithRenameRegion.ts';
|
|
2
|
+
import type { RpcExecuteArgs } from '../RpcRegistry.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The feature behind one instance of a `CoreEncodeFeatures` answer: the same
|
|
5
|
+
* request run again, and the entry of `layer`'s list the instance's
|
|
6
|
+
* `featureIndex` names. A display holds channels and no records, and two reads
|
|
7
|
+
* sharing a span, a run counted inside one facet section or a mark whose `x` is
|
|
8
|
+
* not `start` are each a feature no coordinate lookup finds.
|
|
9
|
+
*/
|
|
10
|
+
export default class CoreGetEncodedFeature extends RpcMethodTypeWithRenameRegion<'CoreGetEncodedFeature'> {
|
|
11
|
+
name: 'CoreGetEncodedFeature';
|
|
12
|
+
execute(args: RpcExecuteArgs<'CoreGetEncodedFeature'>): Promise<import("../../util/simpleFeature.ts").SimpleFeatureSerialized | undefined>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { getFeatureAdapterOrThrow } from '../../data_adapters/getFeatureAdapter.js';
|
|
2
|
+
import RpcMethodTypeWithRenameRegion from '../../pluggableElementTypes/RpcMethodTypeWithRenameRegion.js';
|
|
3
|
+
import { layerFeatures } from './layerFeatures.js';
|
|
4
|
+
/**
|
|
5
|
+
* The feature behind one instance of a `CoreEncodeFeatures` answer: the same
|
|
6
|
+
* request run again, and the entry of `layer`'s list the instance's
|
|
7
|
+
* `featureIndex` names. A display holds channels and no records, and two reads
|
|
8
|
+
* sharing a span, a run counted inside one facet section or a mark whose `x` is
|
|
9
|
+
* not `start` are each a feature no coordinate lookup finds.
|
|
10
|
+
*/
|
|
11
|
+
export default class CoreGetEncodedFeature extends RpcMethodTypeWithRenameRegion {
|
|
12
|
+
name = 'CoreGetEncodedFeature';
|
|
13
|
+
async execute(args) {
|
|
14
|
+
const { sessionId, adapterConfig, sequenceAdapter, layer, featureIndex } = args;
|
|
15
|
+
const asked = args.layers[layer];
|
|
16
|
+
if (!asked) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
const { pluginManager } = this;
|
|
20
|
+
const dataAdapter = await getFeatureAdapterOrThrow({
|
|
21
|
+
pluginManager,
|
|
22
|
+
sessionId,
|
|
23
|
+
adapterConfig,
|
|
24
|
+
sequenceAdapter,
|
|
25
|
+
});
|
|
26
|
+
// A layer's list does not depend on its neighbours, so only the one asked
|
|
27
|
+
// about runs its steps.
|
|
28
|
+
const { layers } = await layerFeatures(dataAdapter, { ...args, layers: [asked] }, pluginManager.jexl);
|
|
29
|
+
return layers[0]?.[featureIndex]?.toJSON();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -3,7 +3,7 @@ import RpcMethodTypeWithRenameRegions from '../../pluggableElementTypes/RpcMetho
|
|
|
3
3
|
export default class CoreGetExportData extends RpcMethodTypeWithRenameRegions {
|
|
4
4
|
name = 'CoreGetExportData';
|
|
5
5
|
async execute(args) {
|
|
6
|
-
const { sessionId, adapterConfig, regions, formatType, opts,
|
|
6
|
+
const { sessionId, adapterConfig, regions, formatType, opts, signal, statusCallback, } = args;
|
|
7
7
|
const dataAdapter = await getFeatureAdapterOrThrow({
|
|
8
8
|
pluginManager: this.pluginManager,
|
|
9
9
|
sessionId,
|
|
@@ -22,7 +22,7 @@ export default class CoreGetExportData extends RpcMethodTypeWithRenameRegions {
|
|
|
22
22
|
// empty file instead.
|
|
23
23
|
return dataAdapter.getExportData(regions, formatType, {
|
|
24
24
|
...opts,
|
|
25
|
-
|
|
25
|
+
signal,
|
|
26
26
|
statusCallback,
|
|
27
27
|
});
|
|
28
28
|
}
|
|
@@ -9,12 +9,12 @@ import RpcMethodTypeWithRenameRegions from '../../pluggableElementTypes/RpcMetho
|
|
|
9
9
|
export default class CoreGetFeatureDensity extends RpcMethodTypeWithRenameRegions {
|
|
10
10
|
name = 'CoreGetFeatureDensity';
|
|
11
11
|
async execute(args) {
|
|
12
|
-
const { adapterConfig, sessionId, regions, bpPerPx,
|
|
12
|
+
const { adapterConfig, sessionId, regions, bpPerPx, signal } = args;
|
|
13
13
|
const { dataAdapter } = await getAdapter(this.pluginManager, sessionId, adapterConfig);
|
|
14
14
|
return isFeatureAdapter(dataAdapter)
|
|
15
15
|
? dataAdapter.getFeatureDensity(regions, {
|
|
16
16
|
bpPerPx,
|
|
17
|
-
|
|
17
|
+
signal,
|
|
18
18
|
statusCallback: args.statusCallback,
|
|
19
19
|
})
|
|
20
20
|
: undefined;
|
|
@@ -10,7 +10,7 @@ export default class CoreGetFeatures extends RpcMethodTypeWithRenameRegions {
|
|
|
10
10
|
return unwrapRpcResult(feats).map(feat => new SimpleFeature(feat));
|
|
11
11
|
}
|
|
12
12
|
async execute(args) {
|
|
13
|
-
const {
|
|
13
|
+
const { signal, statusCallback, sessionId, adapterConfig, sequenceAdapter, regions, opts, } = args;
|
|
14
14
|
const dataAdapter = await getFeatureAdapterOrThrow({
|
|
15
15
|
pluginManager: this.pluginManager,
|
|
16
16
|
sessionId,
|
|
@@ -21,7 +21,7 @@ export default class CoreGetFeatures extends RpcMethodTypeWithRenameRegions {
|
|
|
21
21
|
.getFeaturesInMultipleRegions(regions, {
|
|
22
22
|
...opts,
|
|
23
23
|
statusCallback,
|
|
24
|
-
|
|
24
|
+
signal,
|
|
25
25
|
})
|
|
26
26
|
.pipe(toArray()));
|
|
27
27
|
return r.map(f => f.toJSON());
|
|
@@ -6,11 +6,11 @@ import RpcMethodType from '../../pluggableElementTypes/RpcMethodType.js';
|
|
|
6
6
|
export default class CoreGetSequence extends RpcMethodType {
|
|
7
7
|
name = 'CoreGetSequence';
|
|
8
8
|
async execute(args) {
|
|
9
|
-
const {
|
|
9
|
+
const { signal, statusCallback, sessionId, adapterConfig, region } = args;
|
|
10
10
|
const { dataAdapter } = await getAdapter(this.pluginManager, sessionId, adapterConfig);
|
|
11
11
|
if (!isSequenceAdapter(dataAdapter)) {
|
|
12
12
|
throw new Error('Adapter does not support retrieving sequences');
|
|
13
13
|
}
|
|
14
|
-
return dataAdapter.getSequence(region, {
|
|
14
|
+
return dataAdapter.getSequence(region, { signal, statusCallback });
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BaseFeatureDataAdapter } from '../../data_adapters/BaseAdapter/index.ts';
|
|
2
|
+
import type { JexlInstance } from '../../util/jexlStrings.ts';
|
|
3
|
+
import type { CoreEncodeFeaturesArgs, FacetSection, LayerRequest } from '../../util/markEncodingTypes.ts';
|
|
4
|
+
import type { StatusCallback } from '../../util/progress.ts';
|
|
5
|
+
import type { Feature } from '../../util/simpleFeature.ts';
|
|
6
|
+
/**
|
|
7
|
+
* The field a layer's `row` channel reads: the one its encoding names, else the
|
|
8
|
+
* one its own `pileup` writes, so a packed layer restates nothing.
|
|
9
|
+
*/
|
|
10
|
+
export declare function layerRow({ encoding, transform }: LayerRequest): string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* The feature list each layer of a `CoreEncodeFeatures` request encodes: the
|
|
13
|
+
* region's features through the shared steps, split by the facet where the
|
|
14
|
+
* request names one, then through each layer's own steps, with each faceted
|
|
15
|
+
* layer's stacked rows beside it. An instance's `featureIndex` indexes its
|
|
16
|
+
* layer's list, so the same request answers which feature an instance is.
|
|
17
|
+
*/
|
|
18
|
+
export declare function layerFeatures(dataAdapter: BaseFeatureDataAdapter, args: Pick<CoreEncodeFeaturesArgs, 'region' | 'layers' | 'transform' | 'facet' | 'bpPerPx'> & {
|
|
19
|
+
signal?: AbortSignal;
|
|
20
|
+
statusCallback?: StatusCallback;
|
|
21
|
+
}, jexl: JexlInstance): Promise<{
|
|
22
|
+
layers: (readonly Feature[])[];
|
|
23
|
+
rows: (readonly number[])[] | undefined;
|
|
24
|
+
sections: FacetSection[] | undefined;
|
|
25
|
+
zoomRange: import("../../data_adapters/BaseAdapter/zoomRange.ts").ZoomRange | undefined;
|
|
26
|
+
}>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { checkAbortSignal } from '../../util/aborting.js';
|
|
2
|
+
import { DEFAULT_PILEUP_AS, facetLayers, runTransforms, } from '../../util/featureTransforms.js';
|
|
3
|
+
import { updateStatus } from '../../util/progress.js';
|
|
4
|
+
/**
|
|
5
|
+
* The field a layer's `row` channel reads: the one its encoding names, else the
|
|
6
|
+
* one its own `pileup` writes, so a packed layer restates nothing.
|
|
7
|
+
*/
|
|
8
|
+
export function layerRow({ encoding, transform = [] }) {
|
|
9
|
+
const pileup = transform.find((s) => s.type === 'pileup');
|
|
10
|
+
return (encoding.row ??
|
|
11
|
+
(pileup === undefined ? undefined : (pileup.as ?? DEFAULT_PILEUP_AS)));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The feature list each layer of a `CoreEncodeFeatures` request encodes: the
|
|
15
|
+
* region's features through the shared steps, split by the facet where the
|
|
16
|
+
* request names one, then through each layer's own steps, with each faceted
|
|
17
|
+
* layer's stacked rows beside it. An instance's `featureIndex` indexes its
|
|
18
|
+
* layer's list, so the same request answers which feature an instance is.
|
|
19
|
+
*/
|
|
20
|
+
export async function layerFeatures(dataAdapter, args, jexl) {
|
|
21
|
+
const { region, layers: requested, transform = [], facet, bpPerPx, signal, statusCallback, } = args;
|
|
22
|
+
const fetchOpts = { bpPerPx, statusCallback, signal };
|
|
23
|
+
const [fetched, zoomRange] = await updateStatus('Downloading features', statusCallback, () => Promise.all([
|
|
24
|
+
dataAdapter.getFeaturesArray(region, fetchOpts),
|
|
25
|
+
dataAdapter.getZoomRange(fetchOpts),
|
|
26
|
+
]));
|
|
27
|
+
checkAbortSignal(signal);
|
|
28
|
+
const shared = runTransforms(fetched, transform, jexl);
|
|
29
|
+
const faceted = facet
|
|
30
|
+
? facetLayers(shared, facet.field, requested.map(r => ({ transform: r.transform, row: layerRow(r) })), jexl)
|
|
31
|
+
: undefined;
|
|
32
|
+
const layers = requested.map(({ transform: own }, i) => faceted
|
|
33
|
+
? faceted.layers[i].features
|
|
34
|
+
: own
|
|
35
|
+
? runTransforms(shared, own, jexl)
|
|
36
|
+
: shared);
|
|
37
|
+
const rows = faceted?.layers.map(l => l.rows);
|
|
38
|
+
const sections = faceted?.sections;
|
|
39
|
+
return { layers, rows, sections, zoomRange };
|
|
40
|
+
}
|
package/esm/svg/SvgExport.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
4
4
|
// (`constants.ts`, `svgReady.ts`) so this stays component-only for
|
|
5
5
|
// react-refresh.
|
|
6
6
|
import { useTheme } from '@mui/material';
|
|
7
|
-
import { stripAlpha } from '../util/
|
|
7
|
+
import { stripAlpha } from '../util/svgColorProps.js';
|
|
8
8
|
import { exportMargin } from './constants.js';
|
|
9
9
|
import { svgSafeId } from './svgId.js';
|
|
10
10
|
// Full-bleed background rect. `width`/`height` are the *total* SVG dimensions.
|
|
@@ -36,9 +36,8 @@ export function SVGMessageBox({ message, width, height, }) {
|
|
|
36
36
|
// terminal state itself — a "region too large" message — and only paints the
|
|
37
37
|
// children when the display has renderable data. The body is an ordinary child
|
|
38
38
|
// component, so it never runs in a terminal state and no `renderSvg` re-detects
|
|
39
|
-
// one from empty/absent data. The readiness wait
|
|
40
|
-
// `
|
|
41
|
-
// step), so this component is sync.
|
|
39
|
+
// one from empty/absent data. The readiness wait happens before it, in
|
|
40
|
+
// `renderDisplaySvg` (the one genuinely async step), so this component is sync.
|
|
42
41
|
//
|
|
43
42
|
// One terminal, not two, and the asymmetry is the point: over-budget is a state
|
|
44
43
|
// the user navigated to on purpose, and a figure saying so is the honest export
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ThemeOptions } from '@mui/material';
|
|
2
|
+
/**
|
|
3
|
+
* Both theme providers, from the export's theme options. An export renders
|
|
4
|
+
* outside every React tree the app mounted, so without them a `useTheme` body
|
|
5
|
+
* gets MUI's default theme and a `usePalette` or `makeStyles` one JBrowse's
|
|
6
|
+
* default light style theme — whatever theme the user picked. Every place an
|
|
7
|
+
* export tree is rendered mounts this: the file, a live figure, a ring strip.
|
|
8
|
+
*/
|
|
9
|
+
export declare function SvgThemeProviders({ theme, children, }: {
|
|
10
|
+
theme: ThemeOptions | undefined;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ThemeProvider } from '@mui/material';
|
|
3
|
+
import { StyleThemeProvider } from '../ui/PaletteContext.js';
|
|
4
|
+
import { resolveStyleTheme } from '../ui/styleTheme.js';
|
|
5
|
+
import { createJBrowseTheme } from '../ui/theme.js';
|
|
6
|
+
/**
|
|
7
|
+
* Both theme providers, from the export's theme options. An export renders
|
|
8
|
+
* outside every React tree the app mounted, so without them a `useTheme` body
|
|
9
|
+
* gets MUI's default theme and a `usePalette` or `makeStyles` one JBrowse's
|
|
10
|
+
* default light style theme — whatever theme the user picked. Every place an
|
|
11
|
+
* export tree is rendered mounts this: the file, a live figure, a ring strip.
|
|
12
|
+
*/
|
|
13
|
+
export function SvgThemeProviders({ theme, children, }) {
|
|
14
|
+
return (_jsx(ThemeProvider, { theme: createJBrowseTheme(theme), children: _jsx(StyleThemeProvider, { theme: resolveStyleTheme({ configTheme: theme }), children: children }) }));
|
|
15
|
+
}
|