@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
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { isJexl, stringToJexlExpression } from './jexlStrings.js';
|
|
2
|
+
import { buildJexlContext } from './simpleFeature.js';
|
|
3
|
+
/**
|
|
4
|
+
* #api
|
|
5
|
+
* What a channel reads off a feature: a field by name, a dotted path into a
|
|
6
|
+
* structured field where no field carries the whole name (`INFO.SVTYPE` on a
|
|
7
|
+
* VCF record), or a `jexl:` expression over `feature`. A jexl expression that
|
|
8
|
+
* does not compile throws here, once, rather than on every feature.
|
|
9
|
+
*/
|
|
10
|
+
export function fieldReader(ref, jexl) {
|
|
11
|
+
const path = ref.includes('.') ? ref.split('.') : undefined;
|
|
12
|
+
const rests = path?.map((_, i) => path.slice(i).join('.'));
|
|
13
|
+
if (isJexl(ref)) {
|
|
14
|
+
if (!jexl) {
|
|
15
|
+
throw new Error(`a jexl: field needs a jexl instance (${ref})`);
|
|
16
|
+
}
|
|
17
|
+
const expr = stringToJexlExpression(ref, jexl);
|
|
18
|
+
return feature => expr.eval(buildJexlContext({ feature }));
|
|
19
|
+
}
|
|
20
|
+
return feature => {
|
|
21
|
+
const value = feature.get(ref);
|
|
22
|
+
return value === undefined && path && rests
|
|
23
|
+
? readPath(feature.get(path[0]), path, rests)
|
|
24
|
+
: value;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* #api
|
|
29
|
+
* Whether a field ref is a bare name: what `feature.get` answers on its own,
|
|
30
|
+
* with no path to walk and no expression to evaluate. A loop over a plain name
|
|
31
|
+
* keeps the direct call, and only a config that writes a path pays for one.
|
|
32
|
+
*/
|
|
33
|
+
export function isPlainFieldRef(ref) {
|
|
34
|
+
return !ref.includes('.') && !isJexl(ref);
|
|
35
|
+
}
|
|
36
|
+
function readPath(root, path, rests) {
|
|
37
|
+
let value = root;
|
|
38
|
+
for (let i = 1; i < path.length; i++) {
|
|
39
|
+
value =
|
|
40
|
+
typeof value === 'object' && value !== null
|
|
41
|
+
? Reflect.get(value, path[i])
|
|
42
|
+
: undefined;
|
|
43
|
+
}
|
|
44
|
+
return value ?? readWholeRest(root, path, rests);
|
|
45
|
+
}
|
|
46
|
+
// A path that read nothing by descending tries each level's rest as one key,
|
|
47
|
+
// so `INFO.AF.EAS` reaches a key named `AF.EAS`, which VCF 4.3 allows. Only a
|
|
48
|
+
// miss pays for it: a path that resolves is the plain walk above.
|
|
49
|
+
function readWholeRest(root, path, rests) {
|
|
50
|
+
let value = root;
|
|
51
|
+
for (let i = 1; i < path.length - 1; i++) {
|
|
52
|
+
if (typeof value !== 'object' || value === null) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
const whole = Reflect.get(value, rests[i]);
|
|
56
|
+
if (whole !== undefined) {
|
|
57
|
+
return whole ?? undefined;
|
|
58
|
+
}
|
|
59
|
+
value = Reflect.get(value, path[i]);
|
|
60
|
+
}
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ordering every in-track group-by shares, whatever partitioned the
|
|
3
|
+
* features: named groups first, then the `''` catch-all a dimension files its
|
|
4
|
+
* unanswerable features under, then the overflow bucket a capped partition
|
|
5
|
+
* merged its tail into.
|
|
6
|
+
*/
|
|
7
|
+
export declare const OVERFLOW_GROUP_KEY = "\0overflow";
|
|
8
|
+
export declare const MAX_GROUPS = 40;
|
|
9
|
+
/**
|
|
10
|
+
* The text a field value groups, colors and labels by: a missing value is the
|
|
11
|
+
* `''` catch-all, and a multi-valued attribute joins, so two features carrying
|
|
12
|
+
* the same list land together.
|
|
13
|
+
*/
|
|
14
|
+
export declare function valueText(value: unknown): string;
|
|
15
|
+
/**
|
|
16
|
+
* Numbers first by value, then every other key run by run with digit runs by
|
|
17
|
+
* magnitude, so -1 before 1 and chr2 before chr10. The two classes never
|
|
18
|
+
* interleave: a signed or decimal number read run by run orders differently
|
|
19
|
+
* than by value, and letting them mix made the order intransitive.
|
|
20
|
+
*/
|
|
21
|
+
export declare function compareGroupKeys(a: string, b: string): number;
|
|
22
|
+
/**
|
|
23
|
+
* The order a facet stacks its sections in. `domain` is the channel's
|
|
24
|
+
* declared order: the keys it lists come first, in that order, and the rest
|
|
25
|
+
* follow under `compareGroupKeys`. Every categorical channel in the tree
|
|
26
|
+
* reads its domain this way, so a listed value is a placement and an
|
|
27
|
+
* unlisted one is not an error.
|
|
28
|
+
*/
|
|
29
|
+
export declare function groupKeyComparator(domain?: readonly string[]): typeof compareGroupKeys;
|
|
30
|
+
/**
|
|
31
|
+
* The domain a re-pick keeps: a facet set from a menu or dialog names no
|
|
32
|
+
* domain, so one naming the field the current facet already reads carries
|
|
33
|
+
* the current order along. A reorder names its own domain and passes
|
|
34
|
+
* through, an empty one included.
|
|
35
|
+
*/
|
|
36
|
+
export declare function carryGroupDomain<T extends {
|
|
37
|
+
field: string;
|
|
38
|
+
domain?: readonly string[];
|
|
39
|
+
}>(next: T | undefined, current: T | undefined): T | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* The overflow bucket's chip. Says MERGED because that lane is the one entry
|
|
42
|
+
* in a stack that is not a value, and this label is the only place a reader
|
|
43
|
+
* is told the cap fired at all.
|
|
44
|
+
*/
|
|
45
|
+
export declare function overflowLabel(count: number): string;
|
|
46
|
+
/**
|
|
47
|
+
* Which section each key stacks into once the cap applies: the first
|
|
48
|
+
* `MAX_GROUPS` keys in natural order keep their own and the rest fold into
|
|
49
|
+
* the overflow section. The catch-all `''` is held out of the merge, since
|
|
50
|
+
* "lacking the value" is an answer users look for. A domain orders the
|
|
51
|
+
* sections and never decides which exist, so reordering them changes no
|
|
52
|
+
* key's section.
|
|
53
|
+
*/
|
|
54
|
+
export declare function capGroupKeys(keys: Iterable<string>): {
|
|
55
|
+
mergedCount: number;
|
|
56
|
+
sectionOf: (key: string) => string;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* A group's stable identity: its sort key and the label its chip shows.
|
|
60
|
+
*/
|
|
61
|
+
export interface GroupId {
|
|
62
|
+
key: string;
|
|
63
|
+
label: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Identity of the key space a facet hands out keys in: its field. A key means
|
|
67
|
+
* nothing on its own, since `''` is both the ungrouped section and every
|
|
68
|
+
* field's catch-all, so anything keyed by group key is dropped when this
|
|
69
|
+
* moves. The `domain` only orders the keys and is no part of the space, so a
|
|
70
|
+
* reorder keeps what a reader hid.
|
|
71
|
+
*/
|
|
72
|
+
export declare function groupKeySpaceOf(facet: {
|
|
73
|
+
field: string;
|
|
74
|
+
domain?: readonly string[];
|
|
75
|
+
} | undefined): string;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ordering every in-track group-by shares, whatever partitioned the
|
|
3
|
+
* features: named groups first, then the `''` catch-all a dimension files its
|
|
4
|
+
* unanswerable features under, then the overflow bucket a capped partition
|
|
5
|
+
* merged its tail into.
|
|
6
|
+
*/
|
|
7
|
+
// '\0' cannot collide with a real tag value or refName, and the rank below
|
|
8
|
+
// pins it dead last so a merged tail never displaces a named group.
|
|
9
|
+
export const OVERFLOW_GROUP_KEY = '\u0000overflow';
|
|
10
|
+
// Hard ceiling on the sections one grouping may stack; the tail past it merges
|
|
11
|
+
// into the overflow section. A backstop for the dimensions that are not a
|
|
12
|
+
// closed set, a tag or an attribute, whose value space is the file's.
|
|
13
|
+
export const MAX_GROUPS = 40;
|
|
14
|
+
/**
|
|
15
|
+
* The text a field value groups, colors and labels by: a missing value is the
|
|
16
|
+
* `''` catch-all, and a multi-valued attribute joins, so two features carrying
|
|
17
|
+
* the same list land together.
|
|
18
|
+
*/
|
|
19
|
+
export function valueText(value) {
|
|
20
|
+
return value === undefined || value === null
|
|
21
|
+
? ''
|
|
22
|
+
: Array.isArray(value)
|
|
23
|
+
? value.map(String).join(',')
|
|
24
|
+
: String(value);
|
|
25
|
+
}
|
|
26
|
+
function groupKeyRank(key) {
|
|
27
|
+
return key === '' ? 1 : key === OVERFLOW_GROUP_KEY ? 2 : 0;
|
|
28
|
+
}
|
|
29
|
+
const NUMERIC = /^-?\d+(\.\d+)?$/;
|
|
30
|
+
const DIGIT_RUNS = /\d+|\D+/g;
|
|
31
|
+
function compareRuns(a, b) {
|
|
32
|
+
const runsA = a.match(DIGIT_RUNS) ?? [];
|
|
33
|
+
const runsB = b.match(DIGIT_RUNS) ?? [];
|
|
34
|
+
const shared = Math.min(runsA.length, runsB.length);
|
|
35
|
+
for (let i = 0; i < shared; i++) {
|
|
36
|
+
const x = runsA[i];
|
|
37
|
+
const y = runsB[i];
|
|
38
|
+
if (x === y) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (/^\d/.test(x) && /^\d/.test(y)) {
|
|
42
|
+
const nx = Number(x);
|
|
43
|
+
const ny = Number(y);
|
|
44
|
+
if (nx !== ny) {
|
|
45
|
+
return nx < ny ? -1 : 1;
|
|
46
|
+
}
|
|
47
|
+
return x.length < y.length ? -1 : 1;
|
|
48
|
+
}
|
|
49
|
+
return x < y ? -1 : 1;
|
|
50
|
+
}
|
|
51
|
+
return runsA.length - runsB.length;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Numbers first by value, then every other key run by run with digit runs by
|
|
55
|
+
* magnitude, so -1 before 1 and chr2 before chr10. The two classes never
|
|
56
|
+
* interleave: a signed or decimal number read run by run orders differently
|
|
57
|
+
* than by value, and letting them mix made the order intransitive.
|
|
58
|
+
*/
|
|
59
|
+
export function compareGroupKeys(a, b) {
|
|
60
|
+
const rankDiff = groupKeyRank(a) - groupKeyRank(b);
|
|
61
|
+
if (rankDiff !== 0 || a === b) {
|
|
62
|
+
return rankDiff;
|
|
63
|
+
}
|
|
64
|
+
const numA = NUMERIC.test(a);
|
|
65
|
+
const numB = NUMERIC.test(b);
|
|
66
|
+
if (numA !== numB) {
|
|
67
|
+
return numA ? -1 : 1;
|
|
68
|
+
}
|
|
69
|
+
if (numA) {
|
|
70
|
+
const diff = Number(a) - Number(b);
|
|
71
|
+
if (diff !== 0) {
|
|
72
|
+
return diff < 0 ? -1 : 1;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return compareRuns(a, b);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The order a facet stacks its sections in. `domain` is the channel's
|
|
79
|
+
* declared order: the keys it lists come first, in that order, and the rest
|
|
80
|
+
* follow under `compareGroupKeys`. Every categorical channel in the tree
|
|
81
|
+
* reads its domain this way, so a listed value is a placement and an
|
|
82
|
+
* unlisted one is not an error.
|
|
83
|
+
*/
|
|
84
|
+
export function groupKeyComparator(domain) {
|
|
85
|
+
if (!domain?.length) {
|
|
86
|
+
return compareGroupKeys;
|
|
87
|
+
}
|
|
88
|
+
const rank = new Map();
|
|
89
|
+
domain.forEach((key, i) => {
|
|
90
|
+
if (!rank.has(key)) {
|
|
91
|
+
rank.set(key, i);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return (a, b) => {
|
|
95
|
+
const ra = rank.get(a) ?? Infinity;
|
|
96
|
+
const rb = rank.get(b) ?? Infinity;
|
|
97
|
+
return ra !== rb ? (ra < rb ? -1 : 1) : compareGroupKeys(a, b);
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The domain a re-pick keeps: a facet set from a menu or dialog names no
|
|
102
|
+
* domain, so one naming the field the current facet already reads carries
|
|
103
|
+
* the current order along. A reorder names its own domain and passes
|
|
104
|
+
* through, an empty one included.
|
|
105
|
+
*/
|
|
106
|
+
export function carryGroupDomain(next, current) {
|
|
107
|
+
return next !== undefined &&
|
|
108
|
+
next.domain === undefined &&
|
|
109
|
+
current?.domain !== undefined &&
|
|
110
|
+
next.field === current.field
|
|
111
|
+
? { ...next, domain: current.domain }
|
|
112
|
+
: next;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The overflow bucket's chip. Says MERGED because that lane is the one entry
|
|
116
|
+
* in a stack that is not a value, and this label is the only place a reader
|
|
117
|
+
* is told the cap fired at all.
|
|
118
|
+
*/
|
|
119
|
+
export function overflowLabel(count) {
|
|
120
|
+
return `${count} merged values`;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Which section each key stacks into once the cap applies: the first
|
|
124
|
+
* `MAX_GROUPS` keys in natural order keep their own and the rest fold into
|
|
125
|
+
* the overflow section. The catch-all `''` is held out of the merge, since
|
|
126
|
+
* "lacking the value" is an answer users look for. A domain orders the
|
|
127
|
+
* sections and never decides which exist, so reordering them changes no
|
|
128
|
+
* key's section.
|
|
129
|
+
*/
|
|
130
|
+
export function capGroupKeys(keys) {
|
|
131
|
+
const ordered = [...new Set(keys)].sort(compareGroupKeys);
|
|
132
|
+
const hasUntagged = ordered.includes('');
|
|
133
|
+
const named = ordered.filter(key => key !== '');
|
|
134
|
+
const merged = ordered.length > MAX_GROUPS
|
|
135
|
+
? named.slice(MAX_GROUPS - (hasUntagged ? 2 : 1))
|
|
136
|
+
: [];
|
|
137
|
+
const mergedSet = new Set(merged);
|
|
138
|
+
return {
|
|
139
|
+
mergedCount: merged.length,
|
|
140
|
+
sectionOf: (key) => (mergedSet.has(key) ? OVERFLOW_GROUP_KEY : key),
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Identity of the key space a facet hands out keys in: its field. A key means
|
|
145
|
+
* nothing on its own, since `''` is both the ungrouped section and every
|
|
146
|
+
* field's catch-all, so anything keyed by group key is dropped when this
|
|
147
|
+
* moves. The `domain` only orders the keys and is no part of the space, so a
|
|
148
|
+
* reorder keeps what a reader hid.
|
|
149
|
+
*/
|
|
150
|
+
export function groupKeySpaceOf(facet) {
|
|
151
|
+
return facet?.field ?? '';
|
|
152
|
+
}
|
package/esm/util/highlights.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import type { IAnyStateTreeNode } from '@jbrowse/mobx-state-tree';
|
|
2
1
|
import type { Theme } from '@mui/material';
|
|
3
2
|
export interface HighlightType {
|
|
4
3
|
start: number;
|
|
5
4
|
end: number;
|
|
6
|
-
assemblyName
|
|
5
|
+
assemblyName: string;
|
|
7
6
|
refName: string;
|
|
8
7
|
color?: string;
|
|
9
8
|
label?: string;
|
|
10
9
|
}
|
|
11
|
-
export
|
|
10
|
+
export type HighlightInput = Omit<HighlightType, 'assemblyName'> & {
|
|
11
|
+
assemblyName?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function isSameHighlight(a: HighlightType, b: HighlightType): boolean;
|
|
12
14
|
export declare function highlightKey(h: {
|
|
13
15
|
assemblyName?: string;
|
|
14
16
|
refName: string;
|
|
@@ -18,4 +20,4 @@ export declare function highlightKey(h: {
|
|
|
18
20
|
export declare function getHighlightColor(highlight: {
|
|
19
21
|
color?: string;
|
|
20
22
|
}, theme: Theme, alpha?: number): import("./colord.ts").Colord;
|
|
21
|
-
export declare function coerceHighlight(h: string |
|
|
23
|
+
export declare function coerceHighlight(h: string | HighlightInput, defaultAssembly: string, isValidRefName: (refName: string, assemblyName?: string) => boolean): HighlightType | undefined;
|
package/esm/util/highlights.js
CHANGED
|
@@ -1,25 +1,12 @@
|
|
|
1
|
-
import { addDisposer } from '@jbrowse/mobx-state-tree';
|
|
2
|
-
import { autorun } from 'mobx';
|
|
3
1
|
import { colord } from './colord.js';
|
|
4
2
|
import { parseLocString } from './locString.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// removals only lower the baseline — they never re-reveal, or the toggle could
|
|
13
|
-
// never be turned off.
|
|
14
|
-
export function revealHighlightsOnGrowth(node, count) {
|
|
15
|
-
let prevCount = count();
|
|
16
|
-
addDisposer(node, autorun(function highlightRevealAutorun() {
|
|
17
|
-
const newCount = count();
|
|
18
|
-
if (newCount > prevCount) {
|
|
19
|
-
getSession(node).revealHighlights();
|
|
20
|
-
}
|
|
21
|
-
prevCount = newCount;
|
|
22
|
-
}));
|
|
3
|
+
export function isSameHighlight(a, b) {
|
|
4
|
+
return (a.assemblyName === b.assemblyName &&
|
|
5
|
+
a.refName === b.refName &&
|
|
6
|
+
a.start === b.start &&
|
|
7
|
+
a.end === b.end &&
|
|
8
|
+
a.color === b.color &&
|
|
9
|
+
a.label === b.label);
|
|
23
10
|
}
|
|
24
11
|
// Highlight regions have no id and can duplicate, so the trailing index only
|
|
25
12
|
// breaks ties between otherwise-identical regions. Wrapping the array index in
|
|
@@ -84,11 +71,11 @@ function parseLocHighlight(s, defaultAssembly, isValidRefName) {
|
|
|
84
71
|
? { refName, start, end, assemblyName: assemblyName ?? defaultAssembly }
|
|
85
72
|
: undefined;
|
|
86
73
|
}
|
|
87
|
-
// Normalize
|
|
88
|
-
//
|
|
89
|
-
// LinearGenomeView and DotplotView, whose `
|
|
90
|
-
// three forms — the JSON shape-check in particular has to stay identical or
|
|
91
|
-
// highlight that works in one view silently drops in the other.
|
|
74
|
+
// Normalize a launch spec's `highlight` entry (object, JSON string, or loc
|
|
75
|
+
// string) into a HighlightType, defaulting the assemblyName. Shared by
|
|
76
|
+
// LinearGenomeView and DotplotView, whose `highlight` launch keys accept the
|
|
77
|
+
// same three forms — the JSON shape-check in particular has to stay identical or
|
|
78
|
+
// a highlight that works in one view silently drops in the other.
|
|
92
79
|
export function coerceHighlight(h, defaultAssembly,
|
|
93
80
|
// takes the assembly a `{...}` prefix named, so a caller with more than one
|
|
94
81
|
// assembly in play validates the refName against the one the entry asked for
|
package/esm/util/hooks.d.ts
CHANGED
|
@@ -66,8 +66,7 @@ export declare function useFinalUnmount(cleanup: () => void): void;
|
|
|
66
66
|
* components on the same key each kept their own copy of it, so toggling a
|
|
67
67
|
* setting in one BreakpointSplitView header left a second one open beside it
|
|
68
68
|
* showing the old value until it remounted. Instances on a key now subscribe to
|
|
69
|
-
* each other's writes, and to other tabs' — `subscribeToLocalStorageKey
|
|
70
|
-
* the grid-bookmark widget shares from its state model.
|
|
69
|
+
* each other's writes, and to other tabs' — `subscribeToLocalStorageKey`.
|
|
71
70
|
*
|
|
72
71
|
* The store is read on every notify rather than cached, so nothing here can go
|
|
73
72
|
* stale against a `localStorage.clear()`. Which also means a functional update
|
package/esm/util/hooks.js
CHANGED
|
@@ -204,8 +204,7 @@ function resolveUpdate(value, prev) {
|
|
|
204
204
|
* components on the same key each kept their own copy of it, so toggling a
|
|
205
205
|
* setting in one BreakpointSplitView header left a second one open beside it
|
|
206
206
|
* showing the old value until it remounted. Instances on a key now subscribe to
|
|
207
|
-
* each other's writes, and to other tabs' — `subscribeToLocalStorageKey
|
|
208
|
-
* the grid-bookmark widget shares from its state model.
|
|
207
|
+
* each other's writes, and to other tabs' — `subscribeToLocalStorageKey`.
|
|
209
208
|
*
|
|
210
209
|
* The store is read on every notify rather than cached, so nothing here can go
|
|
211
210
|
* stale against a `localStorage.clear()`. Which also means a functional update
|
package/esm/util/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export { avg, clamp, getDisplayStr, getNumberGrouping, max, maxFinite, min, minm
|
|
|
23
23
|
export { type MinimalRegion, bpSpanPx, bpToPx, bytesForRegions, featureSpanPx, getBpDisplayStr, getTickDisplayStr, parseBpString, } from './bpUtils.ts';
|
|
24
24
|
export { type BasicFeature, gatherOverlaps, mergeIntervals, } from './intervals.ts';
|
|
25
25
|
export { clampToContig, clampToListedContig } from './clampToContig.ts';
|
|
26
|
-
export { animationAllowed } from './animationAllowed.ts';
|
|
26
|
+
export { MORPH_DURATION_MS, animationAllowed, easeInOutCubic, morphClockMs, } from './animationAllowed.ts';
|
|
27
27
|
export { springAnimate } from './springAnimate.ts';
|
|
28
28
|
export { localStorageAvailable, localStorageGetBoolean, localStorageGetItem, localStorageGetJSON, localStorageGetNumber, localStorageGetStringArray, localStorageRemoveItem, localStorageSetBoolean, localStorageSetItem, localStorageSetJSON, localStorageSetNumber, notifyLocalStorageKey, subscribeToLocalStorageKey, } from './localStorage.ts';
|
|
29
29
|
export { renameRegionIfNeeded, renameRegionsIfNeeded } from './renameRegions.ts';
|
|
@@ -65,7 +65,7 @@ export declare function testAdapter(fileName: string, regex: RegExp, adapterHint
|
|
|
65
65
|
export { type Feature, type SimpleFeatureSerialized, type SimpleFeatureSerializedNoId, default as SimpleFeature, isFeature, } from './simpleFeature.ts';
|
|
66
66
|
export { saveAs } from './FileSaver/index.ts';
|
|
67
67
|
export { type SaveSvgAsImageOptions, saveSvgAsImage, svgHtmlToPngBlob, } from '../svg/saveSvgAsImage.ts';
|
|
68
|
-
export { type ActiveFetch, type StatusChannel, type StatusReporter, createStatusChannel,
|
|
68
|
+
export { type ActiveFetch, type StatusChannel, type StatusReporter, createStatusChannel, createAbortRotation, } from './createAbortRotation.ts';
|
|
69
69
|
export { createSharedSetup } from './cachedSetup.ts';
|
|
70
70
|
export { scheduleDetachedDestroy } from './scheduleDetachedDestroy.ts';
|
|
71
71
|
export { isDataCurrent } from './isDataCurrent.ts';
|
|
@@ -75,7 +75,7 @@ export { isGeneLikeType, isSequenceMatchType } from './featureTypes.ts';
|
|
|
75
75
|
export { locStringsToRegions } from './locStringsToRegions.ts';
|
|
76
76
|
export type { RefNameSource } from './locStringsToRegions.ts';
|
|
77
77
|
export { type ParsedLocString, UnknownRefNameError, assembleLocString, assembleLocStringRaw, assembleLocStrings, compareLocStrings, compareLocs, parseLocString, parseLocStringOneBased, stringify, } from './locString.ts';
|
|
78
|
-
export { type
|
|
78
|
+
export { type AbortBreakpoint, checkAbortSignal, createAbortBreakpoint, withAbortCheck, } from './aborting.ts';
|
|
79
79
|
export { type AddTrackComponentModel, type AddTrackComponentProps, adapterNeedsAddTrackComponent, addAddTrackComponent, } from './addTrackComponent.ts';
|
|
80
80
|
export { adapterConfigFromSpec } from './formatGuessers.ts';
|
|
81
81
|
export { type AdapterConfig, type AdapterGuesser, type LooseTrackInput, type TrackTypeGuesser, UNKNOWN, UNSUPPORTED, addAdapterGuesser, addTrackTypeGuesser, clearFileFromCache, ensureFileHandleReady, expandLooseTrackConfig, findFileHandleIds, generateUnknownTrackConf, generateUnsupportedTrackConf, getBlob, getBlobMap, getConfAssemblyNames, getFileFromCache, getFileName, getRpcSessionId, getTrackAssemblyNames, getTrackName, guessAdapter, guessTrackConf, guessTrackType, hasFileHandlesInCache, hideTrackGeneric, isLooseTrackConfig, makeIndex, makeIndexType, restoreFileHandles, restoreFileHandlesFromSnapshot, setBlobMap, setFileInCache, showTrackGeneric, storeBlobLocation, storeFileHandleLocation, stripFileExtension, stripTrackIds, toggleTrackGeneric, } from './tracks.ts';
|
package/esm/util/index.js
CHANGED
|
@@ -30,7 +30,7 @@ export { avg, clamp, getDisplayStr, getNumberGrouping, max, maxFinite, min, minm
|
|
|
30
30
|
export { bpSpanPx, bpToPx, bytesForRegions, featureSpanPx, getBpDisplayStr, getTickDisplayStr, parseBpString, } from './bpUtils.js';
|
|
31
31
|
export { gatherOverlaps, mergeIntervals, } from './intervals.js';
|
|
32
32
|
export { clampToContig, clampToListedContig } from './clampToContig.js';
|
|
33
|
-
export { animationAllowed } from './animationAllowed.js';
|
|
33
|
+
export { MORPH_DURATION_MS, animationAllowed, easeInOutCubic, morphClockMs, } from './animationAllowed.js';
|
|
34
34
|
export { springAnimate } from './springAnimate.js';
|
|
35
35
|
export { localStorageAvailable, localStorageGetBoolean, localStorageGetItem, localStorageGetJSON, localStorageGetNumber, localStorageGetStringArray, localStorageRemoveItem, localStorageSetBoolean, localStorageSetItem, localStorageSetJSON, localStorageSetNumber, notifyLocalStorageKey, subscribeToLocalStorageKey, } from './localStorage.js';
|
|
36
36
|
export { renameRegionIfNeeded, renameRegionsIfNeeded } from './renameRegions.js';
|
|
@@ -119,6 +119,7 @@ export function isSupportedIndexingAdapter(type = '') {
|
|
|
119
119
|
// needing insertion order builds its own Map (see tree-sidebar's CLAUDE.md).
|
|
120
120
|
export function groupBy(array, predicate) {
|
|
121
121
|
const result = Object.create(null);
|
|
122
|
+
// eslint-disable-next-line unicorn/prefer-group-by -- Object.groupBy types its result Partial, which would widen every caller's Object.values to `T[] | undefined`
|
|
122
123
|
for (const value of array) {
|
|
123
124
|
const t = predicate(value);
|
|
124
125
|
result[t] ??= [];
|
|
@@ -135,7 +136,7 @@ export function testAdapter(fileName, regex, adapterHint, expected) {
|
|
|
135
136
|
export { default as SimpleFeature, isFeature, } from './simpleFeature.js';
|
|
136
137
|
export { saveAs } from './FileSaver/index.js';
|
|
137
138
|
export { saveSvgAsImage, svgHtmlToPngBlob, } from '../svg/saveSvgAsImage.js';
|
|
138
|
-
export { createStatusChannel,
|
|
139
|
+
export { createStatusChannel, createAbortRotation, } from './createAbortRotation.js';
|
|
139
140
|
// `installFetch` is deliberately NOT re-exported here: it reaches `getSession`
|
|
140
141
|
// through `fetchContext.ts`, which imports this barrel, so exporting it makes
|
|
141
142
|
// the barrel initialize itself. Import it from `@jbrowse/core/util/installFetch`.
|
|
@@ -147,7 +148,7 @@ export { linkify } from './linkify.js';
|
|
|
147
148
|
export { isGeneLikeType, isSequenceMatchType } from './featureTypes.js';
|
|
148
149
|
export { locStringsToRegions } from './locStringsToRegions.js';
|
|
149
150
|
export { UnknownRefNameError, assembleLocString, assembleLocStringRaw, assembleLocStrings, compareLocStrings, compareLocs, parseLocString, parseLocStringOneBased, stringify, } from './locString.js';
|
|
150
|
-
export {
|
|
151
|
+
export { checkAbortSignal, createAbortBreakpoint, withAbortCheck, } from './aborting.js';
|
|
151
152
|
export { adapterNeedsAddTrackComponent, addAddTrackComponent, } from './addTrackComponent.js';
|
|
152
153
|
export { adapterConfigFromSpec } from './formatGuessers.js';
|
|
153
154
|
export { UNKNOWN, UNSUPPORTED, addAdapterGuesser, addTrackTypeGuesser, clearFileFromCache, ensureFileHandleReady, expandLooseTrackConfig, findFileHandleIds, generateUnknownTrackConf, generateUnsupportedTrackConf, getBlob, getBlobMap, getConfAssemblyNames, getFileFromCache, getFileName, getRpcSessionId, getTrackAssemblyNames, getTrackName, guessAdapter, guessTrackConf, guessTrackType, hasFileHandlesInCache, hideTrackGeneric, isLooseTrackConfig, makeIndex, makeIndexType, restoreFileHandles, restoreFileHandlesFromSnapshot, setBlobMap, setFileInCache, showTrackGeneric, storeBlobLocation, storeFileHandleLocation, stripFileExtension, stripTrackIds, toggleTrackGeneric, } from './tracks.js';
|
|
@@ -73,7 +73,7 @@ export function siblingLocation(location, fileName) {
|
|
|
73
73
|
const replaceLast = (path) =>
|
|
74
74
|
// the separator is kept: a Windows local path uses backslashes and a URI
|
|
75
75
|
// never does, so rebuilding with '/' would corrupt one of them
|
|
76
|
-
path.replace(/[^/\\]*$/, fileName);
|
|
76
|
+
path.replace(/[^/\\]*$/, () => fileName);
|
|
77
77
|
if (location.locationType === 'UriLocation') {
|
|
78
78
|
return { ...location, uri: replaceLast(location.uri) };
|
|
79
79
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { ActiveFetch, StatusReporter,
|
|
1
|
+
import type { ActiveFetch, StatusReporter, AbortRotation } from './createAbortRotation.ts';
|
|
2
2
|
import type { FetchContext } from './fetchContext.ts';
|
|
3
3
|
import type { FetchPhases } from './fetchPhases.ts';
|
|
4
|
-
import type { StopToken } from './stopToken.ts';
|
|
5
4
|
import type { IStateTreeNode } from '@jbrowse/mobx-state-tree';
|
|
6
5
|
/**
|
|
7
6
|
* The bookkeeping a family hangs off one fetch, beside the phases. Each of the
|
|
@@ -24,17 +23,17 @@ export interface FetchLifecycle {
|
|
|
24
23
|
setError: (error?: unknown) => void;
|
|
25
24
|
/**
|
|
26
25
|
* Runs synchronously as the fetch starts, after the rotation has superseded
|
|
27
|
-
* whatever it replaced: the loading flag (`FetchMixin`'s `
|
|
26
|
+
* whatever it replaced: the loading flag (`FetchMixin`'s `activeSignal`,
|
|
28
27
|
* through `fetchMixinLifecycle`), and anything a display blanks
|
|
29
28
|
* because it has no freshness signature to keep stale data honest with
|
|
30
29
|
* (chord's refName map).
|
|
31
30
|
*
|
|
32
|
-
* Takes the
|
|
31
|
+
* Takes the signal rather than the whole {@link ActiveFetch}: publishing it is
|
|
33
32
|
* the only thing any implementation does with the fetch, and the guard and
|
|
34
33
|
* the status slot are the skeleton's to hand out — through `ctx`, where a
|
|
35
34
|
* `run` gets them pre-wired.
|
|
36
35
|
*/
|
|
37
|
-
onBegin?: (
|
|
36
|
+
onBegin?: (signal: AbortSignal) => void;
|
|
38
37
|
/**
|
|
39
38
|
* Runs in the `finally`, before the rotation's `end()`. `current` is this
|
|
40
39
|
* run's own guard, already evaluated: a **superseded** run must not clear the
|
|
@@ -56,7 +55,7 @@ export interface FetchLifecycle {
|
|
|
56
55
|
* the loading flag on an abort. The rules only pay for themselves by being the
|
|
57
56
|
* same everywhere, so they live here and the differences are parameters.
|
|
58
57
|
*
|
|
59
|
-
* `active` comes from a {@link
|
|
58
|
+
* `active` comes from a {@link createAbortRotation} `begin()` the caller
|
|
60
59
|
* already made, because who owns the rotation is one of the real differences: a
|
|
61
60
|
* display's *primary* fetch rotates through `FetchMixin`, so `cancelFetch` can
|
|
62
61
|
* reach it, while every other fetch's rotation lives in its installer's closure
|
|
@@ -143,8 +142,12 @@ interface InstallFetchOptionsBase<TArgs, TResult> extends FetchPhases<TArgs, TRe
|
|
|
143
142
|
*
|
|
144
143
|
* Omit it where the fetch holds no committed state to compare against — most
|
|
145
144
|
* of them, whose `prepare` returns args unconditionally.
|
|
145
|
+
*
|
|
146
|
+
* A value, compared by `isDataCurrent`: the settings a fetch was issued
|
|
147
|
+
* under go in as the object the worker receives, never as a serialized
|
|
148
|
+
* spelling of it.
|
|
146
149
|
*/
|
|
147
|
-
fetchKey?: (args: TArgs) =>
|
|
150
|
+
fetchKey?: (args: TArgs) => unknown;
|
|
148
151
|
/**
|
|
149
152
|
* The key of the data already committed, when the host keeps one —
|
|
150
153
|
* `KeyedFetchMixin` stamps `loadedFetchKey`, which its `dataCurrent` reads
|
|
@@ -157,10 +160,10 @@ interface InstallFetchOptionsBase<TArgs, TResult> extends FetchPhases<TArgs, TRe
|
|
|
157
160
|
* write is what wakes the autorun to fetch A again. A closure variable would
|
|
158
161
|
* leave data B under viewport A until the next input moved.
|
|
159
162
|
*/
|
|
160
|
-
loadedKey?: () =>
|
|
163
|
+
loadedKey?: () => unknown;
|
|
161
164
|
/**
|
|
162
165
|
* The predicate form of the freshness gate, for a fetch whose "I have exactly
|
|
163
|
-
* this already" is not
|
|
166
|
+
* this already" is not key equality: the density tier holds bins over a
|
|
164
167
|
* buffered read and answers a viewport those bins *contain*, which no key can
|
|
165
168
|
* spell. Same rules as `fetchKey` — declined runs report `declined`, and a
|
|
166
169
|
* `reloadCounter` advanced since the last issued fetch overrides it — so the
|
|
@@ -203,7 +206,7 @@ export type InstallFetchOptions<TArgs, TResult> = InstallFetchOptionsBase<TArgs,
|
|
|
203
206
|
rotation?: never;
|
|
204
207
|
} | {
|
|
205
208
|
/** the host's own latest-wins rotation, lent whole — see above */
|
|
206
|
-
rotation:
|
|
209
|
+
rotation: AbortRotation;
|
|
207
210
|
report?: never;
|
|
208
211
|
});
|
|
209
212
|
/**
|
package/esm/util/installFetch.js
CHANGED
|
@@ -2,7 +2,7 @@ import { addDisposer, isAlive } from '@jbrowse/mobx-state-tree';
|
|
|
2
2
|
import { observable, runInAction, untracked } from 'mobx';
|
|
3
3
|
import { assertDisplayContract, makeRetryContractCheck, } from '../pluggableElementTypes/models/assertDisplayContract.js';
|
|
4
4
|
import { handleFetchError } from './aborting.js';
|
|
5
|
-
import {
|
|
5
|
+
import { createAbortRotation } from './createAbortRotation.js';
|
|
6
6
|
import { makeFetchContext } from './fetchContext.js';
|
|
7
7
|
import { isDataCurrent } from './isDataCurrent.js';
|
|
8
8
|
import { leadingEdgeAutorun } from './leadingEdgeAutorun.js';
|
|
@@ -18,7 +18,7 @@ import { leadingEdgeAutorun } from './leadingEdgeAutorun.js';
|
|
|
18
18
|
* the loading flag on an abort. The rules only pay for themselves by being the
|
|
19
19
|
* same everywhere, so they live here and the differences are parameters.
|
|
20
20
|
*
|
|
21
|
-
* `active` comes from a {@link
|
|
21
|
+
* `active` comes from a {@link createAbortRotation} `begin()` the caller
|
|
22
22
|
* already made, because who owns the rotation is one of the real differences: a
|
|
23
23
|
* display's *primary* fetch rotates through `FetchMixin`, so `cancelFetch` can
|
|
24
24
|
* reach it, while every other fetch's rotation lives in its installer's closure
|
|
@@ -30,13 +30,13 @@ import { leadingEdgeAutorun } from './leadingEdgeAutorun.js';
|
|
|
30
30
|
* flow, and so an action, which MobX runs untracked already.
|
|
31
31
|
*/
|
|
32
32
|
export async function runFetchOnce(self, active, args, { run, commit, setError, onBegin, onEnd, }) {
|
|
33
|
-
const {
|
|
33
|
+
const { signal, isCurrent, statusCallback, end } = active;
|
|
34
34
|
// synchronous, so it lands while this run is by construction the current one
|
|
35
35
|
setError(undefined);
|
|
36
|
-
onBegin?.(
|
|
36
|
+
onBegin?.(signal);
|
|
37
37
|
try {
|
|
38
38
|
const result = await run(args, makeFetchContext(self, {
|
|
39
|
-
|
|
39
|
+
signal,
|
|
40
40
|
isStale: () => !isCurrent(),
|
|
41
41
|
statusCallback,
|
|
42
42
|
}));
|
|
@@ -52,8 +52,8 @@ export async function runFetchOnce(self, active, args, { run, commit, setError,
|
|
|
52
52
|
finally {
|
|
53
53
|
// Both `onEnd` implementations are MST actions on `self`, and a display
|
|
54
54
|
// destroyed mid-fetch — a track closed, a display type switched out from
|
|
55
|
-
// under a load — still resumes here. `beforeDestroy` already
|
|
56
|
-
//
|
|
55
|
+
// under a load — still resumes here. `beforeDestroy` already aborted the
|
|
56
|
+
// signal, so the bookkeeping is moot on a dead node; calling the action
|
|
57
57
|
// anyway only warns.
|
|
58
58
|
if (isAlive(self)) {
|
|
59
59
|
onEnd?.(isCurrent());
|
|
@@ -79,7 +79,7 @@ function installContractChecks(self, contract) {
|
|
|
79
79
|
* would drop a write the host's other operations are still owed.
|
|
80
80
|
*/
|
|
81
81
|
function ownRotation(self, report) {
|
|
82
|
-
const rotation =
|
|
82
|
+
const rotation = createAbortRotation(self, report);
|
|
83
83
|
addDisposer(self, () => {
|
|
84
84
|
rotation.dispose();
|
|
85
85
|
});
|
|
@@ -118,9 +118,10 @@ export function installFetch(self, opts) {
|
|
|
118
118
|
let issuedEpoch;
|
|
119
119
|
// The skeleton's own stamp exists only where there is a key to stamp — a
|
|
120
120
|
// fetch with no `fetchKey` never reads it, so allocating one would only feed
|
|
121
|
-
// it `undefined` on every commit.
|
|
121
|
+
// it `undefined` on every commit. Shallow, because the deep enhancer would
|
|
122
|
+
// swap a stamped key object for an observable copy of it.
|
|
122
123
|
const stamp = loadedKey === undefined && fetchKey !== undefined
|
|
123
|
-
? observable.box()
|
|
124
|
+
? observable.box(undefined, { deep: false })
|
|
124
125
|
: undefined;
|
|
125
126
|
const heldKey = loadedKey ?? (() => stamp?.get());
|
|
126
127
|
// the freshness gate in whichever form the caller declared it
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StatusReporter } from './
|
|
1
|
+
import type { StatusReporter } from './createAbortRotation.ts';
|
|
2
2
|
import type { FetchContext } from './fetchContext.ts';
|
|
3
3
|
import type { FetchSkeletonHost } from './installFetch.ts';
|
|
4
4
|
/**
|
|
@@ -12,6 +12,8 @@ export interface PrerequisiteFetchHost extends FetchSkeletonHost {
|
|
|
12
12
|
/**
|
|
13
13
|
* Read in `prepare`, so it is **tracked**: an adapter edited in the config
|
|
14
14
|
* editor has to re-read, and `run`'s own reads are untracked by contract.
|
|
15
|
+
* The key stamps it by reference, which is safe because nothing mutates an
|
|
16
|
+
* adapter config in place: it is a config snapshot or built fresh from one.
|
|
15
17
|
*/
|
|
16
18
|
adapterConfig: Record<string, unknown>;
|
|
17
19
|
isMinimized: boolean;
|
|
@@ -52,7 +54,7 @@ export interface PrerequisiteFetchHost extends FetchSkeletonHost {
|
|
|
52
54
|
* nothing; a header is not a load.
|
|
53
55
|
*
|
|
54
56
|
* `createAdapterMetadataFetch` keys on the same adapter config and is
|
|
55
|
-
* deliberately NOT one of these: no trigger, no
|
|
57
|
+
* deliberately NOT one of these: no trigger, no signal and no status,
|
|
56
58
|
* because it is fetched lazily when a details widget opens and the widget opens
|
|
57
59
|
* on the result. A prerequisite read is the one a display's own fetch waits on.
|
|
58
60
|
*
|
|
@@ -69,7 +71,7 @@ export interface PrerequisiteFetchHost extends FetchSkeletonHost {
|
|
|
69
71
|
* Everything the skeleton gives it is the point of going through the skeleton:
|
|
70
72
|
* the latest-wins rotation (so a superseding read aborts the one it replaced,
|
|
71
73
|
* and only a superseding read does — a user cancel of the primary fetch cannot
|
|
72
|
-
* strand the display the way sharing its
|
|
74
|
+
* strand the display the way sharing its signal would), the clear at the start,
|
|
73
75
|
* the currency-guarded error rule, the unconditional `reloadCounter` read that
|
|
74
76
|
* makes the chrome's Retry re-run this, and the retired status slot that keeps a
|
|
75
77
|
* failed read from leaving a progress chip up for good.
|