@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
|
@@ -1,26 +1,23 @@
|
|
|
1
|
+
import type { ZoomRange } from '../data_adapters/BaseAdapter/zoomRange.ts';
|
|
2
|
+
import type { ColorSchemeName } from './colorSchemes.ts';
|
|
1
3
|
/**
|
|
2
4
|
* #api
|
|
3
5
|
* Where a channel's value comes from: a feature field name, read natively
|
|
4
6
|
* (`feature.get(name)`), or a `jexl:` expression over `feature` — the opt-in
|
|
5
|
-
* escape,
|
|
7
|
+
* escape, measured at 1.5x to 2.0x native per feature (MARK_ENCODING.md
|
|
8
|
+
* "The jexl channel, measured").
|
|
6
9
|
*/
|
|
7
10
|
export type FieldRef = string;
|
|
8
|
-
/**
|
|
9
|
-
* #api
|
|
10
|
-
* The ramp a continuous colour scale samples: a named ramp, or evenly spaced
|
|
11
|
-
* CSS colour stops.
|
|
12
|
-
*/
|
|
13
|
-
export type RampRef = 'viridis' | string[];
|
|
14
11
|
/**
|
|
15
12
|
* #api
|
|
16
13
|
* A field bound to a categorical scale: each distinct value takes one entry
|
|
17
|
-
* of the channel's range — a
|
|
18
|
-
* `glyph`.
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* the
|
|
23
|
-
*
|
|
14
|
+
* of the channel's `range` — a colour for `color`, a glyph name for
|
|
15
|
+
* `glyph`. Every value derives its entry from itself (an integer takes the
|
|
16
|
+
* slot it names, anything else hashes in), so every region agrees on a value
|
|
17
|
+
* it shares with another at the cost of an occasional collision. A `domain`
|
|
18
|
+
* spends the range deliberately: the listed values take it in order, and a
|
|
19
|
+
* value the domain leaves out never takes a listed value's entry. The domain
|
|
20
|
+
* orders and spends; it never adds a value the data lacks.
|
|
24
21
|
*/
|
|
25
22
|
export interface CategoricalRef {
|
|
26
23
|
field: FieldRef;
|
|
@@ -29,42 +26,46 @@ export interface CategoricalRef {
|
|
|
29
26
|
}
|
|
30
27
|
/**
|
|
31
28
|
* #api
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* into `ramp`, and there a listed `domain` is what pins the answer across a
|
|
37
|
-
* whole view.
|
|
29
|
+
* A numeric field cut into intervals: `domain` is the ascending cut points
|
|
30
|
+
* and `range` holds one colour more, so a value paints the entry for the
|
|
31
|
+
* number of cut points it is at or past. A value that is not a number
|
|
32
|
+
* belongs to no interval.
|
|
38
33
|
*/
|
|
39
|
-
export
|
|
40
|
-
palette?: string[];
|
|
41
|
-
}) | {
|
|
34
|
+
export interface ThresholdRef {
|
|
42
35
|
field: FieldRef;
|
|
43
|
-
scale: '
|
|
44
|
-
domain?:
|
|
45
|
-
|
|
46
|
-
}
|
|
36
|
+
scale: 'threshold';
|
|
37
|
+
domain?: (string | number)[];
|
|
38
|
+
range?: string[];
|
|
39
|
+
}
|
|
47
40
|
/**
|
|
48
41
|
* #api
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* resolved from it.
|
|
55
|
-
*
|
|
56
|
-
* `resolve` is which axis the mark reads. `shared` — the default — folds it
|
|
57
|
-
* into the display's one y domain with every other mark. `independent` gives
|
|
58
|
-
* it a domain folded from its layers alone and a second axis on the right, so
|
|
59
|
-
* a coverage run and the raw features can share a plot; one mark per display
|
|
60
|
-
* may ask for it.
|
|
42
|
+
* A numeric field read through a linear or log scale into a ramp. Each end of
|
|
43
|
+
* the domain is pinned by `domainMin` or `domainMax`, or is the region's own
|
|
44
|
+
* extreme where unset, so pinning both keeps colours consistent across a
|
|
45
|
+
* whole view. The ramp is `range`'s CSS colours, evenly spaced, where it
|
|
46
|
+
* lists any, else the named `scheme`; `reverse` turns it round.
|
|
61
47
|
*/
|
|
62
|
-
export
|
|
48
|
+
export interface ContinuousRef {
|
|
63
49
|
field: FieldRef;
|
|
64
|
-
scale
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
50
|
+
scale: 'linear' | 'log';
|
|
51
|
+
domainMin?: number;
|
|
52
|
+
domainMax?: number;
|
|
53
|
+
/** The value the ramp's middle stop sits at; the domain's centre unset. */
|
|
54
|
+
domainMid?: number;
|
|
55
|
+
range?: string[];
|
|
56
|
+
scheme?: ColorSchemeName;
|
|
57
|
+
reverse?: boolean;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* #api
|
|
61
|
+
* How a mark's `color` channel resolves. A CSS colour or a `jexl:` expression
|
|
62
|
+
* returning one paints per feature with no scale; the object forms bind a
|
|
63
|
+
* field to a scale, which a legend can describe, and share the config's
|
|
64
|
+
* member names.
|
|
65
|
+
*/
|
|
66
|
+
export type ColorEncoding = string | (CategoricalRef & {
|
|
67
|
+
range?: string[];
|
|
68
|
+
}) | ContinuousRef | ThresholdRef;
|
|
68
69
|
export type GlyphName = 'disc' | 'triangle' | 'diamond';
|
|
69
70
|
/**
|
|
70
71
|
* #api
|
|
@@ -77,16 +78,17 @@ export type GlyphEncoding = GlyphName | `jexl:${string}` | (CategoricalRef & {
|
|
|
77
78
|
});
|
|
78
79
|
/**
|
|
79
80
|
* #api
|
|
80
|
-
* The declared mapping from a feature's fields to a mark's channels.
|
|
81
|
-
* defaults to `start` and `x2` to `end
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
81
|
+
* The declared mapping from a feature's fields to a mark's channels. Every
|
|
82
|
+
* positional channel is a field: `x` defaults to `start` and `x2` to `end`, a
|
|
83
|
+
* mark that plots no value leaves `y` off, and the scale `y` is read through
|
|
84
|
+
* belongs to the display rather than to the encoding. `glyph` is read by the
|
|
85
|
+
* `point` shape alone, `row` — an integer field, 0 where missing — by every
|
|
86
|
+
* shape, which stands a feature in the band it names.
|
|
85
87
|
*/
|
|
86
88
|
export interface MarkEncoding {
|
|
87
89
|
x?: FieldRef;
|
|
88
90
|
x2?: FieldRef;
|
|
89
|
-
y?:
|
|
91
|
+
y?: FieldRef;
|
|
90
92
|
row?: FieldRef;
|
|
91
93
|
color?: ColorEncoding;
|
|
92
94
|
glyph?: GlyphEncoding;
|
|
@@ -109,21 +111,57 @@ export type LaneName = 'y' | 'color' | 'colorValue' | 'glyph' | 'row' | 'index';
|
|
|
109
111
|
export type ColorScaleTable = {
|
|
110
112
|
kind: 'categorical';
|
|
111
113
|
field: string;
|
|
114
|
+
domain: string[];
|
|
115
|
+
/** The declared range, the other half of what assigns a key its colour. */
|
|
116
|
+
range?: string[];
|
|
117
|
+
/**
|
|
118
|
+
* Whether every non-empty key met here parsed as a finite number: a
|
|
119
|
+
* numeric field the declaration landed on a categorical scale, which
|
|
120
|
+
* the key can then say rather than the encoder typing the field from
|
|
121
|
+
* the data.
|
|
122
|
+
*/
|
|
123
|
+
numericKeys?: boolean;
|
|
124
|
+
/** Each key met, in the field's order, `''` for no value. */
|
|
112
125
|
entries: {
|
|
113
|
-
|
|
126
|
+
value: string;
|
|
127
|
+
color: number;
|
|
128
|
+
}[];
|
|
129
|
+
} | {
|
|
130
|
+
kind: 'threshold';
|
|
131
|
+
field: string;
|
|
132
|
+
/** The cut points, ascending, as numbers. */
|
|
133
|
+
domain: number[];
|
|
134
|
+
/** One row per interval, in order, labelled by the interval it spans. */
|
|
135
|
+
entries: {
|
|
136
|
+
value: string;
|
|
114
137
|
color: number;
|
|
115
138
|
}[];
|
|
116
139
|
} | {
|
|
117
140
|
kind: 'ramp';
|
|
118
141
|
field: string;
|
|
119
142
|
scale: 'linear' | 'log';
|
|
120
|
-
/** What the ramp spans here:
|
|
143
|
+
/** What the ramp spans here: each declared end, else `extent`'s. */
|
|
121
144
|
domain: [number, number];
|
|
122
|
-
/**
|
|
123
|
-
|
|
124
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Whether each end was declared, and so already agrees across regions;
|
|
147
|
+
* an open end is what a display widens to the union of theirs.
|
|
148
|
+
*/
|
|
149
|
+
pinned: [boolean, boolean];
|
|
150
|
+
/** The declared {@link ColorEncoding} `domainMid`, already baked into `lut`. */
|
|
151
|
+
domainMid?: number;
|
|
152
|
+
/**
|
|
153
|
+
* This region's own extremes of the field, what a display unions;
|
|
154
|
+
* `[Infinity, -Infinity]` where it holds no number, so a union passes
|
|
155
|
+
* over it.
|
|
156
|
+
*/
|
|
125
157
|
extent: [number, number];
|
|
126
158
|
lut: Uint8Array;
|
|
159
|
+
/**
|
|
160
|
+
* The ramp's RGBA stops, carried beside a `domainMid`: where the middle
|
|
161
|
+
* stop lands in `lut` depends on the domain, so a display that unions an
|
|
162
|
+
* unpinned domain past this region's bakes `lut` again from these.
|
|
163
|
+
*/
|
|
164
|
+
stops?: readonly (readonly [number, number, number, number])[];
|
|
127
165
|
};
|
|
128
166
|
/**
|
|
129
167
|
* #api
|
|
@@ -133,8 +171,10 @@ export type ColorScaleTable = {
|
|
|
133
171
|
export interface GlyphScaleTable {
|
|
134
172
|
kind: 'glyph';
|
|
135
173
|
field: string;
|
|
174
|
+
domain: string[];
|
|
175
|
+
range?: GlyphName[];
|
|
136
176
|
entries: {
|
|
137
|
-
|
|
177
|
+
value: string;
|
|
138
178
|
glyph: GlyphName;
|
|
139
179
|
}[];
|
|
140
180
|
}
|
|
@@ -159,6 +199,12 @@ export interface EncodedChannels {
|
|
|
159
199
|
* reads this beside `count` to say so.
|
|
160
200
|
*/
|
|
161
201
|
skipped: number;
|
|
202
|
+
/**
|
|
203
|
+
* Of `skipped`, the features whose `x` or `x2` read no number, such as
|
|
204
|
+
* the edges a `bin` writes for a feature lacking its field. Absent where
|
|
205
|
+
* the layer placed nothing by a field, as the density sidecar's does.
|
|
206
|
+
*/
|
|
207
|
+
skippedPosition?: number;
|
|
162
208
|
x: Uint32Array;
|
|
163
209
|
x2: Uint32Array;
|
|
164
210
|
featureIndex: Uint32Array;
|
|
@@ -208,7 +254,10 @@ export interface LayerRequest {
|
|
|
208
254
|
*/
|
|
209
255
|
export interface EncodedFeaturesResult {
|
|
210
256
|
layers: EncodedChannels[];
|
|
257
|
+
/** The sections a facet stacked every layer's rows into. */
|
|
258
|
+
facet?: FacetSection[];
|
|
211
259
|
bytes?: number;
|
|
260
|
+
zoomRange?: ZoomRange;
|
|
212
261
|
}
|
|
213
262
|
/**
|
|
214
263
|
* #api
|
|
@@ -295,16 +344,14 @@ export interface FlattenStep {
|
|
|
295
344
|
* there — greedy first fit in start order, the packing a pileup is — and
|
|
296
345
|
* write it to the field `as` (`row`). `fields` names the interval read
|
|
297
346
|
* (`start`, `end`); `padding` is bp of clearance kept between two features
|
|
298
|
-
* sharing a row
|
|
299
|
-
*
|
|
300
|
-
* encoding `row` stacks it.
|
|
347
|
+
* sharing a row. The answer is the input in start order, so a `span`
|
|
348
|
+
* encoding `row` stacks it. Under a facet it packs each section on its own.
|
|
301
349
|
*/
|
|
302
|
-
export interface
|
|
303
|
-
type: '
|
|
350
|
+
export interface PileupStep {
|
|
351
|
+
type: 'pileup';
|
|
304
352
|
as?: string;
|
|
305
|
-
fields?: [
|
|
353
|
+
fields?: [FieldRef, FieldRef];
|
|
306
354
|
padding?: number;
|
|
307
|
-
groupby?: FieldRef[];
|
|
308
355
|
}
|
|
309
356
|
/**
|
|
310
357
|
* #api
|
|
@@ -312,7 +359,7 @@ export interface StackStep {
|
|
|
312
359
|
* way GenomeSpy spells a transform; every step runs in order and the next
|
|
313
360
|
* reads what the last answered.
|
|
314
361
|
*/
|
|
315
|
-
export type TransformStep = FilterStep | FormulaStep | FlattenStep | BinStep | AggregateStep | CoverageStep |
|
|
362
|
+
export type TransformStep = FilterStep | FormulaStep | FlattenStep | BinStep | AggregateStep | CoverageStep | PileupStep;
|
|
316
363
|
export type CoreEncodeFeaturesArgs = {
|
|
317
364
|
adapterConfig: Record<string, unknown>;
|
|
318
365
|
region: {
|
|
@@ -324,8 +371,32 @@ export type CoreEncodeFeaturesArgs = {
|
|
|
324
371
|
layers: LayerRequest[];
|
|
325
372
|
/** The steps over the features, in order, before every layer encodes. */
|
|
326
373
|
transform?: TransformStep[];
|
|
327
|
-
/**
|
|
328
|
-
|
|
374
|
+
/** Split the features after the shared steps, before each layer's own. */
|
|
375
|
+
facet?: FacetSpec;
|
|
376
|
+
/**
|
|
377
|
+
* The zoom the adapter reads at, for one with zoom levels (BigWig); absent
|
|
378
|
+
* is full resolution.
|
|
379
|
+
*/
|
|
380
|
+
bpPerPx?: number;
|
|
329
381
|
byteLimit?: number;
|
|
330
382
|
sequenceAdapter?: Record<string, unknown>;
|
|
331
383
|
};
|
|
384
|
+
/**
|
|
385
|
+
* #api
|
|
386
|
+
* A row facet: split the features on `field`'s value, run every layer's own
|
|
387
|
+
* steps over each section alone, and stack the sections, each starting on the
|
|
388
|
+
* row after the one above it ends.
|
|
389
|
+
*/
|
|
390
|
+
export interface FacetSpec {
|
|
391
|
+
field: FieldRef;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* #api
|
|
395
|
+
* One faceted section as the worker stacked it: its key, the row it starts on
|
|
396
|
+
* and how many rows it holds.
|
|
397
|
+
*/
|
|
398
|
+
export interface FacetSection {
|
|
399
|
+
key: string;
|
|
400
|
+
firstRow: number;
|
|
401
|
+
rowCount: number;
|
|
402
|
+
}
|
package/esm/util/mstUtils.d.ts
CHANGED
|
@@ -49,33 +49,30 @@ export declare function getRenderingServices(node: IAnyStateTreeNode): Rendering
|
|
|
49
49
|
/**
|
|
50
50
|
* #api core/util
|
|
51
51
|
* Resolve user-authored refName text against the assembly of the view
|
|
52
|
-
* containing `node
|
|
53
|
-
*
|
|
54
|
-
* aliases have not loaded.
|
|
52
|
+
* containing `node`, resolving aliases and casing together. Falls back to the
|
|
53
|
+
* input when the assembly is absent or its aliases have not loaded.
|
|
55
54
|
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* all carry the refNames the view laid out.
|
|
55
|
+
* Uses the view's assembly, not the track's, because displayed regions, loaded
|
|
56
|
+
* regions and blocks all carry the refNames the view laid out.
|
|
59
57
|
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* whatever the author read out of the location box.
|
|
58
|
+
* Call it wherever a refName a *person* wrote is about to be compared against
|
|
59
|
+
* regions, features or blocks, which carry the assembly's canonical name. A
|
|
60
|
+
* refName a display copied off a region is already canonical. One from a
|
|
61
|
+
* session spec, a config slot or a URL is whatever the author typed.
|
|
65
62
|
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
63
|
+
* Without it, matching depends on the assembly: `chr12` matches on an assembly
|
|
64
|
+
* canonicalized `chr12` and matches nothing on one canonicalized `12`. The
|
|
65
|
+
* same spec key works on one config and does nothing on the next, with no
|
|
66
|
+
* error.
|
|
70
67
|
*
|
|
71
|
-
* Resolves through `getCanonicalRefName2`,
|
|
72
|
-
* read before the alias file has loaded
|
|
73
|
-
* read user specs
|
|
68
|
+
* Resolves through `getCanonicalRefName2`, which falls back to the input
|
|
69
|
+
* instead of throwing when a spec is read before the alias file has loaded.
|
|
70
|
+
* The getters that read user specs run from the first render.
|
|
74
71
|
*
|
|
75
|
-
* Takes a refName, not a spec that might hold one
|
|
76
|
-
* `refName.toLowerCase()`, so
|
|
77
|
-
* and a caller reading an untyped `frozen` slot
|
|
78
|
-
*
|
|
72
|
+
* Takes a refName, not a spec that might hold one. The resolver calls
|
|
73
|
+
* `refName.toLowerCase()`, so any other value throws once the aliases have
|
|
74
|
+
* loaded, and a caller reading an untyped `frozen` slot must first check that
|
|
75
|
+
* the value is a refName.
|
|
79
76
|
*/
|
|
80
77
|
export declare function canonicalizeViewRefName(node: IAnyStateTreeNode, refName: string): string;
|
|
81
78
|
/**
|
package/esm/util/mstUtils.js
CHANGED
|
@@ -64,33 +64,30 @@ export function getRenderingServices(node) {
|
|
|
64
64
|
/**
|
|
65
65
|
* #api core/util
|
|
66
66
|
* Resolve user-authored refName text against the assembly of the view
|
|
67
|
-
* containing `node
|
|
68
|
-
*
|
|
69
|
-
* aliases have not loaded.
|
|
67
|
+
* containing `node`, resolving aliases and casing together. Falls back to the
|
|
68
|
+
* input when the assembly is absent or its aliases have not loaded.
|
|
70
69
|
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* all carry the refNames the view laid out.
|
|
70
|
+
* Uses the view's assembly, not the track's, because displayed regions, loaded
|
|
71
|
+
* regions and blocks all carry the refNames the view laid out.
|
|
74
72
|
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* whatever the author read out of the location box.
|
|
73
|
+
* Call it wherever a refName a *person* wrote is about to be compared against
|
|
74
|
+
* regions, features or blocks, which carry the assembly's canonical name. A
|
|
75
|
+
* refName a display copied off a region is already canonical. One from a
|
|
76
|
+
* session spec, a config slot or a URL is whatever the author typed.
|
|
80
77
|
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
78
|
+
* Without it, matching depends on the assembly: `chr12` matches on an assembly
|
|
79
|
+
* canonicalized `chr12` and matches nothing on one canonicalized `12`. The
|
|
80
|
+
* same spec key works on one config and does nothing on the next, with no
|
|
81
|
+
* error.
|
|
85
82
|
*
|
|
86
|
-
* Resolves through `getCanonicalRefName2`,
|
|
87
|
-
* read before the alias file has loaded
|
|
88
|
-
* read user specs
|
|
83
|
+
* Resolves through `getCanonicalRefName2`, which falls back to the input
|
|
84
|
+
* instead of throwing when a spec is read before the alias file has loaded.
|
|
85
|
+
* The getters that read user specs run from the first render.
|
|
89
86
|
*
|
|
90
|
-
* Takes a refName, not a spec that might hold one
|
|
91
|
-
* `refName.toLowerCase()`, so
|
|
92
|
-
* and a caller reading an untyped `frozen` slot
|
|
93
|
-
*
|
|
87
|
+
* Takes a refName, not a spec that might hold one. The resolver calls
|
|
88
|
+
* `refName.toLowerCase()`, so any other value throws once the aliases have
|
|
89
|
+
* loaded, and a caller reading an untyped `frozen` slot must first check that
|
|
90
|
+
* the value is a refName.
|
|
94
91
|
*/
|
|
95
92
|
export function canonicalizeViewRefName(node, refName) {
|
|
96
93
|
const { assemblyManager } = getSession(node);
|
|
@@ -10,6 +10,13 @@ export declare function getNumberGrouping(): boolean;
|
|
|
10
10
|
export declare function toLocale(n: number): string;
|
|
11
11
|
export declare function toPrecision(s: number, n?: number): number;
|
|
12
12
|
export declare function reducePrecision(s: number, n?: number): string;
|
|
13
|
+
/**
|
|
14
|
+
* A score as a guide prints it: three significant figures below 100, whole
|
|
15
|
+
* numbers above, trailing fractional zeros dropped. The decimal-point guard
|
|
16
|
+
* matters because toPrecision can round up out of the fractional form —
|
|
17
|
+
* 99.95 comes back as "100", where a bare trailing-zero strip would report 1.
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatScore(n: number): string;
|
|
13
20
|
/**
|
|
14
21
|
* A byte count as a person reads it. Shared by the region-too-large banner and
|
|
15
22
|
* the save-track-data dialog, which quote the same index estimate and would
|
package/esm/util/numericUtils.js
CHANGED
|
@@ -98,6 +98,22 @@ export function toPrecision(s, n = 3) {
|
|
|
98
98
|
export function reducePrecision(s, n = 3) {
|
|
99
99
|
return toLocale(toPrecision(s, n));
|
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* A score as a guide prints it: three significant figures below 100, whole
|
|
103
|
+
* numbers above, trailing fractional zeros dropped. The decimal-point guard
|
|
104
|
+
* matters because toPrecision can round up out of the fractional form —
|
|
105
|
+
* 99.95 comes back as "100", where a bare trailing-zero strip would report 1.
|
|
106
|
+
*/
|
|
107
|
+
export function formatScore(n) {
|
|
108
|
+
if (n === 0) {
|
|
109
|
+
return '0';
|
|
110
|
+
}
|
|
111
|
+
if (Math.abs(n) >= 100) {
|
|
112
|
+
return n.toFixed(0);
|
|
113
|
+
}
|
|
114
|
+
const s = n.toPrecision(3);
|
|
115
|
+
return s.includes('.') ? s.replace(/\.?0+$/, '') : s;
|
|
116
|
+
}
|
|
101
117
|
/**
|
|
102
118
|
* A byte count as a person reads it. Shared by the region-too-large banner and
|
|
103
119
|
* the save-track-data dialog, which quote the same index estimate and would
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A field's value as the number a quantitative channel or step reads, `NaN`
|
|
3
|
+
* where it holds none. `Number()` answers 0 for `null`, `''`, `[]` and
|
|
4
|
+
* `[null]` — a VCF's `DP=.` arrives as the last — which plots a missing value
|
|
5
|
+
* as a measured zero. A one-element list is its element, as a VCF INFO value
|
|
6
|
+
* is; a string has to hold digits; anything else is not a number.
|
|
7
|
+
*
|
|
8
|
+
* The order is the measurement: a number returns first, and a string converts
|
|
9
|
+
* before its blank check, which runs only on a zero. Over a million features
|
|
10
|
+
* against `Number()`, interleaved in one process: numbers 0.98x, strings
|
|
11
|
+
* 1.00-1.02x, one-element lists 0.28x. Testing the list first and trimming
|
|
12
|
+
* every string measured 1.11-1.16x on a string column.
|
|
13
|
+
*/
|
|
14
|
+
export declare function numericValue(value: unknown): number;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
function textNumber(text) {
|
|
2
|
+
const n = Number(text);
|
|
3
|
+
return n === 0 && text.trim() === '' ? Number.NaN : n;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A field's value as the number a quantitative channel or step reads, `NaN`
|
|
7
|
+
* where it holds none. `Number()` answers 0 for `null`, `''`, `[]` and
|
|
8
|
+
* `[null]` — a VCF's `DP=.` arrives as the last — which plots a missing value
|
|
9
|
+
* as a measured zero. A one-element list is its element, as a VCF INFO value
|
|
10
|
+
* is; a string has to hold digits; anything else is not a number.
|
|
11
|
+
*
|
|
12
|
+
* The order is the measurement: a number returns first, and a string converts
|
|
13
|
+
* before its blank check, which runs only on a zero. Over a million features
|
|
14
|
+
* against `Number()`, interleaved in one process: numbers 0.98x, strings
|
|
15
|
+
* 1.00-1.02x, one-element lists 0.28x. Testing the list first and trimming
|
|
16
|
+
* every string measured 1.11-1.16x on a string column.
|
|
17
|
+
*/
|
|
18
|
+
export function numericValue(value) {
|
|
19
|
+
if (typeof value === 'number') {
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
if (typeof value === 'string') {
|
|
23
|
+
return textNumber(value);
|
|
24
|
+
}
|
|
25
|
+
if (Array.isArray(value) && value.length === 1) {
|
|
26
|
+
const v = value[0];
|
|
27
|
+
return typeof v === 'number'
|
|
28
|
+
? v
|
|
29
|
+
: typeof v === 'string'
|
|
30
|
+
? textNumber(v)
|
|
31
|
+
: Number.NaN;
|
|
32
|
+
}
|
|
33
|
+
return Number.NaN;
|
|
34
|
+
}
|
|
@@ -30,14 +30,13 @@ export function openFeatureWidget(node, featureData, opts = {}) {
|
|
|
30
30
|
}
|
|
31
31
|
session.setSelection(opts.feature ?? new SimpleFeature(featureData));
|
|
32
32
|
const { type, id } = opts.widget ?? DEFAULT_FEATURE_WIDGET;
|
|
33
|
-
const widget = session.
|
|
33
|
+
const widget = session.openWidget(type, id, {
|
|
34
34
|
featureData,
|
|
35
35
|
parentFeature: opts.parentFeature,
|
|
36
36
|
view: getContainingView(node),
|
|
37
37
|
track: getContainingTrack(node),
|
|
38
38
|
...opts.extra,
|
|
39
39
|
});
|
|
40
|
-
session.showWidget(widget);
|
|
41
40
|
return widget;
|
|
42
41
|
}
|
|
43
42
|
/**
|
package/esm/util/openViews.d.ts
CHANGED
|
@@ -14,3 +14,4 @@ import type { AbstractSessionModel, AbstractTrackModel, AbstractViewModel } from
|
|
|
14
14
|
export declare function openViews(session: AbstractSessionModel): AbstractViewModel[];
|
|
15
15
|
/** Every track on every open view. */
|
|
16
16
|
export declare function openTracks(session: AbstractSessionModel): AbstractTrackModel[];
|
|
17
|
+
export declare function viewAndNested(view: AbstractViewModel): AbstractViewModel[];
|
package/esm/util/openViews.js
CHANGED
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
* getter holds annotation rows that are not tracks.
|
|
12
12
|
*/
|
|
13
13
|
export function openViews(session) {
|
|
14
|
-
return session.views.flatMap(
|
|
14
|
+
return session.views.flatMap(viewAndNested);
|
|
15
15
|
}
|
|
16
16
|
/** Every track on every open view. */
|
|
17
17
|
export function openTracks(session) {
|
|
18
18
|
return openViews(session).flatMap(v => v.ownTracks ?? []);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
return [view, ...(view.ownViews ?? []).flatMap(
|
|
20
|
+
export function viewAndNested(view) {
|
|
21
|
+
return [view, ...(view.ownViews ?? []).flatMap(viewAndNested)];
|
|
22
22
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IntervalTree } from './IntervalTree.ts';
|
|
2
2
|
import type { StatusCallback } from './progress.ts';
|
|
3
|
-
import type { StopToken } from './stopToken.ts';
|
|
4
3
|
export type { StatusCallback };
|
|
5
4
|
export type LineCallback = (line: string, lineIndex: number) => boolean | undefined;
|
|
6
5
|
/**
|
|
@@ -37,10 +36,10 @@ export declare function makeFeatureIntervalTreeMap<T extends {
|
|
|
37
36
|
* default to `() => {}`, which says the opposite.
|
|
38
37
|
* @param opts - `label` names the phase on the progress bar (a multi-phase
|
|
39
38
|
* adapter wants "Parsing PAF", not another "Loading" indistinguishable from
|
|
40
|
-
* the download that preceded it); `
|
|
41
|
-
*
|
|
39
|
+
* the download that preceded it); `signal` is read on every line, but the
|
|
40
|
+
* parse never yields, so it sees only an abort that landed before it began.
|
|
42
41
|
*/
|
|
43
42
|
export declare function parseLineByLine(buffer: Uint8Array, lineCallback: LineCallback, statusCallback: StatusCallback | undefined, opts?: {
|
|
44
43
|
label?: string;
|
|
45
|
-
|
|
44
|
+
signal?: AbortSignal;
|
|
46
45
|
}): void;
|
|
@@ -97,21 +97,17 @@ function chunkBoundary(buffer, start) {
|
|
|
97
97
|
* default to `() => {}`, which says the opposite.
|
|
98
98
|
* @param opts - `label` names the phase on the progress bar (a multi-phase
|
|
99
99
|
* adapter wants "Parsing PAF", not another "Loading" indistinguishable from
|
|
100
|
-
* the download that preceded it); `
|
|
101
|
-
*
|
|
100
|
+
* the download that preceded it); `signal` is read on every line, but the
|
|
101
|
+
* parse never yields, so it sees only an abort that landed before it began.
|
|
102
102
|
*/
|
|
103
103
|
export function parseLineByLine(buffer, lineCallback, statusCallback, opts = {}) {
|
|
104
|
-
const { label = 'Loading',
|
|
104
|
+
const { label = 'Loading', signal } = opts;
|
|
105
105
|
const decoder = new TextDecoder('utf8');
|
|
106
|
-
// Time-gated, not gated on a line counter: a file of few but very expensive
|
|
107
|
-
// lines would never reach a count mask, freezing the bar at 0% for the whole
|
|
108
|
-
// parse (the failure createProgressReporter documents). The stop-token check
|
|
109
|
-
// rides the same tick, so cancellation lands within one window.
|
|
110
106
|
const report = createProgressReporter({
|
|
111
107
|
label,
|
|
112
108
|
total: buffer.length,
|
|
113
109
|
statusCallback,
|
|
114
|
-
|
|
110
|
+
signal,
|
|
115
111
|
});
|
|
116
112
|
let chunkStart = 0;
|
|
117
113
|
let i = 0;
|
|
@@ -140,11 +136,9 @@ export function parseLineByLine(buffer, lineCallback, statusCallback, opts = {})
|
|
|
140
136
|
}
|
|
141
137
|
}
|
|
142
138
|
i++;
|
|
143
|
-
// Chunk-granular position
|
|
144
|
-
//
|
|
145
|
-
//
|
|
146
|
-
// within the chunk would mean converting a UTF-16 offset back to a byte
|
|
147
|
-
// offset, and at 64KB the bar already moves in sub-percent steps.
|
|
139
|
+
// Chunk-granular position: interpolating within the chunk would mean
|
|
140
|
+
// converting a UTF-16 offset back to a byte offset, and at 64KB the bar
|
|
141
|
+
// already moves in sub-percent steps.
|
|
148
142
|
report(chunkStart);
|
|
149
143
|
p = lineEnd + 1;
|
|
150
144
|
}
|