@jbrowse/core 5.0.0-beta.11 → 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.
Files changed (439) hide show
  1. package/README.md +450 -132
  2. package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +3 -2
  3. package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +4 -2
  4. package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +6 -2
  5. package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +18 -3
  6. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseAttributes.d.ts +2 -1
  7. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseAttributes.js +4 -2
  8. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCard.d.ts +2 -1
  9. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +4 -2
  10. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCoreDetails.d.ts +2 -1
  11. package/esm/BaseFeatureWidget/BaseFeatureDetail/BaseCoreDetails.js +4 -2
  12. package/esm/BaseFeatureWidget/BaseFeatureDetail/BasicValue.d.ts +5 -4
  13. package/esm/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +6 -4
  14. package/esm/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +2 -1
  15. package/esm/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +4 -2
  16. package/esm/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.d.ts +3 -2
  17. package/esm/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +4 -2
  18. package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +2 -2
  19. package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureWash.d.ts +3 -2
  20. package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureWash.js +4 -2
  21. package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.d.ts +3 -2
  22. package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.js +4 -2
  23. package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldName.d.ts +3 -2
  24. package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +4 -2
  25. package/esm/BaseFeatureWidget/BaseFeatureDetail/Formatter.d.ts +3 -2
  26. package/esm/BaseFeatureWidget/BaseFeatureDetail/Formatter.js +4 -2
  27. package/esm/BaseFeatureWidget/BaseFeatureDetail/ParentFeatureLine.d.ts +3 -2
  28. package/esm/BaseFeatureWidget/BaseFeatureDetail/ParentFeatureLine.js +4 -2
  29. package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +3 -2
  30. package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +4 -2
  31. package/esm/BaseFeatureWidget/BaseFeatureDetail/UriField.d.ts +3 -2
  32. package/esm/BaseFeatureWidget/BaseFeatureDetail/UriField.js +4 -2
  33. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceBody.d.ts +3 -2
  34. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceBody.js +4 -2
  35. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +3 -1
  36. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +15 -24
  37. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +1 -1
  38. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceLegend.d.ts +3 -2
  39. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceLegend.js +4 -2
  40. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +4 -4
  41. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/FeatureSequenceDialog.d.ts +3 -1
  42. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/FeatureSequenceDialog.js +2 -2
  43. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.d.ts +3 -2
  44. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +4 -2
  45. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +1 -2
  46. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +2 -2
  47. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +1 -2
  48. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.js +15 -36
  49. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/TranscriptSelector.d.ts +3 -2
  50. package/esm/BaseFeatureWidget/SequenceFeatureDetails/dialogs/TranscriptSelector.js +4 -2
  51. package/esm/BaseFeatureWidget/SequenceFeatureDetails/featureTypeUtil.d.ts +4 -2
  52. package/esm/BaseFeatureWidget/SequenceFeatureDetails/featureTypeUtil.js +29 -20
  53. package/esm/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +13 -1
  54. package/esm/BaseFeatureWidget/SequenceFeatureDetails/model.js +28 -1
  55. package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js +3 -3
  56. package/esm/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +2 -2
  57. package/esm/BaseFeatureWidget/stateModelFactory.d.ts +9 -0
  58. package/esm/BaseFeatureWidget/stateModelFactory.js +11 -0
  59. package/esm/BaseFeatureWidget/types.d.ts +2 -0
  60. package/esm/PluginManager.d.ts +7 -3
  61. package/esm/PluginManager.js +12 -3
  62. package/esm/ReExports/coreModules.generated.js +538 -518
  63. package/esm/ReExports/coreWorkerModules.generated.js +456 -438
  64. package/esm/ReExports/lazify.js +3 -2
  65. package/esm/ReExports/list.js +22 -6
  66. package/esm/ReExports/names.d.ts +1 -0
  67. package/esm/ReExports/names.generated.d.ts +2 -0
  68. package/esm/ReExports/names.generated.js +566 -0
  69. package/esm/ReExports/names.js +3 -0
  70. package/esm/TextSearch/TextSearchManager.d.ts +3 -3
  71. package/esm/TextSearch/TextSearchManager.js +6 -13
  72. package/esm/assemblyManager/assembly.d.ts +9 -0
  73. package/esm/assemblyManager/assembly.js +13 -0
  74. package/esm/assemblyManager/assemblyConfigSchema.d.ts +6 -1
  75. package/esm/assemblyManager/assemblyConfigSchema.js +23 -22
  76. package/esm/assemblyManager/assemblyManager.d.ts +11 -0
  77. package/esm/assemblyManager/assemblyManager.js +2 -0
  78. package/esm/assemblyManager/expandAssemblyConfigShorthand.d.ts +9 -0
  79. package/esm/assemblyManager/expandAssemblyConfigShorthand.js +23 -0
  80. package/esm/checkPlugins.js +10 -4
  81. package/esm/configuration/configurationSchema.d.ts +51 -100
  82. package/esm/configuration/configurationSchema.js +59 -225
  83. package/esm/configuration/configurationSchemaUnion.d.ts +2 -1
  84. package/esm/configuration/configurationSchemaUnion.js +2 -1
  85. package/esm/configuration/configurationSlot.d.ts +18 -64
  86. package/esm/configuration/configurationSlot.js +32 -98
  87. package/esm/configuration/fillLocations.d.ts +4 -2
  88. package/esm/configuration/fillLocations.js +9 -3
  89. package/esm/configuration/formatAboutConfigSchema.d.ts +2 -2
  90. package/esm/configuration/formatAboutConfigSchema.js +2 -2
  91. package/esm/configuration/formatDetailsConfigSchema.d.ts +2 -2
  92. package/esm/configuration/formatDetailsConfigSchema.js +7 -5
  93. package/esm/configuration/getConf.d.ts +7 -36
  94. package/esm/configuration/getConf.js +20 -41
  95. package/esm/configuration/index.d.ts +4 -3
  96. package/esm/configuration/index.js +3 -2
  97. package/esm/configuration/partitionAdvanced.d.ts +12 -0
  98. package/esm/configuration/partitionAdvanced.js +42 -0
  99. package/esm/configuration/plot.d.ts +6 -0
  100. package/esm/configuration/plot.js +56 -9
  101. package/esm/configuration/readConfObject.d.ts +15 -17
  102. package/esm/configuration/readConfObject.js +19 -50
  103. package/esm/configuration/schemaRegistry.d.ts +0 -2
  104. package/esm/configuration/schemaTypes.js +5 -1
  105. package/esm/configuration/slotFacade.js +2 -2
  106. package/esm/configuration/snapshotPreprocess.d.ts +42 -18
  107. package/esm/configuration/snapshotPreprocess.js +95 -37
  108. package/esm/configuration/tabixShorthand.js +1 -3
  109. package/esm/configuration/types.d.ts +60 -159
  110. package/esm/data_adapters/BaseAdapter/BaseAdapter.d.ts +7 -0
  111. package/esm/data_adapters/BaseAdapter/BaseAdapter.js +7 -0
  112. package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +0 -22
  113. package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +0 -55
  114. package/esm/data_adapters/BaseAdapter/index.d.ts +0 -1
  115. package/esm/data_adapters/BaseAdapter/index.js +0 -1
  116. package/esm/data_adapters/BaseAdapter/rowSources.d.ts +2 -2
  117. package/esm/data_adapters/BaseAdapter/types.d.ts +1 -0
  118. package/esm/data_adapters/CytobandAdapter/configSchema.d.ts +2 -0
  119. package/esm/data_adapters/CytobandAdapter/configSchema.js +5 -0
  120. package/esm/data_adapters/dataAdapterCache.d.ts +25 -13
  121. package/esm/data_adapters/dataAdapterCache.js +68 -24
  122. package/esm/data_adapters/getFeatureAdapter.d.ts +9 -0
  123. package/esm/data_adapters/getFeatureAdapter.js +17 -0
  124. package/esm/pluggableElementTypes/DisplayType.d.ts +7 -0
  125. package/esm/pluggableElementTypes/DisplayType.js +7 -0
  126. package/esm/pluggableElementTypes/RpcMethodType.d.ts +7 -0
  127. package/esm/pluggableElementTypes/RpcMethodType.js +9 -0
  128. package/esm/pluggableElementTypes/addMenuItems.d.ts +2 -1
  129. package/esm/pluggableElementTypes/addMenuItems.js +2 -1
  130. package/esm/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +2 -0
  131. package/esm/pluggableElementTypes/models/BaseConnectionModelFactory.js +2 -0
  132. package/esm/pluggableElementTypes/models/BaseDisplayModel.d.ts +40 -5
  133. package/esm/pluggableElementTypes/models/BaseDisplayModel.js +57 -9
  134. package/esm/pluggableElementTypes/models/BaseTrackModel.d.ts +5 -7
  135. package/esm/pluggableElementTypes/models/BaseTrackModel.js +9 -10
  136. package/esm/pluggableElementTypes/models/BaseViewModel.d.ts +2 -0
  137. package/esm/pluggableElementTypes/models/BaseViewModel.js +2 -0
  138. package/esm/pluggableElementTypes/models/InternetAccountModel.d.ts +3 -0
  139. package/esm/pluggableElementTypes/models/InternetAccountModel.js +3 -0
  140. package/esm/pluggableElementTypes/models/baseConnectionConfig.d.ts +3 -0
  141. package/esm/pluggableElementTypes/models/baseConnectionConfig.js +3 -0
  142. package/esm/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +3 -1
  143. package/esm/pluggableElementTypes/models/baseInternetAccountConfig.js +3 -1
  144. package/esm/pluggableElementTypes/models/baseTrackConfig.js +12 -1
  145. package/esm/pluggableElementTypes/models/components/SaveTrackData.js +2 -2
  146. package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.d.ts +1 -1
  147. package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.js +1 -1
  148. package/esm/pluginDefinitions.d.ts +7 -0
  149. package/esm/pluginDefinitions.js +20 -0
  150. package/esm/rpc/RpcRegistry.d.ts +2 -11
  151. package/esm/rpc/byteBudget.d.ts +15 -0
  152. package/esm/rpc/byteBudget.js +23 -0
  153. package/esm/rpc/configSchema.d.ts +2 -0
  154. package/esm/rpc/configSchema.js +3 -1
  155. package/esm/rpc/coreRpcMethods.d.ts +1 -2
  156. package/esm/rpc/coreRpcMethods.js +1 -2
  157. package/esm/rpc/explainTransferError.js +3 -3
  158. package/esm/rpc/methods/CoreGetEncodedLayers.d.ts +2 -2
  159. package/esm/rpc/methods/CoreGetEncodedLayers.js +7 -5
  160. package/esm/rpc/methods/CoreLoadTrackCode.d.ts +17 -0
  161. package/esm/rpc/methods/CoreLoadTrackCode.js +24 -0
  162. package/esm/rpc/methods/layerFeatures.d.ts +9 -6
  163. package/esm/rpc/methods/layerFeatures.js +21 -5
  164. package/esm/ui/ActionLink.d.ts +3 -2
  165. package/esm/ui/ActionLink.js +4 -2
  166. package/esm/ui/AddCustomPluginDialog.d.ts +3 -2
  167. package/esm/ui/AddCustomPluginDialog.js +6 -4
  168. package/esm/ui/AppLogo.js +43 -3
  169. package/esm/ui/BaseTooltip.d.ts +3 -2
  170. package/esm/ui/BaseTooltip.js +4 -2
  171. package/esm/ui/CascadingMenu.js +14 -12
  172. package/esm/ui/CascadingMenuButton.d.ts +2 -2
  173. package/esm/ui/CascadingMenuButton.js +5 -4
  174. package/esm/ui/CascadingMenuHelpDialog.d.ts +3 -2
  175. package/esm/ui/CascadingMenuHelpDialog.js +4 -2
  176. package/esm/ui/CascadingMenuHelpIconButton.d.ts +4 -3
  177. package/esm/ui/CascadingMenuHelpIconButton.js +9 -5
  178. package/esm/ui/ColorPicker.d.ts +5 -4
  179. package/esm/ui/ColorPicker.js +6 -4
  180. package/esm/ui/ContextMenu.d.ts +1 -1
  181. package/esm/ui/ContextMenu.js +1 -1
  182. package/esm/ui/CopyToClipboardButton.d.ts +3 -2
  183. package/esm/ui/CopyToClipboardButton.js +4 -2
  184. package/esm/ui/Crosshairs.js +13 -10
  185. package/esm/ui/DOMPurifySanitizedHTML.d.ts +3 -2
  186. package/esm/ui/DOMPurifySanitizedHTML.js +4 -2
  187. package/esm/ui/DataGridFlexContainer.d.ts +3 -2
  188. package/esm/ui/DataGridFlexContainer.js +4 -2
  189. package/esm/ui/Dialog.d.ts +1 -1
  190. package/esm/ui/Dialog.js +5 -4
  191. package/esm/ui/DropDownMenu.js +2 -2
  192. package/esm/ui/EditableTypography.d.ts +1 -1
  193. package/esm/ui/EditableTypography.js +3 -2
  194. package/esm/ui/ErrorActions.d.ts +3 -2
  195. package/esm/ui/ErrorActions.js +4 -2
  196. package/esm/ui/ErrorBanner.d.ts +2 -2
  197. package/esm/ui/ErrorBanner.js +3 -2
  198. package/esm/ui/ErrorBar.d.ts +3 -2
  199. package/esm/ui/ErrorBar.js +4 -2
  200. package/esm/ui/ErrorMessage.d.ts +3 -2
  201. package/esm/ui/ErrorMessage.js +4 -2
  202. package/esm/ui/ErrorMessageStackTraceContents.d.ts +3 -2
  203. package/esm/ui/ErrorMessageStackTraceContents.js +4 -2
  204. package/esm/ui/ErrorMessageStackTraceDialog.d.ts +3 -2
  205. package/esm/ui/ErrorMessageStackTraceDialog.js +4 -2
  206. package/esm/ui/ErrorOverlay.d.ts +3 -2
  207. package/esm/ui/ErrorOverlay.js +4 -2
  208. package/esm/ui/ExportSvgDialog.d.ts +3 -2
  209. package/esm/ui/ExportSvgDialog.js +4 -2
  210. package/esm/ui/ExternalLink.d.ts +2 -1
  211. package/esm/ui/ExternalLink.js +4 -2
  212. package/esm/ui/FactoryResetDialog.d.ts +3 -2
  213. package/esm/ui/FactoryResetDialog.js +4 -2
  214. package/esm/ui/FatalErrorDialog.d.ts +3 -2
  215. package/esm/ui/FatalErrorDialog.js +6 -4
  216. package/esm/ui/FileDropZone.d.ts +3 -2
  217. package/esm/ui/FileDropZone.js +4 -2
  218. package/esm/ui/FileSelector/LocalFileChooser.js +4 -4
  219. package/esm/ui/FileSelector/LocationInput.d.ts +3 -2
  220. package/esm/ui/FileSelector/LocationInput.js +4 -2
  221. package/esm/ui/FileSelector/SourceTypeSelector.d.ts +3 -2
  222. package/esm/ui/FileSelector/SourceTypeSelector.js +8 -6
  223. package/esm/ui/GpuFallbackButton.d.ts +3 -2
  224. package/esm/ui/GpuFallbackButton.js +4 -2
  225. package/esm/ui/HoverMenu.d.ts +2 -2
  226. package/esm/ui/HoverMenu.js +7 -3
  227. package/esm/ui/HoverTooltip.d.ts +3 -2
  228. package/esm/ui/HoverTooltip.js +4 -2
  229. package/esm/ui/Icons.d.ts +5 -5
  230. package/esm/ui/Icons.js +11 -10
  231. package/esm/ui/InlineMenuControls.d.ts +2 -2
  232. package/esm/ui/InlineMenuControls.js +4 -3
  233. package/esm/ui/JexlFilterRowEditors.d.ts +4 -4
  234. package/esm/ui/JexlFilterRowEditors.js +9 -8
  235. package/esm/ui/LabeledCheckbox.d.ts +3 -2
  236. package/esm/ui/LabeledCheckbox.js +4 -2
  237. package/esm/ui/LazyBaseTooltip.d.ts +12 -3
  238. package/esm/ui/LazyBaseTooltip.js +4 -2
  239. package/esm/ui/LegendSwatchGlyph.js +1 -0
  240. package/esm/ui/LoadingDots.d.ts +2 -1
  241. package/esm/ui/LoadingDots.js +4 -2
  242. package/esm/ui/LoadingEllipses.d.ts +5 -2
  243. package/esm/ui/LoadingEllipses.js +5 -3
  244. package/esm/ui/LoadingOverlay.d.ts +3 -2
  245. package/esm/ui/LoadingOverlay.js +4 -2
  246. package/esm/ui/LoadingProgress.d.ts +3 -2
  247. package/esm/ui/LoadingProgress.js +4 -2
  248. package/esm/ui/Logo.d.ts +2 -2
  249. package/esm/ui/Logo.js +9 -8
  250. package/esm/ui/MenuItemChevron.d.ts +2 -2
  251. package/esm/ui/MenuItemChevron.js +3 -2
  252. package/esm/ui/MenuItemEndDecoration.d.ts +2 -2
  253. package/esm/ui/MenuItemEndDecoration.js +3 -2
  254. package/esm/ui/MenuItemTrailing.d.ts +2 -2
  255. package/esm/ui/MenuItemTrailing.js +7 -6
  256. package/esm/ui/MenuTypes.d.ts +21 -1
  257. package/esm/ui/MenuTypes.js +20 -0
  258. package/esm/ui/MonospaceTextField.d.ts +3 -2
  259. package/esm/ui/MonospaceTextField.js +4 -2
  260. package/esm/ui/NumberTextField.d.ts +2 -2
  261. package/esm/ui/NumberTextField.js +4 -2
  262. package/esm/ui/PaletteContext.d.ts +11 -9
  263. package/esm/ui/PaletteContext.js +33 -18
  264. package/esm/ui/PluginStoreCard.d.ts +3 -2
  265. package/esm/ui/PluginStoreCard.js +4 -2
  266. package/esm/ui/PopoverPicker.d.ts +3 -2
  267. package/esm/ui/PopoverPicker.js +4 -2
  268. package/esm/ui/PrerenderedCanvas.d.ts +2 -2
  269. package/esm/ui/PrerenderedCanvas.js +3 -2
  270. package/esm/ui/RedErrorMessageBox.d.ts +3 -2
  271. package/esm/ui/RedErrorMessageBox.js +4 -2
  272. package/esm/ui/RefNameAutocomplete/EndAdornment.d.ts +3 -2
  273. package/esm/ui/RefNameAutocomplete/EndAdornment.js +4 -2
  274. package/esm/ui/RefNameAutocomplete/HelpDialog.d.ts +3 -2
  275. package/esm/ui/RefNameAutocomplete/HelpDialog.js +4 -2
  276. package/esm/ui/ReplaceCurrentViewButton.d.ts +3 -2
  277. package/esm/ui/ReplaceCurrentViewButton.js +4 -2
  278. package/esm/ui/ResizeHandle.d.ts +2 -2
  279. package/esm/ui/ResizeHandle.js +3 -2
  280. package/esm/ui/SanitizedHTML.d.ts +3 -2
  281. package/esm/ui/SanitizedHTML.js +6 -4
  282. package/esm/ui/ScrollChrome.d.ts +3 -2
  283. package/esm/ui/ScrollChrome.js +4 -2
  284. package/esm/ui/ScrollEdgeShadow.d.ts +2 -2
  285. package/esm/ui/ScrollEdgeShadow.js +2 -2
  286. package/esm/ui/SessionJsonPanel.d.ts +3 -2
  287. package/esm/ui/SessionJsonPanel.js +4 -2
  288. package/esm/ui/ShareLinkField.d.ts +3 -2
  289. package/esm/ui/ShareLinkField.js +4 -2
  290. package/esm/ui/SingleSlider.d.ts +2 -2
  291. package/esm/ui/SingleSlider.js +4 -2
  292. package/esm/ui/SliderTooltip.d.ts +2 -1
  293. package/esm/ui/SliderTooltip.js +4 -2
  294. package/esm/ui/SnackbarContents.d.ts +3 -2
  295. package/esm/ui/SnackbarContents.js +4 -2
  296. package/esm/ui/SnackbarModel.d.ts +2 -0
  297. package/esm/ui/SnackbarModel.js +2 -0
  298. package/esm/ui/StackTraceButton.d.ts +3 -2
  299. package/esm/ui/StackTraceButton.js +4 -2
  300. package/esm/ui/StatusProgressBar.d.ts +3 -2
  301. package/esm/ui/StatusProgressBar.js +4 -2
  302. package/esm/ui/SubmitForm.d.ts +2 -1
  303. package/esm/ui/SubmitForm.js +4 -2
  304. package/esm/ui/SvgColorLegend.d.ts +3 -4
  305. package/esm/ui/SvgColorLegend.js +27 -18
  306. package/esm/ui/TagTextField.d.ts +2 -2
  307. package/esm/ui/TagTextField.js +4 -2
  308. package/esm/ui/ViewLoadingScreen.d.ts +3 -2
  309. package/esm/ui/ViewLoadingScreen.js +4 -2
  310. package/esm/ui/buildExtraTrackMenuItems.d.ts +2 -2
  311. package/esm/ui/colorScale.d.ts +5 -1
  312. package/esm/ui/colorScale.js +12 -10
  313. package/esm/ui/colors.d.ts +42 -31
  314. package/esm/ui/colors.js +85 -48
  315. package/esm/ui/filterMenuItems.d.ts +10 -31
  316. package/esm/ui/filterMenuItems.js +13 -14
  317. package/esm/ui/index.d.ts +1 -1
  318. package/esm/ui/index.js +1 -1
  319. package/esm/ui/launchTargetsMenuItem.js +9 -13
  320. package/esm/ui/legendMenuItem.d.ts +4 -4
  321. package/esm/ui/legendMenuItem.js +4 -4
  322. package/esm/ui/menuItemAdornment.d.ts +1 -1
  323. package/esm/ui/menuItemAdornment.js +1 -1
  324. package/esm/ui/menuItems.d.ts +1 -1
  325. package/esm/ui/menuItems.js +1 -1
  326. package/esm/ui/menuLabels.d.ts +2 -2
  327. package/esm/ui/menuLabels.js +2 -2
  328. package/esm/ui/multiTrackMenuItems.d.ts +2 -2
  329. package/esm/ui/palette.d.ts +2 -2
  330. package/esm/ui/palette.js +10 -10
  331. package/esm/ui/radioSubMenu.d.ts +5 -3
  332. package/esm/ui/radioSubMenu.js +2 -2
  333. package/esm/ui/rampKey.d.ts +15 -0
  334. package/esm/ui/rampKey.js +17 -0
  335. package/esm/ui/showSubMenu.d.ts +0 -5
  336. package/esm/ui/showSubMenu.js +6 -15
  337. package/esm/ui/theme.d.ts +2 -2
  338. package/esm/ui/theme.js +1 -1
  339. package/esm/ui/useAssemblySelection.d.ts +2 -0
  340. package/esm/ui/useMouseTracking.d.ts +8 -20
  341. package/esm/ui/useMouseTracking.js +23 -62
  342. package/esm/ui/usePlacedMenuFocus.d.ts +19 -0
  343. package/esm/ui/usePlacedMenuFocus.js +28 -0
  344. package/esm/util/Base1DViewModel.d.ts +5 -3
  345. package/esm/util/Base1DViewModel.js +5 -3
  346. package/esm/util/SvgCanvas.js +1 -1
  347. package/esm/util/aggregateFieldName.d.ts +1 -10
  348. package/esm/util/aggregateFieldName.js +1 -8
  349. package/esm/util/alignedBytes.d.ts +19 -0
  350. package/esm/util/alignedBytes.js +37 -0
  351. package/esm/util/analytics.d.ts +6 -9
  352. package/esm/util/analytics.js +148 -15
  353. package/esm/util/bezierConnector.d.ts +20 -0
  354. package/esm/util/bezierConnector.js +34 -96
  355. package/esm/util/cacheBudgets.d.ts +3 -0
  356. package/esm/util/cacheBudgets.js +3 -0
  357. package/esm/util/categoricalField.d.ts +24 -4
  358. package/esm/util/categoricalField.js +38 -5
  359. package/esm/util/cellMatches.js +14 -14
  360. package/esm/util/cellsStep.d.ts +3 -5
  361. package/esm/util/cellsStep.js +31 -29
  362. package/esm/util/color/index.d.ts +1 -1
  363. package/esm/util/color/index.js +2 -2
  364. package/esm/util/color-bits/bit.js +1 -1
  365. package/esm/util/color-bits/parse.js +28 -17
  366. package/esm/util/colorBits.d.ts +15 -4
  367. package/esm/util/colorBits.js +38 -15
  368. package/esm/util/colorRamp.d.ts +3 -3
  369. package/esm/util/colorRamp.js +20 -2
  370. package/esm/util/colorScale.d.ts +123 -22
  371. package/esm/util/colorScale.js +157 -28
  372. package/esm/util/colorSchemes.d.ts +7 -3
  373. package/esm/util/colorSchemes.js +8 -2
  374. package/esm/util/createSvgRasterCanvas.d.ts +14 -1
  375. package/esm/util/createSvgRasterCanvas.js +36 -12
  376. package/esm/util/diagonalizeRegions.js +18 -9
  377. package/esm/util/featureTransforms.d.ts +2 -2
  378. package/esm/util/featureTransforms.js +85 -135
  379. package/esm/util/fileHandleStore.js +5 -0
  380. package/esm/util/groupKeys.d.ts +5 -4
  381. package/esm/util/groupKeys.js +15 -9
  382. package/esm/util/index.js +1 -1
  383. package/esm/util/installFetch.d.ts +2 -2
  384. package/esm/util/installPrerequisiteFetch.d.ts +8 -3
  385. package/esm/util/installPrerequisiteFetch.js +9 -7
  386. package/esm/util/io/RemoteFileWithRangeCache.d.ts +1 -1
  387. package/esm/util/io/RemoteFileWithRangeCache.js +1 -1
  388. package/esm/util/isoformRank.d.ts +39 -0
  389. package/esm/util/isoformRank.js +118 -0
  390. package/esm/util/jexl.js +1 -1
  391. package/esm/util/layouts/GranularRectLayout.d.ts +19 -3
  392. package/esm/util/layouts/GranularRectLayout.js +57 -34
  393. package/esm/util/leadingEdgeAutorun.d.ts +9 -1
  394. package/esm/util/leadingEdgeAutorun.js +5 -2
  395. package/esm/util/markEncoding.d.ts +10 -8
  396. package/esm/util/markEncoding.js +50 -12
  397. package/esm/util/markEncodingTypes.d.ts +77 -21
  398. package/esm/util/originCut.d.ts +14 -0
  399. package/esm/util/originCut.js +19 -0
  400. package/esm/util/paintLayer.d.ts +1 -1
  401. package/esm/util/paintLayer.js +4 -3
  402. package/esm/util/pathSeries.d.ts +18 -0
  403. package/esm/util/pathSeries.js +143 -0
  404. package/esm/util/pressOwner.d.ts +20 -0
  405. package/esm/util/pressOwner.js +26 -0
  406. package/esm/util/quantileExtent.d.ts +23 -1
  407. package/esm/util/quantileExtent.js +25 -2
  408. package/esm/util/rowStackGeometry.d.ts +1 -1
  409. package/esm/util/rowStackGeometry.js +1 -1
  410. package/esm/util/sessionActivity.d.ts +36 -0
  411. package/esm/util/sessionActivity.js +88 -0
  412. package/esm/util/stepOutputs.d.ts +165 -0
  413. package/esm/util/stepOutputs.js +201 -0
  414. package/esm/util/stepTables.d.ts +7 -3
  415. package/esm/util/stepTables.js +86 -3
  416. package/esm/util/systemColorScheme.d.ts +4 -0
  417. package/esm/util/systemColorScheme.js +21 -0
  418. package/esm/util/tabix.d.ts +1 -1
  419. package/esm/util/tabix.js +1 -1
  420. package/esm/util/temporaryAssembly.d.ts +2 -2
  421. package/esm/util/temporaryAssembly.js +2 -3
  422. package/esm/util/thresholdScale.d.ts +1 -1
  423. package/esm/util/thresholdScale.js +1 -1
  424. package/esm/util/trackConfigDelta.d.ts +1 -1
  425. package/esm/util/tracks.d.ts +25 -15
  426. package/esm/util/tracks.js +68 -44
  427. package/esm/util/types/index.d.ts +15 -7
  428. package/esm/util/types/index.js +21 -2
  429. package/esm/util/usePanZoom.js +4 -10
  430. package/esm/util/useRowVirtualScroll.d.ts +1 -0
  431. package/esm/util/windowStep.d.ts +6 -0
  432. package/esm/util/windowStep.js +153 -0
  433. package/package.json +27 -16
  434. package/esm/data_adapters/BaseAdapter/featureDensity.d.ts +0 -40
  435. package/esm/data_adapters/BaseAdapter/featureDensity.js +0 -31
  436. package/esm/rpc/methods/CoreGetFeatureDensity.d.ts +0 -11
  437. package/esm/rpc/methods/CoreGetFeatureDensity.js +0 -22
  438. package/esm/rpc/methods/CoreLoadAdapterCode.d.ts +0 -13
  439. package/esm/rpc/methods/CoreLoadAdapterCode.js +0 -16
