react-msaview 6.5.0 → 8.0.0

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 (414) hide show
  1. package/README.md +13 -11
  2. package/bundle/index.js +122 -112
  3. package/bundle/index.js.map +4 -4
  4. package/dist/colorSchemes.js +1 -2
  5. package/dist/colorSchemes.js.map +1 -1
  6. package/dist/columnStats.d.ts +28 -0
  7. package/dist/columnStats.js +34 -0
  8. package/dist/columnStats.js.map +1 -0
  9. package/dist/components/DragHandle.d.ts +3 -2
  10. package/dist/components/DragHandle.js +11 -5
  11. package/dist/components/DragHandle.js.map +1 -1
  12. package/dist/components/Loading.js +2 -2
  13. package/dist/components/Loading.js.map +1 -1
  14. package/dist/components/MSAView.js +17 -6
  15. package/dist/components/MSAView.js.map +1 -1
  16. package/dist/components/MSAViewer.d.ts +69 -4
  17. package/dist/components/MSAViewer.js +201 -8
  18. package/dist/components/MSAViewer.js.map +1 -1
  19. package/dist/components/PortalTooltip.d.ts +11 -0
  20. package/dist/components/PortalTooltip.js +29 -0
  21. package/dist/components/PortalTooltip.js.map +1 -0
  22. package/dist/components/ResizeHandles.d.ts +3 -3
  23. package/dist/components/ResizeHandles.js +13 -24
  24. package/dist/components/ResizeHandles.js.map +1 -1
  25. package/dist/components/SequenceTextArea.js +3 -3
  26. package/dist/components/SequenceTextArea.js.map +1 -1
  27. package/dist/components/Track.js +41 -22
  28. package/dist/components/Track.js.map +1 -1
  29. package/dist/components/dialogs/{InterProScanDialog.d.ts → AnnotationFileDialog.d.ts} +2 -2
  30. package/dist/components/dialogs/AnnotationFileDialog.js +92 -0
  31. package/dist/components/dialogs/AnnotationFileDialog.js.map +1 -0
  32. package/dist/components/dialogs/ExportSVGDialog.js +5 -3
  33. package/dist/components/dialogs/ExportSVGDialog.js.map +1 -1
  34. package/dist/components/dialogs/FeatureDialog.js +13 -9
  35. package/dist/components/dialogs/FeatureDialog.js.map +1 -1
  36. package/dist/components/dialogs/TrackInfoDialog.js +1 -1
  37. package/dist/components/dialogs/TrackInfoDialog.js.map +1 -1
  38. package/dist/components/header/GappynessSlider.js +6 -11
  39. package/dist/components/header/GappynessSlider.js.map +1 -1
  40. package/dist/components/header/Header.js +7 -0
  41. package/dist/components/header/Header.js.map +1 -1
  42. package/dist/components/header/HeaderStatusArea.js +0 -2
  43. package/dist/components/header/HeaderStatusArea.js.map +1 -1
  44. package/dist/components/header/LoadWarnings.d.ts +6 -0
  45. package/dist/components/header/LoadWarnings.js +35 -0
  46. package/dist/components/header/LoadWarnings.js.map +1 -0
  47. package/dist/components/header/MultiAlignmentSelector.js +0 -0
  48. package/dist/components/header/MultiAlignmentSelector.js.map +1 -1
  49. package/dist/components/header/ScrollZoomIcons.d.ts +6 -0
  50. package/dist/components/header/ScrollZoomIcons.js +35 -0
  51. package/dist/components/header/ScrollZoomIcons.js.map +1 -0
  52. package/dist/components/header/TreeSettingsMenu.js +7 -1
  53. package/dist/components/header/TreeSettingsMenu.js.map +1 -1
  54. package/dist/components/header/UnshareableDataWarning.d.ts +6 -0
  55. package/dist/components/header/UnshareableDataWarning.js +40 -0
  56. package/dist/components/header/UnshareableDataWarning.js.map +1 -0
  57. package/dist/components/header/ZoomControls.js +49 -6
  58. package/dist/components/header/ZoomControls.js.map +1 -1
  59. package/dist/components/header/getAnnotationsMenu.js +11 -14
  60. package/dist/components/header/getAnnotationsMenu.js.map +1 -1
  61. package/dist/components/header/settingsMenuItems.js +10 -7
  62. package/dist/components/header/settingsMenuItems.js.map +1 -1
  63. package/dist/components/import/ImportForm.js +1 -1
  64. package/dist/components/import/ImportForm.js.map +1 -1
  65. package/dist/components/import/ImportFormExamples.js +2 -6
  66. package/dist/components/import/ImportFormExamples.js.map +1 -1
  67. package/dist/components/import/util.js +2 -0
  68. package/dist/components/import/util.js.map +1 -1
  69. package/dist/components/minimap/Minimap.js +1 -2
  70. package/dist/components/minimap/Minimap.js.map +1 -1
  71. package/dist/components/msa/AnnotationLegend.js +27 -19
  72. package/dist/components/msa/AnnotationLegend.js.map +1 -1
  73. package/dist/components/msa/MSACanvas.js +1 -1
  74. package/dist/components/msa/MSACanvas.js.map +1 -1
  75. package/dist/components/msa/MSACanvasBlock.js +17 -20
  76. package/dist/components/msa/MSACanvasBlock.js.map +1 -1
  77. package/dist/components/msa/MSAMouseoverCanvas.js +2 -1
  78. package/dist/components/msa/MSAMouseoverCanvas.js.map +1 -1
  79. package/dist/components/msa/domainBandCursor.d.ts +7 -11
  80. package/dist/components/msa/domainBandCursor.js +7 -11
  81. package/dist/components/msa/domainBandCursor.js.map +1 -1
  82. package/dist/components/msa/drawFeatureSpans.d.ts +53 -0
  83. package/dist/components/msa/drawFeatureSpans.js +78 -0
  84. package/dist/components/msa/drawFeatureSpans.js.map +1 -0
  85. package/dist/components/msa/legendRows.d.ts +8 -0
  86. package/dist/components/msa/legendRows.js +16 -0
  87. package/dist/components/msa/legendRows.js.map +1 -0
  88. package/dist/components/msa/msaRaster.d.ts +30 -27
  89. package/dist/components/msa/msaRaster.js +193 -90
  90. package/dist/components/msa/msaRaster.js.map +1 -1
  91. package/dist/components/msa/packDomainLanes.d.ts +20 -0
  92. package/dist/components/msa/packDomainLanes.js +33 -0
  93. package/dist/components/msa/packDomainLanes.js.map +1 -0
  94. package/dist/components/msa/renderBoxFeatureCanvasBlock.d.ts +3 -1
  95. package/dist/components/msa/renderBoxFeatureCanvasBlock.js +51 -87
  96. package/dist/components/msa/renderBoxFeatureCanvasBlock.js.map +1 -1
  97. package/dist/components/msa/renderHighlights.d.ts +44 -4
  98. package/dist/components/msa/renderHighlights.js +99 -11
  99. package/dist/components/msa/renderHighlights.js.map +1 -1
  100. package/dist/components/msa/renderMSABlock.d.ts +1 -2
  101. package/dist/components/msa/renderMSABlock.js +28 -31
  102. package/dist/components/msa/renderMSABlock.js.map +1 -1
  103. package/dist/components/msa/renderMSAMouseover.js +9 -30
  104. package/dist/components/msa/renderMSAMouseover.js.map +1 -1
  105. package/dist/components/msa/tileColor.js +4 -7
  106. package/dist/components/msa/tileColor.js.map +1 -1
  107. package/dist/components/msa/useMsaBlockMouse.d.ts +5 -3
  108. package/dist/components/msa/useMsaBlockMouse.js +6 -6
  109. package/dist/components/msa/useMsaBlockMouse.js.map +1 -1
  110. package/dist/components/renderCtx.d.ts +1 -1
  111. package/dist/components/rowpanels/RowPanelBlock.d.ts +9 -0
  112. package/dist/components/rowpanels/RowPanelBlock.js +86 -0
  113. package/dist/components/rowpanels/RowPanelBlock.js.map +1 -0
  114. package/dist/components/rowpanels/RowPanelHeaders.d.ts +12 -0
  115. package/dist/components/rowpanels/RowPanelHeaders.js +38 -0
  116. package/dist/components/rowpanels/RowPanelHeaders.js.map +1 -0
  117. package/dist/components/{msa/ColumnStats.d.ts → rowpanels/RowPanels.d.ts} +2 -2
  118. package/dist/components/rowpanels/RowPanels.js +32 -0
  119. package/dist/components/rowpanels/RowPanels.js.map +1 -0
  120. package/dist/components/rowpanels/headerLayout.d.ts +1 -0
  121. package/dist/components/rowpanels/headerLayout.js +5 -0
  122. package/dist/components/rowpanels/headerLayout.js.map +1 -0
  123. package/dist/components/rowpanels/renderFeaturePanel.d.ts +21 -0
  124. package/dist/components/rowpanels/renderFeaturePanel.js +37 -0
  125. package/dist/components/rowpanels/renderFeaturePanel.js.map +1 -0
  126. package/dist/components/rowpanels/renderRowPanel.d.ts +23 -0
  127. package/dist/components/rowpanels/renderRowPanel.js +22 -0
  128. package/dist/components/rowpanels/renderRowPanel.js.map +1 -0
  129. package/dist/components/rowpanels/renderStrip.d.ts +20 -0
  130. package/dist/components/rowpanels/renderStrip.js +26 -0
  131. package/dist/components/rowpanels/renderStrip.js.map +1 -0
  132. package/dist/components/tracks/TrackBlocks.js +13 -16
  133. package/dist/components/tracks/TrackBlocks.js.map +1 -1
  134. package/dist/components/tracks/TrackTooltipContent.d.ts +15 -0
  135. package/dist/components/tracks/TrackTooltipContent.js +109 -0
  136. package/dist/components/tracks/TrackTooltipContent.js.map +1 -0
  137. package/dist/components/tracks/drawTracks.d.ts +30 -12
  138. package/dist/components/tracks/drawTracks.js +127 -34
  139. package/dist/components/tracks/drawTracks.js.map +1 -1
  140. package/dist/components/tracks/useTrackHover.d.ts +22 -0
  141. package/dist/components/tracks/useTrackHover.js +30 -0
  142. package/dist/components/tracks/useTrackHover.js.map +1 -0
  143. package/dist/components/tree/CladeLabels.d.ts +12 -0
  144. package/dist/components/tree/CladeLabels.js +48 -0
  145. package/dist/components/tree/CladeLabels.js.map +1 -0
  146. package/dist/components/tree/TreeCanvas.js +6 -4
  147. package/dist/components/tree/TreeCanvas.js.map +1 -1
  148. package/dist/components/tree/TreeCanvasBlock.js +6 -21
  149. package/dist/components/tree/TreeCanvasBlock.js.map +1 -1
  150. package/dist/components/tree/TreeOverview.d.ts +14 -0
  151. package/dist/components/tree/TreeOverview.js +75 -0
  152. package/dist/components/tree/TreeOverview.js.map +1 -0
  153. package/dist/components/tree/TreeRuler.js +11 -5
  154. package/dist/components/tree/TreeRuler.js.map +1 -1
  155. package/dist/components/tree/cladeBrackets.d.ts +25 -0
  156. package/dist/components/tree/cladeBrackets.js +51 -0
  157. package/dist/components/tree/cladeBrackets.js.map +1 -0
  158. package/dist/components/tree/dialogs/TreeNodeInfoDialog.js +2 -2
  159. package/dist/components/tree/dialogs/TreeNodeInfoDialog.js.map +1 -1
  160. package/dist/components/tree/renderTreeCanvas.d.ts +0 -1
  161. package/dist/components/tree/renderTreeCanvas.js +221 -47
  162. package/dist/components/tree/renderTreeCanvas.js.map +1 -1
  163. package/dist/components/tree/renderTreeOverview.d.ts +52 -0
  164. package/dist/components/tree/renderTreeOverview.js +138 -0
  165. package/dist/components/tree/renderTreeOverview.js.map +1 -0
  166. package/dist/components/tree/scaleBar.d.ts +10 -0
  167. package/dist/components/tree/scaleBar.js +24 -0
  168. package/dist/components/tree/scaleBar.js.map +1 -0
  169. package/dist/components/tree/useTreeHover.js +2 -4
  170. package/dist/components/tree/useTreeHover.js.map +1 -1
  171. package/dist/constants.d.ts +18 -1
  172. package/dist/constants.js +51 -8
  173. package/dist/constants.js.map +1 -1
  174. package/dist/createPaletteMap.d.ts +7 -6
  175. package/dist/createPaletteMap.js +10 -9
  176. package/dist/createPaletteMap.js.map +1 -1
  177. package/dist/element.d.ts +13 -0
  178. package/dist/element.js +269 -0
  179. package/dist/element.js.map +1 -0
  180. package/dist/featureFields.d.ts +11 -0
  181. package/dist/featureFields.js +17 -0
  182. package/dist/featureFields.js.map +1 -0
  183. package/dist/fetchUtils.d.ts +7 -7
  184. package/dist/fetchUtils.js +4 -32
  185. package/dist/fetchUtils.js.map +1 -1
  186. package/dist/flatToTree.js +1 -2
  187. package/dist/flatToTree.js.map +1 -1
  188. package/dist/ggplotPalettes.d.ts +10 -0
  189. package/dist/ggplotPalettes.js +58 -0
  190. package/dist/ggplotPalettes.js.map +1 -1
  191. package/dist/hierarchy.d.ts +29 -1
  192. package/dist/hierarchy.js +82 -19
  193. package/dist/hierarchy.js.map +1 -1
  194. package/dist/index.d.ts +10 -1
  195. package/dist/index.js +10 -2
  196. package/dist/index.js.map +1 -1
  197. package/dist/model/DataModel.js +4 -4
  198. package/dist/model/DataModel.js.map +1 -1
  199. package/dist/model/msaModel.d.ts +3 -2
  200. package/dist/model/msaModel.js +3 -2
  201. package/dist/model/msaModel.js.map +1 -1
  202. package/dist/model/treeModel.d.ts +30 -0
  203. package/dist/model/treeModel.js +37 -1
  204. package/dist/model/treeModel.js.map +1 -1
  205. package/dist/model.d.ts +792 -259
  206. package/dist/model.js +2092 -675
  207. package/dist/model.js.map +1 -1
  208. package/dist/mount.d.ts +11 -0
  209. package/dist/mount.js +22 -0
  210. package/dist/mount.js.map +1 -0
  211. package/dist/neighborJoining.js +8 -32
  212. package/dist/neighborJoining.js.map +1 -1
  213. package/dist/renderToStaticMarkup.d.ts +15 -13
  214. package/dist/renderToStaticMarkup.js +37 -25
  215. package/dist/renderToStaticMarkup.js.map +1 -1
  216. package/dist/renderToSvg.js +198 -68
  217. package/dist/renderToSvg.js.map +1 -1
  218. package/dist/rowCoordinateCalculations.d.ts +26 -28
  219. package/dist/rowCoordinateCalculations.js +13 -39
  220. package/dist/rowCoordinateCalculations.js.map +1 -1
  221. package/dist/scales.d.ts +22 -0
  222. package/dist/scales.js +30 -0
  223. package/dist/scales.js.map +1 -0
  224. package/dist/seqPosToGlobalCol.d.ts +2 -3
  225. package/dist/seqPosToGlobalCol.js +5 -4
  226. package/dist/seqPosToGlobalCol.js.map +1 -1
  227. package/dist/sequenceLogo.d.ts +6 -11
  228. package/dist/sequenceLogo.js +6 -11
  229. package/dist/sequenceLogo.js.map +1 -1
  230. package/dist/stripDefault.d.ts +7 -14
  231. package/dist/stripDefault.js +7 -14
  232. package/dist/stripDefault.js.map +1 -1
  233. package/dist/svgTestUtil.d.ts +306 -124
  234. package/dist/types.d.ts +295 -3
  235. package/dist/umd.d.ts +2 -0
  236. package/dist/umd.js +4 -2
  237. package/dist/umd.js.map +1 -1
  238. package/dist/useCanvasAutorun.d.ts +5 -10
  239. package/dist/useCanvasAutorun.js +5 -10
  240. package/dist/useCanvasAutorun.js.map +1 -1
  241. package/dist/useMsaSvgFigure.d.ts +20 -0
  242. package/dist/useMsaSvgFigure.js +46 -0
  243. package/dist/useMsaSvgFigure.js.map +1 -0
  244. package/dist/util.d.ts +10 -4
  245. package/dist/util.js +37 -10
  246. package/dist/util.js.map +1 -1
  247. package/dist/version.d.ts +1 -1
  248. package/dist/version.js +1 -1
  249. package/dist/wuss.d.ts +14 -0
  250. package/dist/wuss.js +55 -0
  251. package/dist/wuss.js.map +1 -0
  252. package/package.json +23 -14
  253. package/src/colorSchemes.ts +1 -2
  254. package/src/columnStats.ts +58 -0
  255. package/src/components/DragHandle.tsx +18 -7
  256. package/src/components/Loading.tsx +14 -8
  257. package/src/components/MSAView.tsx +19 -5
  258. package/src/components/MSAViewer.tsx +326 -10
  259. package/src/components/PortalTooltip.tsx +47 -0
  260. package/src/components/ResizeHandles.tsx +21 -36
  261. package/src/components/SequenceTextArea.tsx +3 -3
  262. package/src/components/Track.tsx +55 -18
  263. package/src/components/dialogs/AnnotationFileDialog.tsx +162 -0
  264. package/src/components/dialogs/ExportSVGDialog.tsx +7 -2
  265. package/src/components/dialogs/FeatureDialog.tsx +13 -9
  266. package/src/components/dialogs/TrackInfoDialog.tsx +1 -1
  267. package/src/components/header/GappynessSlider.tsx +6 -11
  268. package/src/components/header/Header.tsx +10 -0
  269. package/src/components/header/HeaderStatusArea.tsx +0 -5
  270. package/src/components/header/LoadWarnings.tsx +48 -0
  271. package/src/components/header/MultiAlignmentSelector.tsx +0 -0
  272. package/src/components/header/ScrollZoomIcons.tsx +52 -0
  273. package/src/components/header/TreeSettingsMenu.tsx +7 -1
  274. package/src/components/header/UnshareableDataWarning.tsx +56 -0
  275. package/src/components/header/ZoomControls.tsx +74 -14
  276. package/src/components/header/getAnnotationsMenu.ts +13 -17
  277. package/src/components/header/settingsMenuItems.ts +11 -6
  278. package/src/components/import/ImportForm.tsx +2 -2
  279. package/src/components/import/ImportFormExamples.tsx +4 -8
  280. package/src/components/import/util.ts +2 -0
  281. package/src/components/minimap/Minimap.tsx +1 -2
  282. package/src/components/msa/AnnotationLegend.tsx +48 -38
  283. package/src/components/msa/MSACanvas.tsx +3 -5
  284. package/src/components/msa/MSACanvasBlock.tsx +17 -21
  285. package/src/components/msa/MSAMouseoverCanvas.tsx +2 -1
  286. package/src/components/msa/domainBandCursor.ts +7 -11
  287. package/src/components/msa/drawFeatureSpans.ts +150 -0
  288. package/src/components/msa/legendRows.ts +24 -0
  289. package/src/components/msa/msaRaster.ts +236 -88
  290. package/src/components/msa/packDomainLanes.ts +36 -0
  291. package/src/components/msa/renderBoxFeatureCanvasBlock.ts +69 -123
  292. package/src/components/msa/renderHighlights.ts +141 -10
  293. package/src/components/msa/renderMSABlock.ts +29 -38
  294. package/src/components/msa/renderMSAMouseover.ts +9 -39
  295. package/src/components/msa/tileColor.ts +4 -7
  296. package/src/components/msa/useMsaBlockMouse.ts +6 -6
  297. package/src/components/renderCtx.ts +1 -0
  298. package/src/components/rowpanels/RowPanelBlock.tsx +139 -0
  299. package/src/components/rowpanels/RowPanelHeaders.tsx +57 -0
  300. package/src/components/rowpanels/RowPanels.tsx +77 -0
  301. package/src/components/rowpanels/headerLayout.ts +5 -0
  302. package/src/components/rowpanels/renderFeaturePanel.ts +66 -0
  303. package/src/components/rowpanels/renderRowPanel.ts +41 -0
  304. package/src/components/rowpanels/renderStrip.ts +46 -0
  305. package/src/components/tracks/TrackBlocks.tsx +13 -18
  306. package/src/components/tracks/TrackTooltipContent.tsx +156 -0
  307. package/src/components/tracks/drawTracks.ts +169 -38
  308. package/src/components/tracks/useTrackHover.ts +42 -0
  309. package/src/components/tree/CladeLabels.tsx +77 -0
  310. package/src/components/tree/TreeCanvas.tsx +4 -3
  311. package/src/components/tree/TreeCanvasBlock.tsx +10 -32
  312. package/src/components/tree/TreeOverview.tsx +106 -0
  313. package/src/components/tree/TreeRuler.tsx +29 -5
  314. package/src/components/tree/cladeBrackets.ts +73 -0
  315. package/src/components/tree/dialogs/TreeNodeInfoDialog.tsx +2 -2
  316. package/src/components/tree/renderTreeCanvas.ts +312 -48
  317. package/src/components/tree/renderTreeOverview.ts +212 -0
  318. package/src/components/tree/scaleBar.ts +23 -0
  319. package/src/components/tree/useTreeHover.ts +2 -4
  320. package/src/constants.ts +61 -8
  321. package/src/createPaletteMap.ts +10 -9
  322. package/src/element.ts +321 -0
  323. package/src/featureFields.ts +19 -0
  324. package/src/fetchUtils.ts +7 -40
  325. package/src/flatToTree.ts +1 -2
  326. package/src/ggplotPalettes.ts +60 -0
  327. package/src/hierarchy.ts +97 -20
  328. package/src/index.ts +46 -6
  329. package/src/model/DataModel.ts +5 -4
  330. package/src/model/msaModel.ts +3 -2
  331. package/src/model/treeModel.ts +42 -0
  332. package/src/model.ts +2492 -793
  333. package/src/mount.tsx +32 -0
  334. package/src/neighborJoining.ts +8 -32
  335. package/src/rawImports.d.ts +9 -0
  336. package/src/renderToStaticMarkup.ts +41 -25
  337. package/src/renderToSvg.tsx +365 -92
  338. package/src/rowCoordinateCalculations.ts +16 -62
  339. package/src/scales.ts +47 -0
  340. package/src/seqPosToGlobalCol.ts +5 -4
  341. package/src/sequenceLogo.ts +6 -11
  342. package/src/stripDefault.ts +7 -14
  343. package/src/types.ts +352 -12
  344. package/src/umd.ts +4 -2
  345. package/src/useCanvasAutorun.ts +5 -10
  346. package/src/useMsaSvgFigure.ts +72 -0
  347. package/src/util.ts +40 -14
  348. package/src/version.ts +1 -1
  349. package/src/wuss.ts +62 -0
  350. package/dist/components/dialogs/InterProScanDialog.js +0 -137
  351. package/dist/components/dialogs/InterProScanDialog.js.map +0 -1
  352. package/dist/components/dialogs/InterProScanFileDialog.d.ts +0 -7
  353. package/dist/components/dialogs/InterProScanFileDialog.js +0 -64
  354. package/dist/components/dialogs/InterProScanFileDialog.js.map +0 -1
  355. package/dist/components/msa/ColumnStats.js +0 -42
  356. package/dist/components/msa/ColumnStats.js.map +0 -1
  357. package/dist/launchInterProScan.d.ts +0 -13
  358. package/dist/launchInterProScan.js +0 -110
  359. package/dist/launchInterProScan.js.map +0 -1
  360. package/dist/useColorContrast.d.ts +0 -10
  361. package/dist/useColorContrast.js +0 -13
  362. package/dist/useColorContrast.js.map +0 -1
  363. package/src/clustalX.test.ts +0 -74
  364. package/src/colSpace.test.ts +0 -67
  365. package/src/collapseLogic.test.ts +0 -115
  366. package/src/colorSchemes.docs.test.ts +0 -57
  367. package/src/columnCounts.test.ts +0 -73
  368. package/src/columnStats.test.ts +0 -94
  369. package/src/columnTracks.test.ts +0 -97
  370. package/src/components/dialogs/InterProScanDialog.tsx +0 -214
  371. package/src/components/dialogs/InterProScanFileDialog.tsx +0 -138
  372. package/src/components/minimap/minimapLayout.test.ts +0 -71
  373. package/src/components/msa/ColumnStats.tsx +0 -54
  374. package/src/components/msa/msaRaster.test.ts +0 -145
  375. package/src/components/msa/renderBoxFeatureCanvasBlock.test.ts +0 -51
  376. package/src/components/tree/renderTreeCanvas.test.ts +0 -296
  377. package/src/dataInitialized.test.ts +0 -42
  378. package/src/domainBands.test.ts +0 -122
  379. package/src/domainLetterColor.test.ts +0 -80
  380. package/src/exportFileName.test.ts +0 -40
  381. package/src/fetchUtils.test.ts +0 -83
  382. package/src/flatToTree.test.ts +0 -51
  383. package/src/hierarchy.test.ts +0 -228
  384. package/src/highlights.test.ts +0 -70
  385. package/src/impgRender.test.tsx +0 -68
  386. package/src/largeTree.test.ts +0 -67
  387. package/src/launchInterProScan.ts +0 -167
  388. package/src/loadErrorDisplay.test.tsx +0 -102
  389. package/src/modelFilehandleLoaders.test.ts +0 -137
  390. package/src/modelReset.test.ts +0 -120
  391. package/src/neighborJoining.test.ts +0 -164
  392. package/src/parseAsn1.test.ts +0 -36
  393. package/src/propertyConservation.test.ts +0 -36
  394. package/src/renderColumnTracksSvg.test.tsx +0 -108
  395. package/src/renderDomainsSvg.test.tsx +0 -118
  396. package/src/renderHighlightsSvg.test.tsx +0 -85
  397. package/src/renderMinimapSvg.test.tsx +0 -62
  398. package/src/renderRasterSvg.test.tsx +0 -144
  399. package/src/renderSequenceLogoSvg.test.tsx +0 -165
  400. package/src/renderToSvg.test.tsx +0 -65
  401. package/src/reset.test.ts +0 -61
  402. package/src/rowCoordinateCalculations.test.ts +0 -211
  403. package/src/rowSpace.test.ts +0 -46
  404. package/src/segmentOverlay.test.ts +0 -70
  405. package/src/seqPosToGlobalCol.test.ts +0 -59
  406. package/src/sequenceLogo.test.ts +0 -88
  407. package/src/setFontSize.test.ts +0 -33
  408. package/src/stripDefault.test.ts +0 -48
  409. package/src/stripDefaultSnapshot.test.ts +0 -87
  410. package/src/treeMetadata.test.ts +0 -39
  411. package/src/useCanvasAutorun.test.tsx +0 -98
  412. package/src/useColorContrast.ts +0 -18
  413. package/src/viewChrome.test.tsx +0 -134
  414. package/src/wheelZoom.test.ts +0 -46
