@jbrowse/core 5.0.0-beta.7 → 5.0.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +427 -130
- package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +5 -3
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +3 -5
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +8 -9
- package/esm/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +8 -13
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +2 -1
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +3 -3
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.d.ts +8 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.js +24 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +5 -3
- package/esm/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +1 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/index.js +1 -4
- package/esm/BaseFeatureWidget/BaseFeatureDetail/jexlFilterActions.d.ts +16 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/jexlFilterActions.js +53 -0
- package/esm/BaseFeatureWidget/BaseFeatureDetail/util.d.ts +0 -8
- package/esm/BaseFeatureWidget/BaseFeatureDetail/util.js +0 -16
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.js +7 -34
- package/esm/BaseFeatureWidget/configSchema.d.ts +1 -1
- package/esm/BaseFeatureWidget/formatDetails.d.ts +13 -29
- package/esm/BaseFeatureWidget/formatDetails.js +46 -79
- package/esm/BaseFeatureWidget/index.d.ts +1 -0
- package/esm/BaseFeatureWidget/stateModelFactory.d.ts +35 -28
- package/esm/BaseFeatureWidget/stateModelFactory.js +94 -102
- package/esm/BaseFeatureWidget/types.d.ts +3 -0
- package/esm/BaseFeatureWidget/util.d.ts +0 -3
- package/esm/BaseFeatureWidget/util.js +0 -17
- package/esm/PluginLoader.d.ts +14 -9
- package/esm/PluginLoader.js +34 -26
- package/esm/PluginManager.d.ts +4 -4
- package/esm/PluginManager.js +1 -1
- package/esm/ReExports/coreModules.generated.d.ts +2 -0
- package/esm/ReExports/coreModules.generated.js +492 -0
- package/esm/ReExports/coreWorkerModules.generated.d.ts +2 -0
- package/esm/ReExports/coreWorkerModules.generated.js +453 -0
- package/esm/ReExports/frameworkModules.d.ts +2 -0
- package/esm/ReExports/frameworkModules.js +67 -0
- package/esm/ReExports/frameworkShared.d.ts +12 -0
- package/esm/ReExports/frameworkShared.js +16 -0
- package/esm/ReExports/frameworkWorkerModules.generated.d.ts +2 -0
- package/esm/ReExports/frameworkWorkerModules.generated.js +130 -0
- package/esm/ReExports/list.js +493 -79
- package/esm/ReExports/modules.d.ts +1 -1
- package/esm/ReExports/modules.js +10 -87
- package/esm/ReExports/registry.d.ts +1 -0
- package/esm/ReExports/registry.js +23 -5
- package/esm/ReExports/uiStub.d.ts +2 -1
- package/esm/ReExports/uiStub.js +24 -2
- package/esm/ReExports/workerModules.js +8 -12
- package/esm/TextSearch/TextSearchManager.d.ts +3 -12
- package/esm/TextSearch/TextSearchManager.js +22 -10
- package/esm/assemblyManager/assembly.d.ts +10 -14
- package/esm/assemblyManager/assembly.js +10 -14
- package/esm/assemblyManager/assemblyConfigSchema.d.ts +23 -81
- package/esm/assemblyManager/assemblyManager.d.ts +10 -16
- package/esm/assemblyManager/assemblyManager.js +7 -10
- package/esm/assemblyManager/loadRefNameMap.js +3 -3
- package/esm/configuration/configurationSchema.d.ts +75 -31
- package/esm/configuration/configurationSchema.js +74 -40
- package/esm/configuration/configurationSchemaUnion.d.ts +39 -0
- package/esm/configuration/configurationSchemaUnion.js +59 -0
- package/esm/configuration/configurationSlot.d.ts +37 -12
- package/esm/configuration/configurationSlot.js +83 -22
- package/esm/configuration/formatAboutConfigSchema.d.ts +7 -21
- package/esm/configuration/formatDetailsConfigSchema.d.ts +11 -37
- package/esm/configuration/formatDetailsConfigSchema.js +10 -13
- package/esm/configuration/getConf.d.ts +17 -9
- package/esm/configuration/getConf.js +52 -7
- package/esm/configuration/index.d.ts +11 -4
- package/esm/configuration/index.js +7 -4
- package/esm/configuration/mergeFormatCallbacks.d.ts +6 -7
- package/esm/configuration/mergeFormatCallbacks.js +13 -10
- package/esm/configuration/readConfObject.d.ts +2 -22
- package/esm/configuration/readConfObject.js +15 -49
- package/esm/configuration/requirements.d.ts +37 -0
- package/esm/configuration/requirements.js +88 -0
- package/esm/configuration/schemaRegistry.d.ts +21 -1
- package/esm/configuration/schemaRegistry.js +11 -0
- package/esm/configuration/schemaTypes.d.ts +3 -0
- package/esm/configuration/schemaTypes.js +10 -0
- package/esm/configuration/slotFacade.d.ts +35 -4
- package/esm/configuration/slotFacade.js +96 -9
- package/esm/configuration/snapshotPreprocess.d.ts +27 -0
- package/esm/configuration/snapshotPreprocess.js +102 -0
- package/esm/configuration/types.d.ts +161 -22
- package/esm/data_adapters/BaseAdapter/BaseAdapter.d.ts +2 -2
- package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +11 -2
- package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +12 -1
- package/esm/data_adapters/BaseAdapter/featureDensity.d.ts +2 -3
- package/esm/data_adapters/BaseAdapter/featureDensity.js +2 -3
- package/esm/data_adapters/BaseAdapter/index.d.ts +22 -3
- package/esm/data_adapters/BaseAdapter/types.d.ts +3 -4
- package/esm/data_adapters/BaseAdapter/zoomRange.d.ts +10 -0
- package/esm/data_adapters/BaseAdapter/zoomRange.js +1 -0
- package/esm/data_adapters/CytobandAdapter/configSchema.d.ts +9 -11
- package/esm/data_adapters/getSequenceSubAdapter.d.ts +1 -3
- package/esm/data_adapters/getSequenceSubAdapter.js +1 -3
- package/esm/pluggableElementTypes/AdapterType.d.ts +7 -7
- package/esm/pluggableElementTypes/RpcMethodType.d.ts +1 -1
- package/esm/pluggableElementTypes/RpcMethodType.js +3 -8
- package/esm/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.d.ts +1 -2
- package/esm/pluggableElementTypes/TextSearchAdapterType.d.ts +7 -7
- package/esm/pluggableElementTypes/index.d.ts +1 -1
- package/esm/pluggableElementTypes/index.js +1 -1
- package/esm/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +17 -7
- package/esm/pluggableElementTypes/models/BaseDisplayModel.d.ts +45 -48
- package/esm/pluggableElementTypes/models/BaseDisplayModel.js +40 -36
- package/esm/pluggableElementTypes/models/BaseTrackModel.d.ts +10 -13
- package/esm/pluggableElementTypes/models/BaseTrackModel.js +6 -6
- package/esm/pluggableElementTypes/models/BaseViewModel.d.ts +37 -17
- package/esm/pluggableElementTypes/models/BaseViewModel.js +25 -10
- package/esm/pluggableElementTypes/models/InternetAccountModel.d.ts +26 -16
- package/esm/pluggableElementTypes/models/assertDisplayContract.d.ts +1 -1
- package/esm/pluggableElementTypes/models/baseConnectionConfig.d.ts +22 -18
- package/esm/pluggableElementTypes/models/baseConnectionConfig.js +5 -5
- package/esm/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +26 -31
- package/esm/pluggableElementTypes/models/baseTrackConfig.d.ts +57 -141
- package/esm/pluggableElementTypes/models/baseTrackConfig.js +22 -26
- package/esm/pluggableElementTypes/models/components/SaveTrackData.js +2 -2
- package/esm/pluggableElementTypes/models/components/fetchTrackData.d.ts +3 -4
- package/esm/pluggableElementTypes/models/components/fetchTrackData.js +3 -3
- package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.d.ts +15 -7
- package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.js +38 -29
- package/esm/pluggableElementTypes/models/index.d.ts +1 -2
- package/esm/pluggableElementTypes/models/index.js +1 -2
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/genbank.d.ts +3 -3
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/genbank.js +4 -4
- package/esm/pluggableElementTypes/models/saveTrackFileTypes/types.d.ts +3 -3
- package/esm/rpc/BaseRpcDriver.d.ts +1 -2
- package/esm/rpc/BaseRpcDriver.js +23 -30
- package/esm/rpc/MainThreadRpcDriver.d.ts +2 -2
- package/esm/rpc/MainThreadRpcDriver.js +13 -8
- package/esm/rpc/RpcClient.d.ts +17 -6
- package/esm/rpc/RpcClient.js +42 -12
- package/esm/rpc/RpcManager.d.ts +8 -10
- package/esm/rpc/RpcManager.js +1 -1
- package/esm/rpc/RpcRegistry.d.ts +8 -2
- package/esm/rpc/RpcServer.d.ts +3 -1
- package/esm/rpc/RpcServer.js +19 -12
- package/esm/rpc/WebWorkerRpcDriver.d.ts +3 -3
- package/esm/rpc/WebWorkerRpcDriver.js +9 -47
- package/esm/rpc/byteBudget.d.ts +3 -5
- package/esm/rpc/byteBudget.js +4 -4
- package/esm/rpc/configSchema.d.ts +7 -21
- package/esm/rpc/coreRpcMethods.d.ts +1 -0
- package/esm/rpc/coreRpcMethods.js +1 -0
- package/esm/rpc/methods/CoreEncodeFeatures.d.ts +6 -5
- package/esm/rpc/methods/CoreEncodeFeatures.js +26 -31
- package/esm/rpc/methods/CoreGetEncodedFeature.d.ts +13 -0
- package/esm/rpc/methods/CoreGetEncodedFeature.js +31 -0
- package/esm/rpc/methods/CoreGetExportData.js +2 -2
- package/esm/rpc/methods/CoreGetFeatureDensity.js +2 -2
- package/esm/rpc/methods/CoreGetFeatures.js +2 -2
- package/esm/rpc/methods/CoreGetSequence.js +2 -2
- package/esm/rpc/methods/layerFeatures.d.ts +26 -0
- package/esm/rpc/methods/layerFeatures.js +40 -0
- package/esm/svg/SvgExport.js +3 -4
- package/esm/svg/SvgThemeProviders.d.ts +12 -0
- package/esm/svg/SvgThemeProviders.js +15 -0
- package/esm/svg/exportViewSvg.d.ts +32 -0
- package/esm/svg/exportViewSvg.js +13 -0
- package/esm/svg/normalizeSvgMarkup.d.ts +7 -0
- package/esm/svg/normalizeSvgMarkup.js +99 -0
- package/esm/svg/serializeSvg.d.ts +7 -0
- package/esm/svg/serializeSvg.js +11 -0
- package/esm/svg/svgReady.d.ts +8 -7
- package/esm/svg/svgReady.js +8 -7
- package/esm/svg/trackNames.d.ts +5 -5
- package/esm/svg/trackNames.js +6 -6
- package/esm/svg/wrapSvgExport.js +6 -74
- package/esm/ui/CascadingMenu.js +83 -86
- package/esm/ui/ErrorMessageStackTraceDialog.js +0 -5
- package/esm/ui/FileSelector/useInternetAccounts.d.ts +156 -96
- package/esm/ui/HoverMenu.d.ts +1 -2
- package/esm/ui/HoverMenu.js +6 -3
- package/esm/ui/JexlFilterDialog.d.ts +13 -10
- package/esm/ui/JexlFilterDialog.js +122 -49
- package/esm/ui/JexlFilterRowEditors.d.ts +15 -0
- package/esm/ui/JexlFilterRowEditors.js +90 -0
- package/esm/ui/LazyBaseTooltip.d.ts +4 -0
- package/esm/ui/LazyBaseTooltip.js +9 -0
- package/esm/ui/LoadingOverlay.js +3 -1
- package/esm/ui/MonospaceTextField.d.ts +2 -1
- package/esm/ui/MonospaceTextField.js +21 -19
- package/esm/ui/PaletteContext.d.ts +7 -9
- package/esm/ui/PaletteContext.js +24 -10
- package/esm/ui/RefNameAutocomplete/index.d.ts +1 -2
- package/esm/ui/RefNameAutocomplete/index.js +1 -1
- package/esm/ui/ScrollChrome.d.ts +6 -9
- package/esm/ui/ScrollChrome.js +5 -6
- package/esm/ui/ScrollEdgeShadow.d.ts +6 -9
- package/esm/ui/ScrollEdgeShadow.js +9 -24
- package/esm/ui/SettingsChangesTable.js +3 -3
- package/esm/ui/VerticalScrollbar.d.ts +13 -34
- package/esm/ui/VerticalScrollbar.js +29 -83
- package/esm/ui/ViewLoadingScreen.d.ts +2 -2
- package/esm/ui/ViewLoadingScreen.js +3 -3
- package/esm/ui/colorScale.d.ts +26 -1
- package/esm/ui/colorScale.js +28 -5
- package/esm/ui/colors.d.ts +49 -1
- package/esm/ui/colors.js +139 -4
- package/esm/ui/hoverBoxStyle.d.ts +14 -2
- package/esm/ui/hoverBoxStyle.js +17 -2
- package/esm/ui/index.d.ts +5 -3
- package/esm/ui/index.js +9 -7
- package/esm/ui/launchViewMenu.js +3 -3
- package/esm/ui/legendSpec.d.ts +2 -0
- package/esm/ui/legendSpec.js +3 -0
- package/esm/ui/palette.d.ts +0 -1
- package/esm/ui/palette.js +3 -27
- package/esm/ui/replaceViewAction.d.ts +1 -1
- package/esm/ui/replaceViewAction.js +1 -1
- package/esm/ui/theme.d.ts +1 -1
- package/esm/ui/theme.js +6 -40
- package/esm/ui/viewHeaderHeight.d.ts +1 -0
- package/esm/ui/viewHeaderHeight.js +1 -0
- package/esm/util/Base1DUtils.d.ts +1 -1
- package/esm/util/Base1DUtils.js +2 -2
- package/esm/util/SvgCanvas.d.ts +15 -13
- package/esm/util/SvgCanvas.js +72 -53
- package/esm/util/aborting.d.ts +39 -0
- package/esm/util/aborting.js +84 -0
- package/esm/util/adapterMetadata.d.ts +1 -1
- package/esm/util/adapterMetadata.js +6 -6
- package/esm/util/addAndShowTrack.d.ts +1 -4
- package/esm/util/addRelativeUris.d.ts +10 -2
- package/esm/util/addRelativeUris.js +22 -7
- package/esm/util/addTrackFromWidget.d.ts +2 -5
- package/esm/util/animationAllowed.d.ts +9 -0
- package/esm/util/animationAllowed.js +13 -0
- package/esm/util/applyRowResizeWheel.d.ts +10 -5
- package/esm/util/applyRowResizeWheel.js +10 -21
- package/esm/util/bandLayout.d.ts +4 -4
- package/esm/util/bandLayout.js +4 -4
- package/esm/util/bezierConnector.js +5 -4
- package/esm/util/bgzfWorkerPool.d.ts +20 -74
- package/esm/util/bgzfWorkerPool.js +20 -74
- package/esm/util/cachedSetup.d.ts +1 -1
- package/esm/util/cachedSetup.js +2 -2
- package/esm/util/categoricalField.d.ts +37 -0
- package/esm/util/categoricalField.js +52 -0
- package/esm/util/color/cssColorsLevel4.d.ts +1 -0
- package/esm/util/color/cssColorsLevel4.js +1 -0
- package/esm/util/color/index.d.ts +5 -3
- package/esm/util/color/index.js +7 -4
- package/esm/util/colorBits.d.ts +1 -2
- package/esm/util/colorBits.js +17 -39
- package/esm/util/colorRamp.d.ts +27 -1
- package/esm/util/colorRamp.js +56 -2
- package/esm/util/colorSchemes.d.ts +9 -0
- package/esm/util/colorSchemes.js +7 -0
- package/esm/util/{createStopTokenRotation.d.ts → createAbortRotation.d.ts} +11 -14
- package/esm/util/{createStopTokenRotation.js → createAbortRotation.js} +14 -26
- package/esm/util/cssColorParse.d.ts +15 -0
- package/esm/util/cssColorParse.js +53 -0
- package/esm/util/diagonalizeRegions.d.ts +2 -3
- package/esm/util/diagonalizeRegions.js +7 -12
- package/esm/util/expandLooseSearchIndex.d.ts +7 -0
- package/esm/util/expandLooseSearchIndex.js +25 -0
- package/esm/util/featureTransforms.d.ts +30 -3
- package/esm/util/featureTransforms.js +233 -36
- package/esm/util/fetchAndMaybeUnzip.js +5 -6
- package/esm/util/fetchContext.d.ts +5 -6
- package/esm/util/fetchContext.js +1 -1
- package/esm/util/fetchHub.d.ts +3 -1
- package/esm/util/fetchHub.js +2 -2
- package/esm/util/fetchSeq.d.ts +2 -3
- package/esm/util/fetchSeq.js +2 -2
- package/esm/util/fieldReader.d.ts +17 -0
- package/esm/util/fieldReader.js +62 -0
- package/esm/util/groupKeys.d.ts +75 -0
- package/esm/util/groupKeys.js +152 -0
- package/esm/util/highlights.d.ts +6 -4
- package/esm/util/highlights.js +12 -25
- package/esm/util/hooks.d.ts +1 -2
- package/esm/util/hooks.js +1 -2
- package/esm/util/index.d.ts +3 -3
- package/esm/util/index.js +4 -3
- package/esm/util/indexCandidates.js +1 -1
- package/esm/util/installFetch.d.ts +13 -10
- package/esm/util/installFetch.js +11 -10
- package/esm/util/installPrerequisiteFetch.d.ts +5 -3
- package/esm/util/installPrerequisiteFetch.js +3 -4
- package/esm/util/io/index.js +12 -12
- package/esm/util/isDataCurrent.d.ts +7 -5
- package/esm/util/isDataCurrent.js +9 -6
- package/esm/util/jexl.js +24 -21
- package/esm/util/jexlFilterRows.d.ts +89 -0
- package/esm/util/jexlFilterRows.js +252 -0
- package/esm/util/jexlFilters.d.ts +7 -5
- package/esm/util/jexlStrings.d.ts +3 -4
- package/esm/util/jexlStrings.js +2 -3
- package/esm/util/legendCandidates.d.ts +31 -27
- package/esm/util/legendCandidates.js +79 -53
- package/esm/util/localStorage.js +4 -4
- package/esm/util/markEncoding.d.ts +32 -16
- package/esm/util/markEncoding.js +177 -150
- package/esm/util/markEncodingTypes.d.ts +137 -66
- package/esm/util/mstUtils.d.ts +19 -22
- package/esm/util/mstUtils.js +19 -22
- package/esm/util/numericUtils.d.ts +7 -0
- package/esm/util/numericUtils.js +16 -0
- package/esm/util/numericValue.d.ts +14 -0
- package/esm/util/numericValue.js +34 -0
- package/esm/util/openFeatureWidget.js +1 -2
- package/esm/util/openViews.d.ts +1 -0
- package/esm/util/openViews.js +3 -3
- package/esm/util/parseLineByLine.d.ts +3 -4
- package/esm/util/parseLineByLine.js +7 -13
- package/esm/util/progress.d.ts +21 -21
- package/esm/util/progress.js +27 -26
- package/esm/util/renameRegions.d.ts +1 -2
- package/esm/util/renderToStaticMarkup.js +16 -16
- package/esm/util/rxjs.d.ts +7 -8
- package/esm/util/rxjs.js +12 -15
- package/esm/util/simpleFeature.d.ts +0 -1
- package/esm/util/svgColorProps.d.ts +11 -0
- package/esm/util/svgColorProps.js +28 -1
- package/esm/util/tabix.d.ts +3 -4
- package/esm/util/tabix.js +6 -7
- package/esm/util/thresholdScale.d.ts +54 -0
- package/esm/util/thresholdScale.js +112 -0
- package/esm/util/timeGate.d.ts +4 -5
- package/esm/util/timeGate.js +4 -5
- package/esm/util/trackConfigDelta.d.ts +22 -18
- package/esm/util/trackConfigDelta.js +40 -38
- package/esm/util/tracks.d.ts +27 -4
- package/esm/util/tracks.js +116 -43
- package/esm/util/translateTranscript.d.ts +44 -0
- package/esm/util/translateTranscript.js +102 -0
- package/esm/util/types/index.d.ts +19 -7
- package/esm/util/types/services.d.ts +1 -1
- package/esm/util/unknownSnapshotKeys.d.ts +15 -0
- package/esm/util/unknownSnapshotKeys.js +13 -0
- package/esm/util/useFeatureSequence.js +4 -4
- package/esm/util/useFetch.d.ts +3 -4
- package/esm/util/useFetch.js +5 -6
- package/esm/util/usePanelVirtualScroll.d.ts +7 -39
- package/esm/util/usePanelVirtualScroll.js +9 -40
- package/esm/util/useRowVirtualScroll.d.ts +6 -29
- package/esm/util/useRowVirtualScroll.js +8 -49
- package/esm/util/useVirtualScrollWheel.d.ts +20 -4
- package/esm/util/useVirtualScrollWheel.js +40 -84
- package/esm/util/viewHighlights.d.ts +3 -0
- package/esm/util/viewHighlights.js +5 -0
- package/esm/util/viewStatus.d.ts +24 -15
- package/esm/util/viewStatus.js +17 -0
- package/esm/util/withLaunchInput.d.ts +1 -1
- package/esm/util/withLaunchInput.js +0 -4
- package/package.json +26 -12
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.d.ts +0 -80
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.js +0 -583
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.d.ts +0 -141
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.js +0 -1116
- package/esm/ReExports/BaseFeatureDetails.d.ts +0 -1
- package/esm/ReExports/BaseFeatureDetails.js +0 -10
- package/esm/ReExports/barrelOnlyNames.d.ts +0 -5
- package/esm/ReExports/barrelOnlyNames.js +0 -63
- package/esm/ReExports/index.d.ts +0 -1
- package/esm/ReExports/index.js +0 -1
- package/esm/ReExports/publicTracks.d.ts +0 -1
- package/esm/ReExports/publicTracks.js +0 -14
- package/esm/ReExports/publicUi.d.ts +0 -4
- package/esm/ReExports/publicUi.js +0 -33
- package/esm/ReExports/publicUtil.d.ts +0 -1
- package/esm/ReExports/publicUtil.js +0 -32
- package/esm/ReExports/sharedModules.d.ts +0 -96
- package/esm/ReExports/sharedModules.js +0 -66
- package/esm/ReExports/workerNamespaceNames.d.ts +0 -11
- package/esm/ReExports/workerNamespaceNames.js +0 -275
- package/esm/pluggableElementTypes/models/HighlightsMixin.d.ts +0 -51
- package/esm/pluggableElementTypes/models/HighlightsMixin.js +0 -78
- package/esm/ui/highlightChipReveal.d.ts +0 -32
- package/esm/ui/highlightChipReveal.js +0 -39
- package/esm/util/adapterConfigKey.d.ts +0 -12
- package/esm/util/adapterConfigKey.js +0 -14
- package/esm/util/stopToken.d.ts +0 -212
- package/esm/util/stopToken.js +0 -438
package/esm/ui/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { colorFwdStrand, colorInterchrom, colorLongInsert, colorLongreadInv,
|
|
1
|
+
export { colorFwdStrand, colorInterchrom, colorLongInsert, colorLongreadInv, colorPairLL, colorPairLR, colorPairLRDark, colorPairRL, colorPairRR, colorRevStrand, colorShortInsert, colorSplitReadInversion, colorSupplementary, colorUnmappedMate, colorUnmappedMateDark, createJBrowseBaseTheme, createJBrowseTheme, createJBrowseThemeFromArgs, defaultThemes, methylated5hmC, methylated5mC, tagColorPalette, unmethylated5mC, } from './theme.js';
|
|
2
2
|
export { default as BaseExportSvgDialog } from './BaseExportSvgDialog.js';
|
|
3
3
|
export { default as ExportSvgDialog } from './ExportSvgDialog.js';
|
|
4
4
|
export { useExportSvgPreference } from './useExportSvgPreference.js';
|
|
@@ -6,7 +6,8 @@ export { LogoFull, Logomark } from './Logo.js';
|
|
|
6
6
|
export { default as AssemblySelector } from './AssemblySelector.js';
|
|
7
7
|
export { useAssemblySelection } from './useAssemblySelection.js';
|
|
8
8
|
export { useRecentLocations } from './useRecentLocations.js';
|
|
9
|
-
export { RefNameAutocompleteEndAdornment,
|
|
9
|
+
export { RefNameAutocompleteEndAdornment, default as RefNameAutocomplete, } from './RefNameAutocomplete/index.js';
|
|
10
|
+
export { adornmentReservePx, getInputWidth, } from './RefNameAutocomplete/util.js';
|
|
10
11
|
export { default as CascadingMenu } from './CascadingMenu.js';
|
|
11
12
|
export { default as CascadingMenuButton } from './CascadingMenuButton.js';
|
|
12
13
|
export { default as ContextMenu } from './ContextMenu.js';
|
|
@@ -56,10 +57,11 @@ export { default as SettingsChangesTable } from './SettingsChangesTable.js';
|
|
|
56
57
|
export { default as ActionLink } from './ActionLink.js';
|
|
57
58
|
export { default as ExternalLink } from './ExternalLink.js';
|
|
58
59
|
export { default as SanitizedHTML } from './SanitizedHTML.js';
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
// deep-
|
|
60
|
+
// The eager BaseTooltip reaches @floating-ui (~266KB), and this barrel is
|
|
61
|
+
// imported by eager plugin entries, so the barrel serves the lazy wrapper:
|
|
62
|
+
// published apollo reads `BaseTooltip` off the served ui namespace. In-tree
|
|
63
|
+
// consumers deep-import '@jbrowse/core/ui/BaseTooltip'.
|
|
64
|
+
export { default as BaseTooltip } from './LazyBaseTooltip.js';
|
|
63
65
|
export { default as PluggableComponent } from './PluggableComponent.js';
|
|
64
66
|
export { default as PluggableComponents } from './PluggableComponents.js';
|
|
65
67
|
export { default as PluggableElements } from './PluggableElements.js';
|
|
@@ -72,7 +74,7 @@ export { launchTargetsMenuItem } from './launchTargetsMenuItem.js';
|
|
|
72
74
|
export { default as Crosshairs } from './Crosshairs.js';
|
|
73
75
|
export { hoverBoxStyle } from './hoverBoxStyle.js';
|
|
74
76
|
export { useMouseState, useMouseTracking } from './useMouseTracking.js';
|
|
75
|
-
export
|
|
77
|
+
export { VIEW_HEADER_HEIGHT } from './viewHeaderHeight.js';
|
|
76
78
|
export { LEGEND_ROW_HEIGHT, LEGEND_SVG_GUTTER_WIDTH, LEGEND_SWATCH, default as SvgColorLegend, } from './SvgColorLegend.js';
|
|
77
79
|
export { measureLegendText } from './measureLegendText.js';
|
|
78
80
|
export { LegendSwatchGlyph } from './LegendSwatchGlyph.js';
|
package/esm/ui/launchViewMenu.js
CHANGED
|
@@ -34,9 +34,9 @@ export function pushIntoSubMenu(items, label, item) {
|
|
|
34
34
|
// `rubberBandLaunchMenuItems()` on the linear genome view — because there the
|
|
35
35
|
// grouping is the model's, not each contributor's, to do.
|
|
36
36
|
//
|
|
37
|
-
// Keeps its name while the label loses a word:
|
|
38
|
-
//
|
|
39
|
-
//
|
|
37
|
+
// Keeps its name while the label loses a word: `@jbrowse/core/ui` serves it, so
|
|
38
|
+
// a published plugin bundle reads it off the host at module scope and a rename
|
|
39
|
+
// is `undefined` inside an already-shipped UMD.
|
|
40
40
|
export function pushLaunchViewMenuItem(items, item) {
|
|
41
41
|
pushIntoSubMenu(items, LAUNCH_LABEL, item);
|
|
42
42
|
}
|
package/esm/ui/legendSpec.d.ts
CHANGED
|
@@ -29,7 +29,9 @@ export declare function legendSwatches(item: LegendItem): LegendSwatch[];
|
|
|
29
29
|
export interface LegendSection {
|
|
30
30
|
id: string;
|
|
31
31
|
title?: string;
|
|
32
|
+
note?: string;
|
|
32
33
|
items: LegendItem[];
|
|
34
|
+
focusesRows?: boolean;
|
|
33
35
|
}
|
|
34
36
|
export interface LegendSpec {
|
|
35
37
|
title?: string;
|
package/esm/ui/legendSpec.js
CHANGED
|
@@ -25,6 +25,9 @@ export function legendEntries(spec) {
|
|
|
25
25
|
...(titled && section.title !== undefined
|
|
26
26
|
? [{ key: `${section.id}-title`, label: section.title }]
|
|
27
27
|
: []),
|
|
28
|
+
...(section.note === undefined
|
|
29
|
+
? []
|
|
30
|
+
: [{ key: `${section.id}-note`, label: section.note }]),
|
|
28
31
|
...section.items.map((item, idx) => ({
|
|
29
32
|
key: `${section.id}-${idx}`,
|
|
30
33
|
label: item.label,
|
package/esm/ui/palette.d.ts
CHANGED
|
@@ -126,7 +126,6 @@ export declare const colorPairRL = "#0099bb";
|
|
|
126
126
|
export declare const colorPairLL = "#4d9a4d";
|
|
127
127
|
/** #color alignments-pair-orientation | RR (← ←) | Both mates on the reverse strand */
|
|
128
128
|
export declare const colorPairRR = "#5555bb";
|
|
129
|
-
export declare const colorNeutralRead = "#c8c8c8";
|
|
130
129
|
/**
|
|
131
130
|
* #color alignments-pair-orientation | Inter-chromosomal | Mate on another chromosome
|
|
132
131
|
* #color alignments-insert-size | Inter-chromosomal | Mate on another chromosome
|
package/esm/ui/palette.js
CHANGED
|
@@ -242,30 +242,6 @@ export const colorPairRL = '#0099bb';
|
|
|
242
242
|
export const colorPairLL = '#4d9a4d';
|
|
243
243
|
/** #color alignments-pair-orientation | RR (← ←) | Both mates on the reverse strand */
|
|
244
244
|
export const colorPairRR = '#5555bb';
|
|
245
|
-
// Was `colorNostrand`, which named the one thing it essentially never paints. A
|
|
246
|
-
// SAM record's strand is DEFINED from the reverse flag inside the adapter's
|
|
247
|
-
// feature class (`SamRecordFeature.strand`), so it is always +1 or -1, and a
|
|
248
|
-
// PAF/synteny block carries a real strand too — `strandCategory`'s `noStrand`
|
|
249
|
-
// branch is the defensive third case of a `-1 | 0 | 1` return, not a category
|
|
250
|
-
// an alignments track produces. The name survived because the two places that
|
|
251
|
-
// DO reach 0 are strand questions of a different kind: a sashimi junction whose
|
|
252
|
-
// spliced reads carry no XS/TS/ts tag (ordinary unstranded RNA-seq), and a
|
|
253
|
-
// strand-valued read tag that a read simply lacks.
|
|
254
|
-
//
|
|
255
|
-
// What it actually paints, in volume, is neither — `nonSplit` ("Unsplit read",
|
|
256
|
-
// the majority of a pileup under the split-read scheme) and `mapqUnavailable`
|
|
257
|
-
// (MAPQ 255). What unites all five is that the scheme's question has no
|
|
258
|
-
// informative answer for this read, so the value is the neutral it falls back
|
|
259
|
-
// to rather than a statement about strand.
|
|
260
|
-
//
|
|
261
|
-
// It is NOT the only such neutral: `colorPairLR` #d3d3d3 is the baseline for
|
|
262
|
-
// `normalInsert`, `noTagValue` and `plain`, and the two sit dE 3.95 apart —
|
|
263
|
-
// close enough that `readTagColors.ts` moved its untagged-read case off this one
|
|
264
|
-
// and onto that one, because only that one darkens under the dark theme. Whether
|
|
265
|
-
// two neutrals are wanted at all is the open question here; this rename does not
|
|
266
|
-
// settle it, and the dark-mode half is
|
|
267
|
-
// `agent-docs/ideas/dark-theme-palette-gaps.md`.
|
|
268
|
-
export const colorNeutralRead = '#c8c8c8';
|
|
269
245
|
/**
|
|
270
246
|
* #color alignments-pair-orientation | Inter-chromosomal | Mate on another chromosome
|
|
271
247
|
* #color alignments-insert-size | Inter-chromosomal | Mate on another chromosome
|
|
@@ -497,9 +473,9 @@ const skip = '#009a8a';
|
|
|
497
473
|
* which is the same lie louder — on a foldback the arms are opposite-strand
|
|
498
474
|
* red and blue, and darkening whichever drew last reads as extra-inverted.
|
|
499
475
|
*
|
|
500
|
-
* So the value has one job: read as NEITHER segment.
|
|
501
|
-
*
|
|
502
|
-
* #
|
|
476
|
+
* So the value has one job: read as NEITHER segment. The alignments vocabulary's
|
|
477
|
+
* one neutral grey is light (`colorPairLR` #d3d3d3, and `colorPairLRDark`
|
|
478
|
+
* #8a8a8a on the dark theme), so this sits past
|
|
503
479
|
* the dark end of them in light mode and past the light end in dark mode,
|
|
504
480
|
* which is also why it inverts rather than dimming: on a dark track background
|
|
505
481
|
* a charcoal span is the background showing through, i.e. a gap where the mark
|
|
@@ -6,7 +6,7 @@ import type { SubmitFormProps } from './SubmitForm.tsx';
|
|
|
6
6
|
* the launching view occupies.
|
|
7
7
|
*
|
|
8
8
|
* Every launcher anchored on what a view is already showing — the synteny
|
|
9
|
-
* launches, "read vs ref"
|
|
9
|
+
* launches, "read vs ref" — wants exactly this
|
|
10
10
|
* pair, and each had written the same four lines around
|
|
11
11
|
* {@link ReplaceCurrentViewButton}: the guard, the button, its disabled state,
|
|
12
12
|
* and the renaming of Submit that only makes sense once there are two buttons.
|
|
@@ -7,7 +7,7 @@ import ReplaceCurrentViewButton from './ReplaceCurrentViewButton.js';
|
|
|
7
7
|
* the launching view occupies.
|
|
8
8
|
*
|
|
9
9
|
* Every launcher anchored on what a view is already showing — the synteny
|
|
10
|
-
* launches, "read vs ref"
|
|
10
|
+
* launches, "read vs ref" — wants exactly this
|
|
11
11
|
* pair, and each had written the same four lines around
|
|
12
12
|
* {@link ReplaceCurrentViewButton}: the guard, the button, its disabled state,
|
|
13
13
|
* and the renaming of Submit that only makes sense once there are two buttons.
|
package/esm/ui/theme.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ declare module '@mui/material/styles' {
|
|
|
58
58
|
alignmentFill?: Partial<AlignmentFill>;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
export { colorFwdStrand, colorInterchrom, colorLongInsert, colorLongreadInv,
|
|
61
|
+
export { colorFwdStrand, colorInterchrom, colorLongInsert, colorLongreadInv, colorPairLL, colorPairLR, colorPairLRDark, colorPairRL, colorPairRR, colorRevStrand, colorShortInsert, colorSplitReadInversion, colorSupplementary, colorUnmappedMate, colorUnmappedMateDark, methylated5hmC, methylated5mC, tagColorPalette, unmethylated5mC, } from './palette.ts';
|
|
62
62
|
export type { JBrowsePalette } from './palette.ts';
|
|
63
63
|
/**
|
|
64
64
|
* The structurally-serializable inputs that fully describe a session's active
|
package/esm/ui/theme.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createTheme } from '@mui/material';
|
|
1
|
+
import { createTheme } from '@mui/material/styles';
|
|
2
2
|
import { deepMerge } from '../util/deepMerge.js';
|
|
3
3
|
import { palettePresets, resolvePalette } from './palette.js';
|
|
4
4
|
import { DEFAULT_FONT_SIZE, DEFAULT_SPACING } from './styleTheme.js';
|
|
@@ -9,7 +9,7 @@ import { DEFAULT_FONT_SIZE, DEFAULT_SPACING } from './styleTheme.js';
|
|
|
9
9
|
// Static domain colors and the theme presets are re-exported from palette.ts so
|
|
10
10
|
// existing `@jbrowse/core/ui` imports are unaffected. Import them from
|
|
11
11
|
// `@jbrowse/core/ui/palette` to get them without pulling in Material UI.
|
|
12
|
-
export { colorFwdStrand, colorInterchrom, colorLongInsert, colorLongreadInv,
|
|
12
|
+
export { colorFwdStrand, colorInterchrom, colorLongInsert, colorLongreadInv, colorPairLL, colorPairLR, colorPairLRDark, colorPairRL, colorPairRR, colorRevStrand, colorShortInsert, colorSplitReadInversion, colorSupplementary, colorUnmappedMate, colorUnmappedMateDark, methylated5hmC, methylated5mC, tagColorPalette, unmethylated5mC, } from './palette.js';
|
|
13
13
|
// The display names and MUI component overrides layered on top of each palette
|
|
14
14
|
// preset. The colors come from palette.ts, so a preset's palette is stated once
|
|
15
15
|
// and this map is the Material UI half of it.
|
|
@@ -68,6 +68,10 @@ const baseThemeOptions = {
|
|
|
68
68
|
fontSize: DEFAULT_FONT_SIZE,
|
|
69
69
|
},
|
|
70
70
|
spacing: DEFAULT_SPACING,
|
|
71
|
+
// an animation makes every popover, dialog and hover trail the input
|
|
72
|
+
motion: {
|
|
73
|
+
reducedMotion: 'always',
|
|
74
|
+
},
|
|
71
75
|
components: {
|
|
72
76
|
MuiTooltip: {
|
|
73
77
|
styleOverrides: {
|
|
@@ -90,7 +94,6 @@ const baseThemeOptions = {
|
|
|
90
94
|
disableGutters: true,
|
|
91
95
|
slotProps: {
|
|
92
96
|
transition: {
|
|
93
|
-
timeout: 150,
|
|
94
97
|
unmountOnExit: true,
|
|
95
98
|
},
|
|
96
99
|
},
|
|
@@ -166,16 +169,6 @@ const baseThemeOptions = {
|
|
|
166
169
|
size: 'small',
|
|
167
170
|
},
|
|
168
171
|
},
|
|
169
|
-
MuiPopover: {
|
|
170
|
-
defaultProps: {
|
|
171
|
-
transitionDuration: 0,
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
MuiMenu: {
|
|
175
|
-
defaultProps: {
|
|
176
|
-
transitionDuration: 0,
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
172
|
MuiMenuItem: {
|
|
180
173
|
defaultProps: {
|
|
181
174
|
dense: true,
|
|
@@ -229,33 +222,6 @@ const baseThemeOptions = {
|
|
|
229
222
|
size: 'small',
|
|
230
223
|
},
|
|
231
224
|
},
|
|
232
|
-
// Speed up ripple animations for snappier feel (default is 550ms)
|
|
233
|
-
// See https://mui.com/material-ui/api/button-base/
|
|
234
|
-
// and https://github.com/mui/material-ui/blob/master/packages/mui-material/src/ButtonBase/TouchRipple.js
|
|
235
|
-
//
|
|
236
|
-
// The click ripple only: a *focus* ripple is a different animation on the
|
|
237
|
-
// same two elements — childPulsate, which runs `infinite` — so a blanket
|
|
238
|
-
// 50ms turns MUI's 2500ms breath into a 20Hz strobe that never stops. It
|
|
239
|
-
// shows up on any focus-visible button, and Chrome hands one out unasked:
|
|
240
|
-
// it re-evaluates :focus-visible on the already-focused element after any
|
|
241
|
-
// keystroke, and the focus event that a browser-tab switch fires on the way
|
|
242
|
-
// back is what makes MUI act on it. So these select the enter and leaving
|
|
243
|
-
// keyframes by name and let the pulsate keep its own duration.
|
|
244
|
-
//
|
|
245
|
-
// Both selectors also outrank TouchRipple's own rules on specificity, which
|
|
246
|
-
// is what `!important` was here for.
|
|
247
|
-
MuiButtonBase: {
|
|
248
|
-
styleOverrides: {
|
|
249
|
-
root: {
|
|
250
|
-
'& .MuiTouchRipple-ripple.MuiTouchRipple-rippleVisible:not(.MuiTouchRipple-ripplePulsate)': {
|
|
251
|
-
animationDuration: '50ms',
|
|
252
|
-
},
|
|
253
|
-
'& .MuiTouchRipple-child.MuiTouchRipple-childLeaving': {
|
|
254
|
-
animationDuration: '50ms',
|
|
255
|
-
},
|
|
256
|
-
},
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
225
|
},
|
|
260
226
|
};
|
|
261
227
|
export function createJBrowseBaseTheme(theme = {}) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VIEW_HEADER_HEIGHT = 28;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const VIEW_HEADER_HEIGHT = 28;
|
|
@@ -43,7 +43,7 @@ export interface ViewLayout {
|
|
|
43
43
|
export declare function moveTo(self: MoveSnap & {
|
|
44
44
|
zoomTo: (arg: number) => number;
|
|
45
45
|
scrollTo: (arg: number) => void;
|
|
46
|
-
}, start?: BpOffset, end?: BpOffset): void;
|
|
46
|
+
}, start?: BpOffset, end?: BpOffset, minBpPerPx?: number): void;
|
|
47
47
|
/**
|
|
48
48
|
* Pure version of moveTo: returns the {bpPerPx, offsetPx} that moveTo would
|
|
49
49
|
* apply, without mutating any model. Assumes no bpPerPx clamping (i.e.
|
package/esm/util/Base1DUtils.js
CHANGED
|
@@ -28,10 +28,10 @@ function computeScrollPos(self, start, bpPerPx, extraBp) {
|
|
|
28
28
|
return Math.round((cumulativeBp(self.displayedRegions, start.index, start.offset) - extraBp) /
|
|
29
29
|
bpPerPx);
|
|
30
30
|
}
|
|
31
|
-
export function moveTo(self, start, end) {
|
|
31
|
+
export function moveTo(self, start, end, minBpPerPx = 0) {
|
|
32
32
|
if (start && end) {
|
|
33
33
|
const targetBpPerPx = computeTargetBpPerPx(self, start, end);
|
|
34
|
-
const newBpPerPx = self.zoomTo(targetBpPerPx);
|
|
34
|
+
const newBpPerPx = self.zoomTo(Math.max(targetBpPerPx, minBpPerPx));
|
|
35
35
|
const extraBp = targetBpPerPx < newBpPerPx
|
|
36
36
|
? ((newBpPerPx - targetBpPerPx) * self.width) / 2
|
|
37
37
|
: 0;
|
package/esm/util/SvgCanvas.d.ts
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Run `render` as one document's clip-id numbering run, starting at 0, then put
|
|
3
|
+
* the counter back.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* that aren't real, and `jest -t` on any export test but the first fails its
|
|
9
|
-
* checked-in snapshot with a diff that is nothing but renumbering.
|
|
5
|
+
* Starting at 0 is what makes the same view export to the same bytes: a counter
|
|
6
|
+
* left running numbers each export from wherever the previous one stopped, so
|
|
7
|
+
* diffing two saved SVGs shows changes that aren't real and `jest -t` on any
|
|
8
|
+
* export test but the first fails its snapshot on renumbering alone.
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
* `
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* Putting it back is what keeps a file export from renumbering the page: live
|
|
11
|
+
* figures (`useViewSvgFigure`) mint from the same counter into one DOM, where
|
|
12
|
+
* ids must not repeat, so a reset that stuck would let the next figure reuse an
|
|
13
|
+
* id another figure still points at.
|
|
14
|
+
*
|
|
15
|
+
* `render` must be synchronous — an `await` inside it would let two documents
|
|
16
|
+
* share a numbering run.
|
|
15
17
|
*/
|
|
16
|
-
export declare function
|
|
18
|
+
export declare function withFreshSvgClipIds<T>(render: () => T): T;
|
|
17
19
|
export declare class SvgCanvas {
|
|
18
20
|
private parts;
|
|
19
21
|
private pathData;
|
|
@@ -36,6 +38,7 @@ export declare class SvgCanvas {
|
|
|
36
38
|
private e;
|
|
37
39
|
private f;
|
|
38
40
|
private get axisAligned();
|
|
41
|
+
private get lengthScale();
|
|
39
42
|
private transformPoint;
|
|
40
43
|
private transformSize;
|
|
41
44
|
private originMatrixAttr;
|
|
@@ -72,7 +75,6 @@ export declare class SvgCanvas {
|
|
|
72
75
|
fillText(text: string, x: number, y: number): void;
|
|
73
76
|
strokeText(text: string, x: number, y: number): void;
|
|
74
77
|
drawImage(..._args: unknown[]): void;
|
|
75
|
-
putImageData(..._args: unknown[]): void;
|
|
76
78
|
clip(..._args: unknown[]): void;
|
|
77
79
|
measureText(text: string): {
|
|
78
80
|
width: number;
|
package/esm/util/SvgCanvas.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { measureText as measureTextWidth } from './measureText.js';
|
|
2
|
+
import { splitPaintAlpha } from './svgColorProps.js';
|
|
2
3
|
const XML_ESCAPES = {
|
|
3
4
|
'&': '&',
|
|
4
5
|
'<': '<',
|
|
@@ -29,14 +30,16 @@ function parseFont(font) {
|
|
|
29
30
|
// SVG-compatible attributes. The default sans-serif family is left off so
|
|
30
31
|
// feature labels match the raw-JSX <text> elements (ruler, scalebar, etc.),
|
|
31
32
|
// which set no family either; an explicitly-set family is still emitted.
|
|
32
|
-
function fontAttrs(font) {
|
|
33
|
+
function fontAttrs(font, scale) {
|
|
33
34
|
const { prefix, size, family } = parseFont(font);
|
|
34
35
|
const tokens = prefix.split(/\s+/).filter(Boolean);
|
|
35
36
|
const weight = tokens.find(t => fontWeightTokens.has(t) || /^\d{1,4}$/.test(t));
|
|
36
37
|
const style = tokens.find(t => fontStyleTokens.has(t));
|
|
37
38
|
return [
|
|
38
|
-
` font-size="${size}"`,
|
|
39
|
-
family === '' || family === 'sans-serif'
|
|
39
|
+
` font-size="${Number(size) * scale}"`,
|
|
40
|
+
family === '' || family === 'sans-serif'
|
|
41
|
+
? ''
|
|
42
|
+
: ` font-family="${escapeXml(family)}"`,
|
|
40
43
|
weight ? ` font-weight="${weight}"` : '',
|
|
41
44
|
style ? ` font-style="${style}"` : '',
|
|
42
45
|
].join('');
|
|
@@ -47,25 +50,34 @@ function fontAttrs(font) {
|
|
|
47
50
|
// mint `svgcanvas-clip-0`, whereupon `url(#svgcanvas-clip-0)` resolves to the
|
|
48
51
|
// first and every later layer is clipped to some other layer's rect.
|
|
49
52
|
//
|
|
50
|
-
// Document-global, not process-global: `
|
|
53
|
+
// Document-global, not process-global: `withFreshSvgClipIds` below.
|
|
51
54
|
let clipIdCounter = 0;
|
|
52
55
|
/**
|
|
53
|
-
*
|
|
56
|
+
* Run `render` as one document's clip-id numbering run, starting at 0, then put
|
|
57
|
+
* the counter back.
|
|
54
58
|
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* that aren't real, and `jest -t` on any export test but the first fails its
|
|
60
|
-
* checked-in snapshot with a diff that is nothing but renumbering.
|
|
59
|
+
* Starting at 0 is what makes the same view export to the same bytes: a counter
|
|
60
|
+
* left running numbers each export from wherever the previous one stopped, so
|
|
61
|
+
* diffing two saved SVGs shows changes that aren't real and `jest -t` on any
|
|
62
|
+
* export test but the first fails its snapshot on renumbering alone.
|
|
61
63
|
*
|
|
62
|
-
*
|
|
63
|
-
* `
|
|
64
|
-
*
|
|
65
|
-
*
|
|
64
|
+
* Putting it back is what keeps a file export from renumbering the page: live
|
|
65
|
+
* figures (`useViewSvgFigure`) mint from the same counter into one DOM, where
|
|
66
|
+
* ids must not repeat, so a reset that stuck would let the next figure reuse an
|
|
67
|
+
* id another figure still points at.
|
|
68
|
+
*
|
|
69
|
+
* `render` must be synchronous — an `await` inside it would let two documents
|
|
70
|
+
* share a numbering run.
|
|
66
71
|
*/
|
|
67
|
-
export function
|
|
72
|
+
export function withFreshSvgClipIds(render) {
|
|
73
|
+
const saved = clipIdCounter;
|
|
68
74
|
clipIdCounter = 0;
|
|
75
|
+
try {
|
|
76
|
+
return render();
|
|
77
|
+
}
|
|
78
|
+
finally {
|
|
79
|
+
clipIdCounter = saved;
|
|
80
|
+
}
|
|
69
81
|
}
|
|
70
82
|
export class SvgCanvas {
|
|
71
83
|
parts = [];
|
|
@@ -115,6 +127,13 @@ export class SvgCanvas {
|
|
|
115
127
|
get axisAligned() {
|
|
116
128
|
return this.b === 0 && this.c === 0;
|
|
117
129
|
}
|
|
130
|
+
// How much the CTM scales a length, for what SVG draws at a size of its own
|
|
131
|
+
// rather than through transformed coordinates: stroke widths, dashes and
|
|
132
|
+
// font sizes. Exact for a uniform scale; the geometric mean otherwise, where
|
|
133
|
+
// a Canvas2D pen would draw an ellipse no stroke-width can state.
|
|
134
|
+
get lengthScale() {
|
|
135
|
+
return Math.sqrt(Math.abs(this.a * this.d - this.b * this.c));
|
|
136
|
+
}
|
|
118
137
|
transformPoint(x, y) {
|
|
119
138
|
return [this.a * x + this.c * y + this.e, this.b * x + this.d * y + this.f];
|
|
120
139
|
}
|
|
@@ -170,23 +189,20 @@ export class SvgCanvas {
|
|
|
170
189
|
? 'end'
|
|
171
190
|
: 'start';
|
|
172
191
|
}
|
|
173
|
-
// Split rgba(r,g,b,a) into separate color + opacity SVG attributes for
|
|
174
|
-
// compatibility with SVG 1.1 consumers like Inkscape that don't honor the
|
|
175
|
-
// alpha component of CSS3 rgba() fill/stroke values. Whitespace-tolerant so
|
|
176
|
-
// spaced forms (MUI alpha(), colord toRgbString → "rgba(255, 177, 29, 0.12)")
|
|
177
|
-
// are separated too, not just the compact "rgba(255,177,29,0.12)".
|
|
178
192
|
paintAttr(name, style) {
|
|
179
193
|
const s = `${style}`;
|
|
180
|
-
const
|
|
181
|
-
if (
|
|
182
|
-
|
|
183
|
-
const base = `${name}="rgb(${m[1]},${m[2]},${m[3]})"`;
|
|
184
|
-
return a < 1 ? `${base} ${name}-opacity="${a}"` : base;
|
|
194
|
+
const split = splitPaintAlpha(s);
|
|
195
|
+
if (!split) {
|
|
196
|
+
return `${name}="${s}"`;
|
|
185
197
|
}
|
|
186
|
-
|
|
198
|
+
const base = `${name}="${split.color}"`;
|
|
199
|
+
return split.opacity < 1
|
|
200
|
+
? `${base} ${name}-opacity="${split.opacity}"`
|
|
201
|
+
: base;
|
|
187
202
|
}
|
|
188
203
|
strokeAttrs() {
|
|
189
|
-
|
|
204
|
+
const scale = this.lengthScale;
|
|
205
|
+
let attrs = ` ${this.paintAttr('stroke', this.strokeStyle)} stroke-width="${this.lineWidth * scale}"`;
|
|
190
206
|
if (this.lineCap !== 'butt') {
|
|
191
207
|
attrs += ` stroke-linecap="${this.lineCap}"`;
|
|
192
208
|
}
|
|
@@ -194,7 +210,7 @@ export class SvgCanvas {
|
|
|
194
210
|
attrs += ` stroke-linejoin="${this.lineJoin}"`;
|
|
195
211
|
}
|
|
196
212
|
if (this.lineDash.length > 0) {
|
|
197
|
-
attrs += ` stroke-dasharray="${this.lineDash.join(',')}"`;
|
|
213
|
+
attrs += ` stroke-dasharray="${this.lineDash.map(d => d * scale).join(',')}"`;
|
|
198
214
|
}
|
|
199
215
|
return attrs;
|
|
200
216
|
}
|
|
@@ -358,34 +374,40 @@ export class SvgCanvas {
|
|
|
358
374
|
this.ellipse(x, y, radius, radius, 0, startAngle, endAngle, counterclockwise);
|
|
359
375
|
}
|
|
360
376
|
ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise = false) {
|
|
361
|
-
const [cx, cy] = this.transformPoint(x, y);
|
|
362
377
|
const [rx, ry] = this.transformSize(radiusX, radiusY);
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
const
|
|
378
|
+
// A mirrored CTM turns a clockwise sweep counterclockwise on the page, and
|
|
379
|
+
// its rotation the other way.
|
|
380
|
+
const mirrored = this.a * this.d < 0;
|
|
381
|
+
const sweep = counterclockwise === mirrored ? 1 : 0;
|
|
382
|
+
const deg = ((mirrored ? -rotation : rotation) * 180) / Math.PI;
|
|
366
383
|
// Canvas measures the angle on the UNROTATED ellipse and then spins the
|
|
367
384
|
// whole thing, so the endpoint is the parametric point rotated — not the
|
|
368
|
-
// point at (angle + rotation).
|
|
385
|
+
// point at (angle + rotation) — and then placed by the CTM.
|
|
369
386
|
const at = (angle) => {
|
|
370
|
-
const px =
|
|
371
|
-
const py =
|
|
372
|
-
return
|
|
373
|
-
cx + px * Math.cos(rotation) - py * Math.sin(rotation),
|
|
374
|
-
cy + px * Math.sin(rotation) + py * Math.cos(rotation),
|
|
375
|
-
];
|
|
387
|
+
const px = radiusX * Math.cos(angle);
|
|
388
|
+
const py = radiusY * Math.sin(angle);
|
|
389
|
+
return this.transformPoint(x + px * Math.cos(rotation) - py * Math.sin(rotation), y + px * Math.sin(rotation) + py * Math.cos(rotation));
|
|
376
390
|
};
|
|
377
|
-
|
|
391
|
+
// The angle actually swept, as Canvas2D resolves it: in the stated
|
|
392
|
+
// direction, a whole turn once it reaches 2π, and otherwise wrapped into
|
|
393
|
+
// [0, 2π) — so a clockwise sweep from 0.5π back to 0 goes the long way.
|
|
394
|
+
const TAU = 2 * Math.PI;
|
|
395
|
+
const signed = counterclockwise
|
|
396
|
+
? startAngle - endAngle
|
|
397
|
+
: endAngle - startAngle;
|
|
398
|
+
const swept = signed >= TAU ? TAU : ((signed % TAU) + TAU) % TAU;
|
|
399
|
+
const [sx, sy] = at(startAngle);
|
|
400
|
+
if (swept === TAU) {
|
|
378
401
|
// A closed ellipse has coincident endpoints, which an SVG arc command
|
|
379
|
-
// degenerates on — so go round in two halves.
|
|
380
|
-
const
|
|
381
|
-
const [
|
|
382
|
-
this.pathData += `M${
|
|
402
|
+
// degenerates on — so go round in two halves, as a subpath of its own.
|
|
403
|
+
const half = counterclockwise ? -Math.PI : Math.PI;
|
|
404
|
+
const [hx, hy] = at(startAngle + half);
|
|
405
|
+
this.pathData += `M${sx},${sy}A${rx},${ry} ${deg} 1 ${sweep} ${hx},${hy}A${rx},${ry} ${deg} 1 ${sweep} ${sx},${sy}`;
|
|
383
406
|
return;
|
|
384
407
|
}
|
|
385
|
-
const [sx, sy2] = at(startAngle);
|
|
386
408
|
const [ex, ey] = at(endAngle);
|
|
387
|
-
const largeArc =
|
|
388
|
-
this.pathData += !this.pathData ? `M${sx},${
|
|
409
|
+
const largeArc = swept > Math.PI ? 1 : 0;
|
|
410
|
+
this.pathData += !this.pathData ? `M${sx},${sy}` : `L${sx},${sy}`;
|
|
389
411
|
this.pathData += `A${rx},${ry} ${deg} ${largeArc} ${sweep} ${ex},${ey}`;
|
|
390
412
|
}
|
|
391
413
|
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {
|
|
@@ -441,19 +463,16 @@ export class SvgCanvas {
|
|
|
441
463
|
fillText(text, x, y) {
|
|
442
464
|
const [tx, ty] = this.transformPoint(x, y);
|
|
443
465
|
const escaped = escapeXml(text);
|
|
444
|
-
this.emit(`<text x="${tx}" y="${ty}" ${this.paintAttr('fill', this.fillStyle)}${fontAttrs(this.font)} text-anchor="${this.textAnchor()}" dominant-baseline="${this.dominantBaseline()}">${escaped}</text>`);
|
|
466
|
+
this.emit(`<text x="${tx}" y="${ty}" ${this.paintAttr('fill', this.fillStyle)}${fontAttrs(this.font, this.lengthScale)} text-anchor="${this.textAnchor()}" dominant-baseline="${this.dominantBaseline()}">${escaped}</text>`);
|
|
445
467
|
}
|
|
446
468
|
strokeText(text, x, y) {
|
|
447
469
|
const [tx, ty] = this.transformPoint(x, y);
|
|
448
470
|
const escaped = escapeXml(text);
|
|
449
|
-
this.emit(`<text x="${tx}" y="${ty}" fill="none"${this.strokeAttrs()}${fontAttrs(this.font)} text-anchor="${this.textAnchor()}" dominant-baseline="${this.dominantBaseline()}">${escaped}</text>`);
|
|
471
|
+
this.emit(`<text x="${tx}" y="${ty}" fill="none"${this.strokeAttrs()}${fontAttrs(this.font, this.lengthScale)} text-anchor="${this.textAnchor()}" dominant-baseline="${this.dominantBaseline()}">${escaped}</text>`);
|
|
450
472
|
}
|
|
451
473
|
drawImage(..._args) {
|
|
452
474
|
// no-op: raster images can't be meaningfully serialized to SVG paths
|
|
453
475
|
}
|
|
454
|
-
putImageData(..._args) {
|
|
455
|
-
// no-op
|
|
456
|
-
}
|
|
457
476
|
clip(..._args) {
|
|
458
477
|
// Use the current path as a clipPath, then open a `<g clip-path>`
|
|
459
478
|
// group that subsequent draws will land inside. The group is closed by
|
package/esm/util/aborting.d.ts
CHANGED
|
@@ -20,4 +20,43 @@ export declare function handleFetchError(exception: unknown, isCurrent: () => bo
|
|
|
20
20
|
* @param exception -
|
|
21
21
|
*/
|
|
22
22
|
export declare function isAbortException(exception: unknown): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Throw an AbortError if `signal` has aborted. A `signal.aborted` read, so it
|
|
25
|
+
* is cheap enough for the body of a loop; place it after any await and in any
|
|
26
|
+
* per-item callback a reader hands you.
|
|
27
|
+
*/
|
|
28
|
+
export declare function checkAbortSignal(signal?: AbortSignal): void;
|
|
29
|
+
/**
|
|
30
|
+
* Run an awaited stage under `signal`: checked before it starts, and again
|
|
31
|
+
* once it settles. The check after is the one that gets left out when the two
|
|
32
|
+
* are placed by hand — a stop landing during a long await otherwise goes
|
|
33
|
+
* unseen until the next stage.
|
|
34
|
+
*/
|
|
35
|
+
export declare function withAbortCheck<T>(signal: AbortSignal | undefined, fn: () => T | Promise<T>): Promise<T>;
|
|
36
|
+
export interface AbortBreakpoint {
|
|
37
|
+
/** True once every ~50 ms of wall time, otherwise a counter bump. */
|
|
38
|
+
due(): boolean;
|
|
39
|
+
/** Yield a task so a posted abort can land, then throw if it did. */
|
|
40
|
+
yield(): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Cancellation for a loop that can run for seconds without awaiting — a
|
|
44
|
+
* whole-genome projection, a matrix fill. A `signal.aborted` read inside such a
|
|
45
|
+
* loop never changes, because the abort is a posted message; the loop has to
|
|
46
|
+
* give the event loop a turn now and then. A loop bounded by the byte gate or
|
|
47
|
+
* one region's features finishes before this would matter and only checks.
|
|
48
|
+
*
|
|
49
|
+
* const breakpoint = createAbortBreakpoint(signal)
|
|
50
|
+
* for (const row of rows) {
|
|
51
|
+
* if (breakpoint.due()) {
|
|
52
|
+
* await breakpoint.yield()
|
|
53
|
+
* }
|
|
54
|
+
* …
|
|
55
|
+
* }
|
|
56
|
+
*
|
|
57
|
+
* Two calls rather than one because an `await` on a non-promise still costs a
|
|
58
|
+
* microtask, about 60 ns against 2 ns for the `due()` read, and a loop over
|
|
59
|
+
* every read in a pileup notices the difference.
|
|
60
|
+
*/
|
|
61
|
+
export declare function createAbortBreakpoint(signal?: AbortSignal): AbortBreakpoint;
|
|
23
62
|
export {};
|