@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
|
@@ -1,5 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A symmetric cubic's extreme sits 3/4 of the way from its baseline to its
|
|
3
|
+
* controls; the sashimi labels solve the same equation in the other direction.
|
|
4
|
+
*/
|
|
1
5
|
export declare const CUBIC_APEX_RATIO = 0.75;
|
|
6
|
+
/**
|
|
7
|
+
* How far a curve can stray outside the band between its two endpoints, which
|
|
8
|
+
* a culler pads its viewport test by.
|
|
9
|
+
*/
|
|
2
10
|
export declare const BEZIER_CONNECTOR_MAX_REACH_PX = 110;
|
|
11
|
+
/**
|
|
12
|
+
* One horizontal-tangent connector curve as an SVG path: the read and
|
|
13
|
+
* breakpoint connector BreakpointSplitView's AlignmentConnections draws, and
|
|
14
|
+
* the alignments display draws as render-core's `connector` mark. The
|
|
15
|
+
* geometry is that shader's own, through its JS twin, so the two views cannot
|
|
16
|
+
* drift in which way a connection leaves its read.
|
|
17
|
+
*
|
|
18
|
+
* A discordant connection dips below its ends instead of bowing up over them,
|
|
19
|
+
* so the two classes read apart at a glance. How deep is the caller's call:
|
|
20
|
+
* only it knows the band the ink has to survive in, and `discordantDipPx`
|
|
21
|
+
* (@jbrowse/sv-core) is the law the two views share.
|
|
22
|
+
*/
|
|
3
23
|
export declare function bezierConnectorPath({ x1, y1, x2, y2, s1, s2, leadingEnd2, reversed1, reversed2, maxHandlePx, dipPx, }: {
|
|
4
24
|
x1: number;
|
|
5
25
|
y1: number;
|
|
@@ -1,105 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// A symmetric cubic's extreme sits 3/4 of the way from its baseline to its
|
|
26
|
-
// control points, so an arc asked to reach a given apex puts its controls 4/3
|
|
27
|
-
// past it. Exported because the sashimi overlay solves the same equation in the
|
|
28
|
-
// other direction, and the two spellings drifting apart would put the insert-
|
|
29
|
-
// size ruler's labels at heights nothing plots at.
|
|
30
|
-
export const CUBIC_APEX_RATIO = 0.75;
|
|
31
|
-
// Vertical bow applied to a connection whose two endpoints share (or nearly
|
|
32
|
-
// share) a row — e.g. a chain whose split segments are all laid out on one
|
|
33
|
-
// pileup row. Without it the horizontal-only handles collapse the cubic to a
|
|
34
|
-
// flat, invisible line lying on the row; the bow lifts the control points so
|
|
35
|
-
// the curve arcs into a visible hump. This is the control-point lift, not the
|
|
36
|
-
// height the curve reaches.
|
|
37
|
-
const MAX_BOW_PX = 30;
|
|
38
|
-
// A discordant connection bows *down* instead of up, so the two classes read
|
|
39
|
-
// apart at a glance. Both renderers follow this: BreakpointSplitView dips its
|
|
40
|
-
// same-level discordant links, and the pileup overlay dips every discordant
|
|
41
|
-
// curve it draws (a normal-orientation pair is a plain line, or bows up over its
|
|
42
|
-
// row where a hidden-segment one would lie on a chain's connecting line). Keep
|
|
43
|
-
// it that way — a renderer that opts out makes "below the reads" mean two
|
|
44
|
-
// different things in two views of the same data.
|
|
45
|
-
//
|
|
46
|
-
// HOW DEEP is the renderer's call, not this file's. Depth is the mark's one free
|
|
47
|
-
// channel, and only the renderer knows the band the ink has to survive in — the
|
|
48
|
-
// pileup clips each section at its band bottom, and the split view bleeds a
|
|
49
|
-
// too-deep dip into the panel below. So callers pass the depth they want and
|
|
50
|
-
// `discordantDipPx` (@jbrowse/sv-core) is the law the two of them share.
|
|
51
|
-
// How far a curve can stray outside the band between its two endpoints. The dip
|
|
52
|
-
// is the deeper of the two shaping terms, so this is a ceiling on it, applied
|
|
53
|
-
// here rather than trusted to a caller: a culler pads its viewport test by this,
|
|
54
|
-
// and the shaping is applied to the *control points*, so a curve whose two
|
|
55
|
-
// endpoints both sit just outside the viewport can still have a visible body.
|
|
56
|
-
export const BEZIER_CONNECTOR_MAX_REACH_PX = 110;
|
|
57
|
-
// Sign (+1/-1) of an endpoint's horizontal control handle. The handle leaves a
|
|
58
|
-
// trailing (3') endpoint along the read's reading direction (`strand`); at a
|
|
59
|
-
// split junction's leading (5') endpoint it flips, so the curve arrives flowing
|
|
60
|
-
// *into* the next segment (a fwd→rev inversion folds back instead of cutting
|
|
61
|
-
// straight across). `reversed` flips screen-x for a reverse-complemented region.
|
|
62
|
-
function tangentSign(strand, leading, reversed) {
|
|
63
|
-
return strand * (leading ? -1 : 1) * (reversed ? -1 : 1);
|
|
64
|
-
}
|
|
65
|
-
// How much shaping (handle length, bow height) this curve may spend: a fraction
|
|
66
|
-
// of the distance it has to cover.
|
|
67
|
-
function shapingBudget(p1, p2) {
|
|
68
|
-
const dy = Math.min(Math.abs(p2.y - p1.y), MAX_VERTICAL_SPAN_PX);
|
|
69
|
-
return Math.hypot(p2.x - p1.x, dy) * SPAN_FACTOR;
|
|
70
|
-
}
|
|
71
|
-
// Fades to zero as the endpoints' rows separate, since a cross-row curve
|
|
72
|
-
// already has vertical extent — and via the budget as they close in
|
|
73
|
-
// horizontally, since a short connector is legible without a hump.
|
|
74
|
-
function bowHeight(p1, p2, budget) {
|
|
75
|
-
return Math.min(budget, Math.max(0, MAX_BOW_PX - Math.abs(p2.y - p1.y)));
|
|
76
|
-
}
|
|
77
|
-
function cubicPath(from, ctrl1, ctrl2, to) {
|
|
78
|
-
return `M ${from.x} ${from.y} C ${ctrl1.x} ${ctrl1.y} ${ctrl2.x} ${ctrl2.y} ${to.x} ${to.y}`;
|
|
79
|
-
}
|
|
1
|
+
import { connectorBudgetPx, connectorHandlePx, connectorLiftPx, connectorTangent, } from '@jbrowse/render-core/shaders/connectorMark';
|
|
2
|
+
import { CONNECTOR_APEX_RATIO, CONNECTOR_BOW, CONNECTOR_MAX_HANDLE_PX, CONNECTOR_MAX_REACH_PX, } from '@jbrowse/render-core/shaders/connectorMarkConsts';
|
|
3
|
+
/**
|
|
4
|
+
* A symmetric cubic's extreme sits 3/4 of the way from its baseline to its
|
|
5
|
+
* controls; the sashimi labels solve the same equation in the other direction.
|
|
6
|
+
*/
|
|
7
|
+
export const CUBIC_APEX_RATIO = CONNECTOR_APEX_RATIO;
|
|
8
|
+
/**
|
|
9
|
+
* How far a curve can stray outside the band between its two endpoints, which
|
|
10
|
+
* a culler pads its viewport test by.
|
|
11
|
+
*/
|
|
12
|
+
export const BEZIER_CONNECTOR_MAX_REACH_PX = CONNECTOR_MAX_REACH_PX;
|
|
13
|
+
/**
|
|
14
|
+
* One horizontal-tangent connector curve as an SVG path: the read and
|
|
15
|
+
* breakpoint connector BreakpointSplitView's AlignmentConnections draws, and
|
|
16
|
+
* the alignments display draws as render-core's `connector` mark. The
|
|
17
|
+
* geometry is that shader's own, through its JS twin, so the two views cannot
|
|
18
|
+
* drift in which way a connection leaves its read.
|
|
19
|
+
*
|
|
20
|
+
* A discordant connection dips below its ends instead of bowing up over them,
|
|
21
|
+
* so the two classes read apart at a glance. How deep is the caller's call:
|
|
22
|
+
* only it knows the band the ink has to survive in, and `discordantDipPx`
|
|
23
|
+
* (@jbrowse/sv-core) is the law the two views share.
|
|
24
|
+
*/
|
|
80
25
|
export function bezierConnectorPath({ x1, y1, x2, y2, s1, s2,
|
|
81
26
|
// The second endpoint is a split junction's 5' leading edge (its handle flips
|
|
82
27
|
// to fold the curve into the next segment); false for a paired mate's 3' edge.
|
|
83
|
-
leadingEnd2 = false, reversed1 = false, reversed2 = false, maxHandlePx =
|
|
84
|
-
// Depth, in px, of the dip a discordant connection draws instead
|
|
85
|
-
// concordant one gets
|
|
86
|
-
// strand flip, so the two classes are tellable apart by shape alone. It is
|
|
87
|
-
// the depth of the curve's APEX — what a caller can bound by the room it has —
|
|
88
|
-
// and CUBIC_APEX_RATIO converts it to the control-point drop that puts the ink
|
|
89
|
-
// there. Leave it out to bow up.
|
|
28
|
+
leadingEnd2 = false, reversed1 = false, reversed2 = false, maxHandlePx = CONNECTOR_MAX_HANDLE_PX,
|
|
29
|
+
// Depth, in px, of the APEX of the dip a discordant connection draws instead
|
|
30
|
+
// of the bow a concordant one gets. Leave it out to bow up.
|
|
90
31
|
dipPx, }) {
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
const
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
// it goes, so a big event squeezed into a few px draws a narrow trough rather
|
|
99
|
-
// than a squiggle. Pinned by 'a dipped connection never overshoots its
|
|
100
|
-
// endpoints in x'.
|
|
101
|
-
const bow = dipPx === undefined
|
|
102
|
-
? bowHeight(from, to, budget)
|
|
103
|
-
: -Math.min(dipPx, BEZIER_CONNECTOR_MAX_REACH_PX) / CUBIC_APEX_RATIO;
|
|
104
|
-
return cubicPath(from, { x: x1 + handle * tangentSign(s1, false, reversed1), y: y1 - bow }, { x: x2 + handle * tangentSign(s2, leadingEnd2, reversed2), y: y2 - bow }, to);
|
|
32
|
+
const dy = y2 - y1;
|
|
33
|
+
const budget = connectorBudgetPx(x2 - x1, dy);
|
|
34
|
+
const handle = connectorHandlePx(budget, maxHandlePx);
|
|
35
|
+
const lift = connectorLiftPx(budget, dy, dipPx ?? CONNECTOR_BOW);
|
|
36
|
+
const c1x = x1 + handle * connectorTangent(s1, 0, reversed1 ? 1 : 0);
|
|
37
|
+
const c2x = x2 + handle * connectorTangent(s2, leadingEnd2 ? 1 : 0, reversed2 ? 1 : 0);
|
|
38
|
+
return `M ${x1} ${y1} C ${c1x} ${y1 - lift} ${c2x} ${y2 - lift} ${x2} ${y2}`;
|
|
105
39
|
}
|
|
@@ -51,5 +51,8 @@ import { SharedBudget } from '@gmod/shared-read-cache';
|
|
|
51
51
|
* why this used to be two budgets named for their units: a million records
|
|
52
52
|
* could not be added to bytes, and never bound long-read data either, where a
|
|
53
53
|
* 6 MB slice counted as 37.
|
|
54
|
+
*
|
|
55
|
+
* `@jbrowse/tables` lowers the limit for a host such as R, which keeps no
|
|
56
|
+
* track open to pan (`packages/tables/src/cache.ts`).
|
|
54
57
|
*/
|
|
55
58
|
export declare const decompressedBytesBudget: SharedBudget;
|
package/esm/util/cacheBudgets.js
CHANGED
|
@@ -51,5 +51,8 @@ import { SharedBudget } from '@gmod/shared-read-cache';
|
|
|
51
51
|
* why this used to be two budgets named for their units: a million records
|
|
52
52
|
* could not be added to bytes, and never bound long-read data either, where a
|
|
53
53
|
* 6 MB slice counted as 37.
|
|
54
|
+
*
|
|
55
|
+
* `@jbrowse/tables` lowers the limit for a host such as R, which keeps no
|
|
56
|
+
* track open to pan (`packages/tables/src/cache.ts`).
|
|
54
57
|
*/
|
|
55
58
|
export const decompressedBytesBudget = new SharedBudget(1024 * 2 ** 20);
|
|
@@ -41,7 +41,7 @@ export interface CategoricalField {
|
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* #api
|
|
44
|
-
* What a key names each of `keys`, from a
|
|
44
|
+
* What a key names each of `keys`, from a color object's `labels`: one each in
|
|
45
45
|
* order, an empty or missing entry leaving that key its own name. Every key
|
|
46
46
|
* that takes `labels` reads them through this, so a config means one thing by
|
|
47
47
|
* them everywhere.
|
|
@@ -63,7 +63,7 @@ export declare function categoricalField(field: string, { domain, range, labels,
|
|
|
63
63
|
}): CategoricalField;
|
|
64
64
|
/**
|
|
65
65
|
* #api
|
|
66
|
-
* Deals `keys` their
|
|
66
|
+
* Deals `keys` their colors in `field.compare` order, so the colors a set
|
|
67
67
|
* of keys first seen together takes do not depend on the order they arrive
|
|
68
68
|
* in. A no-op for a field that deals nothing.
|
|
69
69
|
*/
|
|
@@ -18,7 +18,7 @@ export const SV_TYPE_FIELD = 'svType';
|
|
|
18
18
|
export const NO_VALUE_LABEL = '(no value)';
|
|
19
19
|
/**
|
|
20
20
|
* #api
|
|
21
|
-
* What a key names each of `keys`, from a
|
|
21
|
+
* What a key names each of `keys`, from a color object's `labels`: one each in
|
|
22
22
|
* order, an empty or missing entry leaving that key its own name. Every key
|
|
23
23
|
* that takes `labels` reads them through this, so a config means one thing by
|
|
24
24
|
* them everywhere.
|
|
@@ -44,7 +44,7 @@ export function keyNames(keys, labels = []) {
|
|
|
44
44
|
*/
|
|
45
45
|
export function categoricalField(field, { domain = [], range = [], labels = [], held, } = {}) {
|
|
46
46
|
// a field with a vocabulary of its own reads it on every channel, a facet's
|
|
47
|
-
// sections as well as a
|
|
47
|
+
// sections as well as a color's key
|
|
48
48
|
const vocabulary = universalPresetOf(field);
|
|
49
49
|
const ownOrder = vocabulary?.domain ?? [];
|
|
50
50
|
const order = domain.length > 0 ? domain : ownOrder;
|
|
@@ -76,7 +76,7 @@ export function categoricalField(field, { domain = [], range = [], labels = [],
|
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* #api
|
|
79
|
-
* Deals `keys` their
|
|
79
|
+
* Deals `keys` their colors in `field.compare` order, so the colors a set
|
|
80
80
|
* of keys first seen together takes do not depend on the order they arrive
|
|
81
81
|
* in. A no-op for a field that deals nothing.
|
|
82
82
|
*/
|
|
@@ -78,7 +78,7 @@ export declare function relight(color: string, lightnessShift: number, chromaSca
|
|
|
78
78
|
* once per feature, and what a reader saw was every unlabelled feature in one
|
|
79
79
|
* strong color: a large fake category, drawn over the real ones. Grey says the
|
|
80
80
|
* only true thing about a feature with no value for the attribute you asked to
|
|
81
|
-
*
|
|
81
|
+
* color by.
|
|
82
82
|
*
|
|
83
83
|
* @param str - The string to generate a color from
|
|
84
84
|
* @returns A CSS hex color string
|
package/esm/util/color/index.js
CHANGED
|
@@ -82,7 +82,7 @@ export { CSS_COLOR_NAMES, isNamedColor, namedColorToHex, } from './cssColorsLeve
|
|
|
82
82
|
// has to read as "not in a category" beside a palette whose every member is
|
|
83
83
|
// equally light and equally colorful, so it cannot be one more hue.
|
|
84
84
|
export const NO_CATEGORY_COLOR = '#afafaf';
|
|
85
|
-
// What a
|
|
85
|
+
// What a color declaration paints where it reads nothing it can color, so a
|
|
86
86
|
// misconfiguration surfaces rather than passing for the no-category grey.
|
|
87
87
|
export const MISCONFIGURED_COLOR = '#808080';
|
|
88
88
|
const RANDOM_COLOR_TIERS = [
|
|
@@ -185,7 +185,7 @@ export function relight(color, lightnessShift, chromaScale = 1) {
|
|
|
185
185
|
* once per feature, and what a reader saw was every unlabelled feature in one
|
|
186
186
|
* strong color: a large fake category, drawn over the real ones. Grey says the
|
|
187
187
|
* only true thing about a feature with no value for the attribute you asked to
|
|
188
|
-
*
|
|
188
|
+
* color by.
|
|
189
189
|
*
|
|
190
190
|
* @param str - The string to generate a color from
|
|
191
191
|
* @returns A CSS hex color string
|
|
@@ -32,6 +32,6 @@ export function clampByte(n) {
|
|
|
32
32
|
// against NaN is false, and an unclamped NaN shifts to 0 anyway — silently,
|
|
33
33
|
// one channel at a time. `jexl:alpha(color, get(feature,'opacity'))` on a
|
|
34
34
|
// non-numeric attribute is the reachable one, and it drew the feature at
|
|
35
|
-
// alpha 0 instead of reaching the invalid-
|
|
35
|
+
// alpha 0 instead of reaching the invalid-color sentinel.
|
|
36
36
|
return n > 0 ? (n > 255 ? 255 : n) : 0;
|
|
37
37
|
}
|
|
@@ -9,15 +9,15 @@ const E = 'e'.charCodeAt(0);
|
|
|
9
9
|
/**
|
|
10
10
|
* Approximative CSS colorspace string pattern, e.g. rgb(), color()
|
|
11
11
|
*
|
|
12
|
-
* **Anchored**, because the whole string has to be a
|
|
13
|
-
* Unanchored it matched a
|
|
12
|
+
* **Anchored**, because the whole string has to be a color for this to be one.
|
|
13
|
+
* Unanchored it matched a color sitting anywhere inside anything, so
|
|
14
14
|
* `parseCssColor('foo rgb(1,2,3) bar')` answered `[1,2,3]` — and a config slot
|
|
15
|
-
* holding prose, a jexl expression that did not evaluate, or two
|
|
16
|
-
* mistake read as a plausible
|
|
15
|
+
* holding prose, a jexl expression that did not evaluate, or two colors by
|
|
16
|
+
* mistake read as a plausible color instead of reaching the invalid-color
|
|
17
17
|
* sentinel. That sentinel is a contract (`colorBits.test.ts`: a broken config
|
|
18
|
-
* reads as magenta, never as a plausible wrong
|
|
18
|
+
* reads as magenta, never as a plausible wrong color), and it was unreachable
|
|
19
19
|
* for every such string. Surrounding whitespace is still tolerated: a slot with
|
|
20
|
-
* a trailing space is a formatting slip, not a different
|
|
20
|
+
* a trailing space is a formatting slip, not a different color.
|
|
21
21
|
*/
|
|
22
22
|
const PATTERN = (() => {
|
|
23
23
|
const NAME = String.raw `(\w+)`;
|
package/esm/util/colorBits.d.ts
CHANGED
|
@@ -13,12 +13,13 @@ export type { Color } from './color-bits/index.ts';
|
|
|
13
13
|
* rendering as the magenta invalid-color sentinel. Takes the raw value so it
|
|
14
14
|
* stays dependency-free and directly testable.
|
|
15
15
|
*/
|
|
16
|
-
export declare function featureItemRgb(raw: unknown): string | undefined;
|
|
16
|
+
export declare function featureItemRgb(raw: unknown, itemRgbOn?: boolean): string | undefined;
|
|
17
17
|
/**
|
|
18
|
-
* The BED color a feature declares for itself, under
|
|
19
|
-
* undefined if it declares none.
|
|
18
|
+
* The BED color a feature declares for itself, under any column name, or
|
|
19
|
+
* undefined if it declares none. `itemRgbOn` reads "0,0,0" as black and a
|
|
20
|
+
* packed integer as UCSC does.
|
|
20
21
|
*/
|
|
21
|
-
export declare function featureBedColor(feature: Feature): string | undefined;
|
|
22
|
+
export declare function featureBedColor(feature: Feature, itemRgbOn?: boolean): string | undefined;
|
|
22
23
|
export declare function parseCssColor(color: string | undefined | null): number;
|
|
23
24
|
export declare function cssColorToNormalizedRgb(color: string): [number, number, number];
|
|
24
25
|
export declare function cssColorToRgb(color: string): [number, number, number];
|
|
@@ -36,4 +37,14 @@ export declare function abgrRed(c: number): number;
|
|
|
36
37
|
export declare function abgrGreen(c: number): number;
|
|
37
38
|
export declare function abgrBlue(c: number): number;
|
|
38
39
|
export declare function abgrAlpha(c: number): number;
|
|
40
|
+
/** An ABGR-packed color as lowercase `#rrggbb`, its alpha dropped. */
|
|
41
|
+
export declare function abgrToHex(c: number): string;
|
|
42
|
+
/** Any CSS color as lowercase `#rrggbb`, its alpha dropped. */
|
|
43
|
+
export declare function cssColorToHex(color: string): string;
|
|
44
|
+
/** A 0..1 normalized RGB triple as lowercase `#rrggbb`. */
|
|
45
|
+
export declare function normalizedRgbToHex([r, g, b]: readonly [
|
|
46
|
+
number,
|
|
47
|
+
number,
|
|
48
|
+
number
|
|
49
|
+
]): string;
|
|
39
50
|
export declare function cssColorToNormalizedRgba(color: string): [number, number, number, number];
|
package/esm/util/colorBits.js
CHANGED
|
@@ -10,13 +10,18 @@ export { alpha, blend, darken, formatHEX, formatHEXA, formatRGBA, getAlpha, getB
|
|
|
10
10
|
// Returning magenta makes the bad slot visually obvious without breaking the
|
|
11
11
|
// rest of the render.
|
|
12
12
|
const INVALID_COLOR = newColor(255, 0, 255, 255);
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
// Plain BED12 files fill itemRgb with "0,0,0" rather than omitting it (every
|
|
14
|
+
// itemRgb in the volvox-bed12 fixture is one), and UCSC ignores the column
|
|
15
|
+
// unless trackDb says `itemRgb on`. So the triple reads as absent unless the
|
|
16
|
+
// caller passes `itemRgbOn`. Under it, UCSC also reads a comma-free value as a
|
|
17
|
+
// packed 0xRRGGBB integer, and paints 0 its track color, black by default.
|
|
18
|
+
const BED_TRIPLE_UNSET = '0,0,0';
|
|
19
|
+
function packedRgb(raw) {
|
|
20
|
+
const n = typeof raw === 'string' && /^\d+$/.test(raw.trim()) ? Number(raw) : raw;
|
|
21
|
+
return typeof n === 'number' && Number.isInteger(n) && n >= 0 && n <= 0xffffff
|
|
22
|
+
? `${n >> 16},${(n >> 8) & 255},${n & 255}`
|
|
23
|
+
: undefined;
|
|
24
|
+
}
|
|
20
25
|
/**
|
|
21
26
|
* One raw attribute value as a usable BED color, or undefined when it isn't
|
|
22
27
|
* one. Deliberately strict: this feeds an *automatic* coloring path, so a value
|
|
@@ -26,11 +31,13 @@ const BED_TRIPLE_UNSET = /^0(,0,0)?$/;
|
|
|
26
31
|
* rendering as the magenta invalid-color sentinel. Takes the raw value so it
|
|
27
32
|
* stays dependency-free and directly testable.
|
|
28
33
|
*/
|
|
29
|
-
export function featureItemRgb(raw) {
|
|
34
|
+
export function featureItemRgb(raw, itemRgbOn = false) {
|
|
30
35
|
const triple = typeof raw === 'string' ? bedTriple(raw) : undefined;
|
|
31
|
-
return
|
|
32
|
-
? triple
|
|
33
|
-
:
|
|
36
|
+
return itemRgbOn
|
|
37
|
+
? (triple ?? packedRgb(raw))
|
|
38
|
+
: triple !== BED_TRIPLE_UNSET
|
|
39
|
+
? triple
|
|
40
|
+
: undefined;
|
|
34
41
|
}
|
|
35
42
|
// The names the BED color column goes by, most specific first.
|
|
36
43
|
//
|
|
@@ -51,13 +58,14 @@ export function featureItemRgb(raw) {
|
|
|
51
58
|
// write) keeps working, and can now just be deleted.
|
|
52
59
|
const BED_COLOR_FIELDS = ['itemRgb', 'reserved', 'field8'];
|
|
53
60
|
/**
|
|
54
|
-
* The BED color a feature declares for itself, under
|
|
55
|
-
* undefined if it declares none.
|
|
61
|
+
* The BED color a feature declares for itself, under any column name, or
|
|
62
|
+
* undefined if it declares none. `itemRgbOn` reads "0,0,0" as black and a
|
|
63
|
+
* packed integer as UCSC does.
|
|
56
64
|
*/
|
|
57
|
-
export function featureBedColor(feature) {
|
|
65
|
+
export function featureBedColor(feature, itemRgbOn = false) {
|
|
58
66
|
let found;
|
|
59
67
|
for (const field of BED_COLOR_FIELDS) {
|
|
60
|
-
found ??= featureItemRgb(feature.get(field));
|
|
68
|
+
found ??= featureItemRgb(feature.get(field), itemRgbOn);
|
|
61
69
|
}
|
|
62
70
|
return found;
|
|
63
71
|
}
|
|
@@ -144,6 +152,21 @@ export function abgrBlue(c) {
|
|
|
144
152
|
export function abgrAlpha(c) {
|
|
145
153
|
return (c >>> 24) & 0xff;
|
|
146
154
|
}
|
|
155
|
+
function hexByte(n) {
|
|
156
|
+
return n.toString(16).padStart(2, '0');
|
|
157
|
+
}
|
|
158
|
+
/** An ABGR-packed color as lowercase `#rrggbb`, its alpha dropped. */
|
|
159
|
+
export function abgrToHex(c) {
|
|
160
|
+
return `#${hexByte(abgrRed(c))}${hexByte(abgrGreen(c))}${hexByte(abgrBlue(c))}`;
|
|
161
|
+
}
|
|
162
|
+
/** Any CSS color as lowercase `#rrggbb`, its alpha dropped. */
|
|
163
|
+
export function cssColorToHex(color) {
|
|
164
|
+
return abgrToHex(cssColorToABGR(color));
|
|
165
|
+
}
|
|
166
|
+
/** A 0..1 normalized RGB triple as lowercase `#rrggbb`. */
|
|
167
|
+
export function normalizedRgbToHex([r, g, b]) {
|
|
168
|
+
return abgrToHex(normalizedRgbToABGR(r, g, b));
|
|
169
|
+
}
|
|
147
170
|
export function cssColorToNormalizedRgba(color) {
|
|
148
171
|
const c = parseCssColor(color);
|
|
149
172
|
return [
|
package/esm/util/colorRamp.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare const VIRIDIS_STOPS: readonly ColorRampStop[];
|
|
|
17
17
|
export declare function darkAtLowEnd(scheme: ColorSchemeName): boolean;
|
|
18
18
|
/**
|
|
19
19
|
* #api
|
|
20
|
-
* The domain a continuous
|
|
20
|
+
* The domain a continuous color scale spans: each end `min` or `max` pins,
|
|
21
21
|
* else the extent's, ascending, since a span has no direction and `reverse`
|
|
22
22
|
* is the ramp's. An open end stops at a pinned one rather than crossing it,
|
|
23
23
|
* and an extent holding no value (`[Infinity, -Infinity]`) spans [0, 1].
|
|
@@ -25,7 +25,7 @@ export declare function darkAtLowEnd(scheme: ColorSchemeName): boolean;
|
|
|
25
25
|
export declare function rampDomain(min: number | undefined, max: number | undefined, extent: readonly [number, number]): [number, number];
|
|
26
26
|
/**
|
|
27
27
|
* #api
|
|
28
|
-
* The stops a continuous
|
|
28
|
+
* The stops a continuous color scale samples: `range`'s CSS colors where it
|
|
29
29
|
* lists any, else the named `scheme`, viridis while that is unset, turned
|
|
30
30
|
* round under `reverse`.
|
|
31
31
|
*/
|
|
@@ -53,7 +53,7 @@ export declare function sampleColorRamp(stops: readonly ColorRampStop[], t: numb
|
|
|
53
53
|
export declare function buildColorRampLut(stops: readonly ColorRampStop[]): Uint8Array<ArrayBuffer>;
|
|
54
54
|
/**
|
|
55
55
|
* #api
|
|
56
|
-
* A continuous
|
|
56
|
+
* A continuous color scale's ramp as a config declares it.
|
|
57
57
|
*/
|
|
58
58
|
export interface RampDeclaration {
|
|
59
59
|
range?: readonly string[];
|
package/esm/util/colorRamp.js
CHANGED
|
@@ -95,6 +95,17 @@ const REDGREYBLUE_STOPS = [
|
|
|
95
95
|
[140, 140, 140, 255],
|
|
96
96
|
[47, 102, 176, 255],
|
|
97
97
|
];
|
|
98
|
+
const BLUEYELLOWRED_STOPS = [
|
|
99
|
+
[69, 117, 180, 255],
|
|
100
|
+
[116, 173, 209, 255],
|
|
101
|
+
[171, 217, 233, 255],
|
|
102
|
+
[224, 243, 248, 255],
|
|
103
|
+
[255, 255, 191, 255],
|
|
104
|
+
[254, 224, 144, 255],
|
|
105
|
+
[253, 174, 97, 255],
|
|
106
|
+
[244, 109, 67, 255],
|
|
107
|
+
[215, 48, 39, 255],
|
|
108
|
+
];
|
|
98
109
|
const SCHEME_STOPS = {
|
|
99
110
|
viridis: VIRIDIS_STOPS,
|
|
100
111
|
juicebox: JUICEBOX_STOPS,
|
|
@@ -107,6 +118,7 @@ const SCHEME_STOPS = {
|
|
|
107
118
|
redblue: REDBLUE_STOPS,
|
|
108
119
|
purpleorange: PURPLEORANGE_STOPS,
|
|
109
120
|
redgreyblue: REDGREYBLUE_STOPS,
|
|
121
|
+
blueyellowred: BLUEYELLOWRED_STOPS,
|
|
110
122
|
};
|
|
111
123
|
function luminanceOverWhite([r, g, b, a]) {
|
|
112
124
|
const over = (c) => 255 + (c - 255) * (a / 255);
|
|
@@ -124,7 +136,7 @@ export function darkAtLowEnd(scheme) {
|
|
|
124
136
|
const EMPTY_EXTENT_DOMAIN = [0, 1];
|
|
125
137
|
/**
|
|
126
138
|
* #api
|
|
127
|
-
* The domain a continuous
|
|
139
|
+
* The domain a continuous color scale spans: each end `min` or `max` pins,
|
|
128
140
|
* else the extent's, ascending, since a span has no direction and `reverse`
|
|
129
141
|
* is the ramp's. An open end stops at a pinned one rather than crossing it,
|
|
130
142
|
* and an extent holding no value (`[Infinity, -Infinity]`) spans [0, 1].
|
|
@@ -144,7 +156,7 @@ export function rampDomain(min, max, extent) {
|
|
|
144
156
|
}
|
|
145
157
|
/**
|
|
146
158
|
* #api
|
|
147
|
-
* The stops a continuous
|
|
159
|
+
* The stops a continuous color scale samples: `range`'s CSS colors where it
|
|
148
160
|
* lists any, else the named `scheme`, viridis while that is unset, turned
|
|
149
161
|
* round under `reverse`.
|
|
150
162
|
*/
|