@jbrowse/core 5.0.0-beta.7 → 5.0.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (379) hide show
  1. package/README.md +427 -130
  2. package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +3 -2
  3. package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +5 -3
  4. package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +3 -5
  5. package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +8 -9
  6. package/esm/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +8 -13
  7. package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +2 -1
  8. package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +3 -3
  9. package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.d.ts +8 -0
  10. package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.js +24 -0
  11. package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +3 -2
  12. package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +5 -3
  13. package/esm/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +1 -0
  14. package/esm/BaseFeatureWidget/BaseFeatureDetail/index.js +1 -4
  15. package/esm/BaseFeatureWidget/BaseFeatureDetail/jexlFilterActions.d.ts +16 -0
  16. package/esm/BaseFeatureWidget/BaseFeatureDetail/jexlFilterActions.js +53 -0
  17. package/esm/BaseFeatureWidget/BaseFeatureDetail/util.d.ts +0 -8
  18. package/esm/BaseFeatureWidget/BaseFeatureDetail/util.js +0 -16
  19. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.js +7 -34
  20. package/esm/BaseFeatureWidget/configSchema.d.ts +1 -1
  21. package/esm/BaseFeatureWidget/formatDetails.d.ts +13 -29
  22. package/esm/BaseFeatureWidget/formatDetails.js +46 -79
  23. package/esm/BaseFeatureWidget/index.d.ts +1 -0
  24. package/esm/BaseFeatureWidget/stateModelFactory.d.ts +35 -28
  25. package/esm/BaseFeatureWidget/stateModelFactory.js +94 -102
  26. package/esm/BaseFeatureWidget/types.d.ts +3 -0
  27. package/esm/BaseFeatureWidget/util.d.ts +0 -3
  28. package/esm/BaseFeatureWidget/util.js +0 -17
  29. package/esm/PluginLoader.d.ts +14 -9
  30. package/esm/PluginLoader.js +34 -26
  31. package/esm/PluginManager.d.ts +4 -4
  32. package/esm/PluginManager.js +1 -1
  33. package/esm/ReExports/coreModules.generated.d.ts +2 -0
  34. package/esm/ReExports/coreModules.generated.js +492 -0
  35. package/esm/ReExports/coreWorkerModules.generated.d.ts +2 -0
  36. package/esm/ReExports/coreWorkerModules.generated.js +453 -0
  37. package/esm/ReExports/frameworkModules.d.ts +2 -0
  38. package/esm/ReExports/frameworkModules.js +67 -0
  39. package/esm/ReExports/frameworkShared.d.ts +12 -0
  40. package/esm/ReExports/frameworkShared.js +16 -0
  41. package/esm/ReExports/frameworkWorkerModules.generated.d.ts +2 -0
  42. package/esm/ReExports/frameworkWorkerModules.generated.js +130 -0
  43. package/esm/ReExports/list.js +493 -79
  44. package/esm/ReExports/modules.d.ts +1 -1
  45. package/esm/ReExports/modules.js +10 -87
  46. package/esm/ReExports/registry.d.ts +1 -0
  47. package/esm/ReExports/registry.js +23 -5
  48. package/esm/ReExports/uiStub.d.ts +2 -1
  49. package/esm/ReExports/uiStub.js +24 -2
  50. package/esm/ReExports/workerModules.js +8 -12
  51. package/esm/TextSearch/TextSearchManager.d.ts +3 -12
  52. package/esm/TextSearch/TextSearchManager.js +22 -10
  53. package/esm/assemblyManager/assembly.d.ts +10 -14
  54. package/esm/assemblyManager/assembly.js +10 -14
  55. package/esm/assemblyManager/assemblyConfigSchema.d.ts +23 -81
  56. package/esm/assemblyManager/assemblyManager.d.ts +10 -16
  57. package/esm/assemblyManager/assemblyManager.js +7 -10
  58. package/esm/assemblyManager/loadRefNameMap.js +3 -3
  59. package/esm/configuration/configurationSchema.d.ts +75 -31
  60. package/esm/configuration/configurationSchema.js +74 -40
  61. package/esm/configuration/configurationSchemaUnion.d.ts +39 -0
  62. package/esm/configuration/configurationSchemaUnion.js +59 -0
  63. package/esm/configuration/configurationSlot.d.ts +37 -12
  64. package/esm/configuration/configurationSlot.js +83 -22
  65. package/esm/configuration/formatAboutConfigSchema.d.ts +7 -21
  66. package/esm/configuration/formatDetailsConfigSchema.d.ts +11 -37
  67. package/esm/configuration/formatDetailsConfigSchema.js +10 -13
  68. package/esm/configuration/getConf.d.ts +17 -9
  69. package/esm/configuration/getConf.js +52 -7
  70. package/esm/configuration/index.d.ts +11 -4
  71. package/esm/configuration/index.js +7 -4
  72. package/esm/configuration/mergeFormatCallbacks.d.ts +6 -7
  73. package/esm/configuration/mergeFormatCallbacks.js +13 -10
  74. package/esm/configuration/readConfObject.d.ts +2 -22
  75. package/esm/configuration/readConfObject.js +15 -49
  76. package/esm/configuration/requirements.d.ts +37 -0
  77. package/esm/configuration/requirements.js +88 -0
  78. package/esm/configuration/schemaRegistry.d.ts +21 -1
  79. package/esm/configuration/schemaRegistry.js +11 -0
  80. package/esm/configuration/schemaTypes.d.ts +3 -0
  81. package/esm/configuration/schemaTypes.js +10 -0
  82. package/esm/configuration/slotFacade.d.ts +35 -4
  83. package/esm/configuration/slotFacade.js +96 -9
  84. package/esm/configuration/snapshotPreprocess.d.ts +27 -0
  85. package/esm/configuration/snapshotPreprocess.js +102 -0
  86. package/esm/configuration/types.d.ts +161 -22
  87. package/esm/data_adapters/BaseAdapter/BaseAdapter.d.ts +2 -2
  88. package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +11 -2
  89. package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +12 -1
  90. package/esm/data_adapters/BaseAdapter/featureDensity.d.ts +2 -3
  91. package/esm/data_adapters/BaseAdapter/featureDensity.js +2 -3
  92. package/esm/data_adapters/BaseAdapter/index.d.ts +22 -3
  93. package/esm/data_adapters/BaseAdapter/types.d.ts +3 -4
  94. package/esm/data_adapters/BaseAdapter/zoomRange.d.ts +10 -0
  95. package/esm/data_adapters/BaseAdapter/zoomRange.js +1 -0
  96. package/esm/data_adapters/CytobandAdapter/configSchema.d.ts +9 -11
  97. package/esm/data_adapters/getSequenceSubAdapter.d.ts +1 -3
  98. package/esm/data_adapters/getSequenceSubAdapter.js +1 -3
  99. package/esm/pluggableElementTypes/AdapterType.d.ts +7 -7
  100. package/esm/pluggableElementTypes/RpcMethodType.d.ts +1 -1
  101. package/esm/pluggableElementTypes/RpcMethodType.js +3 -8
  102. package/esm/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.d.ts +1 -2
  103. package/esm/pluggableElementTypes/TextSearchAdapterType.d.ts +7 -7
  104. package/esm/pluggableElementTypes/index.d.ts +1 -1
  105. package/esm/pluggableElementTypes/index.js +1 -1
  106. package/esm/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +17 -7
  107. package/esm/pluggableElementTypes/models/BaseDisplayModel.d.ts +45 -48
  108. package/esm/pluggableElementTypes/models/BaseDisplayModel.js +40 -36
  109. package/esm/pluggableElementTypes/models/BaseTrackModel.d.ts +10 -13
  110. package/esm/pluggableElementTypes/models/BaseTrackModel.js +6 -6
  111. package/esm/pluggableElementTypes/models/BaseViewModel.d.ts +37 -17
  112. package/esm/pluggableElementTypes/models/BaseViewModel.js +25 -10
  113. package/esm/pluggableElementTypes/models/InternetAccountModel.d.ts +26 -16
  114. package/esm/pluggableElementTypes/models/assertDisplayContract.d.ts +1 -1
  115. package/esm/pluggableElementTypes/models/baseConnectionConfig.d.ts +22 -18
  116. package/esm/pluggableElementTypes/models/baseConnectionConfig.js +5 -5
  117. package/esm/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +26 -31
  118. package/esm/pluggableElementTypes/models/baseTrackConfig.d.ts +57 -141
  119. package/esm/pluggableElementTypes/models/baseTrackConfig.js +22 -26
  120. package/esm/pluggableElementTypes/models/components/SaveTrackData.js +2 -2
  121. package/esm/pluggableElementTypes/models/components/fetchTrackData.d.ts +3 -4
  122. package/esm/pluggableElementTypes/models/components/fetchTrackData.js +3 -3
  123. package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.d.ts +15 -7
  124. package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.js +38 -29
  125. package/esm/pluggableElementTypes/models/index.d.ts +1 -2
  126. package/esm/pluggableElementTypes/models/index.js +1 -2
  127. package/esm/pluggableElementTypes/models/saveTrackFileTypes/genbank.d.ts +3 -3
  128. package/esm/pluggableElementTypes/models/saveTrackFileTypes/genbank.js +4 -4
  129. package/esm/pluggableElementTypes/models/saveTrackFileTypes/types.d.ts +3 -3
  130. package/esm/rpc/BaseRpcDriver.d.ts +1 -2
  131. package/esm/rpc/BaseRpcDriver.js +23 -30
  132. package/esm/rpc/MainThreadRpcDriver.d.ts +2 -2
  133. package/esm/rpc/MainThreadRpcDriver.js +13 -8
  134. package/esm/rpc/RpcClient.d.ts +17 -6
  135. package/esm/rpc/RpcClient.js +42 -12
  136. package/esm/rpc/RpcManager.d.ts +8 -10
  137. package/esm/rpc/RpcManager.js +1 -1
  138. package/esm/rpc/RpcRegistry.d.ts +8 -2
  139. package/esm/rpc/RpcServer.d.ts +3 -1
  140. package/esm/rpc/RpcServer.js +19 -12
  141. package/esm/rpc/WebWorkerRpcDriver.d.ts +3 -3
  142. package/esm/rpc/WebWorkerRpcDriver.js +9 -47
  143. package/esm/rpc/byteBudget.d.ts +3 -5
  144. package/esm/rpc/byteBudget.js +4 -4
  145. package/esm/rpc/configSchema.d.ts +7 -21
  146. package/esm/rpc/coreRpcMethods.d.ts +1 -0
  147. package/esm/rpc/coreRpcMethods.js +1 -0
  148. package/esm/rpc/methods/CoreEncodeFeatures.d.ts +6 -5
  149. package/esm/rpc/methods/CoreEncodeFeatures.js +26 -31
  150. package/esm/rpc/methods/CoreGetEncodedFeature.d.ts +13 -0
  151. package/esm/rpc/methods/CoreGetEncodedFeature.js +31 -0
  152. package/esm/rpc/methods/CoreGetExportData.js +2 -2
  153. package/esm/rpc/methods/CoreGetFeatureDensity.js +2 -2
  154. package/esm/rpc/methods/CoreGetFeatures.js +2 -2
  155. package/esm/rpc/methods/CoreGetSequence.js +2 -2
  156. package/esm/rpc/methods/layerFeatures.d.ts +26 -0
  157. package/esm/rpc/methods/layerFeatures.js +40 -0
  158. package/esm/svg/SvgExport.js +3 -4
  159. package/esm/svg/SvgThemeProviders.d.ts +12 -0
  160. package/esm/svg/SvgThemeProviders.js +15 -0
  161. package/esm/svg/exportViewSvg.d.ts +32 -0
  162. package/esm/svg/exportViewSvg.js +13 -0
  163. package/esm/svg/normalizeSvgMarkup.d.ts +7 -0
  164. package/esm/svg/normalizeSvgMarkup.js +99 -0
  165. package/esm/svg/serializeSvg.d.ts +7 -0
  166. package/esm/svg/serializeSvg.js +11 -0
  167. package/esm/svg/svgReady.d.ts +8 -7
  168. package/esm/svg/svgReady.js +8 -7
  169. package/esm/svg/trackNames.d.ts +5 -5
  170. package/esm/svg/trackNames.js +6 -6
  171. package/esm/svg/wrapSvgExport.js +6 -74
  172. package/esm/ui/CascadingMenu.js +83 -86
  173. package/esm/ui/ErrorMessageStackTraceDialog.js +0 -5
  174. package/esm/ui/FileSelector/useInternetAccounts.d.ts +156 -96
  175. package/esm/ui/HoverMenu.d.ts +1 -2
  176. package/esm/ui/HoverMenu.js +6 -3
  177. package/esm/ui/JexlFilterDialog.d.ts +13 -10
  178. package/esm/ui/JexlFilterDialog.js +122 -49
  179. package/esm/ui/JexlFilterRowEditors.d.ts +15 -0
  180. package/esm/ui/JexlFilterRowEditors.js +90 -0
  181. package/esm/ui/LazyBaseTooltip.d.ts +4 -0
  182. package/esm/ui/LazyBaseTooltip.js +9 -0
  183. package/esm/ui/LoadingOverlay.js +3 -1
  184. package/esm/ui/MonospaceTextField.d.ts +2 -1
  185. package/esm/ui/MonospaceTextField.js +21 -19
  186. package/esm/ui/PaletteContext.d.ts +7 -9
  187. package/esm/ui/PaletteContext.js +24 -10
  188. package/esm/ui/RefNameAutocomplete/index.d.ts +1 -2
  189. package/esm/ui/RefNameAutocomplete/index.js +1 -1
  190. package/esm/ui/ScrollChrome.d.ts +6 -9
  191. package/esm/ui/ScrollChrome.js +5 -6
  192. package/esm/ui/ScrollEdgeShadow.d.ts +6 -9
  193. package/esm/ui/ScrollEdgeShadow.js +9 -24
  194. package/esm/ui/SettingsChangesTable.js +3 -3
  195. package/esm/ui/VerticalScrollbar.d.ts +13 -34
  196. package/esm/ui/VerticalScrollbar.js +29 -83
  197. package/esm/ui/ViewLoadingScreen.d.ts +2 -2
  198. package/esm/ui/ViewLoadingScreen.js +3 -3
  199. package/esm/ui/colorScale.d.ts +26 -1
  200. package/esm/ui/colorScale.js +28 -5
  201. package/esm/ui/colors.d.ts +49 -1
  202. package/esm/ui/colors.js +139 -4
  203. package/esm/ui/hoverBoxStyle.d.ts +14 -2
  204. package/esm/ui/hoverBoxStyle.js +17 -2
  205. package/esm/ui/index.d.ts +5 -3
  206. package/esm/ui/index.js +9 -7
  207. package/esm/ui/launchViewMenu.js +3 -3
  208. package/esm/ui/legendSpec.d.ts +2 -0
  209. package/esm/ui/legendSpec.js +3 -0
  210. package/esm/ui/palette.d.ts +0 -1
  211. package/esm/ui/palette.js +3 -27
  212. package/esm/ui/replaceViewAction.d.ts +1 -1
  213. package/esm/ui/replaceViewAction.js +1 -1
  214. package/esm/ui/theme.d.ts +1 -1
  215. package/esm/ui/theme.js +6 -40
  216. package/esm/ui/viewHeaderHeight.d.ts +1 -0
  217. package/esm/ui/viewHeaderHeight.js +1 -0
  218. package/esm/util/Base1DUtils.d.ts +1 -1
  219. package/esm/util/Base1DUtils.js +2 -2
  220. package/esm/util/SvgCanvas.d.ts +15 -13
  221. package/esm/util/SvgCanvas.js +72 -53
  222. package/esm/util/aborting.d.ts +39 -0
  223. package/esm/util/aborting.js +84 -0
  224. package/esm/util/adapterMetadata.d.ts +1 -1
  225. package/esm/util/adapterMetadata.js +6 -6
  226. package/esm/util/addAndShowTrack.d.ts +1 -4
  227. package/esm/util/addRelativeUris.d.ts +10 -2
  228. package/esm/util/addRelativeUris.js +22 -7
  229. package/esm/util/addTrackFromWidget.d.ts +2 -5
  230. package/esm/util/animationAllowed.d.ts +9 -0
  231. package/esm/util/animationAllowed.js +13 -0
  232. package/esm/util/applyRowResizeWheel.d.ts +10 -5
  233. package/esm/util/applyRowResizeWheel.js +10 -21
  234. package/esm/util/bandLayout.d.ts +4 -4
  235. package/esm/util/bandLayout.js +4 -4
  236. package/esm/util/bezierConnector.js +5 -4
  237. package/esm/util/bgzfWorkerPool.d.ts +20 -74
  238. package/esm/util/bgzfWorkerPool.js +20 -74
  239. package/esm/util/cachedSetup.d.ts +1 -1
  240. package/esm/util/cachedSetup.js +2 -2
  241. package/esm/util/categoricalField.d.ts +37 -0
  242. package/esm/util/categoricalField.js +52 -0
  243. package/esm/util/color/cssColorsLevel4.d.ts +1 -0
  244. package/esm/util/color/cssColorsLevel4.js +1 -0
  245. package/esm/util/color/index.d.ts +5 -3
  246. package/esm/util/color/index.js +7 -4
  247. package/esm/util/colorBits.d.ts +1 -2
  248. package/esm/util/colorBits.js +17 -39
  249. package/esm/util/colorRamp.d.ts +27 -1
  250. package/esm/util/colorRamp.js +56 -2
  251. package/esm/util/colorSchemes.d.ts +9 -0
  252. package/esm/util/colorSchemes.js +7 -0
  253. package/esm/util/{createStopTokenRotation.d.ts → createAbortRotation.d.ts} +11 -14
  254. package/esm/util/{createStopTokenRotation.js → createAbortRotation.js} +14 -26
  255. package/esm/util/cssColorParse.d.ts +15 -0
  256. package/esm/util/cssColorParse.js +53 -0
  257. package/esm/util/diagonalizeRegions.d.ts +2 -3
  258. package/esm/util/diagonalizeRegions.js +7 -12
  259. package/esm/util/expandLooseSearchIndex.d.ts +7 -0
  260. package/esm/util/expandLooseSearchIndex.js +25 -0
  261. package/esm/util/featureTransforms.d.ts +30 -3
  262. package/esm/util/featureTransforms.js +233 -36
  263. package/esm/util/fetchAndMaybeUnzip.js +5 -6
  264. package/esm/util/fetchContext.d.ts +5 -6
  265. package/esm/util/fetchContext.js +1 -1
  266. package/esm/util/fetchHub.d.ts +3 -1
  267. package/esm/util/fetchHub.js +2 -2
  268. package/esm/util/fetchSeq.d.ts +2 -3
  269. package/esm/util/fetchSeq.js +2 -2
  270. package/esm/util/fieldReader.d.ts +17 -0
  271. package/esm/util/fieldReader.js +62 -0
  272. package/esm/util/groupKeys.d.ts +75 -0
  273. package/esm/util/groupKeys.js +152 -0
  274. package/esm/util/highlights.d.ts +6 -4
  275. package/esm/util/highlights.js +12 -25
  276. package/esm/util/hooks.d.ts +1 -2
  277. package/esm/util/hooks.js +1 -2
  278. package/esm/util/index.d.ts +3 -3
  279. package/esm/util/index.js +4 -3
  280. package/esm/util/indexCandidates.js +1 -1
  281. package/esm/util/installFetch.d.ts +13 -10
  282. package/esm/util/installFetch.js +11 -10
  283. package/esm/util/installPrerequisiteFetch.d.ts +5 -3
  284. package/esm/util/installPrerequisiteFetch.js +3 -4
  285. package/esm/util/io/index.js +12 -12
  286. package/esm/util/isDataCurrent.d.ts +7 -5
  287. package/esm/util/isDataCurrent.js +9 -6
  288. package/esm/util/jexl.js +24 -21
  289. package/esm/util/jexlFilterRows.d.ts +89 -0
  290. package/esm/util/jexlFilterRows.js +252 -0
  291. package/esm/util/jexlFilters.d.ts +7 -5
  292. package/esm/util/jexlStrings.d.ts +3 -4
  293. package/esm/util/jexlStrings.js +2 -3
  294. package/esm/util/legendCandidates.d.ts +31 -27
  295. package/esm/util/legendCandidates.js +79 -53
  296. package/esm/util/localStorage.js +4 -4
  297. package/esm/util/markEncoding.d.ts +32 -16
  298. package/esm/util/markEncoding.js +177 -150
  299. package/esm/util/markEncodingTypes.d.ts +137 -66
  300. package/esm/util/mstUtils.d.ts +19 -22
  301. package/esm/util/mstUtils.js +19 -22
  302. package/esm/util/numericUtils.d.ts +7 -0
  303. package/esm/util/numericUtils.js +16 -0
  304. package/esm/util/numericValue.d.ts +14 -0
  305. package/esm/util/numericValue.js +34 -0
  306. package/esm/util/openFeatureWidget.js +1 -2
  307. package/esm/util/openViews.d.ts +1 -0
  308. package/esm/util/openViews.js +3 -3
  309. package/esm/util/parseLineByLine.d.ts +3 -4
  310. package/esm/util/parseLineByLine.js +7 -13
  311. package/esm/util/progress.d.ts +21 -21
  312. package/esm/util/progress.js +27 -26
  313. package/esm/util/renameRegions.d.ts +1 -2
  314. package/esm/util/renderToStaticMarkup.js +16 -16
  315. package/esm/util/rxjs.d.ts +7 -8
  316. package/esm/util/rxjs.js +12 -15
  317. package/esm/util/simpleFeature.d.ts +0 -1
  318. package/esm/util/svgColorProps.d.ts +11 -0
  319. package/esm/util/svgColorProps.js +28 -1
  320. package/esm/util/tabix.d.ts +3 -4
  321. package/esm/util/tabix.js +6 -7
  322. package/esm/util/thresholdScale.d.ts +54 -0
  323. package/esm/util/thresholdScale.js +112 -0
  324. package/esm/util/timeGate.d.ts +4 -5
  325. package/esm/util/timeGate.js +4 -5
  326. package/esm/util/trackConfigDelta.d.ts +22 -18
  327. package/esm/util/trackConfigDelta.js +40 -38
  328. package/esm/util/tracks.d.ts +27 -4
  329. package/esm/util/tracks.js +116 -43
  330. package/esm/util/translateTranscript.d.ts +44 -0
  331. package/esm/util/translateTranscript.js +102 -0
  332. package/esm/util/types/index.d.ts +19 -7
  333. package/esm/util/types/services.d.ts +1 -1
  334. package/esm/util/unknownSnapshotKeys.d.ts +15 -0
  335. package/esm/util/unknownSnapshotKeys.js +13 -0
  336. package/esm/util/useFeatureSequence.js +4 -4
  337. package/esm/util/useFetch.d.ts +3 -4
  338. package/esm/util/useFetch.js +5 -6
  339. package/esm/util/usePanelVirtualScroll.d.ts +7 -39
  340. package/esm/util/usePanelVirtualScroll.js +9 -40
  341. package/esm/util/useRowVirtualScroll.d.ts +6 -29
  342. package/esm/util/useRowVirtualScroll.js +8 -49
  343. package/esm/util/useVirtualScrollWheel.d.ts +20 -4
  344. package/esm/util/useVirtualScrollWheel.js +40 -84
  345. package/esm/util/viewHighlights.d.ts +3 -0
  346. package/esm/util/viewHighlights.js +5 -0
  347. package/esm/util/viewStatus.d.ts +24 -15
  348. package/esm/util/viewStatus.js +17 -0
  349. package/esm/util/withLaunchInput.d.ts +1 -1
  350. package/esm/util/withLaunchInput.js +0 -4
  351. package/package.json +26 -12
  352. package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.d.ts +0 -80
  353. package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.js +0 -583
  354. package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.d.ts +0 -141
  355. package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.js +0 -1116
  356. package/esm/ReExports/BaseFeatureDetails.d.ts +0 -1
  357. package/esm/ReExports/BaseFeatureDetails.js +0 -10
  358. package/esm/ReExports/barrelOnlyNames.d.ts +0 -5
  359. package/esm/ReExports/barrelOnlyNames.js +0 -63
  360. package/esm/ReExports/index.d.ts +0 -1
  361. package/esm/ReExports/index.js +0 -1
  362. package/esm/ReExports/publicTracks.d.ts +0 -1
  363. package/esm/ReExports/publicTracks.js +0 -14
  364. package/esm/ReExports/publicUi.d.ts +0 -4
  365. package/esm/ReExports/publicUi.js +0 -33
  366. package/esm/ReExports/publicUtil.d.ts +0 -1
  367. package/esm/ReExports/publicUtil.js +0 -32
  368. package/esm/ReExports/sharedModules.d.ts +0 -96
  369. package/esm/ReExports/sharedModules.js +0 -66
  370. package/esm/ReExports/workerNamespaceNames.d.ts +0 -11
  371. package/esm/ReExports/workerNamespaceNames.js +0 -275
  372. package/esm/pluggableElementTypes/models/HighlightsMixin.d.ts +0 -51
  373. package/esm/pluggableElementTypes/models/HighlightsMixin.js +0 -78
  374. package/esm/ui/highlightChipReveal.d.ts +0 -32
  375. package/esm/ui/highlightChipReveal.js +0 -39
  376. package/esm/util/adapterConfigKey.d.ts +0 -12
  377. package/esm/util/adapterConfigKey.js +0 -14
  378. package/esm/util/stopToken.d.ts +0 -212
  379. package/esm/util/stopToken.js +0 -438