@@ -1,38 +1,16 @@
1
1
  // The `cells` step: each row's runs against the reference it was fanned out
2
2
  // of, and the texts its walk reads, which the fused identity kernel in
3
3
  // cellMatches.ts walks too. Imported by relative path only.
4
+ import { DASH, SPACE, firstDrawn, isGapByte, isUnknownBase, lastDrawn, sameBase, } from './alignedBytes.js';
4
5
  import { DerivedTable, numberReaderOf, readerOf, valueAt, } from './featureTable.js';
5
6
  import { FannedTable, boundsThrough } from './stepTables.js';
6
7
  export const DEFAULT_CELLS_FIELD = 'seq';
7
- export const DASH = 45;
8
- export const SPACE = 32;
9
- const LOWER_BIT = 0x20;
10
8
  const CELL_STATES = ['match', 'mismatch', 'gap', 'insertion'];
11
9
  export const MATCH = 0;
12
10
  export const MISMATCH = 1;
13
11
  const GAP = 2;
14
12
  const INSERTION = 3;
15
13
  export const NO_STATE = 255;
16
- export function isGapByte(b) {
17
- return b === DASH || b === SPACE;
18
- }
19
- // The columns carrying the row's own sequence: a gap run reaching either end
20
- // of the row measures where the block was cut, not the alignment, so it is no
21
- // cell either.
22
- export function firstDrawn(bytes, at, len) {
23
- let first = 0;
24
- while (first < len && isGapByte(bytes[at + first])) {
25
- first++;
26
- }
27
- return first;
28
- }
29
- export function lastDrawn(bytes, at, len, first) {
30
- let last = len - 1;
31
- while (last > first && isGapByte(bytes[at + last])) {
32
- last--;
33
- }
34
- return last;
35
- }
36
14
  // A reference base's cell: no state outside the drawn columns, else the row's
