@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,4 +1,4 @@
|
|
|
1
|
-
import type { FeatureFormatter } from '../types.tsx';
|
|
1
|
+
import type { FeatureFormatter, FieldActions } from '../types.tsx';
|
|
2
2
|
/**
|
|
3
3
|
* An array of objects renders each element as its own `Attributes` block and
|
|
4
4
|
* draws no label row at this level; anything else is one labelled row like any
|
|
@@ -7,11 +7,12 @@ import type { FeatureFormatter } from '../types.tsx';
|
|
|
7
7
|
* to make the same call.
|
|
8
8
|
*/
|
|
9
9
|
export declare function isObjectArray(value: unknown[]): value is Record<string, unknown>[];
|
|
10
|
-
export default function ArrayValue({ name, value, description, formatter, prefix, width, }: {
|
|
10
|
+
export default function ArrayValue({ name, value, description, formatter, fieldActions, prefix, width, }: {
|
|
11
11
|
description?: React.ReactNode;
|
|
12
12
|
name: string;
|
|
13
13
|
value: unknown[];
|
|
14
14
|
formatter?: FeatureFormatter;
|
|
15
|
+
fieldActions?: FieldActions;
|
|
15
16
|
prefix?: string[];
|
|
16
17
|
width?: number;
|
|
17
18
|
}): import("react").JSX.Element;
|
|
@@ -4,6 +4,7 @@ import { isObject } from '../../util/index.js';
|
|
|
4
4
|
import { makeStyles } from '../../util/tss-react/index.js';
|
|
5
5
|
import Attributes from './Attributes.js';
|
|
6
6
|
import BasicValue from './BasicValue.js';
|
|
7
|
+
import FieldActionsButton, { useRevealFieldActions, } from './FieldActionsButton.js';
|
|
7
8
|
import FieldName from './FieldName.js';
|
|
8
9
|
const MAX_ARRAY_LENGTH = 100;
|
|
9
10
|
// Numeric arrays (e.g. base-modification probabilities, per-base scores) are
|
|
@@ -34,8 +35,9 @@ const useStyles = makeStyles()(theme => ({
|
|
|
34
35
|
export function isObjectArray(value) {
|
|
35
36
|
return value.every(isObject);
|
|
36
37
|
}
|
|
37
|
-
export default function ArrayValue({ name, value, description, formatter, prefix = [], width, }) {
|
|
38
|
-
const { classes } = useStyles();
|
|
38
|
+
export default function ArrayValue({ name, value, description, formatter, fieldActions, prefix = [], width, }) {
|
|
39
|
+
const { classes, cx } = useStyles();
|
|
40
|
+
const reveal = useRevealFieldActions();
|
|
39
41
|
const [showAll, setShowAll] = useState(false);
|
|
40
42
|
const limit = value.every(v => typeof v === 'number')
|
|
41
43
|
? MAX_NUMERIC_ARRAY_LENGTH
|
|
@@ -44,7 +46,7 @@ export default function ArrayValue({ name, value, description, formatter, prefix
|
|
|
44
46
|
const displayedValues = needsTruncation && !showAll ? value.slice(0, limit) : value;
|
|
45
47
|
return isObjectArray(value) ? (value.length === 1 ? (_jsx(Attributes, { formatter: formatter, attributes: value[0], prefix: [...prefix, name] })) : (_jsx(_Fragment, { children: value.map((val, i) => (_jsx(Attributes
|
|
46
48
|
// eslint-disable-next-line @eslint-react/no-array-index-key -- static positional list of attribute objects, no unique field available
|
|
47
|
-
, { formatter: formatter, attributes: val, prefix: [...prefix, `${name}-${i}`] }, i))) }))) : (_jsxs("div", { className: classes.field, children: [_jsx(FieldName, { prefix: prefix, description: description, name: name, width: width }), value.length === 1 ? (_jsx(BasicValue, { value: formatter ? formatter(value[0], name, 0) : value[0] })) : (_jsxs(_Fragment, { children: [displayedValues.map((val, i) => (_jsx("div", { className: classes.fieldSubvalue, children: _jsx(BasicValue, { value: formatter ? formatter(val, name, i) : val }) }, `${String(val)}-${i}`))), needsTruncation ? (_jsx("button", { type: "button", onClick: () => {
|
|
49
|
+
, { formatter: formatter, attributes: val, prefix: [...prefix, `${name}-${i}`] }, i))) }))) : (_jsxs("div", { className: cx(classes.field, reveal), children: [_jsx(FieldName, { prefix: prefix, description: description, name: name, width: width }), value.length === 1 ? (_jsxs(_Fragment, { children: [_jsx(BasicValue, { value: formatter ? formatter(value[0], name, 0) : value[0] }), _jsx(FieldActionsButton, { path: [...prefix, name], value: value[0], fieldActions: fieldActions })] })) : (_jsxs(_Fragment, { children: [displayedValues.map((val, i) => (_jsx("div", { className: classes.fieldSubvalue, children: _jsx(BasicValue, { value: formatter ? formatter(val, name, i) : val }) }, `${String(val)}-${i}`))), needsTruncation ? (_jsx("button", { type: "button", onClick: () => {
|
|
48
50
|
setShowAll(v => !v);
|
|
49
51
|
}, children: showAll
|
|
50
52
|
? 'Show less'
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type { Descriptors, FeatureFormatter } from '../types.tsx';
|
|
1
|
+
import type { Descriptors, FeatureFormatter, FieldActions } from '../types.tsx';
|
|
2
2
|
export default function Attributes(props: {
|
|
3
|
-
attributes:
|
|
4
|
-
[key: string]: unknown;
|
|
5
|
-
__jbrowsefmt?: Record<string, unknown>;
|
|
6
|
-
};
|
|
3
|
+
attributes: Record<string, unknown>;
|
|
7
4
|
omit?: string[];
|
|
8
5
|
omitSingleLevel?: string[];
|
|
9
6
|
formatter?: FeatureFormatter;
|
|
7
|
+
fieldActions?: FieldActions;
|
|
10
8
|
descriptions?: Descriptors;
|
|
11
9
|
prefix?: string[];
|
|
12
10
|
hideUris?: boolean;
|
|
@@ -4,7 +4,7 @@ import { isLocalPathLocation, isObject, isUriLocation, measureText, } from '../.
|
|
|
4
4
|
import ArrayValue, { isObjectArray } from './ArrayValue.js';
|
|
5
5
|
import SimpleField from './SimpleField.js';
|
|
6
6
|
import UriAttribute from './UriField.js';
|
|
7
|
-
import { accessNested
|
|
7
|
+
import { accessNested } from './util.js';
|
|
8
8
|
// Lazy: reaches @mui/x-data-grid, and this module sits on the eager startup
|
|
9
9
|
// path via product-core's ui barrel (AboutDialog -> AboutDialogContents).
|
|
10
10
|
// Only a homogeneous object array actually renders a grid.
|
|
@@ -27,7 +27,6 @@ function isHomogeneousObjectArray(arr) {
|
|
|
27
27
|
}
|
|
28
28
|
// these are always omitted as too detailed
|
|
29
29
|
const globalOmit = [
|
|
30
|
-
'__jbrowsefmt',
|
|
31
30
|
'length',
|
|
32
31
|
'position',
|
|
33
32
|
'subfeatures',
|
|
@@ -62,7 +61,7 @@ function measureLabels(attributes, opts) {
|
|
|
62
61
|
const { omits, deepOmits, hideUris, prefix } = opts;
|
|
63
62
|
let widest = 0;
|
|
64
63
|
const measure = (key) => measureText([...prefix, key].join('.'), FIELD_NAME_FONT_SIZE);
|
|
65
|
-
for (const [key, value] of Object.entries(
|
|
64
|
+
for (const [key, value] of Object.entries(attributes)) {
|
|
66
65
|
if (value == null || omits.has(key)) {
|
|
67
66
|
continue;
|
|
68
67
|
}
|
|
@@ -96,9 +95,9 @@ function widestLabel(attributes, opts) {
|
|
|
96
95
|
return Math.ceil(measureLabels(attributes, opts)) + FIELD_NAME_PADDING;
|
|
97
96
|
}
|
|
98
97
|
export default function Attributes(props) {
|
|
99
|
-
const { attributes, omit = [], omitSingleLevel = [], descriptions, formatter, hideUris, prefix = [], labelWidth, } = props;
|
|
98
|
+
const { attributes, omit = [], omitSingleLevel = [], descriptions, formatter, fieldActions, hideUris, prefix = [], labelWidth, } = props;
|
|
100
99
|
const omits = new Set([...omit, ...globalOmit, ...omitSingleLevel]);
|
|
101
|
-
const
|
|
100
|
+
const shown = Object.entries(attributes).filter(([k, v]) => v != null && !omits.has(k));
|
|
102
101
|
// Measured over the whole subtree on the outermost call, then handed down, so
|
|
103
102
|
// one card has one label column. Per-level measurement put `type`/`trackId` in
|
|
104
103
|
// a narrow column, `adapter.type` in a wider one and `adapter.craiLocation` in
|
|
@@ -115,13 +114,13 @@ export default function Attributes(props) {
|
|
|
115
114
|
hideUris,
|
|
116
115
|
prefix,
|
|
117
116
|
}), MAX_FIELD_NAME_WIDTH);
|
|
118
|
-
return (_jsx(_Fragment, { children:
|
|
117
|
+
return (_jsx(_Fragment, { children: shown.map(([key, value]) => {
|
|
119
118
|
const description = accessNested([...prefix, key], descriptions);
|
|
120
119
|
if (Array.isArray(value)) {
|
|
121
120
|
// Only use the data grid when schemas are homogeneous enough;
|
|
122
121
|
// heterogeneous arrays fall through to ArrayValue which renders
|
|
123
122
|
// each object as individual field sections instead of disappearing
|
|
124
|
-
return isHomogeneousObjectArray(value) ? (_jsx(Suspense, { fallback: null, children: _jsx(DataGridDetails, { name: key, prefix: prefix, value: value }) }, key)) : (_jsx(ArrayValue, { name: key, value: value, formatter: formatter, description: description, prefix: prefix, width: width }, key));
|
|
123
|
+
return isHomogeneousObjectArray(value) ? (_jsx(Suspense, { fallback: null, children: _jsx(DataGridDetails, { name: key, prefix: prefix, value: value }) }, key)) : (_jsx(ArrayValue, { name: key, value: value, formatter: formatter, fieldActions: fieldActions, description: description, prefix: prefix, width: width }, key));
|
|
125
124
|
}
|
|
126
125
|
else if (isObject(value)) {
|
|
127
126
|
// hideUris means "don't show where the data sits". A LocalPathLocation
|
|
@@ -132,10 +131,10 @@ export default function Attributes(props) {
|
|
|
132
131
|
(isUriLocation(value) || isLocalPathLocation(value))) {
|
|
133
132
|
return null;
|
|
134
133
|
}
|
|
135
|
-
return isUriLocation(value) ? (_jsx(UriAttribute, { name: key, prefix: prefix, value: value, width: width }, key)) : (_jsx(Attributes, { attributes: value, omit: omit, descriptions: descriptions, formatter: formatter, hideUris: hideUris, prefix: [...prefix, key], labelWidth: width }, key));
|
|
134
|
+
return isUriLocation(value) ? (_jsx(UriAttribute, { name: key, prefix: prefix, value: value, width: width }, key)) : (_jsx(Attributes, { attributes: value, omit: omit, descriptions: descriptions, formatter: formatter, fieldActions: fieldActions, hideUris: hideUris, prefix: [...prefix, key], labelWidth: width }, key));
|
|
136
135
|
}
|
|
137
136
|
else {
|
|
138
|
-
return (_jsx(SimpleField, { name: key, formatter: formatter, value: value, description: description, prefix: prefix, width: width }, key));
|
|
137
|
+
return (_jsx(SimpleField, { name: key, formatter: formatter, fieldActions: fieldActions, value: value, description: description, prefix: prefix, width: width }, key));
|
|
139
138
|
}
|
|
140
139
|
}) }));
|
|
141
140
|
}
|
|
@@ -2,21 +2,16 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { toLocale } from '../../util/index.js';
|
|
3
3
|
import Position from './Position.js';
|
|
4
4
|
import SimpleField from './SimpleField.js';
|
|
5
|
-
import { applyFeatureFormatting, isFormattedField } from './util.js';
|
|
6
5
|
export default function CoreDetails(props) {
|
|
7
6
|
const { feature } = props;
|
|
8
|
-
const
|
|
9
|
-
|
|
7
|
+
const { start, end } = feature;
|
|
8
|
+
// Length is derived from the coordinates unless a formatDetails callback
|
|
9
|
+
// named it, which is the only way a `length` key reaches the feature: an
|
|
10
|
+
// adapter's own bookkeeping field of that name is in Attributes' globalOmit
|
|
11
|
+
const length = 'length' in feature ? feature.length : end - start;
|
|
10
12
|
const displayedDetails = {
|
|
11
|
-
...
|
|
12
|
-
|
|
13
|
-
// but a formatDetails callback that names `length` still wins (and
|
|
14
|
-
// `length: null` hides the row), like every other core field. The raw
|
|
15
|
-
// feature's own `length`, if any, stays ignored: it is in Attributes'
|
|
16
|
-
// globalOmit precisely because adapters use it as bookkeeping.
|
|
17
|
-
length: isFormattedField(feature, 'length')
|
|
18
|
-
? formattedFeat.length
|
|
19
|
-
: toLocale(end - start),
|
|
13
|
+
...feature,
|
|
14
|
+
length: typeof length === 'number' ? toLocale(length) : length,
|
|
20
15
|
};
|
|
21
16
|
// array (not object) so the display order is explicit, not reliant on JS key
|
|
22
17
|
// insertion order
|
|
@@ -26,7 +21,7 @@ export default function CoreDetails(props) {
|
|
|
26
21
|
['length', 'Length'],
|
|
27
22
|
['type', 'Type'],
|
|
28
23
|
];
|
|
29
|
-
return (_jsxs(_Fragment, { children: [_jsx(SimpleField, { name: "Position", value: _jsx(Position, { ...props
|
|
24
|
+
return (_jsxs(_Fragment, { children: [_jsx(SimpleField, { name: "Position", value: _jsx(Position, { ...props }) }), coreRenderedDetails
|
|
30
25
|
.filter(([key]) => displayedDetails[key] != null)
|
|
31
26
|
.map(([key, name]) => {
|
|
32
27
|
const value = displayedDetails[key];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SimpleFeatureSerialized } from '../../util/index.ts';
|
|
2
|
-
import type { Descriptors, FeatureDetailsModel, FeatureFormatter } from '../types.tsx';
|
|
2
|
+
import type { Descriptors, FeatureDetailsModel, FeatureFormatter, FieldActions } from '../types.tsx';
|
|
3
3
|
interface FeatureDetailsProps {
|
|
4
4
|
model: FeatureDetailsModel;
|
|
5
5
|
feature: SimpleFeatureSerialized;
|
|
@@ -7,6 +7,7 @@ interface FeatureDetailsProps {
|
|
|
7
7
|
omit?: string[];
|
|
8
8
|
descriptions?: Descriptors;
|
|
9
9
|
formatter?: FeatureFormatter;
|
|
10
|
+
fieldActions?: FieldActions;
|
|
10
11
|
}
|
|
11
12
|
declare const FeatureDetails: (props: FeatureDetailsProps) => import("react").JSX.Element;
|
|
12
13
|
export default FeatureDetails;
|
|
@@ -29,7 +29,7 @@ const coreDetails = [
|
|
|
29
29
|
'type',
|
|
30
30
|
];
|
|
31
31
|
const FeatureDetails = observer(function FeatureDetails(props) {
|
|
32
|
-
const { omit = [], model, feature, depth = 0, descriptions, formatter, } = props;
|
|
32
|
+
const { omit = [], model, feature, depth = 0, descriptions, formatter, fieldActions, } = props;
|
|
33
33
|
const maxDepth = model.maxDepth ?? Infinity;
|
|
34
34
|
const { mate: m, name = '', id = '', type = '', subfeatures, uniqueId, } = feature;
|
|
35
35
|
// resolved rather than raw props: `depth` is what tells a registered panel
|
|
@@ -40,7 +40,7 @@ const FeatureDetails = observer(function FeatureDetails(props) {
|
|
|
40
40
|
return (_jsxs(BaseCard, { title: generateTitle(name, id, type), children: [joinByDivider([
|
|
41
41
|
_jsxs(Fragment, { children: [_jsx(SectionHeader, { title: "Core details" }), _jsx(CoreDetails, { ...props })] }, "core"),
|
|
42
42
|
m ? (_jsxs(Fragment, { children: [_jsx(SectionHeader, { title: "Mate details" }), _jsx(CoreDetails, { ...props, feature: { ...m, uniqueId: `${uniqueId}-mate` } })] }, "mate")) : null,
|
|
43
|
-
_jsxs(Fragment, { children: [_jsx(SectionHeader, { title: "Attributes" }), _jsx(Attributes, { attributes: feature, omit: omit, omitSingleLevel: coreDetails, descriptions: descriptions, formatter: formatter })] }, "attributes"),
|
|
43
|
+
_jsxs(Fragment, { children: [_jsx(SectionHeader, { title: "Attributes" }), _jsx(Attributes, { attributes: feature, omit: omit, omitSingleLevel: coreDetails, descriptions: descriptions, formatter: formatter, fieldActions: fieldActions })] }, "attributes"),
|
|
44
44
|
].filter(Boolean)), _jsx(ErrorBoundary, { FallbackComponent: e => _jsx(ErrorBanner, { error: e.error }), children: _jsx(SequenceFeatureDetails, { ...props }) }), _jsx(PluggableComponents, { pluginManager: getEnv(model).pluginManager,
|
|
45
45
|
/** #extensionPoint Core-extraFeaturePanel | sync | Add extra panels to the feature details widget */
|
|
46
46
|
name: "Core-extraFeaturePanel", props: panelProps }), depth < maxDepth && subfeatures?.length ? (_jsx(BaseCard, { title: "Subfeatures", defaultExpanded: depth === 0 && subfeatures.length <= 20, children: subfeatures.map((sub, idx) => (_jsx(FeatureDetails
|
|
@@ -53,6 +53,6 @@ const FeatureDetails = observer(function FeatureDetails(props) {
|
|
|
53
53
|
// descriptions and value formatter apply here too -- omitting
|
|
54
54
|
// them silently dropped e.g. VCF header descriptions and the
|
|
55
55
|
// truncating <Formatter> from every nested card
|
|
56
|
-
descriptions: descriptions, formatter: formatter, omit: omit }, `${uniqueId}_${idx}`))) })) : null] }));
|
|
56
|
+
descriptions: descriptions, formatter: formatter, fieldActions: fieldActions, omit: omit }, `${uniqueId}_${idx}`))) })) : null] }));
|
|
57
57
|
});
|
|
58
58
|
export default FeatureDetails;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FieldActions } from '../types.tsx';
|
|
2
|
+
/** A class for a field row that shows its FieldActionsButton on hover or focus. */
|
|
3
|
+
export declare function useRevealFieldActions(): string;
|
|
4
|
+
export default function FieldActionsButton({ path, value, fieldActions, }: {
|
|
5
|
+
path: string[];
|
|
6
|
+
value: unknown;
|
|
7
|
+
fieldActions?: FieldActions;
|
|
8
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import FilterListIcon from '@mui/icons-material/FilterList';
|
|
3
|
+
import CascadingMenuButton from '../../ui/CascadingMenuButton.js';
|
|
4
|
+
import { makeStyles } from '../../util/tss-react/index.js';
|
|
5
|
+
// on a wrapper because MUI folds an Emotion class handed to one of its
|
|
6
|
+
// components into a class of its own, which a selector naming it never matches
|
|
7
|
+
const useStyles = makeStyles()({
|
|
8
|
+
reveal: {
|
|
9
|
+
opacity: 0,
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
/** A class for a field row that shows its FieldActionsButton on hover or focus. */
|
|
13
|
+
export function useRevealFieldActions() {
|
|
14
|
+
const { classes, css } = useStyles();
|
|
15
|
+
const { reveal } = classes;
|
|
16
|
+
return css({
|
|
17
|
+
[`&:hover .${reveal}, &:focus-within .${reveal}`]: { opacity: 1 },
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export default function FieldActionsButton({ path, value, fieldActions, }) {
|
|
21
|
+
const { classes } = useStyles();
|
|
22
|
+
const items = fieldActions?.(path, value) ?? [];
|
|
23
|
+
return items.length > 0 ? (_jsx("span", { className: classes.reveal, children: _jsx(CascadingMenuButton, { menuItems: items, size: "small", tooltip: "Filter by this value", style: { padding: 0 }, children: _jsx(FilterListIcon, { fontSize: "small" }) }) })) : null;
|
|
24
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { FeatureFormatter } from '../types.tsx';
|
|
2
|
-
export default function SimpleField({ name, value, description, prefix, width, formatter, }: {
|
|
1
|
+
import type { FeatureFormatter, FieldActions } from '../types.tsx';
|
|
2
|
+
export default function SimpleField({ name, value, description, prefix, width, formatter, fieldActions, }: {
|
|
3
3
|
description?: React.ReactNode;
|
|
4
4
|
name: string;
|
|
5
5
|
value: unknown;
|
|
6
6
|
prefix?: string[];
|
|
7
7
|
width?: number;
|
|
8
8
|
formatter?: FeatureFormatter;
|
|
9
|
+
fieldActions?: FieldActions;
|
|
9
10
|
}): import("react").JSX.Element | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { makeStyles } from '../../util/tss-react/index.js';
|
|
3
3
|
import BasicValue from './BasicValue.js';
|
|
4
|
+
import FieldActionsButton, { useRevealFieldActions, } from './FieldActionsButton.js';
|
|
4
5
|
import FieldName from './FieldName.js';
|
|
5
6
|
const useStyles = makeStyles()({
|
|
6
7
|
field: {
|
|
@@ -8,7 +9,8 @@ const useStyles = makeStyles()({
|
|
|
8
9
|
flexWrap: 'wrap',
|
|
9
10
|
},
|
|
10
11
|
});
|
|
11
|
-
export default function SimpleField({ name, value, description, prefix, width, formatter, }) {
|
|
12
|
-
const { classes } = useStyles();
|
|
13
|
-
|
|
12
|
+
export default function SimpleField({ name, value, description, prefix, width, formatter, fieldActions, }) {
|
|
13
|
+
const { classes, cx } = useStyles();
|
|
14
|
+
const reveal = useRevealFieldActions();
|
|
15
|
+
return value != null ? (_jsxs("div", { className: cx(classes.field, reveal), children: [_jsx(FieldName, { prefix: prefix, description: description, name: name, width: width }), _jsx(BasicValue, { value: formatter ? formatter(value, name) : value }), _jsx(FieldActionsButton, { path: [...(prefix ?? []), name], value: value, fieldActions: fieldActions })] })) : null;
|
|
14
16
|
}
|
|
@@ -6,3 +6,4 @@ export { default as BaseAttributes } from './BaseAttributes.tsx';
|
|
|
6
6
|
export { default as BaseCoreDetails } from './BaseCoreDetails.tsx';
|
|
7
7
|
export { default as FeatureDetails } from './FeatureDetails.tsx';
|
|
8
8
|
export { default as FeatureWash } from './FeatureWash.tsx';
|
|
9
|
+
export { filterByValueItems, jexlFilterDisplay } from './jexlFilterActions.ts';
|
|
@@ -9,10 +9,6 @@ const BaseFeatureDetail = observer(function BaseFeatureDetail({ model, }) {
|
|
|
9
9
|
const { error, featureData, parentFeature } = model;
|
|
10
10
|
// annotated to shed the MST node brand types.frozen() carries on the instance
|
|
11
11
|
const descriptions = model.descriptions;
|
|
12
|
-
// A field is hidden by a formatDetails callback returning undefined (jexl
|
|
13
|
-
// can't produce null); every detail component filters with `!= null`, so a
|
|
14
|
-
// field set to undefined (live) or null (round-tripped through a snapshot) is
|
|
15
|
-
// dropped identically.
|
|
16
12
|
if (error) {
|
|
17
13
|
return _jsx(ErrorBanner, { error: error });
|
|
18
14
|
}
|
|
@@ -29,3 +25,4 @@ export { default as BaseAttributes } from './BaseAttributes.js';
|
|
|
29
25
|
export { default as BaseCoreDetails } from './BaseCoreDetails.js';
|
|
30
26
|
export { default as FeatureDetails } from './FeatureDetails.js';
|
|
31
27
|
export { default as FeatureWash } from './FeatureWash.js';
|
|
28
|
+
export { filterByValueItems, jexlFilterDisplay } from './jexlFilterActions.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { MenuItem } from '../../ui/MenuTypes.ts';
|
|
2
|
+
import type { JexlFilterModel } from '../../util/jexlFilters.ts';
|
|
3
|
+
import type { IStateTreeNode } from '@jbrowse/mobx-state-tree';
|
|
4
|
+
export interface JexlFilterDisplay extends JexlFilterModel, IStateTreeNode {
|
|
5
|
+
}
|
|
6
|
+
export declare function isJexlFilterDisplay(thing: unknown): thing is JexlFilterDisplay;
|
|
7
|
+
/** The first of a track's displays that takes jexl filters. */
|
|
8
|
+
export declare function jexlFilterDisplay(track?: {
|
|
9
|
+
displays: readonly unknown[];
|
|
10
|
+
}): JexlFilterDisplay | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* "Show only" and "Hide" items for one feature attribute's value, and "Show
|
|
13
|
+
* only ≥" for a number. Each appends a filter line to the display and offers
|
|
14
|
+
* an undo.
|
|
15
|
+
*/
|
|
16
|
+
export declare function filterByValueItems(display: JexlFilterDisplay, path: string[], value: unknown): MenuItem[];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { pathSubject, printCondition } from '@jbrowse/jexl';
|
|
2
|
+
import { activeJexlFilters } from '../../util/jexlFilters.js';
|
|
3
|
+
import { ensureJexlPrefix } from '../../util/jexlStrings.js';
|
|
4
|
+
import { getNotificationSink } from '../../util/sessionServices.js';
|
|
5
|
+
const MAX_LABEL_VALUE = 30;
|
|
6
|
+
export function isJexlFilterDisplay(thing) {
|
|
7
|
+
return (typeof thing === 'object' &&
|
|
8
|
+
thing !== null &&
|
|
9
|
+
'setJexlFilters' in thing &&
|
|
10
|
+
'configuredFilters' in thing);
|
|
11
|
+
}
|
|
12
|
+
/** The first of a track's displays that takes jexl filters. */
|
|
13
|
+
export function jexlFilterDisplay(track) {
|
|
14
|
+
return track?.displays.find(isJexlFilterDisplay);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* "Show only" and "Hide" items for one feature attribute's value, and "Show
|
|
18
|
+
* only ≥" for a number. Each appends a filter line to the display and offers
|
|
19
|
+
* an undo.
|
|
20
|
+
*/
|
|
21
|
+
export function filterByValueItems(display, path, value) {
|
|
22
|
+
if (typeof value !== 'string' && typeof value !== 'number') {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
const field = path.join('.');
|
|
26
|
+
const text = String(value);
|
|
27
|
+
const shown = text.length > MAX_LABEL_VALUE ? `${text.slice(0, MAX_LABEL_VALUE)}…` : text;
|
|
28
|
+
const add = (op) => () => {
|
|
29
|
+
const previous = display.jexlFiltersSetting;
|
|
30
|
+
const line = printCondition({
|
|
31
|
+
subject: pathSubject('feature', path),
|
|
32
|
+
op,
|
|
33
|
+
value,
|
|
34
|
+
});
|
|
35
|
+
display.setJexlFilters([
|
|
36
|
+
...activeJexlFilters(display),
|
|
37
|
+
ensureJexlPrefix(line),
|
|
38
|
+
]);
|
|
39
|
+
getNotificationSink(display).notify('Filter added', 'info', {
|
|
40
|
+
name: 'Undo',
|
|
41
|
+
onClick: () => {
|
|
42
|
+
display.setJexlFilters(previous && [...previous]);
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
return [
|
|
47
|
+
{ label: `Show only ${field} = ${shown}`, onClick: add('==') },
|
|
48
|
+
{ label: `Hide ${field} = ${shown}`, onClick: add('!=') },
|
|
49
|
+
...(typeof value === 'number'
|
|
50
|
+
? [{ label: `Show only ${field} ≥ ${shown}`, onClick: add('>=') }]
|
|
51
|
+
: []),
|
|
52
|
+
];
|
|
53
|
+
}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
1
|
export declare function isEmpty(obj: Record<string, unknown>): boolean;
|
|
2
|
-
export declare function applyFeatureFormatting<T extends {
|
|
3
|
-
__jbrowsefmt?: Record<string, unknown>;
|
|
4
|
-
}>(feature: T): T & {
|
|
5
|
-
[x: string]: unknown;
|
|
6
|
-
};
|
|
7
|
-
export declare function isFormattedField(feature: {
|
|
8
|
-
__jbrowsefmt?: Record<string, unknown>;
|
|
9
|
-
}, key: string): boolean;
|
|
10
2
|
export declare function generateTitle(name: unknown, id: unknown, type: unknown): string;
|
|
11
3
|
export declare function accessNested(arr: string[], obj?: Record<string, unknown>): string | undefined;
|
|
@@ -3,22 +3,6 @@ import { ellipses } from '../util.js';
|
|
|
3
3
|
export function isEmpty(obj) {
|
|
4
4
|
return Object.keys(obj).length === 0;
|
|
5
5
|
}
|
|
6
|
-
// The view the details panel renders: raw feature fields with the
|
|
7
|
-
// formatDetails-callback output (`__jbrowsefmt`) merged on top, so a callback
|
|
8
|
-
// value overrides the raw one. A field the callback sets to null/undefined then
|
|
9
|
-
// drops out of the panel's `!= null` filters — this is how callbacks hide
|
|
10
|
-
// fields. `__jbrowsefmt` itself is in Attributes' globalOmit, so it never
|
|
11
|
-
// renders.
|
|
12
|
-
export function applyFeatureFormatting(feature) {
|
|
13
|
-
return { ...feature, ...feature.__jbrowsefmt };
|
|
14
|
-
}
|
|
15
|
-
// Whether a formatDetails callback named `key` at all -- including setting it
|
|
16
|
-
// to null/undefined, which is how a callback hides a field. Lets a derived row
|
|
17
|
-
// (e.g. Length) defer to the callback without treating "hidden" as "absent".
|
|
18
|
-
export function isFormattedField(feature, key) {
|
|
19
|
-
const fmt = feature.__jbrowsefmt;
|
|
20
|
-
return fmt !== undefined && key in fmt;
|
|
21
|
-
}
|
|
22
6
|
export function generateTitle(name, id, type) {
|
|
23
7
|
const label = name || id;
|
|
24
8
|
return [label ? ellipses(`${label}`) : '', type ? `${type}` : '']
|
|
@@ -1,42 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { observer } from 'mobx-react';
|
|
3
|
-
import { getGeneticCode
|
|
3
|
+
import { getGeneticCode } from '../../util/geneticCodes.js';
|
|
4
|
+
import SimpleFeature from '../../util/simpleFeature.js';
|
|
5
|
+
import { transcriptGeneticCodeId, transcriptTranslExcept, } from '../../util/translateTranscript.js';
|
|
4
6
|
import { modeHasUpDownstream, modeSupportsRevcomp, resolveShowCoordinates, } from './featureTypeUtil.js';
|
|
5
7
|
import CDNASequence from './seqtypes/CDNASequence.js';
|
|
6
8
|
import CDSSequence from './seqtypes/CDSSequence.js';
|
|
7
9
|
import GenomicSequence from './seqtypes/GenomicSequence.js';
|
|
8
10
|
import ProteinSequence from './seqtypes/ProteinSequence.js';
|
|
9
11
|
import { getSequenceData } from './useSequenceData.js';
|
|
10
|
-
function findCdsSubfeature(feature) {
|
|
11
|
-
return feature.subfeatures?.find(f => f.type?.toLowerCase() === 'cds');
|
|
12
|
-
}
|
|
13
|
-
// CDS-bound translation reads `transl_table` off the CDS subfeature (or the
|
|
14
|
-
// feature itself), so e.g. a mitochondrial gene translates with table 2 rather
|
|
15
|
-
// than the standard code. When the feature carries no transl_table (e.g. UCSC
|
|
16
|
-
// genePred-derived GFFs), fall back to the assembly-configured code for the
|
|
17
|
-
// contig. Undefined falls back to the standard code.
|
|
18
|
-
function proteinGeneticCode(feature, assemblyGeneticCodeId) {
|
|
19
|
-
const cds = findCdsSubfeature(feature);
|
|
20
|
-
const id = parseTranslTable(feature.transl_table) ??
|
|
21
|
-
parseTranslTable(cds?.transl_table) ??
|
|
22
|
-
assemblyGeneticCodeId;
|
|
23
|
-
return getGeneticCode(id);
|
|
24
|
-
}
|
|
25
|
-
// Parses transl_except from the feature or its CDS subfeature into the coordinate
|
|
26
|
-
// system used by convertCodingSequenceToPeptides (feature-relative, reversed for
|
|
27
|
-
// minus-strand genes).
|
|
28
|
-
function featureTranslExcept(feature) {
|
|
29
|
-
const cds = findCdsSubfeature(feature);
|
|
30
|
-
const raw = feature.transl_except ?? cds?.transl_except;
|
|
31
|
-
return raw
|
|
32
|
-
? relativizeTranslExcept({
|
|
33
|
-
raw,
|
|
34
|
-
featureStart: feature.start,
|
|
35
|
-
featureLength: feature.end - feature.start,
|
|
36
|
-
strand: feature.strand,
|
|
37
|
-
})
|
|
38
|
-
: [];
|
|
39
|
-
}
|
|
40
12
|
// Dispatches to the renderer for the current sequence type. An observer because
|
|
41
13
|
// it reads showCoordinatesSetting: that setting moving relative<->genomic
|
|
42
14
|
// leaves the coarse showCoordinates boolean every other observer here reads
|
|
@@ -60,9 +32,10 @@ const SequenceContents = observer(function SequenceContents({ mode, feature, seq
|
|
|
60
32
|
case 'cds':
|
|
61
33
|
return _jsx(CDSSequence, { model: model, cds: cds, sequence: seq });
|
|
62
34
|
case 'protein': {
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
|
|
35
|
+
const transcript = new SimpleFeature(feature);
|
|
36
|
+
const translExcept = transcriptTranslExcept(transcript);
|
|
37
|
+
const code = getGeneticCode(transcriptGeneticCodeId(transcript, assemblyGeneticCodeId));
|
|
38
|
+
return (_jsx(ProteinSequence, { model: model, cds: cds, sequence: seq, codonTable: code.codonTable, starts: code.starts, translExcept: translExcept?.length ? translExcept : undefined }));
|
|
66
39
|
}
|
|
67
40
|
// cdna and the gene_* variants all render the spliced transcript; introns
|
|
68
41
|
// and up/downstream flanks are toggled by the mode name
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const configSchema: import("../configuration/configurationSchema.ts").ConfigurationSchemaType<{}, import("../configuration/configurationSchema.ts").ConfigurationSchemaOptions<undefined, undefined
|
|
1
|
+
declare const configSchema: import("../configuration/configurationSchema.ts").ConfigurationSchemaType<{}, import("../configuration/configurationSchema.ts").ConfigurationSchemaOptions<undefined, undefined, undefined, import("../configuration/requirements.ts").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>>>;
|
|
2
2
|
export { configSchema };
|
|
@@ -1,38 +1,22 @@
|
|
|
1
1
|
import type { AnyConfigurationModel } from '../configuration/index.ts';
|
|
2
2
|
import type { SimpleFeatureSerialized } from '../util/index.ts';
|
|
3
|
-
import type { IStateTreeNode } from '@jbrowse/mobx-state-tree';
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* tier still has to run in that case.
|
|
4
|
+
* The two config nodes carrying a `formatDetails` sub-schema. The session's
|
|
5
|
+
* applies to every track; the track's is absent when the widget was opened
|
|
6
|
+
* without one. The track's object spreads over the session's, and its numbers
|
|
7
|
+
* win.
|
|
10
8
|
*/
|
|
11
|
-
export interface FormatDetailsHolder extends IStateTreeNode {
|
|
12
|
-
configuration: AnyConfigurationModel;
|
|
13
|
-
}
|
|
14
9
|
export interface FormatDetailsTiers {
|
|
15
|
-
session:
|
|
16
|
-
track?:
|
|
10
|
+
session: AnyConfigurationModel;
|
|
11
|
+
track?: AnyConfigurationModel;
|
|
17
12
|
}
|
|
18
|
-
/**
|
|
19
|
-
* `depth` or `maxDepth`: the track's value when the track sets one, else the
|
|
20
|
-
* session's, else unset.
|
|
21
|
-
*
|
|
22
|
-
* These override rather than merge, unlike the callback objects. That is only
|
|
23
|
-
* expressible because both are `maybeNumber` slots with no `defaultValue` --
|
|
24
|
-
* given a schema default the track reported a value whether or not anyone set
|
|
25
|
-
* one, so the session-wide tier could never apply to a track, and every real
|
|
26
|
-
* config has a track.
|
|
27
|
-
*/
|
|
13
|
+
/** `depth` or `maxDepth`: the track's value when set, else the session's. */
|
|
28
14
|
export declare function formatDetailsNumber(tiers: FormatDetailsTiers, slot: string): number | undefined;
|
|
29
15
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* config with no `formatDetails` at all leaves the feature exactly as it came
|
|
36
|
-
* in rather than stamping empty objects through the persisted snapshot.
|
|
16
|
+
* The feature as the details panel shows it: each tier's `feature` callback
|
|
17
|
+
* output spread over the clicked feature, and `subfeatures` output over each
|
|
18
|
+
* subfeature down to `depth`. A key set to null or undefined hides that row,
|
|
19
|
+
* since every detail component filters with `!= null`. A config declaring no
|
|
20
|
+
* callback gets the input back untouched.
|
|
37
21
|
*/
|
|
38
|
-
export declare function applyFormatDetails(tiers: FormatDetailsTiers,
|
|
22
|
+
export declare function applyFormatDetails(tiers: FormatDetailsTiers, feature: SimpleFeatureSerialized): SimpleFeatureSerialized;
|