@jbrowse/core 5.0.0-beta.13 → 5.0.0-beta.14
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 +365 -69
- package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +4 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +4 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseAttributes.d.ts +2 -1
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseAttributes.js +4 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCard.d.ts +2 -1
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +4 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCoreDetails.d.ts +2 -1
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCoreDetails.js +4 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BasicValue.d.ts +5 -4
- package/esm/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +6 -4
- package/esm/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +2 -1
- package/esm/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +4 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +4 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +2 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureWash.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureWash.js +4 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.js +4 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldName.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +4 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Formatter.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/Formatter.js +4 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/ParentFeatureLine.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/ParentFeatureLine.js +4 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +4 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/UriField.d.ts +3 -2
- package/esm/BaseFeatureWidget/BaseFeatureDetail/UriField.js +4 -2
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceBody.d.ts +3 -2
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceBody.js +4 -2
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +1 -1
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +10 -19
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceLegend.d.ts +3 -2
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceLegend.js +4 -2
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +4 -4
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.d.ts +3 -2
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +4 -2
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +1 -2
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +2 -2
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +1 -2
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.js +15 -36
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/TranscriptSelector.d.ts +3 -2
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/TranscriptSelector.js +4 -2
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/featureTypeUtil.d.ts +2 -1
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/featureTypeUtil.js +22 -6
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +13 -1
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/model.js +28 -1
- package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +2 -2
- package/esm/BaseFeatureWidget/stateModelFactory.d.ts +2 -0
- package/esm/PluginManager.d.ts +1 -0
- package/esm/PluginManager.js +6 -0
- package/esm/ReExports/coreModules.generated.js +538 -524
- package/esm/ReExports/coreWorkerModules.generated.js +454 -441
- package/esm/ReExports/lazify.js +3 -2
- package/esm/ReExports/list.js +15 -6
- package/esm/ReExports/names.d.ts +1 -0
- package/esm/ReExports/names.generated.d.ts +2 -0
- package/esm/ReExports/names.generated.js +566 -0
- package/esm/ReExports/names.js +3 -0
- package/esm/assemblyManager/assembly.d.ts +9 -0
- package/esm/assemblyManager/assembly.js +13 -0
- package/esm/assemblyManager/assemblyConfigSchema.d.ts +6 -1
- package/esm/assemblyManager/assemblyConfigSchema.js +23 -22
- package/esm/assemblyManager/assemblyManager.d.ts +11 -0
- package/esm/assemblyManager/assemblyManager.js +2 -0
- package/esm/assemblyManager/expandAssemblyConfigShorthand.d.ts +9 -0
- package/esm/assemblyManager/expandAssemblyConfigShorthand.js +23 -0
- package/esm/checkPlugins.js +10 -4
- package/esm/configuration/configurationSchema.d.ts +18 -5
- package/esm/configuration/configurationSchema.js +9 -7
- package/esm/configuration/configurationSchemaUnion.d.ts +2 -1
- package/esm/configuration/configurationSchemaUnion.js +2 -1
- package/esm/configuration/configurationSlot.js +4 -4
- package/esm/configuration/fillLocations.d.ts +4 -2
- package/esm/configuration/fillLocations.js +9 -3
- package/esm/configuration/formatAboutConfigSchema.d.ts +2 -2
- package/esm/configuration/formatAboutConfigSchema.js +2 -2
- package/esm/configuration/formatDetailsConfigSchema.d.ts +2 -2
- package/esm/configuration/formatDetailsConfigSchema.js +5 -5
- package/esm/configuration/getConf.js +13 -4
- package/esm/configuration/index.d.ts +1 -1
- package/esm/configuration/index.js +1 -1
- package/esm/configuration/plot.d.ts +2 -2
- package/esm/configuration/plot.js +32 -18
- package/esm/configuration/schemaRegistry.d.ts +0 -2
- package/esm/configuration/slotFacade.js +2 -2
- package/esm/configuration/snapshotPreprocess.d.ts +42 -18
- package/esm/configuration/snapshotPreprocess.js +94 -34
- package/esm/configuration/tabixShorthand.js +1 -3
- package/esm/data_adapters/BaseAdapter/BaseAdapter.d.ts +7 -0
- package/esm/data_adapters/BaseAdapter/BaseAdapter.js +7 -0
- package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +0 -22
- package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +0 -55
- package/esm/data_adapters/BaseAdapter/index.d.ts +0 -1
- package/esm/data_adapters/BaseAdapter/index.js +0 -1
- package/esm/data_adapters/BaseAdapter/rowSources.d.ts +2 -2
- package/esm/data_adapters/BaseAdapter/types.d.ts +1 -0
- package/esm/data_adapters/CytobandAdapter/configSchema.d.ts +2 -0
- package/esm/data_adapters/CytobandAdapter/configSchema.js +5 -0
- package/esm/data_adapters/dataAdapterCache.d.ts +25 -13
- package/esm/data_adapters/dataAdapterCache.js +68 -24
- package/esm/data_adapters/getFeatureAdapter.d.ts +9 -0
- package/esm/data_adapters/getFeatureAdapter.js +17 -0
- package/esm/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +2 -0
- package/esm/pluggableElementTypes/models/BaseConnectionModelFactory.js +2 -0
- package/esm/pluggableElementTypes/models/BaseDisplayModel.d.ts +40 -6
- package/esm/pluggableElementTypes/models/BaseDisplayModel.js +56 -8
- package/esm/pluggableElementTypes/models/BaseTrackModel.d.ts +3 -3
- package/esm/pluggableElementTypes/models/BaseTrackModel.js +7 -6
- package/esm/pluggableElementTypes/models/BaseViewModel.d.ts +2 -0
- package/esm/pluggableElementTypes/models/BaseViewModel.js +2 -0
- package/esm/pluggableElementTypes/models/InternetAccountModel.d.ts +3 -0
- package/esm/pluggableElementTypes/models/InternetAccountModel.js +3 -0
- package/esm/pluggableElementTypes/models/baseConnectionConfig.d.ts +3 -0
- package/esm/pluggableElementTypes/models/baseConnectionConfig.js +3 -0
- package/esm/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +3 -1
- package/esm/pluggableElementTypes/models/baseInternetAccountConfig.js +3 -1
- package/esm/pluggableElementTypes/models/baseTrackConfig.js +9 -1
- package/esm/pluggableElementTypes/models/components/SaveTrackData.js +2 -2
- package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.d.ts +1 -1
- package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.js +1 -1
- package/esm/pluginDefinitions.d.ts +7 -0
- package/esm/pluginDefinitions.js +20 -0
- package/esm/rpc/RpcRegistry.d.ts +0 -10
- package/esm/rpc/byteBudget.d.ts +8 -0
- package/esm/rpc/byteBudget.js +13 -0
- package/esm/rpc/configSchema.d.ts +2 -0
- package/esm/rpc/configSchema.js +3 -1
- package/esm/rpc/coreRpcMethods.d.ts +0 -1
- package/esm/rpc/coreRpcMethods.js +0 -1
- package/esm/rpc/methods/CoreGetEncodedLayers.d.ts +2 -2
- package/esm/rpc/methods/CoreGetEncodedLayers.js +7 -5
- package/esm/rpc/methods/layerFeatures.d.ts +9 -6
- package/esm/rpc/methods/layerFeatures.js +21 -5
- package/esm/ui/ActionLink.d.ts +3 -2
- package/esm/ui/ActionLink.js +4 -2
- package/esm/ui/AddCustomPluginDialog.d.ts +3 -2
- package/esm/ui/AddCustomPluginDialog.js +6 -4
- package/esm/ui/BaseTooltip.d.ts +3 -2
- package/esm/ui/BaseTooltip.js +4 -2
- package/esm/ui/CascadingMenu.js +14 -12
- package/esm/ui/CascadingMenuButton.d.ts +2 -2
- package/esm/ui/CascadingMenuButton.js +5 -4
- package/esm/ui/CascadingMenuHelpDialog.d.ts +3 -2
- package/esm/ui/CascadingMenuHelpDialog.js +4 -2
- package/esm/ui/CascadingMenuHelpIconButton.d.ts +4 -3
- package/esm/ui/CascadingMenuHelpIconButton.js +9 -5
- package/esm/ui/ColorPicker.d.ts +5 -4
- package/esm/ui/ColorPicker.js +6 -4
- package/esm/ui/ContextMenu.d.ts +1 -1
- package/esm/ui/ContextMenu.js +1 -1
- package/esm/ui/CopyToClipboardButton.d.ts +3 -2
- package/esm/ui/CopyToClipboardButton.js +4 -2
- package/esm/ui/Crosshairs.js +13 -10
- package/esm/ui/DOMPurifySanitizedHTML.d.ts +3 -2
- package/esm/ui/DOMPurifySanitizedHTML.js +4 -2
- package/esm/ui/DataGridFlexContainer.d.ts +3 -2
- package/esm/ui/DataGridFlexContainer.js +4 -2
- package/esm/ui/Dialog.d.ts +1 -1
- package/esm/ui/Dialog.js +5 -4
- package/esm/ui/DropDownMenu.js +2 -2
- package/esm/ui/EditableTypography.d.ts +1 -1
- package/esm/ui/EditableTypography.js +3 -2
- package/esm/ui/ErrorActions.d.ts +3 -2
- package/esm/ui/ErrorActions.js +4 -2
- package/esm/ui/ErrorBanner.d.ts +2 -2
- package/esm/ui/ErrorBanner.js +3 -2
- package/esm/ui/ErrorBar.d.ts +3 -2
- package/esm/ui/ErrorBar.js +4 -2
- package/esm/ui/ErrorMessage.d.ts +3 -2
- package/esm/ui/ErrorMessage.js +4 -2
- package/esm/ui/ErrorMessageStackTraceContents.d.ts +3 -2
- package/esm/ui/ErrorMessageStackTraceContents.js +4 -2
- package/esm/ui/ErrorMessageStackTraceDialog.d.ts +3 -2
- package/esm/ui/ErrorMessageStackTraceDialog.js +4 -2
- package/esm/ui/ErrorOverlay.d.ts +3 -2
- package/esm/ui/ErrorOverlay.js +4 -2
- package/esm/ui/ExportSvgDialog.d.ts +3 -2
- package/esm/ui/ExportSvgDialog.js +4 -2
- package/esm/ui/ExternalLink.d.ts +2 -1
- package/esm/ui/ExternalLink.js +4 -2
- package/esm/ui/FactoryResetDialog.d.ts +3 -2
- package/esm/ui/FactoryResetDialog.js +4 -2
- package/esm/ui/FatalErrorDialog.d.ts +3 -2
- package/esm/ui/FatalErrorDialog.js +6 -4
- package/esm/ui/FileDropZone.d.ts +3 -2
- package/esm/ui/FileDropZone.js +4 -2
- package/esm/ui/FileSelector/LocalFileChooser.js +4 -4
- package/esm/ui/FileSelector/LocationInput.d.ts +3 -2
- package/esm/ui/FileSelector/LocationInput.js +4 -2
- package/esm/ui/FileSelector/SourceTypeSelector.d.ts +3 -2
- package/esm/ui/FileSelector/SourceTypeSelector.js +8 -6
- package/esm/ui/GpuFallbackButton.d.ts +3 -2
- package/esm/ui/GpuFallbackButton.js +4 -2
- package/esm/ui/HoverMenu.d.ts +2 -2
- package/esm/ui/HoverMenu.js +7 -3
- package/esm/ui/HoverTooltip.d.ts +3 -2
- package/esm/ui/HoverTooltip.js +4 -2
- package/esm/ui/Icons.d.ts +5 -5
- package/esm/ui/Icons.js +11 -10
- package/esm/ui/InlineMenuControls.d.ts +2 -2
- package/esm/ui/InlineMenuControls.js +4 -3
- package/esm/ui/JexlFilterRowEditors.d.ts +4 -4
- package/esm/ui/JexlFilterRowEditors.js +9 -8
- package/esm/ui/LabeledCheckbox.d.ts +3 -2
- package/esm/ui/LabeledCheckbox.js +4 -2
- package/esm/ui/LazyBaseTooltip.d.ts +12 -3
- package/esm/ui/LazyBaseTooltip.js +4 -2
- package/esm/ui/LegendSwatchGlyph.js +1 -0
- package/esm/ui/LoadingDots.d.ts +2 -1
- package/esm/ui/LoadingDots.js +4 -2
- package/esm/ui/LoadingEllipses.d.ts +5 -2
- package/esm/ui/LoadingEllipses.js +5 -3
- package/esm/ui/LoadingOverlay.d.ts +3 -2
- package/esm/ui/LoadingOverlay.js +4 -2
- package/esm/ui/LoadingProgress.d.ts +3 -2
- package/esm/ui/LoadingProgress.js +4 -2
- package/esm/ui/Logo.d.ts +2 -2
- package/esm/ui/Logo.js +9 -8
- package/esm/ui/MenuItemChevron.d.ts +2 -2
- package/esm/ui/MenuItemChevron.js +3 -2
- package/esm/ui/MenuItemEndDecoration.d.ts +2 -2
- package/esm/ui/MenuItemEndDecoration.js +3 -2
- package/esm/ui/MenuItemTrailing.d.ts +2 -2
- package/esm/ui/MenuItemTrailing.js +7 -6
- package/esm/ui/MenuTypes.d.ts +21 -1
- package/esm/ui/MenuTypes.js +20 -0
- package/esm/ui/MonospaceTextField.d.ts +3 -2
- package/esm/ui/MonospaceTextField.js +4 -2
- package/esm/ui/NumberTextField.d.ts +2 -2
- package/esm/ui/NumberTextField.js +4 -2
- package/esm/ui/PaletteContext.d.ts +11 -9
- package/esm/ui/PaletteContext.js +33 -18
- package/esm/ui/PluginStoreCard.d.ts +3 -2
- package/esm/ui/PluginStoreCard.js +4 -2
- package/esm/ui/PopoverPicker.d.ts +3 -2
- package/esm/ui/PopoverPicker.js +4 -2
- package/esm/ui/PrerenderedCanvas.d.ts +2 -2
- package/esm/ui/PrerenderedCanvas.js +3 -2
- package/esm/ui/RedErrorMessageBox.d.ts +3 -2
- package/esm/ui/RedErrorMessageBox.js +4 -2
- package/esm/ui/RefNameAutocomplete/EndAdornment.d.ts +3 -2
- package/esm/ui/RefNameAutocomplete/EndAdornment.js +4 -2
- package/esm/ui/RefNameAutocomplete/HelpDialog.d.ts +3 -2
- package/esm/ui/RefNameAutocomplete/HelpDialog.js +4 -2
- package/esm/ui/ReplaceCurrentViewButton.d.ts +3 -2
- package/esm/ui/ReplaceCurrentViewButton.js +4 -2
- package/esm/ui/ResizeHandle.d.ts +2 -2
- package/esm/ui/ResizeHandle.js +3 -2
- package/esm/ui/SanitizedHTML.d.ts +3 -2
- package/esm/ui/SanitizedHTML.js +6 -4
- package/esm/ui/ScrollChrome.d.ts +3 -2
- package/esm/ui/ScrollChrome.js +4 -2
- package/esm/ui/ScrollEdgeShadow.d.ts +2 -2
- package/esm/ui/ScrollEdgeShadow.js +2 -2
- package/esm/ui/SessionJsonPanel.d.ts +3 -2
- package/esm/ui/SessionJsonPanel.js +4 -2
- package/esm/ui/ShareLinkField.d.ts +3 -2
- package/esm/ui/ShareLinkField.js +4 -2
- package/esm/ui/SingleSlider.d.ts +2 -2
- package/esm/ui/SingleSlider.js +4 -2
- package/esm/ui/SliderTooltip.d.ts +2 -1
- package/esm/ui/SliderTooltip.js +4 -2
- package/esm/ui/SnackbarContents.d.ts +3 -2
- package/esm/ui/SnackbarContents.js +4 -2
- package/esm/ui/SnackbarModel.d.ts +2 -0
- package/esm/ui/SnackbarModel.js +2 -0
- package/esm/ui/StackTraceButton.d.ts +3 -2
- package/esm/ui/StackTraceButton.js +4 -2
- package/esm/ui/StatusProgressBar.d.ts +3 -2
- package/esm/ui/StatusProgressBar.js +4 -2
- package/esm/ui/SubmitForm.d.ts +2 -1
- package/esm/ui/SubmitForm.js +4 -2
- package/esm/ui/SvgColorLegend.d.ts +3 -4
- package/esm/ui/SvgColorLegend.js +27 -18
- package/esm/ui/TagTextField.d.ts +2 -2
- package/esm/ui/TagTextField.js +4 -2
- package/esm/ui/ViewLoadingScreen.d.ts +3 -2
- package/esm/ui/ViewLoadingScreen.js +4 -2
- package/esm/ui/colorScale.d.ts +5 -1
- package/esm/ui/colorScale.js +12 -10
- package/esm/ui/colors.d.ts +3 -3
- package/esm/ui/colors.js +7 -7
- package/esm/ui/filterMenuItems.d.ts +10 -31
- package/esm/ui/filterMenuItems.js +13 -14
- package/esm/ui/index.d.ts +1 -1
- package/esm/ui/index.js +1 -1
- package/esm/ui/launchTargetsMenuItem.js +9 -13
- package/esm/ui/legendMenuItem.d.ts +4 -4
- package/esm/ui/legendMenuItem.js +4 -4
- package/esm/ui/menuItemAdornment.d.ts +1 -1
- package/esm/ui/menuItemAdornment.js +1 -1
- package/esm/ui/menuItems.d.ts +1 -1
- package/esm/ui/menuItems.js +1 -1
- package/esm/ui/menuLabels.d.ts +2 -2
- package/esm/ui/menuLabels.js +2 -2
- package/esm/ui/palette.d.ts +2 -2
- package/esm/ui/palette.js +10 -10
- package/esm/ui/radioSubMenu.d.ts +5 -3
- package/esm/ui/radioSubMenu.js +2 -2
- package/esm/ui/rampKey.d.ts +15 -0
- package/esm/ui/rampKey.js +17 -0
- package/esm/ui/showSubMenu.d.ts +0 -5
- package/esm/ui/showSubMenu.js +6 -15
- package/esm/ui/theme.d.ts +2 -2
- package/esm/ui/theme.js +1 -1
- package/esm/ui/useAssemblySelection.d.ts +2 -0
- package/esm/ui/useMouseTracking.d.ts +8 -20
- package/esm/ui/useMouseTracking.js +23 -62
- package/esm/ui/usePlacedMenuFocus.d.ts +19 -0
- package/esm/ui/usePlacedMenuFocus.js +28 -0
- package/esm/util/Base1DViewModel.d.ts +5 -3
- package/esm/util/Base1DViewModel.js +5 -3
- package/esm/util/SvgCanvas.js +1 -1
- package/esm/util/aggregateFieldName.d.ts +1 -10
- package/esm/util/aggregateFieldName.js +1 -8
- package/esm/util/analytics.d.ts +4 -6
- package/esm/util/analytics.js +143 -12
- package/esm/util/bezierConnector.d.ts +20 -0
- package/esm/util/bezierConnector.js +34 -100
- package/esm/util/cacheBudgets.d.ts +3 -0
- package/esm/util/cacheBudgets.js +3 -0
- package/esm/util/categoricalField.d.ts +2 -2
- package/esm/util/categoricalField.js +3 -3
- package/esm/util/color/index.d.ts +1 -1
- package/esm/util/color/index.js +2 -2
- package/esm/util/color-bits/bit.js +1 -1
- package/esm/util/color-bits/parse.js +6 -6
- package/esm/util/colorBits.d.ts +15 -4
- package/esm/util/colorBits.js +38 -15
- package/esm/util/colorRamp.d.ts +3 -3
- package/esm/util/colorRamp.js +14 -2
- package/esm/util/colorScale.d.ts +114 -20
- package/esm/util/colorScale.js +124 -26
- package/esm/util/colorSchemes.d.ts +6 -4
- package/esm/util/colorSchemes.js +6 -3
- package/esm/util/createSvgRasterCanvas.d.ts +14 -1
- package/esm/util/createSvgRasterCanvas.js +36 -12
- package/esm/util/diagonalizeRegions.js +18 -9
- package/esm/util/featureTransforms.d.ts +2 -2
- package/esm/util/featureTransforms.js +85 -135
- package/esm/util/fileHandleStore.js +5 -0
- package/esm/util/groupKeys.d.ts +5 -4
- package/esm/util/groupKeys.js +15 -9
- package/esm/util/index.js +1 -1
- package/esm/util/installFetch.d.ts +2 -2
- package/esm/util/installPrerequisiteFetch.d.ts +8 -3
- package/esm/util/installPrerequisiteFetch.js +9 -7
- package/esm/util/io/RemoteFileWithRangeCache.d.ts +1 -1
- package/esm/util/io/RemoteFileWithRangeCache.js +1 -1
- package/esm/util/jexl.js +1 -1
- package/esm/util/layouts/GranularRectLayout.d.ts +19 -3
- package/esm/util/layouts/GranularRectLayout.js +57 -34
- package/esm/util/leadingEdgeAutorun.d.ts +9 -1
- package/esm/util/leadingEdgeAutorun.js +5 -2
- package/esm/util/markEncoding.d.ts +10 -8
- package/esm/util/markEncoding.js +50 -12
- package/esm/util/markEncodingTypes.d.ts +74 -20
- package/esm/util/originCut.d.ts +14 -0
- package/esm/util/originCut.js +19 -0
- package/esm/util/paintLayer.d.ts +1 -1
- package/esm/util/paintLayer.js +4 -3
- package/esm/util/pathSeries.d.ts +18 -0
- package/esm/util/pathSeries.js +143 -0
- package/esm/util/pressOwner.d.ts +20 -0
- package/esm/util/pressOwner.js +26 -0
- package/esm/util/quantileExtent.d.ts +3 -3
- package/esm/util/quantileExtent.js +3 -3
- package/esm/util/rowStackGeometry.d.ts +1 -1
- package/esm/util/rowStackGeometry.js +1 -1
- package/esm/util/sessionActivity.d.ts +36 -0
- package/esm/util/sessionActivity.js +88 -0
- package/esm/util/stepOutputs.d.ts +165 -0
- package/esm/util/stepOutputs.js +201 -0
- package/esm/util/stepTables.d.ts +7 -3
- package/esm/util/stepTables.js +86 -3
- package/esm/util/thresholdScale.d.ts +1 -1
- package/esm/util/thresholdScale.js +1 -1
- package/esm/util/tracks.js +1 -1
- package/esm/util/usePanZoom.js +4 -10
- package/esm/util/windowStep.d.ts +6 -0
- package/esm/util/windowStep.js +153 -0
- package/package.json +23 -15
- package/esm/data_adapters/BaseAdapter/featureDensity.d.ts +0 -40
- package/esm/data_adapters/BaseAdapter/featureDensity.js +0 -31
- package/esm/rpc/methods/CoreGetFeatureDensity.d.ts +0 -11
- package/esm/rpc/methods/CoreGetFeatureDensity.js +0 -22
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What each transform step does to the rows it reads, stated once for the
|
|
3
|
+
* runtime's facet split, the validator, the field pickers and the channels a
|
|
4
|
+
* mark adopts by default. Imports nothing, so the validator's copy of the mark
|
|
5
|
+
* rule list carries it unchanged.
|
|
6
|
+
*
|
|
7
|
+
* Every step type answers three things:
|
|
8
|
+
* - `rowwise`: it answers each row from that row alone and in order, so a
|
|
9
|
+
* facet split may run ahead of it.
|
|
10
|
+
* - `replacesRows`: it makes its rows anew (an aggregate, a coverage), so a
|
|
11
|
+
* field survives it only where it writes that field or keeps it as a group.
|
|
12
|
+
* - `writes`: the fields it sets, each with the kind of value it holds and the
|
|
13
|
+
* channel a mark leaving that channel unwritten reads it through.
|
|
14
|
+
*/
|
|
15
|
+
/** The field an aggregate op writes: `as` where named, else `count` for a count, else `<op>_<field>`. */
|
|
16
|
+
export function aggregateFieldName({ op, field, as, }) {
|
|
17
|
+
return as || (op === 'count' || !field ? op : `${op}_${field}`);
|
|
18
|
+
}
|
|
19
|
+
export const DEFAULT_FORMULA_AS = 'value';
|
|
20
|
+
export const DEFAULT_COVERAGE_AS = 'coverage';
|
|
21
|
+
export const DEFAULT_PILEUP_AS = 'row';
|
|
22
|
+
export const DEFAULT_AGGREGATE_OP = 'count';
|
|
23
|
+
export const DEFAULT_BIN_AS = ['start', 'end'];
|
|
24
|
+
/** What a `bin` over `fields` writes on each piece: the bases of its interval inside its bin. */
|
|
25
|
+
export const BIN_OVERLAP_FIELD = 'overlap';
|
|
26
|
+
/** What a `cells` step writes: `state` on every cell, `base` on a mismatch or an insertion, `match` off a gap or a reference `N`, `length` on an insertion. */
|
|
27
|
+
export const CELLS_FIELDS = ['state', 'base', 'match', 'length'];
|
|
28
|
+
/** What a `mate` step writes on every feature it answers. */
|
|
29
|
+
export const MATE_FIELDS = [
|
|
30
|
+
'mate.refName',
|
|
31
|
+
'mate.start',
|
|
32
|
+
'mate.end',
|
|
33
|
+
'mate.mateDirection',
|
|
34
|
+
'mateDirection',
|
|
35
|
+
'alt',
|
|
36
|
+
'svType',
|
|
37
|
+
];
|
|
38
|
+
/** Where a row stands, which every row keeps through every step. */
|
|
39
|
+
export const POSITION_FIELDS = ['refName', 'start', 'end'];
|
|
40
|
+
function named(as, fallback) {
|
|
41
|
+
return typeof as === 'string' && as !== '' ? as : fallback;
|
|
42
|
+
}
|
|
43
|
+
function binEdges(step) {
|
|
44
|
+
const { as } = step;
|
|
45
|
+
return Array.isArray(as) && as.length === 2 ? as : DEFAULT_BIN_AS;
|
|
46
|
+
}
|
|
47
|
+
// A single op names the `y` its mark reads; two leave the mark to choose.
|
|
48
|
+
function summaries(step) {
|
|
49
|
+
const ops = step.ops ?? [];
|
|
50
|
+
return ops.map(({ op = DEFAULT_AGGREGATE_OP, field, as }) => ({
|
|
51
|
+
field: aggregateFieldName({ op, field, as }),
|
|
52
|
+
kind: 'numeric',
|
|
53
|
+
...(ops.length === 1 ? { fills: 'y' } : {}),
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
const kept = (field) => ({ field, kind: 'unknown' });
|
|
57
|
+
export const STEP_OUTPUTS = {
|
|
58
|
+
filter: { rowwise: true, replacesRows: false, writes: () => [] },
|
|
59
|
+
formula: {
|
|
60
|
+
rowwise: true,
|
|
61
|
+
replacesRows: false,
|
|
62
|
+
writes: step => [
|
|
63
|
+
{ field: named(step.as, DEFAULT_FORMULA_AS), kind: 'numeric' },
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
bin: {
|
|
67
|
+
rowwise: true,
|
|
68
|
+
replacesRows: false,
|
|
69
|
+
writes: step => [
|
|
70
|
+
...binEdges(step).map(field => ({ field, kind: 'numeric' })),
|
|
71
|
+
...(step.fields?.length === 2
|
|
72
|
+
? [{ field: BIN_OVERLAP_FIELD, kind: 'numeric' }]
|
|
73
|
+
: []),
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
cells: {
|
|
77
|
+
rowwise: true,
|
|
78
|
+
replacesRows: false,
|
|
79
|
+
writes: () => [
|
|
80
|
+
{ field: 'start', kind: 'numeric' },
|
|
81
|
+
{ field: 'end', kind: 'numeric' },
|
|
82
|
+
{ field: 'state', kind: 'categorical' },
|
|
83
|
+
{ field: 'base', kind: 'categorical' },
|
|
84
|
+
{ field: 'match', kind: 'numeric' },
|
|
85
|
+
{ field: 'length', kind: 'numeric' },
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
aggregate: {
|
|
89
|
+
rowwise: false,
|
|
90
|
+
replacesRows: true,
|
|
91
|
+
writes: (step, edges) => [
|
|
92
|
+
...(step.groupby?.length ? step.groupby : edges).map(kept),
|
|
93
|
+
...summaries(step),
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
window: { rowwise: false, replacesRows: false, writes: summaries },
|
|
97
|
+
coverage: {
|
|
98
|
+
rowwise: false,
|
|
99
|
+
replacesRows: true,
|
|
100
|
+
writes: step => [
|
|
101
|
+
{
|
|
102
|
+
field: named(step.as, DEFAULT_COVERAGE_AS),
|
|
103
|
+
kind: 'numeric',
|
|
104
|
+
fills: 'y',
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
pileup: {
|
|
109
|
+
rowwise: false,
|
|
110
|
+
replacesRows: false,
|
|
111
|
+
writes: step => [
|
|
112
|
+
{
|
|
113
|
+
field: named(step.as, DEFAULT_PILEUP_AS),
|
|
114
|
+
kind: 'numeric',
|
|
115
|
+
fills: 'row',
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
flatten: {
|
|
120
|
+
rowwise: false,
|
|
121
|
+
replacesRows: false,
|
|
122
|
+
writes: step => [
|
|
123
|
+
...(step.index ? [{ field: step.index, kind: 'numeric' }] : []),
|
|
124
|
+
...(step.key ? [{ field: step.key, kind: 'categorical' }] : []),
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
mate: {
|
|
128
|
+
rowwise: false,
|
|
129
|
+
replacesRows: false,
|
|
130
|
+
writes: () => MATE_FIELDS.map(field => ({
|
|
131
|
+
field,
|
|
132
|
+
kind: field === 'mate.start' || field === 'mate.end'
|
|
133
|
+
? 'numeric'
|
|
134
|
+
: 'categorical',
|
|
135
|
+
...(field === 'mate.refName' ? { fills: 'x2' } : {}),
|
|
136
|
+
})),
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
function outputOf(step) {
|
|
140
|
+
return Object.hasOwn(STEP_OUTPUTS, step.type)
|
|
141
|
+
? STEP_OUTPUTS[step.type]
|
|
142
|
+
: undefined;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* The fields one step writes. A step this table does not know writes nothing
|
|
146
|
+
* it can name.
|
|
147
|
+
*/
|
|
148
|
+
export function stepWrites(step, edges = DEFAULT_BIN_AS) {
|
|
149
|
+
return outputOf(step)?.writes(step, edges) ?? [];
|
|
150
|
+
}
|
|
151
|
+
/** Whether a step answers each row from that row alone, in order. */
|
|
152
|
+
export function isRowwise(step) {
|
|
153
|
+
return outputOf(step)?.rowwise ?? false;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* What a run of steps leaves: every field written, the last write of each
|
|
157
|
+
* winning, and, where a step made the rows anew, the only fields that survive
|
|
158
|
+
* it (`undefined` while the input's own fields all do). `channels` are what
|
|
159
|
+
* the output fills where a mark leaves them unwritten.
|
|
160
|
+
*/
|
|
161
|
+
export function stepsOutput(steps) {
|
|
162
|
+
let edges = DEFAULT_BIN_AS;
|
|
163
|
+
let surviving;
|
|
164
|
+
const written = new Map();
|
|
165
|
+
let channels = new Map();
|
|
166
|
+
for (const step of steps) {
|
|
167
|
+
const output = step && outputOf(step);
|
|
168
|
+
if (!step || !output) {
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
const writes = output.writes(step, edges);
|
|
172
|
+
if (output.replacesRows) {
|
|
173
|
+
surviving = new Set(POSITION_FIELDS);
|
|
174
|
+
for (const [field] of written) {
|
|
175
|
+
if (!writes.some(w => w.field === field)) {
|
|
176
|
+
written.delete(field);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
for (const w of writes) {
|
|
180
|
+
surviving.add(w.field);
|
|
181
|
+
}
|
|
182
|
+
channels = new Map([...channels].filter(([, f]) => surviving.has(f)));
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
for (const w of writes) {
|
|
186
|
+
surviving?.add(w.field);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
for (const w of writes) {
|
|
190
|
+
const held = written.get(w.field);
|
|
191
|
+
written.set(w.field, w.kind === 'unknown' && held ? { ...held, field: w.field } : w);
|
|
192
|
+
if (w.fills) {
|
|
193
|
+
channels.set(w.fills, w.field);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (step.type === 'bin') {
|
|
197
|
+
edges = binEdges(step);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return { written: [...written.values()], surviving, channels };
|
|
201
|
+
}
|
package/esm/util/stepTables.d.ts
CHANGED
|
@@ -2,9 +2,7 @@ import { DerivedTable } from './featureTable.ts';
|
|
|
2
2
|
import type { Column, FeatureTable, MadeRows } from './featureTable.ts';
|
|
3
3
|
import type { AggregateOp, AggregateStep, BinStep } from './markEncodingTypes.ts';
|
|
4
4
|
import type { Feature, SimpleFeatureSerialized } from './simpleFeature.ts';
|
|
5
|
-
export
|
|
6
|
-
/** What a `bin` over `fields` writes on each piece: the bases of its interval inside its bin. */
|
|
7
|
-
export declare const BIN_OVERLAP_FIELD = "overlap";
|
|
5
|
+
export { BIN_OVERLAP_FIELD, DEFAULT_BIN_AS } from './stepOutputs.ts';
|
|
8
6
|
/**
|
|
9
7
|
* A table's rows split into sections, each a contiguous range: `bounds[s]` is
|
|
10
8
|
* where section `s` starts and `bounds[s + 1]` where it ends. A step keeps
|
|
@@ -94,3 +92,9 @@ export declare class OpSums {
|
|
|
94
92
|
add(g: number, v: number, w: number): void;
|
|
95
93
|
column(groups: number): Column;
|
|
96
94
|
}
|
|
95
|
+
export declare function sortByStart(rows: Uint32Array, starts: Float64Array): void;
|
|
96
|
+
export declare function groupRows(n: number, bounds: Bounds, reads: readonly ((i: number) => unknown)[], normalize: boolean): {
|
|
97
|
+
groupOf: Uint32Array<ArrayBuffer>;
|
|
98
|
+
firstRow: number[];
|
|
99
|
+
sectionOf: number[];
|
|
100
|
+
};
|
package/esm/util/stepTables.js
CHANGED
|
@@ -6,9 +6,7 @@ import { DerivedTable, NO_COLUMN, TableRow, numberReaderOf, readerOf, valueAt, }
|
|
|
6
6
|
import { fieldReader, isPlainFieldRef } from './fieldReader.js';
|
|
7
7
|
import { isJexl } from './jexlStrings.js';
|
|
8
8
|
import { numericValue } from './numericValue.js';
|
|
9
|
-
export
|
|
10
|
-
/** What a `bin` over `fields` writes on each piece: the bases of its interval inside its bin. */
|
|
11
|
-
export const BIN_OVERLAP_FIELD = 'overlap';
|
|
9
|
+
export { BIN_OVERLAP_FIELD, DEFAULT_BIN_AS } from './stepOutputs.js';
|
|
12
10
|
// Section starts through a step whose rows came from its input's in order:
|
|
13
11
|
// each section starts at the first row whose parent row is in it.
|
|
14
12
|
export function boundsThrough(bounds, parentRow) {
|
|
@@ -275,3 +273,88 @@ export class OpSums {
|
|
|
275
273
|
return { kind: 'number', values, at: undefined, nanIsAbsent: true };
|
|
276
274
|
}
|
|
277
275
|
}
|
|
276
|
+
// Rows in start order, ties in the order they came: a start and a row packed
|
|
277
|
+
// into one double and sorted without a comparator, which leaves the typed
|
|
278
|
+
// sort's fast path only where the packing could not be exact.
|
|
279
|
+
export function sortByStart(rows, starts) {
|
|
280
|
+
const n = rows.length;
|
|
281
|
+
let lo = Infinity;
|
|
282
|
+
let hi = -Infinity;
|
|
283
|
+
let whole = true;
|
|
284
|
+
for (let k = 0; k < n; k++) {
|
|
285
|
+
const v = starts[rows[k]];
|
|
286
|
+
if (v < lo) {
|
|
287
|
+
lo = v;
|
|
288
|
+
}
|
|
289
|
+
if (v > hi) {
|
|
290
|
+
hi = v;
|
|
291
|
+
}
|
|
292
|
+
whole &&= Number.isInteger(v);
|
|
293
|
+
}
|
|
294
|
+
if (whole && (hi - lo + 1) * n < Number.MAX_SAFE_INTEGER) {
|
|
295
|
+
const keys = new Float64Array(n);
|
|
296
|
+
for (let k = 0; k < n; k++) {
|
|
297
|
+
keys[k] = (starts[rows[k]] - lo) * n + k;
|
|
298
|
+
}
|
|
299
|
+
keys.sort();
|
|
300
|
+
const placed = Uint32Array.from(rows);
|
|
301
|
+
for (let k = 0; k < n; k++) {
|
|
302
|
+
rows[k] = placed[keys[k] % n];
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
rows.sort((a, b) => starts[a] - starts[b] || a - b);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
// Each row's group, numbered in the order groups are first met, a section
|
|
310
|
+
// being the outermost level: the groups keyed by their raw values, one Map
|
|
311
|
+
// level per groupby field, where a string key built per row was the
|
|
312
|
+
// aggregate's whole cost.
|
|
313
|
+
export function groupRows(n, bounds, reads, normalize) {
|
|
314
|
+
const groupOf = new Uint32Array(n);
|
|
315
|
+
const firstRow = [];
|
|
316
|
+
const sectionOf = [];
|
|
317
|
+
const last = reads.length - 1;
|
|
318
|
+
for (let s = 0; s + 1 < bounds.length; s++) {
|
|
319
|
+
const root = new Map();
|
|
320
|
+
for (let i = bounds[s]; i < bounds[s + 1]; i++) {
|
|
321
|
+
let g;
|
|
322
|
+
if (reads.length === 0) {
|
|
323
|
+
g =
|
|
324
|
+
firstRow.length > 0 && sectionOf.at(-1) === s
|
|
325
|
+
? firstRow.length - 1
|
|
326
|
+
: -1;
|
|
327
|
+
if (g < 0) {
|
|
328
|
+
g = firstRow.length;
|
|
329
|
+
firstRow.push(i);
|
|
330
|
+
sectionOf.push(s);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
let node = root;
|
|
335
|
+
for (let l = 0; l < last; l++) {
|
|
336
|
+
const raw = reads[l](i);
|
|
337
|
+
const v = normalize && typeof raw !== 'object' ? raw : groupKey(raw);
|
|
338
|
+
let next = node.get(v);
|
|
339
|
+
if (!next) {
|
|
340
|
+
next = new Map();
|
|
341
|
+
node.set(v, next);
|
|
342
|
+
}
|
|
343
|
+
node = next;
|
|
344
|
+
}
|
|
345
|
+
const raw = reads[last](i);
|
|
346
|
+
const v = normalize && typeof raw !== 'object' ? raw : groupKey(raw);
|
|
347
|
+
let at = node.get(v);
|
|
348
|
+
if (at === undefined) {
|
|
349
|
+
at = firstRow.length;
|
|
350
|
+
node.set(v, at);
|
|
351
|
+
firstRow.push(i);
|
|
352
|
+
sectionOf.push(s);
|
|
353
|
+
}
|
|
354
|
+
g = at;
|
|
355
|
+
}
|
|
356
|
+
groupOf[i] = g;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
return { groupOf, firstRow, sectionOf };
|
|
360
|
+
}
|
|
@@ -27,7 +27,7 @@ export declare function thresholdCuts(domain: readonly (string | number)[]): num
|
|
|
27
27
|
export declare function thresholdIndex(value: unknown, domain: readonly number[]): number;
|
|
28
28
|
/**
|
|
29
29
|
* #api
|
|
30
|
-
* The
|
|
30
|
+
* The color of each interval, in order: the declared palette, and the
|
|
31
31
|
* default categorical palette where it runs out.
|
|
32
32
|
*/
|
|
33
33
|
export declare function thresholdPalette(bins: number, palette?: readonly string[]): string[];
|
|
@@ -46,7 +46,7 @@ export function thresholdIndex(value, domain) {
|
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* #api
|
|
49
|
-
* The
|
|
49
|
+
* The color of each interval, in order: the declared palette, and the
|
|
50
50
|
* default categorical palette where it runs out.
|
|
51
51
|
*/
|
|
52
52
|
export function thresholdPalette(bins, palette = []) {
|
package/esm/util/tracks.js
CHANGED
|
@@ -693,7 +693,7 @@ export function pickDisplayForView({ candidates, declaredDisplays, requestedType
|
|
|
693
693
|
// displaySnapshot) triple that `showTrackGeneric` expects. Display props written
|
|
694
694
|
// inline on the track object (everything except trackId/trackSnapshot/
|
|
695
695
|
// displaySnapshot) fold into the display snapshot, so a spec can write
|
|
696
|
-
// `{ trackId,
|
|
696
|
+
// `{ trackId, showLabels: 'name' }` instead of nesting under
|
|
697
697
|
// `displaySnapshot`. An explicit `displaySnapshot` still wins over an inline
|
|
698
698
|
// key of the same name, and the older nested form keeps working unchanged.
|
|
699
699
|
// `showTrackGeneric` then routes any inline key that is a real config slot (e.g.
|
package/esm/util/usePanZoom.js
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
// tooltip is also where ctrl/⌘+scroll — which zooms whatever the preference
|
|
24
24
|
// says — is named.
|
|
25
25
|
import { useEffect, useRef } from 'react';
|
|
26
|
+
import { isClaimedPress } from './pressOwner.js';
|
|
26
27
|
import { createWheelZoomController } from './wheelZoom.js';
|
|
27
28
|
/**
|
|
28
29
|
* Wheel zoom and side-scroll, bound to `ref` for as long as the component
|
|
@@ -126,19 +127,12 @@ export function usePanZoom(ref, view, { touchAction = 'none', } = {}) {
|
|
|
126
127
|
return {
|
|
127
128
|
containerProps: {
|
|
128
129
|
onPointerDown(event) {
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
// that drag on their own — a display's vertical scrollbar, a resize
|
|
132
|
-
// handle), a button (the track-sizing button a display draws in its own
|
|
133
|
-
// corner), or a draggable element. `closest`, because the press usually
|
|
134
|
-
// lands on an icon inside the control. Shift is left alone too: it is
|
|
135
|
-
// what a range-select of the host's own would want, and it is what
|
|
136
|
-
// JBrowse's own view uses it for.
|
|
130
|
+
// Shift is left alone: it is what a range-select of the host's own
|
|
131
|
+
// would want, and it is what JBrowse's own view uses it for.
|
|
137
132
|
if (!event.isPrimary || event.button !== 0 || event.shiftKey) {
|
|
138
133
|
return;
|
|
139
134
|
}
|
|
140
|
-
if (event
|
|
141
|
-
event.target.closest('button, [data-gesture-owner], [draggable="true"]')) {
|
|
135
|
+
if (isClaimedPress(event)) {
|
|
142
136
|
return;
|
|
143
137
|
}
|
|
144
138
|
// Note what this does *not* do: capture the pointer. See onPointerMove.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { WindowStep } from './markEncodingTypes.ts';
|
|
2
|
+
import type { Staged } from './stepTables.ts';
|
|
3
|
+
type Frame = NonNullable<WindowStep['frame']>;
|
|
4
|
+
export declare const DEFAULT_WINDOW_FRAME: Frame;
|
|
5
|
+
export declare function windowStep({ table, bounds }: Staged, step: WindowStep): Staged;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// The `window` step, Vega-Lite's window transform over a group's rows in
|
|
2
|
+
// start order. Imported by relative path only.
|
|
3
|
+
import { aggregateFieldName } from './aggregateFieldName.js';
|
|
4
|
+
import { numberReaderOf, readerOf, withColumns } from './featureTable.js';
|
|
5
|
+
import { isPlainFieldRef } from './fieldReader.js';
|
|
6
|
+
import { groupRows, isWeighted, sortByStart, stepNumberReader, stepReader, } from './stepTables.js';
|
|
7
|
+
export const DEFAULT_WINDOW_FRAME = [-10, 10];
|
|
8
|
+
// The rows grouped, groups in the order first met and so sections outermost,
|
|
9
|
+
// each group's rows in start order, an unreadable start sorting last; and
|
|
10
|
+
// where each group's rows begin.
|
|
11
|
+
function windowOrder(table, groupOf, groups) {
|
|
12
|
+
const n = table.length;
|
|
13
|
+
const groupStart = new Uint32Array(groups + 1);
|
|
14
|
+
for (let i = 0; i < n; i++) {
|
|
15
|
+
groupStart[groupOf[i] + 1]++;
|
|
16
|
+
}
|
|
17
|
+
for (let g = 0; g < groups; g++) {
|
|
18
|
+
groupStart[g + 1] += groupStart[g];
|
|
19
|
+
}
|
|
20
|
+
const order = new Uint32Array(n);
|
|
21
|
+
const next = groupStart.slice(0, groups);
|
|
22
|
+
for (let i = 0; i < n; i++) {
|
|
23
|
+
order[next[groupOf[i]]++] = i;
|
|
24
|
+
}
|
|
25
|
+
const readStart = numberReaderOf(table.column('start'));
|
|
26
|
+
const starts = new Float64Array(n);
|
|
27
|
+
for (let i = 0; i < n; i++) {
|
|
28
|
+
const s = readStart(i);
|
|
29
|
+
starts[i] = Number.isNaN(s) ? Infinity : s;
|
|
30
|
+
}
|
|
31
|
+
for (let g = 0; g < groups; g++) {
|
|
32
|
+
const rows = order.subarray(groupStart[g], groupStart[g + 1]);
|
|
33
|
+
let sorted = true;
|
|
34
|
+
for (let k = 1; k < rows.length && sorted; k++) {
|
|
35
|
+
sorted = starts[rows[k]] >= starts[rows[k - 1]];
|
|
36
|
+
}
|
|
37
|
+
if (!sorted) {
|
|
38
|
+
sortByStart(rows, starts);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return { order, groupStart };
|
|
42
|
+
}
|
|
43
|
+
// The rows `[first, last]` of a group of `m` around its row `j`, empty where
|
|
44
|
+
// `first` passes `last`.
|
|
45
|
+
function frameAt([before, after], j, m) {
|
|
46
|
+
return [
|
|
47
|
+
before === null ? 0 : Math.max(0, j + before),
|
|
48
|
+
after === null ? m - 1 : Math.min(m - 1, j + after),
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
// A sum, count or mean over each frame from running totals, which answer an
|
|
52
|
+
// empty frame exactly 0, since the totals hold one value across it.
|
|
53
|
+
function totalsOver(op, values, weights, frame, lo, hi, out) {
|
|
54
|
+
const m = hi - lo;
|
|
55
|
+
const weightTotal = new Float64Array(m + 1);
|
|
56
|
+
const sumTotal = new Float64Array(m + 1);
|
|
57
|
+
for (let j = 0; j < m; j++) {
|
|
58
|
+
const v = values[lo + j];
|
|
59
|
+
const w = weights[lo + j];
|
|
60
|
+
const counted = Number.isFinite(v) && Number.isFinite(w);
|
|
61
|
+
weightTotal[j + 1] = weightTotal[j] + (counted ? w : 0);
|
|
62
|
+
sumTotal[j + 1] = sumTotal[j] + (counted ? v * w : 0);
|
|
63
|
+
}
|
|
64
|
+
for (let j = 0; j < m; j++) {
|
|
65
|
+
const [a, b] = frameAt(frame, j, m);
|
|
66
|
+
const weight = a > b ? 0 : weightTotal[b + 1] - weightTotal[a];
|
|
67
|
+
const sum = a > b ? 0 : sumTotal[b + 1] - sumTotal[a];
|
|
68
|
+
out[lo + j] =
|
|
69
|
+
op === 'count'
|
|
70
|
+
? weight
|
|
71
|
+
: op === 'sum'
|
|
72
|
+
? sum
|
|
73
|
+
: weight === 0
|
|
74
|
+
? Number.NaN
|
|
75
|
+
: sum / weight;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// A min or max over each frame through a monotonic queue of row positions,
|
|
79
|
+
// which holds because neither end of a frame ever moves back.
|
|
80
|
+
function extremeOver(op, values, frame, lo, hi, out) {
|
|
81
|
+
const m = hi - lo;
|
|
82
|
+
const queue = new Uint32Array(m);
|
|
83
|
+
let head = 0;
|
|
84
|
+
let tail = 0;
|
|
85
|
+
let added = 0;
|
|
86
|
+
for (let j = 0; j < m; j++) {
|
|
87
|
+
const [a, b] = frameAt(frame, j, m);
|
|
88
|
+
for (; added <= b; added++) {
|
|
89
|
+
const v = values[lo + added];
|
|
90
|
+
if (!Number.isFinite(v)) {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
while (tail > head &&
|
|
94
|
+
(op === 'min'
|
|
95
|
+
? values[lo + queue[tail - 1]] >= v
|
|
96
|
+
: values[lo + queue[tail - 1]] <= v)) {
|
|
97
|
+
tail--;
|
|
98
|
+
}
|
|
99
|
+
queue[tail++] = added;
|
|
100
|
+
}
|
|
101
|
+
while (head < tail && queue[head] < a) {
|
|
102
|
+
head++;
|
|
103
|
+
}
|
|
104
|
+
out[lo + j] = head < tail ? values[lo + queue[head]] : Number.NaN;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function windowColumn(table, agg, order, groupStart, frame) {
|
|
108
|
+
const { op, field, weight } = agg;
|
|
109
|
+
if (op !== 'count' && field === undefined) {
|
|
110
|
+
throw new Error(`a window ${op} needs a field`);
|
|
111
|
+
}
|
|
112
|
+
const n = order.length;
|
|
113
|
+
const readValue = field === undefined || op === 'count'
|
|
114
|
+
? () => 0
|
|
115
|
+
: stepNumberReader(table, field, 'a window');
|
|
116
|
+
const readWeight = weight !== undefined && isWeighted(agg)
|
|
117
|
+
? stepNumberReader(table, weight, 'a window')
|
|
118
|
+
: () => 1;
|
|
119
|
+
const values = new Float64Array(n);
|
|
120
|
+
const weights = new Float64Array(n);
|
|
121
|
+
for (let k = 0; k < n; k++) {
|
|
122
|
+
values[k] = readValue(order[k]);
|
|
123
|
+
weights[k] = readWeight(order[k]);
|
|
124
|
+
}
|
|
125
|
+
const out = new Float64Array(n);
|
|
126
|
+
for (let g = 0; g + 1 < groupStart.length; g++) {
|
|
127
|
+
const lo = groupStart[g];
|
|
128
|
+
const hi = groupStart[g + 1];
|
|
129
|
+
if (op === 'min' || op === 'max') {
|
|
130
|
+
extremeOver(op, values, frame, lo, hi, out);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
totalsOver(op, values, weights, frame, lo, hi, out);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return op === 'count' || op === 'sum'
|
|
137
|
+
? { kind: 'number', values: out, at: undefined }
|
|
138
|
+
: { kind: 'number', values: out, at: undefined, nanIsAbsent: true };
|
|
139
|
+
}
|
|
140
|
+
export function windowStep({ table, bounds }, step) {
|
|
141
|
+
const { groupby = [], ops, frame = DEFAULT_WINDOW_FRAME } = step;
|
|
142
|
+
const keyed = groupby.some(field => !isPlainFieldRef(field));
|
|
143
|
+
const reads = groupby.map(field => keyed
|
|
144
|
+
? stepReader(table, field, 'a window')
|
|
145
|
+
: readerOf(table.column(field)));
|
|
146
|
+
const { groupOf, firstRow } = groupRows(table.length, bounds, reads, !keyed);
|
|
147
|
+
const { order, groupStart } = windowOrder(table, groupOf, firstRow.length);
|
|
148
|
+
const written = new Map(ops.map(agg => [
|
|
149
|
+
aggregateFieldName(agg),
|
|
150
|
+
windowColumn(table, agg, order, groupStart, frame),
|
|
151
|
+
]));
|
|
152
|
+
return { table: withColumns(table, written, order), bounds };
|
|
153
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/core",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "JBrowse 2 core libraries used by plugins",
|
|
6
6
|
"keywords": [
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"./PluginManager": "./esm/PluginManager.js",
|
|
34
34
|
"./ReExports/list": "./esm/ReExports/list.js",
|
|
35
35
|
"./ReExports/modules": "./esm/ReExports/modules.js",
|
|
36
|
+
"./ReExports/names": "./esm/ReExports/names.js",
|
|
36
37
|
"./ReExports/registry": "./esm/ReExports/registry.js",
|
|
37
38
|
"./ReExports/uiStub": "./esm/ReExports/uiStub.js",
|
|
38
39
|
"./ReExports/workerModules": "./esm/ReExports/workerModules.js",
|
|
@@ -42,6 +43,8 @@
|
|
|
42
43
|
"./assemblyManager": "./esm/assemblyManager/index.js",
|
|
43
44
|
"./assemblyManager/assembly": "./esm/assemblyManager/assembly.js",
|
|
44
45
|
"./assemblyManager/assemblyConfigSchema": "./esm/assemblyManager/assemblyConfigSchema.js",
|
|
46
|
+
"./assemblyManager/expandAssemblyConfigShorthand": "./esm/assemblyManager/expandAssemblyConfigShorthand.js",
|
|
47
|
+
"./assemblyManager/refNameMaps": "./esm/assemblyManager/refNameMaps.js",
|
|
45
48
|
"./checkPlugins": "./esm/checkPlugins.js",
|
|
46
49
|
"./configuration": "./esm/configuration/index.js",
|
|
47
50
|
"./configuration/configurationSchema": "./esm/configuration/configurationSchema.js",
|
|
@@ -97,6 +100,7 @@
|
|
|
97
100
|
"./ui/CascadingMenuButton": "./esm/ui/CascadingMenuButton.js",
|
|
98
101
|
"./ui/ColorPicker": "./esm/ui/ColorPicker.js",
|
|
99
102
|
"./ui/ConfirmDialog": "./esm/ui/ConfirmDialog.js",
|
|
103
|
+
"./ui/ContextMenu": "./esm/ui/ContextMenu.js",
|
|
100
104
|
"./ui/DataGridFlexContainer": "./esm/ui/DataGridFlexContainer.js",
|
|
101
105
|
"./ui/Dialog": "./esm/ui/Dialog.js",
|
|
102
106
|
"./ui/DraggableDialog": "./esm/ui/DraggableDialog.js",
|
|
@@ -145,6 +149,7 @@
|
|
|
145
149
|
"./ui/multiTrackMenuItems": "./esm/ui/multiTrackMenuItems.js",
|
|
146
150
|
"./ui/palette": "./esm/ui/palette.js",
|
|
147
151
|
"./ui/persistentScrollbarStyle": "./esm/ui/persistentScrollbarStyle.js",
|
|
152
|
+
"./ui/rampKey": "./esm/ui/rampKey.js",
|
|
148
153
|
"./ui/scrollZoomLabels": "./esm/ui/scrollZoomLabels.js",
|
|
149
154
|
"./ui/showSubMenu": "./esm/ui/showSubMenu.js",
|
|
150
155
|
"./ui/styleTheme": "./esm/ui/styleTheme.js",
|
|
@@ -241,9 +246,11 @@
|
|
|
241
246
|
"./util/numericUtils": "./esm/util/numericUtils.js",
|
|
242
247
|
"./util/offscreenCanvasPonyfill": "./esm/util/offscreenCanvasPonyfill.js",
|
|
243
248
|
"./util/openViews": "./esm/util/openViews.js",
|
|
249
|
+
"./util/originCut": "./esm/util/originCut.js",
|
|
244
250
|
"./util/paintLayer": "./esm/util/paintLayer.js",
|
|
245
251
|
"./util/parseLineByLine": "./esm/util/parseLineByLine.js",
|
|
246
252
|
"./util/preloadComponent": "./esm/util/preloadComponent.js",
|
|
253
|
+
"./util/pressOwner": "./esm/util/pressOwner.js",
|
|
247
254
|
"./util/progress": "./esm/util/progress.js",
|
|
248
255
|
"./util/quantileExtent": "./esm/util/quantileExtent.js",
|
|
249
256
|
"./util/range": "./esm/util/range.js",
|
|
@@ -260,6 +267,7 @@
|
|
|
260
267
|
"./util/simpleFeature": "./esm/util/simpleFeature.js",
|
|
261
268
|
"./util/starFusion": "./esm/util/starFusion.js",
|
|
262
269
|
"./util/stats": "./esm/util/stats.js",
|
|
270
|
+
"./util/stepOutputs": "./esm/util/stepOutputs.js",
|
|
263
271
|
"./util/svAlt": "./esm/util/svAlt.js",
|
|
264
272
|
"./util/svgColorProps": "./esm/util/svgColorProps.js",
|
|
265
273
|
"./util/systemColorScheme": "./esm/util/systemColorScheme.js",
|
|
@@ -300,29 +308,29 @@
|
|
|
300
308
|
"@emotion/serialize": "^1.3.3",
|
|
301
309
|
"@emotion/utils": "^1.4.2",
|
|
302
310
|
"@floating-ui/react": "^0.27.20",
|
|
303
|
-
"@gmod/bgzf-filehandle": "^6.
|
|
304
|
-
"@gmod/range-cache-filehandle": "^1.5.
|
|
305
|
-
"@gmod/shared-read-cache": "^1.
|
|
306
|
-
"@gmod/vcf": "^7.
|
|
311
|
+
"@gmod/bgzf-filehandle": "^6.8.0",
|
|
312
|
+
"@gmod/range-cache-filehandle": "^1.5.2",
|
|
313
|
+
"@gmod/shared-read-cache": "^2.1.0",
|
|
314
|
+
"@gmod/vcf": "^7.4.0",
|
|
307
315
|
"@jbrowse/jexl": "^6.0.0",
|
|
308
|
-
"@jbrowse/mobx-state-tree": "^6.
|
|
316
|
+
"@jbrowse/mobx-state-tree": "^6.9.0",
|
|
309
317
|
"@jbrowse/quick-lru": "^8.0.0",
|
|
310
318
|
"@leeoniya/ufuzzy": "^1.0.19",
|
|
311
|
-
"@mui/icons-material": "^9.
|
|
312
|
-
"@mui/material": "^9.
|
|
313
|
-
"@mui/system": "^9.
|
|
314
|
-
"@mui/x-data-grid": "^9.
|
|
319
|
+
"@mui/icons-material": "^9.5.0",
|
|
320
|
+
"@mui/material": "^9.5.0",
|
|
321
|
+
"@mui/system": "^9.5.0",
|
|
322
|
+
"@mui/x-data-grid": "^9.15.0",
|
|
315
323
|
"canvas-sequencer-ts": "^3.1.3",
|
|
316
324
|
"compare-versions": "^6.1.1",
|
|
317
|
-
"dompurify": "^3.4.
|
|
318
|
-
"generic-filehandle2": "^2.5.
|
|
319
|
-
"idb": "^8.0.
|
|
325
|
+
"dompurify": "^3.4.17",
|
|
326
|
+
"generic-filehandle2": "^2.5.1",
|
|
327
|
+
"idb": "^8.0.4",
|
|
320
328
|
"mobx": "^7.0.6",
|
|
321
329
|
"mobx-react": "^10.0.2",
|
|
322
330
|
"rxjs": "^7.8.2",
|
|
323
331
|
"source-map-js": "^1.2.2",
|
|
324
|
-
"@jbrowse/add-track-core": "^5.0.0-beta.
|
|
325
|
-
"@jbrowse/render-core": "^5.0.0-beta.
|
|
332
|
+
"@jbrowse/add-track-core": "^5.0.0-beta.14",
|
|
333
|
+
"@jbrowse/render-core": "^5.0.0-beta.14"
|
|
326
334
|
},
|
|
327
335
|
"peerDependencies": {
|
|
328
336
|
"react": ">=19.0.0",
|