@@ -1,26 +1,23 @@
1
+ import type { ZoomRange } from '../data_adapters/BaseAdapter/zoomRange.ts';
2
+ import type { ColorSchemeName } from './colorSchemes.ts';
1
3
  /**
2
4
  * #api
3
5
  * Where a channel's value comes from: a feature field name, read natively
4
6
  * (`feature.get(name)`), or a `jexl:` expression over `feature` — the opt-in
5
- * escape, three orders of magnitude slower per feature.
7
+ * escape, measured at 1.5x to 2.0x native per feature (MARK_ENCODING.md
8
+ * "The jexl channel, measured").
6
9
  */
7
10
  export type FieldRef = string;
8
- /**
9
- * #api
10
- * The ramp a continuous colour scale samples: a named ramp, or evenly spaced
11
- * CSS colour stops.
12
- */
13
- export type RampRef = 'viridis' | string[];
14
11
  /**
15
12
  * #api
16
13
  * A field bound to a categorical scale: each distinct value takes one entry
17
- * of the channel's range — a palette entry for `color`, a glyph name for
18
- * `glyph`. With a `domain`, the listed values take the range in that order
19
- * and whatever else the region meets follows, sorted; without one each value
20
- * derives its entry from itself (an integer takes the slot it names, anything
21
- * else hashes in), so every region agrees on a value it shares with another at
22
- * the cost of an occasional collision, and `domain` is the way to spend the
23
- * range deliberately.
14
+ * of the channel's `range` — a colour for `color`, a glyph name for
15
+ * `glyph`. Every value derives its entry from itself (an integer takes the
16
+ * slot it names, anything else hashes in), so every region agrees on a value
17
+ * it shares with another at the cost of an occasional collision. A `domain`
18
+ * spends the range deliberately: the listed values take it in order, and a
19
+ * value the domain leaves out never takes a listed value's entry. The domain
20
+ * orders and spends; it never adds a value the data lacks.
24
21
  */
