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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -4,14 +4,15 @@ import type { AnyConfigurationModel } from '../configuration/index.ts';
4
4
  import type RpcMethodType from '../pluggableElementTypes/RpcMethodType.ts';
5
5
  import type { PluginDefinition } from '../pluginDefinitions.ts';
6
6
  import type { StatusCallback } from '../util/progress.ts';
7
+ import type { RpcHandles } from './RpcRegistry.ts';
7
8
  export interface WorkerHandle {
8
9
  destroy(): void;
9
10
  onError?(callback: () => void): void;
10
- notifyStopToken?(id: string): void;
11
11
  on?(eventName: string, listener: (data: unknown) => void): void;
12
12
  postMessage?(message: unknown): void;
13
13
  call(functionName: string, args?: unknown, options?: {
14
14
  statusCallback?: StatusCallback;
15
+ signal?: AbortSignal;
15
16
  }): Promise<unknown>;
16
17
  }
17
18
  declare module '@jbrowse/core/PluginManager' {
@@ -43,7 +44,6 @@ export default class WebWorkerRpcDriver extends BaseRpcDriver {
43
44
  private lastWorkerAssignment;
44
45
  private workerAssignments;
45
46
  private workerPool?;
46
- private unregisterBroadcaster;
47
47
  private destroyed;
48
48
  constructor(pluginManager: PluginManager, config: AnyConfigurationModel, options: WebWorkerRpcDriverOptions);
49
49
  /**
@@ -69,7 +69,7 @@ export default class WebWorkerRpcDriver extends BaseRpcDriver {
69
69
  * plugin's wrapper per RPC; once per boot has nothing to memoize.
70
70
  */
71
71
  extendWorker(worker: WorkerHandle): WorkerHandle;
72
- protected transport(sessionId: string, rpcMethod: RpcMethodType, serializedArgs: Record<string, unknown>, statusCallback: StatusCallback | undefined): Promise<unknown>;
72
+ protected transport(sessionId: string, rpcMethod: RpcMethodType, serializedArgs: Record<string, unknown>, handles: RpcHandles): Promise<unknown>;
73
73
  /**
74
74
  * Boot one worker and run the configuration handshake. Overridable so a test
75
75
  * can hand the pool a fake handle without a `Worker`; nothing in the app does.
@@ -1,6 +1,5 @@
1
1
  import { readConfObject } from '../configuration/index.js';
2
2
  import { clamp } from '../util/index.js';
3
- import { registerStopTokenBroadcaster } from '../util/stopToken.js';
4
3
  import BaseRpcDriver, { CORE_FREE_RESOURCES } from './BaseRpcDriver.js';
5
4
  import RpcClient from './RpcClient.js';
6
5
  import { deserializeError } from './serializeError/index.js';
@@ -36,9 +35,6 @@ class WebWorkerHandle {
36
35
  onError(callback) {
37
36
  this.client.on('error', callback);
38
37
  }
39
- notifyStopToken(id) {
40
- this.client.notifyStopToken(id);
41
- }
42
38
  // the two halves of {@link WorkerHandle}'s plugin-facing pair
43
39
  on(eventName, listener) {
44
40
  this.client.on(eventName, listener);
@@ -73,9 +69,9 @@ class WebWorkerHandle {
73
69
  // `Core-extendWorker` wrapper written against that interface may well call
74
70
  // `worker.call(name, args)` — which destructured `undefined` and threw
75
71
  opts = {}) {
76
- const { statusCallback } = opts;
72
+ const { statusCallback, signal } = opts;
77
73
  if (!statusCallback) {
78
- return this.client.call(funcName, args);
74
+ return this.client.call(funcName, args, signal);
79
75
  }
80
76
  const channel = `message-${++this.channelCount}`;
81
77
  // RpcClient is a generic event emitter (it also carries 'error' events), so
@@ -87,8 +83,7 @@ class WebWorkerHandle {
87
83
  };
88
84
  this.client.on(channel, listener);
89
85
  try {
90
- const result = await this.client.call(funcName, { ...args, channel });
91
- return result;
86
+ return await this.client.call(funcName, { ...args, channel }, signal);
92
87
  }
93
88
  finally {
94
89
  this.client.off(channel, listener);
@@ -151,24 +146,9 @@ class LazyWorker {
151
146
  this.workerP = undefined;
152
147
  }
153
148
  /**
154
- * Forward a stopped token id, but never boot a worker to do it: an unbooted
155
- * slot is running nothing to cancel. Routed through the same promise the
156
- * dispatching call awaits, so a stop issued while this slot is still booting
157
- * still lands after the call it means to cancel rather than ahead of the
158
- * worker's message listener existing.
159
- */
160
- notifyStopToken(id) {
161
- this.bootP
162
- ?.then(worker => {
163
- worker.notifyStopToken?.(id);
164
- })
165
- .catch(() => { });
166
- }
167
- /**
168
- * Drop a session's cached adapters on this slot's worker — and, like
169
- * {@link notifyStopToken}, never boot one to do it. A slot that never booted
170
- * has no cache to free, and booting one there costs a whole worker bundle and
171
- * every runtime plugin to say so.
149
+ * Drop a session's cached adapters on this slot's worker, and never boot one
150
+ * to do it. A slot that never booted has no cache to free, and booting one
151
+ * there costs a whole worker bundle and every runtime plugin to say so.
172
152
  *
173
153
  * Through the extended handle, because it is a `call`: a plugin that wraps
174
154
  * calls should see this one.
@@ -197,17 +177,6 @@ export default class WebWorkerRpcDriver extends BaseRpcDriver {
197
177
  // sessionId -> worker number
198
178
  workerAssignments = new Map();
199
179
  workerPool;
200
- // a stopped token has to reach the thread actually running the work, and this
201
- // is the seam that carries it. Broadcast rather than routed per call: one
202
- // token is commonly in flight on several calls at once, and a worker holding
203
- // nothing under that id ignores the frame.
204
- //
205
- // Registered with the POOL, not in the constructor, so that a driver which
206
- // never boots a worker stays out of the module-global broadcaster set — and
207
- // registered only once the pool exists to receive the broadcast, since a
208
- // `createWorkerPool` that threw after registering left an entry no `destroy`
209
- // could ever reach.
210
- unregisterBroadcaster = () => { };
211
180
  // `destroy` is terminal: `getWorkerPool` refuses rather than letting its `??=`
212
181
  // build a second pool for a driver whose teardown already ran. ADR-086.
213
182
  destroyed = false;
@@ -233,7 +202,6 @@ export default class WebWorkerRpcDriver extends BaseRpcDriver {
233
202
  // discarding the driver so its worker threads don't outlive it
234
203
  destroy() {
235
204
  this.destroyed = true;
236
- this.unregisterBroadcaster();
237
205
  for (const worker of this.workerPool ?? []) {
238
206
  worker.destroy();
239
207
  }
@@ -245,13 +213,7 @@ export default class WebWorkerRpcDriver extends BaseRpcDriver {
245
213
  // workerCount 0 (the config default) means "decide from hardware"
246
214
  const workerCount = readConfObject(this.config, 'workerCount') ||
247
215
  clamp(detectHardwareConcurrency() - 1, 1, 5);
248
- const pool = Array.from({ length: workerCount }, () => new LazyWorker(this));
249
- this.unregisterBroadcaster = registerStopTokenBroadcaster(id => {
250
- for (const worker of pool) {
251
- worker.notifyStopToken(id);
252
- }
253
- });
254
- return pool;
216
+ return Array.from({ length: workerCount }, () => new LazyWorker(this));
255
217
  }
256
218
  getWorkerPool() {
257
219
  if (this.destroyed) {
@@ -285,9 +247,9 @@ export default class WebWorkerRpcDriver extends BaseRpcDriver {
285
247
  'Core-extendWorker', worker);
286
248
  }
287
249
  // get this session's sticky worker and hand off the already-serialized args
288
- async transport(sessionId, rpcMethod, serializedArgs, statusCallback) {
250
+ async transport(sessionId, rpcMethod, serializedArgs, handles) {
289
251
  const worker = await this.getWorker(sessionId);
290
- return worker.call(rpcMethod.name, serializedArgs, { statusCallback });
252
+ return worker.call(rpcMethod.name, serializedArgs, handles);
291
253
  }
292
254
  /**
293
255
  * Boot one worker and run the configuration handshake. Overridable so a test
@@ -1,5 +1,4 @@
1
1
  import type { StatusCallback } from '../util/progress.ts';
2
- import type { StopToken, StopTokenChecker } from '../util/stopToken.ts';
3
2
  import type { AugmentedRegion } from '../util/types/data.ts';
4
3
  /**
5
4
  * Which question a byte budget asks of a region set: the gate's per-region
@@ -17,7 +16,7 @@ export interface GatedFetchArgs {
17
16
  }
18
17
  export interface ByteMeasurableAdapter {
19
18
  getRegionByteSize: (regions: AugmentedRegion[], opts?: {
20
- stopToken?: StopToken;
19
+ signal?: AbortSignal;
21
20
  statusCallback?: StatusCallback;
22
21
  }) => Promise<number | undefined>;
23
22
  }
@@ -45,13 +44,12 @@ export declare function measuredBytes(result: unknown): number | undefined;
45
44
  * comes back either way; when `tooLarge` is set the caller returns it and
46
45
  * fetches nothing. No budget means no measurement.
47
46
  */
48
- export declare function measureRegionBytes({ dataAdapter, regions, byteLimit, stopToken, statusCallback, stopTokenCheck, }: {
47
+ export declare function measureRegionBytes({ dataAdapter, regions, byteLimit, signal, statusCallback, }: {
49
48
  dataAdapter: ByteMeasurableAdapter;
50
49
  regions: AugmentedRegion[];
51
50
  byteLimit: number | undefined;
52
- stopToken?: StopToken;
51
+ signal?: AbortSignal;
53
52
  statusCallback?: StatusCallback;
54
- stopTokenCheck?: StopTokenChecker;
55
53
  }): Promise<{
56
54
  bytes?: number;
57
55
  tooLarge?: RegionTooLargeResult;
@@ -1,5 +1,5 @@
1
+ import { checkAbortSignal } from '../util/aborting.js';
1
2
  import { updateStatus } from '../util/progress.js';
2
- import { checkStopTokenThrottled } from '../util/stopToken.js';
3
3
  export function isRegionRefused(result) {
4
4
  return (typeof result === 'object' && result !== null && 'regionTooLarge' in result);
5
5
  }
@@ -35,15 +35,15 @@ export function measuredBytes(result) {
35
35
  * comes back either way; when `tooLarge` is set the caller returns it and
36
36
  * fetches nothing. No budget means no measurement.
37
37
  */
38
- export async function measureRegionBytes({ dataAdapter, regions, byteLimit, stopToken, statusCallback, stopTokenCheck, }) {
38
+ export async function measureRegionBytes({ dataAdapter, regions, byteLimit, signal, statusCallback, }) {
39
39
  if (byteLimit === undefined) {
40
40
  return {};
41
41
  }
42
42
  const bytes = largestRegionBytes(await updateStatus('Checking region size', statusCallback, () => Promise.all(regions.map(region => dataAdapter.getRegionByteSize([region], {
43
- stopToken,
43
+ signal,
44
44
  statusCallback,
45
45
  })))));
46
- checkStopTokenThrottled(stopTokenCheck);
46
+ checkAbortSignal(signal);
47
47
  return overByteBudget(bytes, byteLimit)
48
48
  ? { bytes, tooLarge: { regionTooLarge: true, bytes } }
49
49
  : { bytes };
@@ -3,29 +3,15 @@
3
3
  * #category root
4
4
  */
5
5
  declare const _default: import("../configuration/configurationSchema.ts").ConfigurationSchemaType<{
6
- /**
7
- * #slot
8
- * which RPC backend to use. Empty means "use the host application's
9
- * default" (web/desktop default to the web worker driver, embedded/headless
10
- * to the main thread). Every call in the session runs on the driver this
11
- * names; there is no per-track or per-call override.
12
- */
13
6
  readonly defaultDriver: {
14
- readonly type: "string";
15
- readonly description: "the RPC driver to run data fetching on: MainThreadRpcDriver or WebWorkerRpcDriver. Leave empty to use the default for this application";
16
- readonly defaultValue: "";
17
- readonly advanced: true;
7
+ type: "string";
8
+ } & {
9
+ defaultValue: string;
18
10
  };
19
- /**
20
- * #slot
21
- * number of web workers to spawn for the web worker RPC driver. 0 lets
22
- * JBrowse pick based on hardware concurrency.
23
- */
24
11
  readonly workerCount: {
25
- readonly type: "number";
26
- readonly description: "The number of workers to use. If 0 (the default) JBrowse will decide how many workers to use.";
27
- readonly defaultValue: 0;
28
- readonly advanced: true;
12
+ type: "number";
13
+ } & {
14
+ defaultValue: number;
29
15
  };
30
- }, import("../configuration/configurationSchema.ts").ConfigurationSchemaOptions<undefined, undefined>>;
16
+ }, import("../configuration/configurationSchema.ts").ConfigurationSchemaOptions<undefined, undefined, undefined, import("../configuration/requirements.ts").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>>>;
31
17
  export default _default;
@@ -3,6 +3,7 @@ export { default as CoreGetMetadata } from './methods/CoreGetMetadata.ts';
3
3
  export { default as CoreGetInfo } from './methods/CoreGetInfo.ts';
4
4
  export { default as CoreGetFeatures } from './methods/CoreGetFeatures.ts';
5
5
  export { default as CoreEncodeFeatures } from './methods/CoreEncodeFeatures.ts';
6
+ export { default as CoreGetEncodedFeature } from './methods/CoreGetEncodedFeature.ts';
6
7
  export { default as CoreGetSequence } from './methods/CoreGetSequence.ts';
7
8
  export { default as CoreFreeResources } from './methods/CoreFreeResources.ts';
8
9
  export { default as CoreGetRegionByteEstimate } from './methods/CoreGetRegionByteEstimate.ts';
@@ -3,6 +3,7 @@ export { default as CoreGetMetadata } from './methods/CoreGetMetadata.js';
3
3
  export { default as CoreGetInfo } from './methods/CoreGetInfo.js';
4
4
  export { default as CoreGetFeatures } from './methods/CoreGetFeatures.js';
5
5
  export { default as CoreEncodeFeatures } from './methods/CoreEncodeFeatures.js';
6
+ export { default as CoreGetEncodedFeature } from './methods/CoreGetEncodedFeature.js';
6
7
  export { default as CoreGetSequence } from './methods/CoreGetSequence.js';
7
8
  export { default as CoreFreeResources } from './methods/CoreFreeResources.js';
8
9
  export { default as CoreGetRegionByteEstimate } from './methods/CoreGetRegionByteEstimate.js';
@@ -3,11 +3,12 @@ import type { EncodedFeaturesResult } from '../../util/markEncoding.ts';
3
3
  import type { RpcExecuteArgs } from '../RpcRegistry.ts';
4
4
  /**
5
5
  * Fetch a region's features once, run the shared transform steps over them,
6
- * then each layer's own, and evaluate the layer's encoding over what is left
7
- * in the worker, where the `Feature` objects are, filling the lanes its shape
8
- * reads. The colours come back packed, the scale tables resolved, and the
9
- * main thread reads the same table for its legend that the colours were
10
- * drawn from.
6
+ * split them by the facet where the request names one, run each layer's own
7
+ * steps (per section, under a facet), and evaluate the layer's encoding over
8
+ * what is left in the worker, where the `Feature` objects are, filling the
9
+ * lanes its shape reads. The colours come back packed, the scale tables
10
+ * resolved, and the main thread reads the same table for its legend that the
11
+ * colours were drawn from.
11
12
  */
12
13
  export default class CoreEncodeFeatures extends RpcMethodTypeWithRenameRegion<'CoreEncodeFeatures'> {
13
14
  name: 'CoreEncodeFeatures';
@@ -1,25 +1,24 @@
1
1
  import { getFeatureAdapterOrThrow } from '../../data_adapters/getFeatureAdapter.js';
2
2
  import RpcMethodTypeWithRenameRegion from '../../pluggableElementTypes/RpcMethodTypeWithRenameRegion.js';
3
- import { runTransforms } from '../../util/featureTransforms.js';
4
3
  import { rpcResult } from '../../util/librpc.js';
5
4
  import { encodeFeatures, encodedChannelTransferables, } from '../../util/markEncoding.js';
6
- import { createProgressReporter, updateStatus } from '../../util/progress.js';
7
- import { checkStopTokenThrottled, createStopTokenChecker, } from '../../util/stopToken.js';
5
+ import { createProgressReporter } from '../../util/progress.js';
8
6
  import { measureRegionBytes } from '../byteBudget.js';
7
+ import { layerFeatures, layerRow } from './layerFeatures.js';
9
8
  /**
10
9
  * Fetch a region's features once, run the shared transform steps over them,
11
- * then each layer's own, and evaluate the layer's encoding over what is left
12
- * in the worker, where the `Feature` objects are, filling the lanes its shape
13
- * reads. The colours come back packed, the scale tables resolved, and the
14
- * main thread reads the same table for its legend that the colours were
15
- * drawn from.
10
+ * split them by the facet where the request names one, run each layer's own
11
+ * steps (per section, under a facet), and evaluate the layer's encoding over
12
+ * what is left in the worker, where the `Feature` objects are, filling the
13
+ * lanes its shape reads. The colours come back packed, the scale tables
14
+ * resolved, and the main thread reads the same table for its legend that the
15
+ * colours were drawn from.
16
16
  */
17
17
  export default class CoreEncodeFeatures extends RpcMethodTypeWithRenameRegion {
18
18
  name = 'CoreEncodeFeatures';
19
19
  async execute(args) {
20
- const { sessionId, adapterConfig, sequenceAdapter, region, layers: requested, transform = [], filters = [], byteLimit, stopToken, statusCallback, } = args;
20
+ const { sessionId, adapterConfig, sequenceAdapter, region, layers: requested, byteLimit, signal, statusCallback, } = args;
21
21
  const { pluginManager } = this;
22
- const stopTokenCheck = createStopTokenChecker(stopToken);
23
22
  const dataAdapter = await getFeatureAdapterOrThrow({
24
23
  pluginManager,
25
24
  sessionId,
@@ -30,33 +29,29 @@ export default class CoreEncodeFeatures extends RpcMethodTypeWithRenameRegion {
30
29
  dataAdapter,
31
30
  regions: [region],
32
31
  byteLimit,
33
- stopToken,
32
+ signal,
34
33
  statusCallback,
35
- stopTokenCheck,
36
34
  });
37
35
  if (tooLarge) {
38
36
  return tooLarge;
39
37
  }
40
- const fetched = await updateStatus('Downloading features', statusCallback, () => dataAdapter.getFeaturesArray(region, { statusCallback, stopToken }));
41
- checkStopTokenThrottled(stopTokenCheck);
42
38
  const { jexl } = pluginManager;
43
- const shared = runTransforms(fetched, [
44
- ...filters.map(expr => ({ type: 'filter', expr })),
45
- ...transform,
46
- ], jexl);
47
- const layers = requested.map(({ encoding, lanes, transform: own }) => {
48
- const features = own ? runTransforms(shared, own, jexl) : shared;
49
- return encodeFeatures(features, encoding, lanes, {
50
- jexl,
51
- report: createProgressReporter({
52
- label: 'Encoding features',
53
- total: features.length,
54
- statusCallback,
55
- stopTokenCheck,
56
- }),
57
- });
58
- });
59
- const result = { layers, bytes };
39
+ const { layers: features, rows, sections, zoomRange, } = await layerFeatures(dataAdapter, args, jexl);
40
+ const layers = requested.map((request, i) => encodeFeatures(features[i], { ...request.encoding, row: rows ? rows[i] : layerRow(request) }, request.lanes, {
41
+ jexl,
42
+ report: createProgressReporter({
43
+ label: 'Encoding features',
44
+ total: features[i].length,
45
+ statusCallback,
46
+ signal,
47
+ }),
48
+ }));
49
+ const result = {
50
+ layers,
51
+ facet: sections,
52
+ bytes,
53
+ zoomRange,
54
+ };
60
55
  return rpcResult(result, layers.flatMap(l => encodedChannelTransferables(l)));
61
56
  }
62
57
  }
@@ -0,0 +1,13 @@
1
+ import RpcMethodTypeWithRenameRegion from '../../pluggableElementTypes/RpcMethodTypeWithRenameRegion.ts';
2
+ import type { RpcExecuteArgs } from '../RpcRegistry.ts';
3
+ /**
4
+ * The feature behind one instance of a `CoreEncodeFeatures` answer: the same
5
+ * request run again, and the entry of `layer`'s list the instance's
6
+ * `featureIndex` names. A display holds channels and no records, and two reads
7
+ * sharing a span, a run counted inside one facet section or a mark whose `x` is
8
+ * not `start` are each a feature no coordinate lookup finds.
9
+ */
10
+ export default class CoreGetEncodedFeature extends RpcMethodTypeWithRenameRegion<'CoreGetEncodedFeature'> {
11
+ name: 'CoreGetEncodedFeature';
12
+ execute(args: RpcExecuteArgs<'CoreGetEncodedFeature'>): Promise<import("../../util/simpleFeature.ts").SimpleFeatureSerialized | undefined>;
13
+ }
@@ -0,0 +1,31 @@
1
+ import { getFeatureAdapterOrThrow } from '../../data_adapters/getFeatureAdapter.js';
2
+ import RpcMethodTypeWithRenameRegion from '../../pluggableElementTypes/RpcMethodTypeWithRenameRegion.js';
3
+ import { layerFeatures } from './layerFeatures.js';
4
+ /**
5
+ * The feature behind one instance of a `CoreEncodeFeatures` answer: the same
6
+ * request run again, and the entry of `layer`'s list the instance's
7
+ * `featureIndex` names. A display holds channels and no records, and two reads
8
+ * sharing a span, a run counted inside one facet section or a mark whose `x` is
9
+ * not `start` are each a feature no coordinate lookup finds.
10
+ */
11
+ export default class CoreGetEncodedFeature extends RpcMethodTypeWithRenameRegion {
12
+ name = 'CoreGetEncodedFeature';
13
+ async execute(args) {
14
+ const { sessionId, adapterConfig, sequenceAdapter, layer, featureIndex } = args;
15
+ const asked = args.layers[layer];
16
+ if (!asked) {
17
+ return undefined;
18
+ }
19
+ const { pluginManager } = this;
20
+ const dataAdapter = await getFeatureAdapterOrThrow({
21
+ pluginManager,
22
+ sessionId,
23
+ adapterConfig,
24
+ sequenceAdapter,
25
+ });
26
+ // A layer's list does not depend on its neighbours, so only the one asked
27
+ // about runs its steps.
28
+ const { layers } = await layerFeatures(dataAdapter, { ...args, layers: [asked] }, pluginManager.jexl);
29
+ return layers[0]?.[featureIndex]?.toJSON();
30
+ }
31
+ }
@@ -3,7 +3,7 @@ import RpcMethodTypeWithRenameRegions from '../../pluggableElementTypes/RpcMetho
3
3
  export default class CoreGetExportData extends RpcMethodTypeWithRenameRegions {
4
4
  name = 'CoreGetExportData';
5
5
  async execute(args) {
6
- const { sessionId, adapterConfig, regions, formatType, opts, stopToken, statusCallback, } = args;
6
+ const { sessionId, adapterConfig, regions, formatType, opts, signal, statusCallback, } = args;
7
7
  const dataAdapter = await getFeatureAdapterOrThrow({
8
8
  pluginManager: this.pluginManager,
9
9
  sessionId,
@@ -22,7 +22,7 @@ export default class CoreGetExportData extends RpcMethodTypeWithRenameRegions {
22
22
  // empty file instead.
23
23
  return dataAdapter.getExportData(regions, formatType, {
24
24
  ...opts,
25
- stopToken,
25
+ signal,
26
26
  statusCallback,
27
27
  });
28
28
  }
@@ -9,12 +9,12 @@ import RpcMethodTypeWithRenameRegions from '../../pluggableElementTypes/RpcMetho
9
9
  export default class CoreGetFeatureDensity extends RpcMethodTypeWithRenameRegions {
10
10
  name = 'CoreGetFeatureDensity';
11
11
  async execute(args) {
12
- const { adapterConfig, sessionId, regions, bpPerPx, stopToken } = args;
12
+ const { adapterConfig, sessionId, regions, bpPerPx, signal } = args;
13
13
  const { dataAdapter } = await getAdapter(this.pluginManager, sessionId, adapterConfig);
14
14
  return isFeatureAdapter(dataAdapter)
15
15
  ? dataAdapter.getFeatureDensity(regions, {
16
16
  bpPerPx,
17
- stopToken,
17
+ signal,
18
18
  statusCallback: args.statusCallback,
19
19
  })
20
20
  : undefined;
@@ -10,7 +10,7 @@ export default class CoreGetFeatures extends RpcMethodTypeWithRenameRegions {
10
10
  return unwrapRpcResult(feats).map(feat => new SimpleFeature(feat));
11
11
  }
12
12
  async execute(args) {
13
- const { stopToken, statusCallback, sessionId, adapterConfig, sequenceAdapter, regions, opts, } = args;
13
+ const { signal, statusCallback, sessionId, adapterConfig, sequenceAdapter, regions, opts, } = args;
14
14
  const dataAdapter = await getFeatureAdapterOrThrow({
15
15
  pluginManager: this.pluginManager,
16
16
  sessionId,
@@ -21,7 +21,7 @@ export default class CoreGetFeatures extends RpcMethodTypeWithRenameRegions {
21
21
  .getFeaturesInMultipleRegions(regions, {
22
22
  ...opts,
23
23
  statusCallback,
24
- stopToken,
24
+ signal,
25
25
  })
26
26
  .pipe(toArray()));
27
27
  return r.map(f => f.toJSON());
@@ -6,11 +6,11 @@ import RpcMethodType from '../../pluggableElementTypes/RpcMethodType.js';
6
6
  export default class CoreGetSequence extends RpcMethodType {
7
7
  name = 'CoreGetSequence';
8
8
  async execute(args) {
9
- const { stopToken, statusCallback, sessionId, adapterConfig, region } = args;
9
+ const { signal, statusCallback, sessionId, adapterConfig, region } = args;
10
10
  const { dataAdapter } = await getAdapter(this.pluginManager, sessionId, adapterConfig);
11
11
  if (!isSequenceAdapter(dataAdapter)) {
12
12
  throw new Error('Adapter does not support retrieving sequences');
13
13
  }
14
- return dataAdapter.getSequence(region, { stopToken, statusCallback });
14
+ return dataAdapter.getSequence(region, { signal, statusCallback });
15
15
  }
16
16
  }
@@ -0,0 +1,26 @@
1
+ import type { BaseFeatureDataAdapter } from '../../data_adapters/BaseAdapter/index.ts';
2
+ import type { JexlInstance } from '../../util/jexlStrings.ts';
3
+ import type { CoreEncodeFeaturesArgs, FacetSection, LayerRequest } from '../../util/markEncodingTypes.ts';
4
+ import type { StatusCallback } from '../../util/progress.ts';
5
+ import type { Feature } from '../../util/simpleFeature.ts';
6
+ /**
7
+ * The field a layer's `row` channel reads: the one its encoding names, else the
8
+ * one its own `pileup` writes, so a packed layer restates nothing.
9
+ */
10
+ export declare function layerRow({ encoding, transform }: LayerRequest): string | undefined;
11
+ /**
12
+ * The feature list each layer of a `CoreEncodeFeatures` request encodes: the
13
+ * region's features through the shared steps, split by the facet where the
14
+ * request names one, then through each layer's own steps, with each faceted
15
+ * layer's stacked rows beside it. An instance's `featureIndex` indexes its
16
+ * layer's list, so the same request answers which feature an instance is.
17
+ */
18
+ export declare function layerFeatures(dataAdapter: BaseFeatureDataAdapter, args: Pick<CoreEncodeFeaturesArgs, 'region' | 'layers' | 'transform' | 'facet' | 'bpPerPx'> & {
19
+ signal?: AbortSignal;
20
+ statusCallback?: StatusCallback;
21
+ }, jexl: JexlInstance): Promise<{
22
+ layers: (readonly Feature[])[];
23
+ rows: (readonly number[])[] | undefined;
24
+ sections: FacetSection[] | undefined;
25
+ zoomRange: import("../../data_adapters/BaseAdapter/zoomRange.ts").ZoomRange | undefined;
26
+ }>;
@@ -0,0 +1,40 @@
1
+ import { checkAbortSignal } from '../../util/aborting.js';
2
+ import { DEFAULT_PILEUP_AS, facetLayers, runTransforms, } from '../../util/featureTransforms.js';
3
+ import { updateStatus } from '../../util/progress.js';
4
+ /**
5
+ * The field a layer's `row` channel reads: the one its encoding names, else the
6
+ * one its own `pileup` writes, so a packed layer restates nothing.
7
+ */
8
+ export function layerRow({ encoding, transform = [] }) {
9
+ const pileup = transform.find((s) => s.type === 'pileup');
10
+ return (encoding.row ??
11
+ (pileup === undefined ? undefined : (pileup.as ?? DEFAULT_PILEUP_AS)));
12
+ }
13
+ /**
14
+ * The feature list each layer of a `CoreEncodeFeatures` request encodes: the
15
+ * region's features through the shared steps, split by the facet where the
16
+ * request names one, then through each layer's own steps, with each faceted
17
+ * layer's stacked rows beside it. An instance's `featureIndex` indexes its
18
+ * layer's list, so the same request answers which feature an instance is.
19
+ */
20
+ export async function layerFeatures(dataAdapter, args, jexl) {
21
+ const { region, layers: requested, transform = [], facet, bpPerPx, signal, statusCallback, } = args;
22
+ const fetchOpts = { bpPerPx, statusCallback, signal };
23
+ const [fetched, zoomRange] = await updateStatus('Downloading features', statusCallback, () => Promise.all([
24
+ dataAdapter.getFeaturesArray(region, fetchOpts),
25
+ dataAdapter.getZoomRange(fetchOpts),
26
+ ]));
27
+ checkAbortSignal(signal);
28
+ const shared = runTransforms(fetched, transform, jexl);
29
+ const faceted = facet
30
+ ? facetLayers(shared, facet.field, requested.map(r => ({ transform: r.transform, row: layerRow(r) })), jexl)
31
+ : undefined;
32
+ const layers = requested.map(({ transform: own }, i) => faceted
33
+ ? faceted.layers[i].features
34
+ : own
35
+ ? runTransforms(shared, own, jexl)
36
+ : shared);
37
+ const rows = faceted?.layers.map(l => l.rows);
38
+ const sections = faceted?.sections;
39
+ return { layers, rows, sections, zoomRange };
40
+ }
@@ -4,7 +4,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
4
4
  // (`constants.ts`, `svgReady.ts`) so this stays component-only for
5
5
  // react-refresh.
6
6
  import { useTheme } from '@mui/material';
7
- import { stripAlpha } from '../util/index.js';
7
+ import { stripAlpha } from '../util/svgColorProps.js';
8
8
  import { exportMargin } from './constants.js';
9
9
  import { svgSafeId } from './svgId.js';
10
10
  // Full-bleed background rect. `width`/`height` are the *total* SVG dimensions.
@@ -36,9 +36,8 @@ export function SVGMessageBox({ message, width, height, }) {
36
36
  // terminal state itself — a "region too large" message — and only paints the
37
37
  // children when the display has renderable data. The body is an ordinary child
38
38
  // component, so it never runs in a terminal state and no `renderSvg` re-detects
39
- // one from empty/absent data. The readiness wait stays an explicit
40
- // `await awaitSvgReady(model)` in each `renderSvg` (the one genuinely async
41
- // step), so this component is sync.
39
+ // one from empty/absent data. The readiness wait happens before it, in
40
+ // `renderDisplaySvg` (the one genuinely async step), so this component is sync.
42
41
  //
43
42
  // One terminal, not two, and the asymmetry is the point: over-budget is a state
44
43
  // the user navigated to on purpose, and a figure saying so is the honest export
@@ -0,0 +1,12 @@
1
+ import type { ThemeOptions } from '@mui/material';
2
+ /**
3
+ * Both theme providers, from the export's theme options. An export renders
4
+ * outside every React tree the app mounted, so without them a `useTheme` body
5
+ * gets MUI's default theme and a `usePalette` or `makeStyles` one JBrowse's
6
+ * default light style theme — whatever theme the user picked. Every place an
7
+ * export tree is rendered mounts this: the file, a live figure, a ring strip.
8
+ */
9
+ export declare function SvgThemeProviders({ theme, children, }: {
10
+ theme: ThemeOptions | undefined;
11
+ children: React.ReactNode;
12
+ }): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ThemeProvider } from '@mui/material';
3
+ import { StyleThemeProvider } from '../ui/PaletteContext.js';
4
+ import { resolveStyleTheme } from '../ui/styleTheme.js';
5
+ import { createJBrowseTheme } from '../ui/theme.js';
6
+ /**
7
+ * Both theme providers, from the export's theme options. An export renders
8
+ * outside every React tree the app mounted, so without them a `useTheme` body
9
+ * gets MUI's default theme and a `usePalette` or `makeStyles` one JBrowse's
10
+ * default light style theme — whatever theme the user picked. Every place an
11
+ * export tree is rendered mounts this: the file, a live figure, a ring strip.
12
+ */
13
+ export function SvgThemeProviders({ theme, children, }) {
14
+ return (_jsx(ThemeProvider, { theme: createJBrowseTheme(theme), children: _jsx(StyleThemeProvider, { theme: resolveStyleTheme({ configTheme: theme }), children: children }) }));
15
+ }