@@ -1,18 +1,67 @@
1
1
  import React from 'react'
2
2
 
3
- import Mouse from '@mui/icons-material/Mouse'
3
+ import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton'
4
4
  import ZoomIn from '@mui/icons-material/ZoomIn'
5
5
  import ZoomOut from '@mui/icons-material/ZoomOut'
6
- import { IconButton, ToggleButton, Tooltip } from '@mui/material'
6
+ import { IconButton, Tooltip } from '@mui/material'
7
7
  import { observer } from 'mobx-react'
8
8
 
9
+ import {
10
+ MouseScroll,
11
+ MouseZoomBoth,
12
+ MouseZoomHorizontal,
13
+ MouseZoomVertical,
14
+ } from './ScrollZoomIcons.tsx'
15
+
16
+ import type { ScrollZoomAxis } from '../../constants.ts'
9
17
  import type { MsaViewModel } from '../../model.ts'
10
18
 
19
+ interface WheelMode {
20
+ label: string
21
+ // undefined is the wheel scrolling the alignment, which is the default
22
+ axis?: ScrollZoomAxis
23
+ Icon: typeof MouseScroll
24
+ helpText?: string
25
+ }
26
+
27
+ const scrollMode: WheelMode = {
28
+ label: 'Scrolls the alignment',
29
+ Icon: MouseScroll,
30
+ helpText: 'Ctrl+wheel zooms both axes at the cursor.',
31
+ }
32
+
33
+ const wheelModes: WheelMode[] = [
34
+ scrollMode,
35
+ {
36
+ label: 'Zooms both axes',
37
+ axis: 'both',
38
+ Icon: MouseZoomBoth,
39
+ helpText: 'Hold shift to pan while the wheel zooms.',
40
+ },
41
+ {
42
+ label: 'Zooms columns only',
43
+ axis: 'horizontal',
44
+ Icon: MouseZoomHorizontal,
45
+ helpText:
46
+ 'Holds the row height, so the labels and letters stay at their size while the alignment compresses.',
47
+ },
48
+ {
49
+ label: 'Zooms rows only',
50
+ axis: 'vertical',
51
+ Icon: MouseZoomVertical,
52
+ helpText:
53
+ 'Holds the column width, so the alignment stays as wide while the rows grow or shrink.',
54
+ },
55
+ ]
56
+
11
57
  const ZoomControls = observer(function ZoomControls({
12
58
  model,
13
59
  }: {
14
60
  model: MsaViewModel
15
61
  }) {
62
+ const { scrollZoom, scrollZoomAxis } = model
63
+ const activeAxis = scrollZoom ? scrollZoomAxis : undefined
64
+ const current = wheelModes.find(m => m.axis === activeAxis) ?? scrollMode
16
65
  return (
17
66
  <>
18
67
  <Tooltip title="Zoom in">
@@ -35,19 +84,30 @@ const ZoomControls = observer(function ZoomControls({
35
84
  <ZoomOut />
36
85
  </IconButton>
37
86
  </Tooltip>
38
- <ToggleButton
39
- value="scrollZoom"
40
- selected={model.scrollZoom}
41
- aria-label="Toggle scroll-to-zoom"
42
- title="Toggle scroll-to-zoom (zoom on plain mouse wheel; ctrl+wheel always zooms)"
43
- size="small"
44
- sx={{ border: 'none' }}
45
- onChange={() => {
46
- model.setScrollZoom(!model.scrollZoom)
47
- }}
87
+ <CascadingMenuButton
88
+ data-testid="scroll_zoom_menu"
89
+ tooltip={`Mouse wheel: ${current.label.toLowerCase()} (ctrl+wheel always zooms)`}
90
+ anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}
91
+ transformOrigin={{ vertical: 'top', horizontal: 'left' }}
92
+ menuItems={[
93
+ { type: 'subHeader', label: 'Mouse wheel' },
94
+ ...wheelModes.map(({ label, axis, Icon, helpText }) => ({
95
+ label,
96
+ icon: Icon,
97
+ helpText,
98
+ type: 'radio' as const,
99
+ checked: current.label === label,
100
+ onClick: () => {
101
+ model.setScrollZoom(axis !== undefined)
102
+ if (axis !== undefined) {
103
+ model.setScrollZoomAxis(axis)
104
+ }
105
+ },
106
+ })),
107
+ ]}
48
108
  >
49
- <Mouse />
50
- </ToggleButton>
109
+ <current.Icon />
110
+ </CascadingMenuButton>
51
111
  </>
52
112
  )
53
113
  })
@@ -2,30 +2,29 @@ import { lazy } from 'react'
2
2
 
3
3
  import FilterAlt from '@mui/icons-material/FilterAlt'
4
4
  import FolderOpen from '@mui/icons-material/FolderOpen'
5
- import Search from '@mui/icons-material/Search'
5
+ import MenuBook from '@mui/icons-material/MenuBook'
6
6
  import Sort from '@mui/icons-material/Sort'
7
7
  import Visibility from '@mui/icons-material/Visibility'
8
8
 
9
9
  import type { MsaViewModel } from '../../model.ts'
10
10
 
11
11
  const FeatureFilterDialog = lazy(() => import('../dialogs/FeatureDialog.tsx'))
12
- const InterProScanFileDialog = lazy(
13
- () => import('../dialogs/InterProScanFileDialog.tsx'),
14
- )
15
- const InterProScanDialog = lazy(
16
- () => import('../dialogs/InterProScanDialog.tsx'),
12
+ const AnnotationFileDialog = lazy(
13
+ () => import('../dialogs/AnnotationFileDialog.tsx'),
17
14
  )
18
15
 
16
+ const domainsTutorial = 'https://gmod.org/JBrowseMSA/tutorials/protein_family'
17
+
19
18
  export function getAnnotationsMenu({ model }: { model: MsaViewModel }) {
20
19
  const { showDomains, actuallyShowDomains, subFeatureRows, noDomains } = model
21
20
  const noneLoaded = noDomains ? ' (none loaded)' : ''
22
21
  return [
23
22
  {
24
- label: 'Open InterProScan results...',
23
+ label: 'Open annotation file...',
25
24
  icon: FolderOpen,
26
25
  onClick: () => {
27
26
  model.queueDialog(handleClose => [
28
- InterProScanFileDialog,
27
+ AnnotationFileDialog,
29
28
  {
30
29
  handleClose,
31
30
  model,
@@ -33,17 +32,14 @@ export function getAnnotationsMenu({ model }: { model: MsaViewModel }) {
33
32
  ])
34
33
  },
35
34
  },
35
+ // `react-msaview-cli interpro` reads InterPro's precomputed matches in
36
+ // seconds, and `interproscan` covers rows InterPro has not seen; this links
37
+ // the tutorial for both
36
38
  {
37
- label: 'Query InterProScan...',
38
- icon: Search,
39
+ label: 'How to get a domain file...',
40
+ icon: MenuBook,
39
41
  onClick: () => {
40
- model.queueDialog(handleClose => [
41
- InterProScanDialog,
42
- {
43
- handleClose,
44
- model,
45
- },
46
- ])
42
+ window.open(domainsTutorial, '_blank', 'noopener,noreferrer')
47
43
  },
48
44
  },
49
45
  {
@@ -12,9 +12,7 @@ function toggle(label: string, checked: boolean, set: (arg: boolean) => void) {
12
12
  }
13
13
  }
14
14
 
15
- // Every track the alignment can show, with its current state. Without this the
16
- // "Close" item on a track's own dropdown is a one-way door -- there is nowhere
17
- // else in the UI to turn a track back on.
15
+ // the only place in the UI to turn a closed track back on
18
16
  function tracksSubMenu(model: MsaViewModel): MenuItem[] {
19
17
  const shown = new Set(model.turnedOnTracks.map(t => t.model.id))
20
18
  return model.tracks.map(({ model: { id, name } }) =>
@@ -33,14 +31,13 @@ export function msaSettingsMenuItems(model: MsaViewModel): MenuItem[] {
33
31
  subMenu: tracksSubMenu(model),
34
32
  },
35
33
  { type: 'divider' as const },
36
- toggle('Show column statistics on hover', showColumnStats, arg => {
34
+ toggle('Show track values on hover', showColumnStats, arg => {
37
35
  model.setShowColumnStats(arg)
38
36
  }),
39
37
  toggle('Draw letters', drawMsaLetters, arg => {
40
38
  model.setDrawMsaLetters(arg)
41
39
  }),
42
- // the checkbox reads as the inverse of the property it sets: bgColor draws
43
- // the tile, and turning it off is what leaves the letter itself colored
40
+ // inverted: bgColor colors the tile, and off colors the letter
44
41
  toggle('Color letters instead of background of tiles', !bgColor, arg => {
45
42
  model.setBgColor(!arg)
46
43
  }),
@@ -56,7 +53,9 @@ export function treeSettingsMenuItems(model: MsaViewModel): MenuItem[] {
56
53
  showBranchLen,
57
54
  labelsAlignRight,
58
55
  drawNodeBubbles,
56
+ drawNodeLabels,
59
57
  drawLabels,
58
+ showTreeOverview,
60
59
  } = model
61
60
  return [
62
61
  toggle('Show branch length', showBranchLen, arg => {
@@ -68,6 +67,12 @@ export function treeSettingsMenuItems(model: MsaViewModel): MenuItem[] {
68
67
  toggle('Draw bubbles on tree branches', drawNodeBubbles, arg => {
69
68
  model.setDrawNodeBubbles(arg)
70
69
  }),
70
+ toggle('Draw internal node labels', drawNodeLabels, arg => {
71
+ model.setDrawNodeLabels(arg)
72
+ }),
73
+ toggle('Show tree overview', showTreeOverview, arg => {
74
+ model.setShowTreeOverview(arg)
75
+ }),
71
76
  toggle('Tree labels align right', labelsAlignRight, arg => {
72
77
  model.setLabelsAlignRight(arg)
73
78
  }),
@@ -21,8 +21,8 @@ const ImportForm = observer(function ({ model }: { model: MsaViewModel }) {
21
21
  <div style={{ width: '50%' }}>
22
22
  {error ? <ErrorMessage error={error} /> : null}
23
23
  <Typography>
24
- Open an MSA file (stockholm or clustal format) and/or a tree file
25
- (newick format).
24
+ Open an MSA file (FASTA, Stockholm, Clustal, A3M or EMF format) and/or
25
+ a tree file (Newick format).
26
26
  </Typography>
27
27
  <Typography color="error">
28
28
  Note: you can open up just an MSA or just a tree, both are not
@@ -9,10 +9,10 @@ import { load } from './util.ts'
9
9
  import type { MsaViewModel } from '../../model.ts'
10
10
 
11
11
  const BASE = 'https://jbrowse.org/genomes/multiple_sequence_alignments'
12
- const TREES = 'https://jbrowse.org/genomes/newicktrees'
12
+ const TREES = 'https://jbrowse.org/genomes/newick_trees'
13
13
 
14
- // each example either points at remote files (msa/tree/gff urls) or carries its
15
- // data inline, which is what the two bundled small ones do
14
+ // each example points at remote files (msa/tree/gff urls) or carries its data
15
+ // inline, as the two small bundled ones do
16
16
  interface Example {
17
17
  label: string
18
18
  msa?: string
@@ -35,11 +35,7 @@ const examples: Example[] = [
35
35
  inline: { msa: smallMSAOnly },
36
36
  },
37
37
  {
38
- label: 'PFAM SARS-CoV2 multi-stockholm',
39
- msa: `${BASE}/pfam-cov2.stock`,
40
- },
41
- {
42
- label: 'PFAM SARS-CoV2 multi-stockholm w/ domains loaded',
38
+ label: 'PFAM SARS-CoV2 multi-stockholm with domains',
43
39
  msa: `${BASE}/pfam-cov2.stock`,
44
40
  gff: `${BASE}/pfam-cov2-domains.gff`,
45
41
  },
@@ -16,5 +16,7 @@ export function load(
16
16
  }
17
17
  if (gffFile) {
18
18
  model.setGFFFilehandle(gffFile)
19
+ // a file opened by hand shows even if the overlay was hidden earlier
20
+ model.setShowDomains(true)
19
21
  }
20
22
  }
@@ -15,8 +15,7 @@ const Minimap = observer(function ({ model }: { model: MsaViewModel }) {
15
15
  const theme = useTheme()
16
16
  const { unit, s, w, polygonHeight, polygonPoints } = getMinimapLayout(model)
17
17
 
18
- // the whole alignment, sampled down to the bar: it says where the conserved
19
- // blocks and the gappy stretches are, which is what a scroll aims at
18
+ // the whole alignment, sampled down to the bar
20
19
  const barWidth = Math.round(msaCanvasWidth * highResScaleFactor)
21
20
  const barHeight = Math.round(MINIMAP_BAR_HEIGHT * highResScaleFactor)
22
21
  const ref = useCanvasAutorun({
@@ -5,6 +5,9 @@ import ExpandMore from '@mui/icons-material/ExpandMore'
5
5
  import { IconButton, Paper, Typography } from '@mui/material'
6
6
  import { observer } from 'mobx-react'
7
7
 
8
+ import { legendZIndex } from '../../constants.ts'
9
+ import { legendRows } from './legendRows.ts'
10
+
8
11
  import type { MsaViewModel } from '../../model.ts'
9
12
 
10
13
  const AnnotationLegend = observer(function ({
@@ -12,65 +15,72 @@ const AnnotationLegend = observer(function ({
12
15
  }: {
13
16
  model: MsaViewModel
14
17
  }) {
15
- const {
16
- actuallyShowDomains,
17
- visibleDomainTypes: visible,
18
- fillPalette,
19
- showDomainLegend: expanded,
20
- } = model
18
+ const { legends, showDomainLegend: expanded } = model
19
+ const rows = legendRows(legends)
21
20
  const ExpandIcon = expanded ? ExpandLess : ExpandMore
22
21
 
23
- return actuallyShowDomains && visible.length > 0 ? (
22
+ return rows.length > 0 ? (
24
23
  <Paper
25
24
  elevation={3}
26
25
  style={{
27
26
  position: 'absolute',
28
27
  top: 4,
29
28
  right: 4,
30
- zIndex: 100,
31
- maxWidth: 260,
29
+ zIndex: legendZIndex,
30
+ maxWidth: 220,
32
31
  maxHeight: '60%',
33
32
  display: 'flex',
34
33
  flexDirection: 'column',
35
34
  opacity: 0.95,
36
35
  }}
37
36
  >
38
- <div
39
- style={{
40
- display: 'flex',
41
- alignItems: 'center',
42
- justifyContent: 'flex-end',
43
- padding: '2px 4px 2px 8px',
37
+ <IconButton
38
+ size="small"
39
+ title={expanded ? 'Collapse key' : 'Expand key'}
40
+ style={
41
+ expanded
42
+ ? { position: 'absolute', top: 0, right: 0, padding: 1 }
43
+ : { padding: 1 }
44
+ }
45
+ onClick={() => {
46
+ model.setShowDomainLegend(!expanded)
44
47
  }}
45
48
  >
46
- <IconButton
47
- size="small"
48
- title={expanded ? 'Collapse key' : 'Expand key'}
49
- onClick={() => {
50
- model.setShowDomainLegend(!expanded)
51
- }}
52
- >
53
- <ExpandIcon fontSize="small" />
54
- </IconButton>
55
- </div>
49
+ <ExpandIcon style={{ fontSize: 14 }} />
50
+ </IconButton>
56
51
  {expanded ? (
57
- <div style={{ overflow: 'auto', padding: '0 8px 6px' }}>
58
- {visible.map(({ accession, name }) => (
52
+ <div style={{ overflow: 'auto', padding: '2px 6px 4px' }}>
53
+ {rows.map((row, i) => (
59
54
  <div
60
- key={accession}
61
- style={{ display: 'flex', alignItems: 'center', gap: 6 }}
62
- title={accession}
55
+ key={row.key}
56
+ style={{
57
+ display: 'flex',
58
+ alignItems: 'center',
59
+ gap: 4,
60
+ marginRight: i === 0 ? 18 : 0,
61
+ }}
62
+ title={row.hint}
63
63
  >
64
- <div
64
+ {row.color ? (
65
+ <div
66
+ style={{
67
+ width: 9,
68
+ height: 9,
69
+ flexShrink: 0,
70
+ background: row.color,
71
+ }}
72
+ />
73
+ ) : null}
74
+ <Typography
75
+ variant="caption"
76
+ noWrap
65
77
  style={{
66
- width: 12,
67
- height: 12,
68
- flexShrink: 0,
69
- background: fillPalette[accession],
78
+ fontSize: 10,
79
+ lineHeight: 1.4,
80
+ fontWeight: row.color ? undefined : 'bold',
70
81
  }}
71
- />
72
- <Typography variant="caption" noWrap>
73
- {name}
82
+ >
83
+ {row.label}
74
84
  </Typography>
75
85
  </div>
76
86
  ))}
@@ -34,7 +34,7 @@ const MSACanvas = observer(function ({ model }: { model: MsaViewModel }) {
34
34
  )
35
35
  const onZoom = useCallback(
36
36
  (scaleFactor: number, offsetX: number, offsetY: number) => {
37
- model.zoomToPos(scaleFactor, offsetX, offsetY)
37
+ model.zoomToPos(scaleFactor, offsetX, offsetY, model.wheelZoomAxis)
38
38
  },
39
39
  [model],
40
40
  )
@@ -49,10 +49,8 @@ const MSACanvas = observer(function ({ model }: { model: MsaViewModel }) {
49
49
  return (
50
50
  <div
51
51
  ref={ref}
52
- // the MSA viewport: its rect is the origin every column/row offset is
53
- // measured from (col*colWidth + scrollX, row*rowHeight + scrollY), which
54
- // is what lets a screenshot callout anchor to an alignment column instead
55
- // of a hand-measured pixel
52
+ // screenshot callouts anchor to columns from this rect's origin:
53
+ // col*colWidth + scrollX, row*rowHeight + scrollY
56
54
  data-testid="msa_canvas"
57
55
  onMouseDown={onMouseDown}
58
56
  onMouseUp={onMouseUp}
@@ -1,11 +1,10 @@
1
1
  import React from 'react'
2
2
 
3
3
  import BaseTooltip from '@jbrowse/core/ui/BaseTooltip'
4
+ import { useTheme } from '@mui/material'
4
5
  import { observer } from 'mobx-react'
5
6
 
6
7
  import { useCanvasAutorun } from '../../useCanvasAutorun.ts'
7
- import { useColorContrast } from '../../useColorContrast.ts'
8
- import ColumnStats from './ColumnStats.tsx'
9
8
  import { drawMsaRaster, rasterSupported } from './msaRaster.ts'
10
9
  import { renderBoxFeatureCanvasBlock } from './renderBoxFeatureCanvasBlock.ts'
11
10
  import { renderMSABlock } from './renderMSABlock.ts'
@@ -22,8 +21,8 @@ const MSACanvasBlock = observer(function ({
22
21
  offsetX: number
23
22
  offsetY: number
24
23
  }) {
25
- const { colorScheme, blockSize, highResScaleFactor } = model
26
- const { theme, contrastScheme } = useColorContrast(colorScheme)
24
+ const { blockSize, highResScaleFactor } = model
25
+ const theme = useTheme()
27
26
  const { tooltipPoint, onMouseMove, onClick, onMouseLeave } = useMsaBlockMouse(
28
27
  {
29
28
  model,
@@ -39,6 +38,7 @@ const MSACanvasBlock = observer(function ({
39
38
  ctx.clearRect(0, 0, canvasSize, canvasSize)
40
39
  renderBoxFeatureCanvasBlock({
41
40
  ctx,
41
+ theme,
42
42
  offsetX,
43
43
  offsetY,
44
44
  model,
@@ -56,17 +56,16 @@ const MSACanvasBlock = observer(function ({
56
56
  theme,
57
57
  offsetX,
58
58
  offsetY,
59
- contrastScheme,
60
59
  model,
61
60
  rasterTiles,
62
61
  })
63
62
  },
64
63
  width: canvasSize,
65
64
  height: canvasSize,
66
- deps: [model, offsetX, offsetY, theme, contrastScheme],
65
+ deps: [model, offsetX, offsetY, theme],
67
66
  })
68
67
 
69
- const { hoveredInsertion, mouseOverDomains, showColumnStats } = model
68
+ const { hoveredInsertion, mouseOverDomains } = model
70
69
 
71
70
  return (
72
71
  <>
@@ -108,20 +107,17 @@ const MSACanvasBlock = observer(function ({
108
107
  : hoveredInsertion.letters}
109
108
  </>
110
109
  ) : (
111
- <>
112
- {mouseOverDomains.map(d => (
113
- <div key={`${d.accession}-${d.start}-${d.end}`}>
114
- <b>{d.name}</b> ({d.accession}) {d.start}-{d.end}
115
- {d.description ? (
116
- <>
117
- <br />
118
- {d.description}
119
- </>
120
- ) : null}
121
- </div>
122
- ))}
123
- {showColumnStats ? <ColumnStats model={model} /> : null}
124
- </>
110
+ mouseOverDomains.map(d => (
111
+ <div key={`${d.accession}-${d.start}-${d.end}`}>
112
+ <b>{d.name}</b> ({d.accession}) {d.start}-{d.end}
113
+ {d.description ? (
114
+ <>
115
+ <br />
116
+ {d.description}
117
+ </>
118
+ ) : null}
119
+ </div>
120
+ ))
125
121
  )}
126
122
  </BaseTooltip>
127
123
  ) : null}
@@ -4,6 +4,7 @@ import { isAlive } from '@jbrowse/mobx-state-tree'
4
4
  import { useTheme } from '@mui/material'
5
5
  import { observer } from 'mobx-react'
6
6
 
7
+ import { msaOverlayZIndex } from '../../constants.ts'
7
8
  import { useCanvasAutorun } from '../../useCanvasAutorun.ts'
8
9
  import { renderMouseover } from './renderMSAMouseover.ts'
9
10
 
@@ -41,7 +42,7 @@ const MSAMouseoverCanvas = observer(function ({
41
42
  left: 0,
42
43
  width,
43
44
  height,
44
- zIndex: 1000,
45
+ zIndex: msaOverlayZIndex,
45
46
  pointerEvents: 'none',
46
47
  }}
47
48
  />
@@ -1,19 +1,15 @@
1
1
  import type { DomainBand } from '../../types.ts'
2
2
 
3
3
  /**
4
- * Left-to-right cursor over one row's domain bands, answering "which band is
5
- * drawn on top at this column" — the fill a letter there has to contrast
6
- * against.
4
+ * Left-to-right cursor over one row's domain bands that returns the band drawn
5
+ * on top at a column, for a letter's contrast color.
7
6
  *
8
- * Not simply the first band covering the column. The overlay paints in
9
- * `domainBands` order, largest first, so where signatures nest — a family
10
- * enclosing a domain, which InterProScan emits routinely — the box a reader
11
- * actually sees is the last one painted over that column. `stackIndex` is that
12
- * paint order.
7
+ * The overlay paints in `domainBands` order, largest first, so where signatures
8
+ * nest (InterProScan often emits a family enclosing a domain) the visible band
9
+ * is the last one painted. `stackIndex` is that paint order.
13
10
  *
14
- * `bands` must be sorted by start column (`domainBandsByStart`), and columns
15
- * must be visited in increasing order, which is what the block renderer does.
16
- * Both keep this to one pass over the bands per row rather than a scan per cell.
11
+ * `bands` must be sorted by start column (`domainBandsByStart`) and columns
12
+ * visited in increasing order, which keeps this to one pass per row.
17
13
  */
18
14
  export function domainBandCursor(bands: DomainBand[] | undefined) {
19
15
  let next = 0