37
15
  // gap, or its base matched or not regardless of case.
38
16
  export function cellState(refByte, rowByte, drawn) {
@@ -40,10 +18,25 @@ export function cellState(refByte, rowByte, drawn) {
40
18
  ? NO_STATE
41
19
  : isGapByte(rowByte)
42
20
  ? GAP
43
- : (refByte | LOWER_BIT) === (rowByte | LOWER_BIT)
21
+ : sameBase(refByte, rowByte)
44
22
  ? MATCH
45
23
  : MISMATCH;
46
24
  }
25
+ // Whether a cell counts toward identity: matched or not against a known
26
+ // reference base.
27
+ export function comparesBase(state, refByte) {
28
+ return state <= MISMATCH && !isUnknownBase(refByte);
29
+ }
30
+ // What the cells of one run share besides their state: whether they are
31
+ // compared, so a run's `match` is one value.
32
+ export function runKey(state, refByte) {
33
+ return state <= MISMATCH && isUnknownBase(refByte) ? 1 : 0;
34
+ }
35
+ // A mismatch always starts a run of its own, so each differing base is one
36
+ // instance and a text over `base` letters every one.
37
+ export function opensRun(state, key, runState, openKey) {
38
+ return state !== runState || key !== openKey || state === MISMATCH;
39
+ }
47
40
  // The row a cell step reads against: past any table that only reordered or
48
41
  // annotated the rows, the one they were fanned out of.
49
42
  function containerOf(table) {
@@ -218,7 +211,11 @@ class CellTable extends DerivedTable {
218
211
  const values = new Float32Array(this.length);
219
212
  for (let i = 0; i < this.length; i++) {
220
213
  const s = this.state[i];
221
- values[i] = s === MATCH ? 1 : s === MISMATCH ? 0 : Number.NaN;
214
+ values[i] = comparesBase(s, this.refByte(i))
215
+ ? s === MATCH
216
+ ? 1
217
+ : 0
218
+ : Number.NaN;
222
219
  }
223
220
  return { kind: 'number', values, at: undefined, nanIsAbsent: true };
224
221
  });
@@ -254,6 +251,11 @@ class CellTable extends DerivedTable {
254
251
  }
255
252
  }