25
22
  export interface CategoricalRef {
26
23
  field: FieldRef;
@@ -29,42 +26,46 @@ export interface CategoricalRef {
29
26
  }
30
27
  /**
31
28
  * #api
32
- * How a mark's `color` channel resolves. A CSS colour or a `jexl:` expression
33
- * returning one paints per feature with no scale; the two object forms bind a
34
- * field to a scale, which is what a legend can describe. A continuous scale
35
- * reads the field through `domain` (the region's own extremes when absent)
36
- * into `ramp`, and there a listed `domain` is what pins the answer across a
37
- * whole view.
29
+ * A numeric field cut into intervals: `domain` is the ascending cut points
30
+ * and `range` holds one colour more, so a value paints the entry for the
31
+ * number of cut points it is at or past. A value that is not a number
32
+ * belongs to no interval.
38
33
  */
39
- export type ColorEncoding = string | (CategoricalRef & {
40
- palette?: string[];
41
- }) | {
34
+ export interface ThresholdRef {
42
35
  field: FieldRef;
43
- scale: 'linear' | 'log';
44
- domain?: [number, number];
45
- ramp?: RampRef;
46
- };
36
+ scale: 'threshold';
37
+ domain?: (string | number)[];
38
+ range?: string[];
39
+ }
47
40
  /**
48
41
  * #api
49
- * How a mark's `y` channel resolves: a feature field (or `jexl:` expression)
50
- * read on a linear scale over the loaded regions' extremes, or the same field
51
- * with the scale spelled out — `log` to read the domain logarithmically,
52
- * `domain` to pin `[min, max]` instead of autoscaling. The declaration is the
53
- * one owner: the display's axis, its ticks and the shader's placement are all
54
- * resolved from it.
55
- *
56
- * `resolve` is which axis the mark reads. `shared` — the default — folds it
57
- * into the display's one y domain with every other mark. `independent` gives
58
- * it a domain folded from its layers alone and a second axis on the right, so
59
- * a coverage run and the raw features can share a plot; one mark per display
60
- * may ask for it.
42
+ * A numeric field read through a linear or log scale into a ramp. Each end of
43
+ * the domain is pinned by `domainMin` or `domainMax`, or is the region's own
44
+ * extreme where unset, so pinning both keeps colours consistent across a
45
+ * whole view. The ramp is `range`'s CSS colours, evenly spaced, where it
46
+ * lists any, else the named `scheme`; `reverse` turns it round.
61
47
  */
62
- export type ValueEncoding = FieldRef | {
48
+ export interface ContinuousRef {
63
49
  field: FieldRef;
64
- scale?: 'linear' | 'log';
65
- domain?: [number, number];
66
- resolve?: 'shared' | 'independent';
67
- };
50
+ scale: 'linear' | 'log';
51
+ domainMin?: number;
52
+ domainMax?: number;
53
+ /** The value the ramp's middle stop sits at; the domain's centre unset. */
54
+ domainMid?: number;
55
+ range?: string[];
56
+ scheme?: ColorSchemeName;
57
+ reverse?: boolean;
58
+ }
59
+ /**
60
+ * #api
61
+ * How a mark's `color` channel resolves. A CSS colour or a `jexl:` expression
62
+ * returning one paints per feature with no scale; the object forms bind a
63
+ * field to a scale, which a legend can describe, and share the config's
64
+ * member names.
65
+ */
66
+ export type ColorEncoding = string | (CategoricalRef & {
67
+ range?: string[];
68
+ }) | ContinuousRef | ThresholdRef;
68
69
  export type GlyphName = 'disc' | 'triangle' | 'diamond';
69
70
  /**
70
71
  * #api
@@ -77,16 +78,17 @@ export type GlyphEncoding = GlyphName | `jexl:${string}` | (CategoricalRef & {
77
78
  });
78
79
  /**
79
80
  * #api
80
- * The declared mapping from a feature's fields to a mark's channels. `x`
81
- * defaults to `start` and `x2` to `end`; a mark that plots no value leaves `y`
82
- * off. `glyph` is read by the `point` shape alone, `row` — an integer field,
83
- * 0 where missing — by the `span` shape, which stacks a feature on the band
84
- * it names.
81
+ * The declared mapping from a feature's fields to a mark's channels. Every
82
+ * positional channel is a field: `x` defaults to `start` and `x2` to `end`, a
83
+ * mark that plots no value leaves `y` off, and the scale `y` is read through
84
+ * belongs to the display rather than to the encoding. `glyph` is read by the
85
+ * `point` shape alone, `row` — an integer field, 0 where missing — by every
86
+ * shape, which stands a feature in the band it names.
85
87
  */
86
88
  export interface MarkEncoding {
87
89
  x?: FieldRef;
88
90
  x2?: FieldRef;
89
- y?: ValueEncoding;
91
+ y?: FieldRef;
90
92
  row?: FieldRef;
91
93
  color?: ColorEncoding;
92
94
  glyph?: GlyphEncoding;
@@ -109,21 +111,57 @@ export type LaneName = 'y' | 'color' | 'colorValue' | 'glyph' | 'row' | 'index';
109
111
  export type ColorScaleTable = {
110
112
  kind: 'categorical';
111
113
  field: string;
114
+ domain: string[];
115
+ /** The declared range, the other half of what assigns a key its colour. */
116
+ range?: string[];
117
+ /**
118
+ * Whether every non-empty key met here parsed as a finite number: a
119
+ * numeric field the declaration landed on a categorical scale, which
120
+ * the key can then say rather than the encoder typing the field from
121
+ * the data.
122
+ */
123
+ numericKeys?: boolean;
124
+ /** Each key met, in the field's order, `''` for no value. */
112
125
  entries: {
113
- label: string;
126
+ value: string;
127
+ color: number;
128
+ }[];
129
+ } | {
130
+ kind: 'threshold';
131
+ field: string;
132
+ /** The cut points, ascending, as numbers. */
133
+ domain: number[];
134
+ /** One row per interval, in order, labelled by the interval it spans. */
135
+ entries: {
136
+ value: string;
114
137
  color: number;
115
138
  }[];
116
139
  } | {
117
140
  kind: 'ramp';
118
141
  field: string;
119
142
  scale: 'linear' | 'log';
120
- /** What the ramp spans here: the declared domain, else `extent`. */
143
+ /** What the ramp spans here: each declared end, else `extent`'s. */
121
144
  domain: [number, number];
122
- /** Whether `domain` was declared, and so already agrees across regions. */
123
- pinned: boolean;
124
- /** This region's own extremes of the field, what a display unions. */
145
+ /**
146
+ * Whether each end was declared, and so already agrees across regions;
147
+ * an open end is what a display widens to the union of theirs.
148
+ */
149
+ pinned: [boolean, boolean];
150
+ /** The declared {@link ColorEncoding} `domainMid`, already baked into `lut`. */
151
+ domainMid?: number;
152
+ /**
153
+ * This region's own extremes of the field, what a display unions;
154
+ * `[Infinity, -Infinity]` where it holds no number, so a union passes
155
+ * over it.
156
+ */
125
157
  extent: [number, number];
126
158
  lut: Uint8Array;
159
+ /**
160
+ * The ramp's RGBA stops, carried beside a `domainMid`: where the middle
161
+ * stop lands in `lut` depends on the domain, so a display that unions an
162
+ * unpinned domain past this region's bakes `lut` again from these.
163
+ */
164
+ stops?: readonly (readonly [number, number, number, number])[];
127
165
  };
128
166
  /**
129
167
  * #api
@@ -133,8 +171,10 @@ export type ColorScaleTable = {
133
171
  export interface GlyphScaleTable {
134
172
  kind: 'glyph';
135
173
  field: string;
174
+ domain: string[];
175
+ range?: GlyphName[];
136
176
  entries: {
137
- label: string;
177
+ value: string;
138
178
  glyph: GlyphName;
139
179
  }[];
140
180
  }
@@ -159,6 +199,12 @@ export interface EncodedChannels {
159
199
  * reads this beside `count` to say so.
160
200
  */
161
201
  skipped: number;
202
+ /**
203
+ * Of `skipped`, the features whose `x` or `x2` read no number, such as
204
+ * the edges a `bin` writes for a feature lacking its field. Absent where
205
+ * the layer placed nothing by a field, as the density sidecar's does.
206
+ */
207
+ skippedPosition?: number;
162
208
  x: Uint32Array;
163
209
  x2: Uint32Array;
164
210
  featureIndex: Uint32Array;
@@ -208,7 +254,10 @@ export interface LayerRequest {
208
254
  */
209
255
  export interface EncodedFeaturesResult {
210
256
  layers: EncodedChannels[];
257
+ /** The sections a facet stacked every layer's rows into. */
258
+ facet?: FacetSection[];
211
259
  bytes?: number;
260
+ zoomRange?: ZoomRange;
212
261
  }
213
262
  /**
214
263
  * #api
@@ -295,16 +344,14 @@ export interface FlattenStep {
295
344
  * there — greedy first fit in start order, the packing a pileup is — and
296
345
  * write it to the field `as` (`row`). `fields` names the interval read
297
346
  * (`start`, `end`); `padding` is bp of clearance kept between two features
298
- * sharing a row; `groupby` packs each distinct value set on its own rows,
299
- * each numbered from 0. The answer is the input in start order, so a `span`
300
- * encoding `row` stacks it.
347
+ * sharing a row. The answer is the input in start order, so a `span`
348
+ * encoding `row` stacks it. Under a facet it packs each section on its own.
301
349
  */
302
- export interface StackStep {
303
- type: 'stack';
350
+ export interface PileupStep {
351
+ type: 'pileup';
304
352
  as?: string;
305
- fields?: [string, string];
353
+ fields?: [FieldRef, FieldRef];
306
354
  padding?: number;
307
- groupby?: FieldRef[];
308
355
  }
309
356
  /**
310
357
  * #api
@@ -312,7 +359,7 @@ export interface StackStep {
312
359
  * way GenomeSpy spells a transform; every step runs in order and the next
313
360
  * reads what the last answered.
314
361
  */
315
- export type TransformStep = FilterStep | FormulaStep | FlattenStep | BinStep | AggregateStep | CoverageStep | StackStep;
362
+ export type TransformStep = FilterStep | FormulaStep | FlattenStep | BinStep | AggregateStep | CoverageStep | PileupStep;
316
363
  export type CoreEncodeFeaturesArgs = {
317
364
  adapterConfig: Record<string, unknown>;
318
365
  region: {
@@ -324,8 +371,32 @@ export type CoreEncodeFeaturesArgs = {
324
371
  layers: LayerRequest[];
325
372
  /** The steps over the features, in order, before every layer encodes. */
326
373
  transform?: TransformStep[];
327
- /** Sugar for leading `filter` steps: `jexl:`-prefixed expressions. */
328
- filters?: string[];
374
+ /** Split the features after the shared steps, before each layer's own. */
375
+ facet?: FacetSpec;
376
+ /**
377
+ * The zoom the adapter reads at, for one with zoom levels (BigWig); absent
378
+ * is full resolution.
379
+ */
380
+ bpPerPx?: number;
329
381
  byteLimit?: number;
330
382
  sequenceAdapter?: Record<string, unknown>;
331
383
  };
384
+ /**
385
+ * #api
386
+ * A row facet: split the features on `field`'s value, run every layer's own
387
+ * steps over each section alone, and stack the sections, each starting on the
388
+ * row after the one above it ends.
389
+ */
390
+ export interface FacetSpec {
391
+ field: FieldRef;
392
+ }
393
+ /**
394
+ * #api
395
+ * One faceted section as the worker stacked it: its key, the row it starts on
396
+ * and how many rows it holds.
397
+ */
398
+ export interface FacetSection {
399
+ key: string;
400
+ firstRow: number;
401
+ rowCount: number;
402
+ }
@@ -49,33 +49,30 @@ export declare function getRenderingServices(node: IAnyStateTreeNode): Rendering
49
49
  /**
50
50
  * #api core/util
51
51
  * Resolve user-authored refName text against the assembly of the view
52
- * containing `node` — the one normalization layer, which resolves aliases and
53
- * casing together. Falls back to the input when the assembly is absent or its
54
- * aliases have not loaded.
52
+ * containing `node`, resolving aliases and casing together. Falls back to the
53
+ * input when the assembly is absent or its aliases have not loaded.
55
54
  *
56
- * Keyed off the VIEW's assembly rather than the track's, because the view is
57
- * what the comparison is against: displayed regions, loaded regions and blocks
58
- * all carry the refNames the view laid out.
55
+ * Uses the view's assembly, not the track's, because displayed regions, loaded
56
+ * regions and blocks all carry the refNames the view laid out.
59
57
  *
60
- * Reach for this wherever a refName a *person* wrote is about to be compared
61
- * against regions, features or blocks, which carry the assembly's canonical
62
- * name. A refName a display copied off a region is canonical already and needs
63
- * nothing; one that arrived in a session spec, a config slot or a URL is
64
- * whatever the author read out of the location box.
58
+ * Call it wherever a refName a *person* wrote is about to be compared against
59
+ * regions, features or blocks, which carry the assembly's canonical name. A
60
+ * refName a display copied off a region is already canonical. One from a
61
+ * session spec, a config slot or a URL is whatever the author typed.
65
62
  *
66
- * Skipping it fails silently and, worse, assembly-dependently: `chr12` matches
67
- * on an assembly canonicalized `chr12` and matches nothing on one canonicalized
68
- * `12`, so the same spec key works on one config and quietly does nothing on
69
- * the next, with no error for anyone to act on.
63
+ * Without it, matching depends on the assembly: `chr12` matches on an assembly
64
+ * canonicalized `chr12` and matches nothing on one canonicalized `12`. The
65
+ * same spec key works on one config and does nothing on the next, with no
66
+ * error.
70
67
  *
71
- * Resolves through `getCanonicalRefName2`, whose fallback is what keeps a spec
72
- * read before the alias file has loaded from throwing — and the getters that
73
- * read user specs do run from the first render.
68
+ * Resolves through `getCanonicalRefName2`, which falls back to the input
69
+ * instead of throwing when a spec is read before the alias file has loaded.
70
+ * The getters that read user specs run from the first render.
74
71
  *
75
- * Takes a refName, not a spec that might hold one: the resolver reads
76
- * `refName.toLowerCase()`, so anything else throws once the aliases are there,
77
- * and a caller reading an untyped `frozen` slot has to establish that it names
78
- * a refName at all before this is the right question to ask of it.
72
+ * Takes a refName, not a spec that might hold one. The resolver calls
73
+ * `refName.toLowerCase()`, so any other value throws once the aliases have
74
+ * loaded, and a caller reading an untyped `frozen` slot must first check that
75
+ * the value is a refName.
79
76
  */
80
77
  export declare function canonicalizeViewRefName(node: IAnyStateTreeNode, refName: string): string;
81
78
  /**
@@ -64,33 +64,30 @@ export function getRenderingServices(node) {
64
64
  /**
65
65
  * #api core/util
66
66
  * Resolve user-authored refName text against the assembly of the view
67
- * containing `node` — the one normalization layer, which resolves aliases and
68
- * casing together. Falls back to the input when the assembly is absent or its
69
- * aliases have not loaded.
67
+ * containing `node`, resolving aliases and casing together. Falls back to the
68
+ * input when the assembly is absent or its aliases have not loaded.
70
69
  *
71
- * Keyed off the VIEW's assembly rather than the track's, because the view is
72
- * what the comparison is against: displayed regions, loaded regions and blocks
73
- * all carry the refNames the view laid out.
70
+ * Uses the view's assembly, not the track's, because displayed regions, loaded
71
+ * regions and blocks all carry the refNames the view laid out.
74
72
  *
75
- * Reach for this wherever a refName a *person* wrote is about to be compared
76
- * against regions, features or blocks, which carry the assembly's canonical
77
- * name. A refName a display copied off a region is canonical already and needs
78
- * nothing; one that arrived in a session spec, a config slot or a URL is
79
- * whatever the author read out of the location box.
73
+ * Call it wherever a refName a *person* wrote is about to be compared against
74
+ * regions, features or blocks, which carry the assembly's canonical name. A
75
+ * refName a display copied off a region is already canonical. One from a
76
+ * session spec, a config slot or a URL is whatever the author typed.
80
77
  *
81
- * Skipping it fails silently and, worse, assembly-dependently: `chr12` matches
82
- * on an assembly canonicalized `chr12` and matches nothing on one canonicalized
83
- * `12`, so the same spec key works on one config and quietly does nothing on
84
- * the next, with no error for anyone to act on.
78
+ * Without it, matching depends on the assembly: `chr12` matches on an assembly
79
+ * canonicalized `chr12` and matches nothing on one canonicalized `12`. The
80
+ * same spec key works on one config and does nothing on the next, with no
81
+ * error.
85
82
  *
86
- * Resolves through `getCanonicalRefName2`, whose fallback is what keeps a spec
87
- * read before the alias file has loaded from throwing — and the getters that
88
- * read user specs do run from the first render.
83
+ * Resolves through `getCanonicalRefName2`, which falls back to the input
84
+ * instead of throwing when a spec is read before the alias file has loaded.
85
+ * The getters that read user specs run from the first render.
89
86
  *
90
- * Takes a refName, not a spec that might hold one: the resolver reads
91
- * `refName.toLowerCase()`, so anything else throws once the aliases are there,
92
- * and a caller reading an untyped `frozen` slot has to establish that it names
93
- * a refName at all before this is the right question to ask of it.
87
+ * Takes a refName, not a spec that might hold one. The resolver calls
88
+ * `refName.toLowerCase()`, so any other value throws once the aliases have
89
+ * loaded, and a caller reading an untyped `frozen` slot must first check that
90
+ * the value is a refName.
94
91
  */
95
92
  export function canonicalizeViewRefName(node, refName) {
96
93
  const { assemblyManager } = getSession(node);
@@ -10,6 +10,13 @@ export declare function getNumberGrouping(): boolean;
10
10
  export declare function toLocale(n: number): string;
11
11
  export declare function toPrecision(s: number, n?: number): number;
12
12
  export declare function reducePrecision(s: number, n?: number): string;
13
+ /**
14
+ * A score as a guide prints it: three significant figures below 100, whole
15
+ * numbers above, trailing fractional zeros dropped. The decimal-point guard
16
+ * matters because toPrecision can round up out of the fractional form —
17
+ * 99.95 comes back as "100", where a bare trailing-zero strip would report 1.
18
+ */
19
+ export declare function formatScore(n: number): string;
13
20
  /**
14
21
  * A byte count as a person reads it. Shared by the region-too-large banner and
15
22
  * the save-track-data dialog, which quote the same index estimate and would
@@ -98,6 +98,22 @@ export function toPrecision(s, n = 3) {
98
98
  export function reducePrecision(s, n = 3) {
99
99
  return toLocale(toPrecision(s, n));
100
100
  }
101
+ /**
102
+ * A score as a guide prints it: three significant figures below 100, whole
103
+ * numbers above, trailing fractional zeros dropped. The decimal-point guard
104
+ * matters because toPrecision can round up out of the fractional form —
105
+ * 99.95 comes back as "100", where a bare trailing-zero strip would report 1.
106
+ */
107
+ export function formatScore(n) {
108
+ if (n === 0) {
109
+ return '0';
110
+ }
111
+ if (Math.abs(n) >= 100) {
112
+ return n.toFixed(0);
113
+ }
114
+ const s = n.toPrecision(3);
115
+ return s.includes('.') ? s.replace(/\.?0+$/, '') : s;
116
+ }
101
117
  /**
102
118
  * A byte count as a person reads it. Shared by the region-too-large banner and
103
119
  * the save-track-data dialog, which quote the same index estimate and would
@@ -0,0 +1,14 @@
1
+ /**
2
+ * A field's value as the number a quantitative channel or step reads, `NaN`
3
+ * where it holds none. `Number()` answers 0 for `null`, `''`, `[]` and
4
+ * `[null]` — a VCF's `DP=.` arrives as the last — which plots a missing value
5
+ * as a measured zero. A one-element list is its element, as a VCF INFO value
6
+ * is; a string has to hold digits; anything else is not a number.
7
+ *
8
+ * The order is the measurement: a number returns first, and a string converts
9
+ * before its blank check, which runs only on a zero. Over a million features
10
+ * against `Number()`, interleaved in one process: numbers 0.98x, strings
11
+ * 1.00-1.02x, one-element lists 0.28x. Testing the list first and trimming
12
+ * every string measured 1.11-1.16x on a string column.
13
+ */
14
+ export declare function numericValue(value: unknown): number;
@@ -0,0 +1,34 @@
1
+ function textNumber(text) {
2
+ const n = Number(text);
3
+ return n === 0 && text.trim() === '' ? Number.NaN : n;
4
+ }
5
+ /**
6
+ * A field's value as the number a quantitative channel or step reads, `NaN`
7
+ * where it holds none. `Number()` answers 0 for `null`, `''`, `[]` and
8
+ * `[null]` — a VCF's `DP=.` arrives as the last — which plots a missing value
9
+ * as a measured zero. A one-element list is its element, as a VCF INFO value
10
+ * is; a string has to hold digits; anything else is not a number.
11
+ *
12
+ * The order is the measurement: a number returns first, and a string converts
13
+ * before its blank check, which runs only on a zero. Over a million features
14
+ * against `Number()`, interleaved in one process: numbers 0.98x, strings
15
+ * 1.00-1.02x, one-element lists 0.28x. Testing the list first and trimming
16
+ * every string measured 1.11-1.16x on a string column.
17
+ */
18
+ export function numericValue(value) {
19
+ if (typeof value === 'number') {
20
+ return value;
21
+ }
22
+ if (typeof value === 'string') {
23
+ return textNumber(value);
24
+ }
25
+ if (Array.isArray(value) && value.length === 1) {
26
+ const v = value[0];
27
+ return typeof v === 'number'
28
+ ? v
29
+ : typeof v === 'string'
30
+ ? textNumber(v)
31
+ : Number.NaN;
32
+ }
33
+ return Number.NaN;
34
+ }
@@ -30,14 +30,13 @@ export function openFeatureWidget(node, featureData, opts = {}) {
30
30
  }
31
31
  session.setSelection(opts.feature ?? new SimpleFeature(featureData));
32
32
  const { type, id } = opts.widget ?? DEFAULT_FEATURE_WIDGET;
33
- const widget = session.addWidget(type, id, {
33
+ const widget = session.openWidget(type, id, {
34
34
  featureData,
35
35
  parentFeature: opts.parentFeature,
36
36
  view: getContainingView(node),
37
37
  track: getContainingTrack(node),
38
38
  ...opts.extra,
39
39
  });
40
- session.showWidget(widget);
41
40
  return widget;
42
41
  }
43
42
  /**
@@ -14,3 +14,4 @@ import type { AbstractSessionModel, AbstractTrackModel, AbstractViewModel } from
14
14
  export declare function openViews(session: AbstractSessionModel): AbstractViewModel[];
15
15
  /** Every track on every open view. */
16
16
  export declare function openTracks(session: AbstractSessionModel): AbstractTrackModel[];
17
+ export declare function viewAndNested(view: AbstractViewModel): AbstractViewModel[];
@@ -11,12 +11,12 @@
11
11
  * getter holds annotation rows that are not tracks.
12
12
  */
13
13
  export function openViews(session) {
14
- return session.views.flatMap(withNested);
14
+ return session.views.flatMap(viewAndNested);
15
15
  }
16
16
  /** Every track on every open view. */
17
17
  export function openTracks(session) {
18
18
  return openViews(session).flatMap(v => v.ownTracks ?? []);
19
19
  }
20
- function withNested(view) {
21
- return [view, ...(view.ownViews ?? []).flatMap(withNested)];
20
+ export function viewAndNested(view) {
21
+ return [view, ...(view.ownViews ?? []).flatMap(viewAndNested)];
22
22
  }
@@ -1,6 +1,5 @@
1
1
  import { IntervalTree } from './IntervalTree.ts';
2
2
  import type { StatusCallback } from './progress.ts';
3
- import type { StopToken } from './stopToken.ts';
4
3
  export type { StatusCallback };
5
4
  export type LineCallback = (line: string, lineIndex: number) => boolean | undefined;
6
5
  /**
@@ -37,10 +36,10 @@ export declare function makeFeatureIntervalTreeMap<T extends {
37
36
  * default to `() => {}`, which says the opposite.
38
37
  * @param opts - `label` names the phase on the progress bar (a multi-phase
39
38
  * adapter wants "Parsing PAF", not another "Loading" indistinguishable from
40
- * the download that preceded it); `stopToken` makes a multi-GB parse
41
- * interruptible instead of running to completion after a cancel.
39
+ * the download that preceded it); `signal` is read on every line, but the
40
+ * parse never yields, so it sees only an abort that landed before it began.
42
41
  */
43
42
  export declare function parseLineByLine(buffer: Uint8Array, lineCallback: LineCallback, statusCallback: StatusCallback | undefined, opts?: {
44
43
  label?: string;
45
- stopToken?: StopToken;
44
+ signal?: AbortSignal;
46
45
  }): void;
@@ -97,21 +97,17 @@ function chunkBoundary(buffer, start) {
97
97
  * default to `() => {}`, which says the opposite.
98
98
  * @param opts - `label` names the phase on the progress bar (a multi-phase
99
99
  * adapter wants "Parsing PAF", not another "Loading" indistinguishable from
100
- * the download that preceded it); `stopToken` makes a multi-GB parse
101
- * interruptible instead of running to completion after a cancel.
100
+ * the download that preceded it); `signal` is read on every line, but the
101
+ * parse never yields, so it sees only an abort that landed before it began.
102
102
  */
103
103
  export function parseLineByLine(buffer, lineCallback, statusCallback, opts = {}) {
104
- const { label = 'Loading', stopToken } = opts;
104
+ const { label = 'Loading', signal } = opts;
105
105
  const decoder = new TextDecoder('utf8');
106
- // Time-gated, not gated on a line counter: a file of few but very expensive
107
- // lines would never reach a count mask, freezing the bar at 0% for the whole
108
- // parse (the failure createProgressReporter documents). The stop-token check
109
- // rides the same tick, so cancellation lands within one window.
110
106
  const report = createProgressReporter({
111
107
  label,
112
108
  total: buffer.length,
113
109
  statusCallback,
114
- stopToken,
110
+ signal,
115
111
  });
116
112
  let chunkStart = 0;
117
113
  let i = 0;
@@ -140,11 +136,9 @@ export function parseLineByLine(buffer, lineCallback, statusCallback, opts = {})
140
136
  }
141
137
  }
142
138
  i++;
143
- // Chunk-granular position, not line-granular: `report` is called every
144
- // line so cancellation still lands within one throttle window, but the
145
- // byte offset it publishes only advances per chunk. Interpolating
146
- // within the chunk would mean converting a UTF-16 offset back to a byte
147
- // offset, and at 64KB the bar already moves in sub-percent steps.
139
+ // Chunk-granular position: interpolating within the chunk would mean
140
+ // converting a UTF-16 offset back to a byte offset, and at 64KB the bar
141
+ // already moves in sub-percent steps.
148
142
  report(chunkStart);
149
143
  p = lineEnd + 1;
150
144
  }