256
253
  }
254
+ refByte(i) {
255
+ const { reference: ref } = this.texts;
256
+ const f = this.texts.refOf(this.parentOf(i));
257
+ return ref.bytes[ref.offset[f] + this.textAt[i]];
258
+ }
257
259
  mismatched(i) {
258
260
  const { bytes, offset } = this.texts.row;
259
261
  const k = this.texts.rowOf(this.parentOf(i));
@@ -342,7 +344,7 @@ class RunLanes {
342
344
  const last = lastDrawn(rowBytes, rowAt, rowLen, first);
343
345
  let runStart = -1;
344
346
  let runState = NO_STATE;
345
- let runBase = -1;
347
+ let openKey = -1;
346
348
  let runCol = 0;
347
349
  let insertAt = -1;
348
350
  for (let col = 0; col < refLen; col++) {
@@ -364,8 +366,8 @@ class RunLanes {
364
366
  insertAt = -1;
365
367
  }
366
368
  const st = cellState(refByte, rowByte, col >= first && col <= last && col < rowLen);
367
- const base = st === MISMATCH ? rowByte : -1;
368
- if (st !== runState || base !== runBase) {
369
+ const key = runKey(st, refByte);
370
+ if (opensRun(st, key, runState, openKey)) {
369
371
  if (runStart >= 0) {
370
372
  start[n] = runStart;
371
373
  end[n] = pos;
@@ -376,7 +378,7 @@ class RunLanes {
376
378
  }
377
379
  runStart = st === NO_STATE ? -1 : pos;
378
380
  runState = st;
379
- runBase = base;
381
+ openKey = key;
380
382
  runCol = col;
381
383
  }
382
384
  pos++;
@@ -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
- * colour by.
81
+ * color by.
82
82
  *
83
83
  * @param str - The string to generate a color from
84
84
  * @returns A CSS hex color string
@@ -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 colour declaration paints where it reads nothing it can colour, so 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
- * colour by.
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-colour sentinel.
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 colour for this to be one.
13
- * Unanchored it matched a colour sitting anywhere inside anything, so
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 colours by
16
- * mistake read as a plausible colour instead of reaching the invalid-colour
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 colour), and it was unreachable
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 colour.
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+)`;
@@ -239,16 +239,27 @@ export function parseColor(color) {
239
239
  }
240
240
  throw new Error(`Color.parse(): invalid CSS color: "${color}"`);
241
241
  }
242
+ /** A channel's leading number, throwing where it has none, as `rgb(a,b,1)`. */
243
+ function parseNumber(value) {
244
+ const n = Number.parseFloat(value);
245
+ if (Number.isNaN(n)) {
246
+ throw new TypeError(`Color.parse(): invalid CSS color channel: "${value}"`);
247
+ }
248
+ return n;
249
+ }
242
250
  /**
243
- * Accepts: "50%", "128"
251
+ * Accepts: "50%", "128", "none"
244
252
  * https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb#values
245
253
  * @returns a value in the 0 to 255 range
246
254
  */
247
255
  function parseColorChannel(channel) {
256
+ if (channel === 'none') {
257
+ return 0;
258
+ }
248
259
  if (channel.charCodeAt(channel.length - 1) === PERCENT) {
249
- return Math.round((Number.parseFloat(channel) / 100) * 255);
260
+ return Math.round((parseNumber(channel) / 100) * 255);
250
261
  }
251
- return Math.round(Number.parseFloat(channel));
262
+ return Math.round(parseNumber(channel));
252
263
  }
253
264
  /**
254
265
  * Accepts: "50%", ".5", "0.5"
@@ -268,9 +279,9 @@ function parseAlphaValue(channel) {
268
279
  return 0;
269
280
  }
270
281
  if (channel.charCodeAt(channel.length - 1) === PERCENT) {
271
- return Number.parseFloat(channel) / 100;
282
+ return parseNumber(channel) / 100;
272
283
  }
273
- return Number.parseFloat(channel);
284
+ return parseNumber(channel);
274
285
  }
275
286
  /**
276
287
  * Accepts: "360", "360deg", "400grad", "6.28rad", "1turn", "none"
@@ -302,7 +313,7 @@ function parseAngle(angle) {
302
313
  factor = 360;
303
314
  }
304
315
  }
305
- const turns = Number.parseFloat(angle) / factor;
316
+ const turns = parseNumber(angle) / factor;
306
317
  // Hue is periodic, and every caller of this is a hue. `hueToRGB` corrects its
307
318
  // argument by at most one turn, so it reads `hsl(-720deg)` as a hue two turns
308
319
  // below the wheel rather than as red — folding here is what makes the three
@@ -317,7 +328,7 @@ function parsePercentage(value) {
317
328
  if (value.charCodeAt(0) === N) {
318
329
  return 0;
319
330
  }
320
- return Number.parseFloat(value) / 100;
331
+ return parseNumber(value) / 100;
321
332
  }
322
333
  /**
323
334
  * Accepts: "1.0", "100%", "none"
@@ -328,9 +339,9 @@ function parsePercentageOrValue(value) {
328
339
  return 0;
329
340
  }
330
341
  if (value.charCodeAt(value.length - 1) === PERCENT) {
331
- return Number.parseFloat(value) / 100;
342
+ return parseNumber(value) / 100;
332
343
  }
333
- return Number.parseFloat(value);
344
+ return parseNumber(value);
334
345
  }
335
346
  /**
336
347
  * Accepts: "100", "100%", "none"
@@ -341,9 +352,9 @@ function parsePercentageFor(value, range) {
341
352
  return 0;
342
353
  }
343
354
  if (value.charCodeAt(value.length - 1) === PERCENT) {
344
- return (Number.parseFloat(value) / 100) * range;
355
+ return (parseNumber(value) / 100) * range;
345
356
  }
346
- return Number.parseFloat(value);
357
+ return parseNumber(value);
347
358
  }
348
359
  // HSL functions
349
360
  function hueToRGB(p, q, t) {
@@ -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 either column name, or
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];
@@ -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
- // UCSC's convention is that a color of "0" means "no color specified", and plain
14
- // BED12 files fill the column with that placeholder (often spelled as the
15
- // all-zero triple) rather than omitting it — every itemRgb in our own
16
- // volvox-bed12 fixture is "0,0,0". Honoring those literally would paint an
17
- // ordinary BED12 track solid black, so read them as absent. A file that really
18
- // wants black can say so with an explicit `color` slot.
19
- const BED_TRIPLE_UNSET = /^0(,0,0)?$/;
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 triple !== undefined && !BED_TRIPLE_UNSET.test(triple)
32
- ? triple
33
- : undefined;
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 either column name, or
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 [
@@ -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 colour scale spans: each end `min` or `max` pins,
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 colour scale samples: `range`'s CSS colours where it
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 colour scale's ramp as a config declares it.
56
+ * A continuous color scale's ramp as a config declares it.
57
57
  */
58
58
  export interface RampDeclaration {
59
59
  range?: readonly string[];
@@ -90,6 +90,22 @@ const PURPLEORANGE_STOPS = [
90
90
  [179, 88, 6, 255],
91
91
  [127, 59, 8, 255],
92
92
  ];
93
+ const REDGREYBLUE_STOPS = [
94
+ [199, 67, 56, 255],
95
+ [140, 140, 140, 255],
96
+ [47, 102, 176, 255],
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
+ ];
93
109
  const SCHEME_STOPS = {
94
110
  viridis: VIRIDIS_STOPS,
95
111
  juicebox: JUICEBOX_STOPS,
@@ -101,6 +117,8 @@ const SCHEME_STOPS = {
101
117
  cividis: stopsFromHex(CIVIDIS_HEX_SPEC),
102
118
  redblue: REDBLUE_STOPS,
103
119
  purpleorange: PURPLEORANGE_STOPS,
120
+ redgreyblue: REDGREYBLUE_STOPS,
121
+ blueyellowred: BLUEYELLOWRED_STOPS,
104
122
  };
105
123
  function luminanceOverWhite([r, g, b, a]) {
106
124
  const over = (c) => 255 + (c - 255) * (a / 255);
@@ -118,7 +136,7 @@ export function darkAtLowEnd(scheme) {
118
136
  const EMPTY_EXTENT_DOMAIN = [0, 1];
119
137
  /**
120
138
  * #api
121
- * The domain a continuous colour scale spans: each end `min` or `max` pins,
139
+ * The domain a continuous color scale spans: each end `min` or `max` pins,
122
140
  * else the extent's, ascending, since a span has no direction and `reverse`
123
141
  * is the ramp's. An open end stops at a pinned one rather than crossing it,
124
142
  * and an extent holding no value (`[Infinity, -Infinity]`) spans [0, 1].
@@ -138,7 +156,7 @@ export function rampDomain(min, max, extent) {
138
156
  }
139
157
  /**
140
158
  * #api
141
- * The stops a continuous colour scale samples: `range`'s CSS colours where it
159
+ * The stops a continuous color scale samples: `range`'s CSS colors where it
142
160
  * lists any, else the named `scheme`, viridis while that is unset, turned
143
161
  * round under `reverse`.
144
162
  */