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,5 +1,3 @@
1
- import { isBlank } from './util.ts'
2
-
3
1
  /**
4
2
  * MSA Coordinate Systems:
5
3
  *
@@ -81,9 +79,8 @@ function countBlanksBefore(blanks: number[], globalCol: number) {
81
79
  * that is its own visible index; for a hidden one it is the index of the next
82
80
  * visible column, i.e. where the hidden column collapses to.
83
81
  *
84
- * That total answer is what spans want: resolving both ends of a span through
85
- * globalColToVisibleCol instead loses the whole span whenever either end lands
86
- * in a hidden column.
82
+ * Spans use this, since globalColToVisibleCol drops a span whenever either end
83
+ * lands in a hidden column.
87
84
  *
88
85
  * @param blanks - Sorted array of global column indices that are hidden
89
86
  * @param globalCol - The global column index in the full MSA
@@ -93,65 +90,22 @@ export function visibleColsBefore(blanks: number[], globalCol: number) {
93
90
  }
94
91
 
95
92
  /**
96
- * Convert a visible column to a row-specific sequence position.
97
- * Returns undefined if the position is a gap in the sequence.
93
+ * The ungapped position a row holds at a global column, or undefined when that
94
+ * column is a gap in the row or past its end.
98
95
  *
99
- * @param seq - The row's sequence string (including gaps)
100
- * @param blanks - Sorted array of global column indices that are hidden
101
- * @param visibleCol - The visible column index
102
- * @returns The sequence position, or undefined if it's a gap
96
+ * Binary-searches the row's ascending seqPos index; it runs on every mouse
97
+ * move, and scanning a 30k-column row per event takes the whole frame.
98
+ *
99
+ * @param index - The row's seqPos -> global column index (buildSeqPosIndex)
100
+ * @param globalCol - The global column index in the full MSA
103
101
  */
104
- export function visibleColToSeqPos({
105
- seq,
106
- blanks,
107
- visibleCol,
108
- }: {
109
- seq: string
110
- blanks: number[]
111
- visibleCol: number
112
- }) {
113
- // First convert the visible column to global column
114
- const globalCol = visibleColToGlobalCol(blanks, visibleCol)
115
- const seqLen = seq.length
116
-
117
- // Check if the position in the sequence is a gap
118
- if (globalCol < seqLen && isBlank(seq[globalCol])) {
102
+ export function seqPosOfGlobalCol(
103
+ index: Int32Array | undefined,
104
+ globalCol: number,
105
+ ) {
106
+ if (!index) {
119
107
  return undefined
120
108
  }
121
-
122
- // Count non-gap characters up to the global position
123
- let seqPos = 0
124
- for (let i = 0; i < globalCol && i < seqLen; i++) {
125
- if (!isBlank(seq[i])) {
126
- seqPos++
127
- }
128
- }
129
-
130
- return globalCol < seqLen ? seqPos : undefined
131
- }
132
-
133
- /**
134
- * Convert a visible column to a row-specific sequence position, with row lookup.
135
- *
136
- * @param rowName - The name of the row
137
- * @param visibleCol - The visible column index
138
- * @param rowMap - Map from row name to sequence string
139
- * @param blanks - Sorted array of global column indices that are hidden
140
- * @returns The sequence position, or undefined if row not found or position is a gap
141
- */
142
- export function visibleColToSeqPosForRow({
143
- rowName,
144
- visibleCol,
145
- rowMap,
146
- blanks,
147
- }: {
148
- rowName: string
149
- visibleCol: number
150
- rowMap: Map<string, string>
151
- blanks: number[]
152
- }) {
153
- const seq = rowMap.get(rowName)
154
- return seq !== undefined
155
- ? visibleColToSeqPos({ seq, visibleCol, blanks })
156
- : undefined
109
+ const seqPos = partitionPoint(index.length, i => index[i]! >= globalCol)
110
+ return index[seqPos] === globalCol ? seqPos : undefined
157
111
  }
package/src/scales.ts ADDED
@@ -0,0 +1,47 @@
1
+ import { createPaletteMap } from './createPaletteMap.ts'
2
+ import { paletteNamed } from './ggplotPalettes.ts'
3
+
4
+ import type { LegendEntry } from './types.ts'
5
+
6
+ /** how a channel reads a field: a palette by name, or a color per value */
7
+ export interface ScaleSpec {
8
+ palette?: string
9
+ map?: Record<string, string>
10
+ }
11
+
12
+ export interface ResolvedScale {
13
+ kind: 'categorical'
14
+ colorOf: (value: string) => string | undefined
15
+ legend: LegendEntry[]
16
+ }
17
+
18
+ /**
19
+ * The scale a channel reads its field through. `values` are the field's values,
20
+ * in any order and with repeats; the domain is their distinct values sorted, so
21
+ * a value keeps its color when rows are re-ordered, collapsed or filtered.
22
+ *
23
+ * `{map}` colors the values the producer named and leaves the rest uncolored.
24
+ * `{palette}` takes the colors of a named palette, and a spec with neither
25
+ * takes the ggplot palette of the domain's size. Every scale is categorical
26
+ * today; a continuous one waits for a caller.
27
+ */
28
+ export function resolveScale(
29
+ spec: ScaleSpec | undefined,
30
+ values: Iterable<string>,
31
+ ): ResolvedScale {
32
+ const domain = [...new Set(values)].sort((a, b) => a.localeCompare(b))
33
+ const { map, palette } = spec ?? {}
34
+ const colors = map ?? createPaletteMap(domain, paletteNamed(palette))
35
+ const present = new Set(domain)
36
+ const labels = map ? Object.keys(map).filter(v => present.has(v)) : domain
37
+ return {
38
+ kind: 'categorical',
39
+ colorOf: (value: string) => colors[value],
40
+ // a categorical value is its own label, and the id a legend keys on
41
+ legend: labels.map(value => ({
42
+ id: value,
43
+ label: value,
44
+ color: colors[value]!,
45
+ })),
46
+ }
47
+ }
@@ -2,9 +2,8 @@
2
2
  * The global column of every ungapped sequence position in a row, i.e.
3
3
  * index[seqPos] is the column holding the seqPos-th non-gap character.
4
4
  *
5
- * A row is indexed once and then answers seqPos -> column by lookup, which is
6
- * what makes the domain overlay affordable: it resolves one position per feature
7
- * per row on every redraw, and scanning the row for each would be quadratic.
5
+ * The domain overlay resolves one position per feature per row on every redraw,
6
+ * and scanning the row for each would be quadratic.
8
7
  *
9
8
  * @example
10
9
  * // Row: "A-TG-C" (A at 0, T at 2, G at 3, C at 5)
@@ -19,5 +18,7 @@ export function buildSeqPosIndex(row: string) {
19
18
  index[n++] = col
20
19
  }
21
20
  }
22
- return index.subarray(0, n)
21
+ // slice, not subarray: a subarray keeps the whole row-length buffer alive,
22
+ // and a gappy alignment's indexes are held for as long as the parse is
23
+ return index.slice(0, n)
23
24
  }
@@ -19,18 +19,13 @@ export function maxBitsFor(sequenceType: 'dna' | 'rna' | 'amino') {
19
19
  * stack bottom-up in array order.
20
20
  *
21
21
  * Heights follow Schneider & Stephens: the column's information content is
22
- * `log2(alphabet) - H` bits, and each residue takes the share of that its own
23
- * frequency earns. Frequencies come from the non-gap residues only, so a column
24
- * of two residues and eight gaps is read as a two-way choice rather than a
25
- * ten-way one -- otherwise every gappy column would look uninformative for the
26
- * wrong reason.
22
+ * `log2(alphabet) - H` bits, split among residues by frequency. Frequencies
23
+ * count non-gap residues only, so two residues and eight gaps form a two-way
24
+ * choice.
27
25
  *
28
- * The whole stack is then scaled by the non-gap fraction, which plain WebLogo
29
- * does not do. Here it earns its place: the track sits directly under an
30
- * alignment where the gaps are visible, and a column that is 90% gap drawing a
31
- * full-height stack off its one remaining pair of residues reads as a conserved
32
- * site. Scaling makes stack height mean "how much this column tells you about
33
- * the family", matching what the conservation track above it already plots.
26
+ * Unlike plain WebLogo, the stack is then scaled by the non-gap fraction, so a
27
+ * 90%-gap column with one conserved pair does not draw a full-height stack, and
28
+ * stack height matches the conservation track.
34
29
  */
35
30
  export function columnLogoStack(
36
31
  colStats: ColumnCounts,
@@ -9,21 +9,14 @@ import type {
9
9
  /**
10
10
  * `types.stripDefault`, degrading to `types.optional` on hosts that lack it.
11
11
  *
12
- * stripDefault keeps defaulted properties out of snapshots, but it exists only
13
- * in the mobx-state-tree that ships with unreleased @jbrowse/core. This package
14
- * declares `@jbrowse/mobx-state-tree: ^5.0.0`, and inside jbrowse-web the host
15
- * supplies its own copy at runtime -- the plugin bundle externalizes it -- so we
16
- * genuinely do not know which version we are calling until we are running.
12
+ * stripDefault keeps defaulted properties out of snapshots, and only the
13
+ * mobx-state-tree in unreleased @jbrowse/core has it. The plugin bundle
14
+ * externalizes mobx-state-tree, so the host's copy is known only at runtime, and
15
+ * calling a missing stripDefault during model construction makes PluginLoader
16
+ * reject and the whole app show its error page.
17
17
  *
18
- * Calling it where it is absent throws while the model is being constructed,
19
- * which in a plugin bundle means PluginLoader rejects and the entire app renders
20
- * its error page. Losing minimal snapshots is a far better failure than losing
21
- * the session, so this degrades instead.
22
- *
23
- * The two signatures are identical, so behaviour differs only in that defaults
24
- * reappear in snapshots on older hosts (bigger session snapshots and shared
25
- * URLs, nothing incorrect). stripDefaultSnapshot.test.ts still pins the stripped
26
- * behaviour, since dev runs against a version that has it.
18
+ * The signatures are identical; on older hosts, defaults reappear in snapshots
19
+ * and shared URLs. stripDefaultSnapshot.test.ts pins the stripped behaviour.
27
20
  */
28
21
  export function stripDefault<IT extends IAnyType>(
29
22
  type: IT,
package/src/types.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { ResolvedScale, ScaleSpec } from './scales.ts'
1
2
  import type { Annotation } from 'msa-parsers'
2
3
 
3
4
  export interface Accession {
@@ -5,10 +6,16 @@ export interface Accession {
5
6
  name: string
6
7
  description: string
7
8
  }
8
- // which renderer draws a track's content. Every track kind draws into the same
9
- // per-column coordinate space, so the kind picks the draw function rather than
10
- // the geometry -- see drawTracks.ts, which dispatches on it.
11
- export type TrackKind = 'text' | 'bar' | 'logo'
9
+ // every kind draws into the same per-column space; drawTracks.ts dispatches on
10
+ // it to pick the draw function
11
+ export type TrackKind = 'text' | 'bar' | 'logo' | 'arc' | 'ruler'
12
+
13
+ /**
14
+ * Which channel the color scheme paints. `fill` colors the cell a residue sits
15
+ * in, `color` colors the letter itself, the same distinction a grammar of
16
+ * graphics draws between a shape's interior and its own ink.
17
+ */
18
+ export type ResidueEncoding = 'fill' | 'color'
12
19
 
13
20
  export interface BasicTrackModel {
14
21
  id: string
@@ -16,6 +23,11 @@ export interface BasicTrackModel {
16
23
  associatedRowName?: string
17
24
  height: number
18
25
  kind: TrackKind
26
+ // the model height this track's divider writes, shared with every track
27
+ // carrying the same key. Absent on a track no divider resizes.
28
+ heightKey?: string
29
+ // hidden until the user asks for it, unless they have already chosen
30
+ defaultOff?: boolean
19
31
  }
20
32
 
21
33
  export interface TextTrackModel extends BasicTrackModel {
@@ -29,20 +41,45 @@ export interface BarTrackModel extends BasicTrackModel {
29
41
  barColor?: string
30
42
  }
31
43
 
44
+ // a pair of columns joined by an arc, resolved to 0-based visible columns for
45
+ // the renderer
46
+ export interface Arc {
47
+ start: number
48
+ end: number
49
+ color?: string
50
+ }
51
+
52
+ // a track that joins pairs of columns with arcs (RNA base pairs, disulfide
53
+ // bonds, residue contacts)
54
+ export interface ArcTrackModel extends BasicTrackModel {
55
+ arcs?: Arc[]
56
+ arcColor?: string
57
+ }
58
+
32
59
  export interface BasicTrack {
33
60
  ReactComponent: React.FC<any>
34
- model: TextTrackModel & BarTrackModel
61
+ model: TextTrackModel & BarTrackModel & ArcTrackModel
62
+ }
63
+
64
+ // one arc of an arc track, in the snapshot's own coordinates: 1-based and
65
+ // inclusive, alignment columns unless the track names a `row`
66
+ export interface ArcSpec {
67
+ start: number
68
+ end: number
69
+ color?: string
35
70
  }
36
71
 
37
72
  // a track supplied as data in the snapshot rather than computed from the
38
73
  // alignment. `values` (bar) or `data` (text) index alignment columns, or the
39
- // 1-based residues of `row` when it names one
74
+ // 1-based residues of `row` when it names one; `arcs` (arc) name two such
75
+ // positions each
40
76
  export interface ColumnTrackSpec {
41
77
  id: string
42
78
  name: string
43
- kind: 'bar' | 'text'
79
+ kind: 'bar' | 'text' | 'arc'
44
80
  values?: number[]
45
81
  data?: string
82
+ arcs?: ArcSpec[]
46
83
  max?: number
47
84
  color?: string
48
85
  colors?: Record<string, string>
@@ -50,20 +87,225 @@ export interface ColumnTrackSpec {
50
87
  height?: number
51
88
  }
52
89
 
53
- // the overlay annotation itself lives in msa-parsers, alongside the adapters
54
- // that build it. TidyDomainAnnotation is its former name, kept because
55
- // downstream plugins name it in their emitted declarations.
90
+ /**
91
+ * A strip panel: one cell per row, colored from a `rowData` field through
92
+ * `scale`, which is ggtree's `gheatmap`. `width` is in pixels and defaults to
93
+ * the row height, and `header` labels the column and defaults to the field.
94
+ * `legend` titles the strip's legend and defaults to the field, and strips
95
+ * naming one title share one legend.
96
+ */
97
+ export interface RowStripSpec {
98
+ kind: 'strip'
99
+ field: string
100
+ scale?: ScaleSpec
101
+ width?: number
102
+ header?: string
103
+ legend?: string
104
+ }
105
+
106
+ /** the channels a `features` panel reads off the feature table */
107
+ export interface FeatureEncodingSpec {
108
+ color?: { field: string; scale?: ScaleSpec }
109
+ label?: string
110
+ }
111
+
112
+ /**
113
+ * Shifts each row so that the first feature named `on` starts at zero, which
114
+ * is gggenes' `make_alignment_dummies`. Only `x: "position"` reads it.
115
+ */
116
+ export interface AlignTransform {
117
+ type: 'align'
118
+ on: string
119
+ }
120
+
121
+ /**
122
+ * A features panel: the GFF's spans per row, as arrows where they carry a
123
+ * strand. `x: "column"` draws them in the alignment's columns, and
124
+ * `x: "position"` in each row's own residue positions on one linear scale, so
125
+ * a genome with no alignment has an x.
126
+ */
127
+ export interface RowFeaturesSpec {
128
+ kind: 'features'
129
+ x: 'column' | 'position'
130
+ width?: number
131
+ header?: string
132
+ encoding?: FeatureEncodingSpec
133
+ transform?: AlignTransform[]
134
+ }
135
+
136
+ /**
137
+ * A panel left of the alignment on the row scale, the counterpart of
138
+ * ColumnTrackSpec on the column scale. See docs/layers.md
139
+ */
140
+ export type RowPanelSpec = RowStripSpec | RowFeaturesSpec
141
+
142
+ interface ResolvedPanelBase {
143
+ id: string
144
+ header: string
145
+ width: number
146
+ offsetX: number
147
+ legend: LegendEntry[]
148
+ /** the legend this panel's entries go under; absent means the domain key */
149
+ legendTitle?: string
150
+ }
151
+
152
+ /**
153
+ * A strip with its scale resolved: the color each row takes, keyed by row
154
+ * name, and the pixel column the panel draws in.
155
+ */
156
+ export interface ResolvedStripPanel extends ResolvedPanelBase {
157
+ kind: 'strip'
158
+ field: string
159
+ colors: Map<string, string>
160
+ }
161
+
162
+ /** one feature of a features panel, at its pixel span inside the panel */
163
+ export interface RowPanelSpan {
164
+ annotation: Annotation
165
+ xStart: number
166
+ xEnd: number
167
+ lane: number
168
+ laneCount: number
169
+ }
170
+
171
+ /**
172
+ * A features panel with its x mapping and its scale resolved: the spans per
173
+ * row name in panel pixels, the fill and outline of each feature, and the
174
+ * label its `label` channel draws. `field` is the field its color scale reads,
175
+ * which its legend is titled by.
176
+ */
177
+ export interface ResolvedFeaturePanel extends ResolvedPanelBase {
178
+ kind: 'features'
179
+ x: 'column' | 'position'
180
+ field?: string
181
+ spans: Map<string, RowPanelSpan[]>
182
+ colors: Map<Annotation, { fill: string; stroke: string }>
183
+ labels?: Map<Annotation, string>
184
+ }
185
+
186
+ export type ResolvedRowPanel = ResolvedStripPanel | ResolvedFeaturePanel
187
+
188
+ // One contiguous run where a row's residues and a structure's line up 1:1, as
189
+ // SIFTS reports them. A position no segment covers is unmapped.
190
+ export interface ResidueSegment {
191
+ rowStart: number
192
+ rowEnd: number
193
+ structStart: number
194
+ structEnd: number
195
+ }
196
+
197
+ // the structure half of a mapping. `id` is whatever the producer calls the
198
+ // entry (a PDB id, an AlphaFold accession); `asymId` names the chain and
199
+ // distinguishes two mappings onto the same entry
200
+ export interface MappedStructure {
201
+ id: string
202
+ kind?: 'experimental' | 'predicted'
203
+ asymId?: string
204
+ url?: string
205
+ }
206
+
207
+ /**
208
+ * The structure residue for each residue of a row, computed outside the viewer
209
+ * (SIFTS, an AlphaFold model, a curator). Sequence equality misplaces tagged
210
+ * constructs, truncations and subsequence rows; see docs/layers.md.
211
+ *
212
+ * Positions are 1-based and inclusive on both sides, as GFF and `highlights`
213
+ * are. Structure positions are `label_seq_id`, the index into the entity's
214
+ * SEQRES; author numbering carries insertion codes and is not used.
215
+ *
216
+ * `unobserved` is in structure positions: present in SEQRES with no
217
+ * coordinates, as distinct from a residue the structure lacks.
218
+ */
219
+ export interface ResidueMapping {
220
+ row: string
221
+ accession?: string
222
+ structure: MappedStructure
223
+ segments: ResidueSegment[]
224
+ unobserved?: [number, number][]
225
+ /**
226
+ * ungapped length of the row this was computed against. When set, the viewer
227
+ * ignores the mapping if the loaded row's length differs, as it does after a
228
+ * re-alignment, revision or swapped sequence.
229
+ */
230
+ rowLength?: number
231
+ generated?: {
232
+ by?: string
233
+ date?: string
234
+ sourceSha256?: string
235
+ }
236
+ }
237
+
238
+ // why a mapping, or one segment of it, is ignored, so a host can tell "no
239
+ // structure for this row" from "the mapping no longer matches what is loaded"
240
+ export interface ResidueMappingProblem {
241
+ row: string
242
+ structureId: string
243
+ /**
244
+ * `mapping` ignores the whole mapping, because the problem concerns its row.
245
+ * `segment` ignores only that segment and keeps the rest.
246
+ */
247
+ scope: 'mapping' | 'segment'
248
+ reason: string
249
+ }
250
+
251
+ // a lookup result in either direction. `observed` is false for a residue in
252
+ // SEQRES with no coordinates.
253
+ export interface StructureResidue {
254
+ structure: MappedStructure
255
+ position: number
256
+ observed: boolean
257
+ }
258
+
259
+ export interface RowResidue {
260
+ rowName: string
261
+ seqPos: number
262
+ }
263
+
264
+ /**
265
+ * One loaded document that the snapshot omits, and its size. `what` uses the
266
+ * import form's names for the documents.
267
+ */
268
+ export interface UnshareableData {
269
+ what: 'alignment' | 'tree' | 'annotations' | 'row metadata' | 'data tracks'
270
+ bytes: number
271
+ }
272
+
273
+ // Annotation is defined in msa-parsers. Downstream plugins' emitted
274
+ // declarations still name TidyDomainAnnotation.
56
275
  export type { Annotation }
57
276
  export type TidyDomainAnnotation = Annotation
58
277
 
59
278
  // an annotation resolved to the visible column span it is drawn across.
60
- // stackIndex is its position among the bands its row actually draws, which the
61
- // sub-row layout uses to stack boxes.
279
+ // stackIndex is its position in its row's paint order; lane is the sub-row it
280
+ // occupies, out of the laneCount the row's overlaps need.
62
281
  export interface DomainBand {
63
282
  annotation: Annotation
64
283
  startCol: number
65
284
  endCol: number
66
285
  stackIndex: number
286
+ lane: number
287
+ laneCount: number
288
+ }
289
+
290
+ /**
291
+ * One swatch of a categorical color key. `id` is the value the scale read, and
292
+ * `label` is the text drawn beside the swatch.
293
+ */
294
+ export interface LegendEntry {
295
+ id: string
296
+ label: string
297
+ color: string
298
+ }
299
+
300
+ /**
301
+ * A categorical color key, drawn by the on-screen overlay and reserved as a
302
+ * column in the SVG export. `title` names the legend where the viewer draws
303
+ * more than one.
304
+ */
305
+ export interface Legend {
306
+ id: string
307
+ title: string
308
+ entries: LegendEntry[]
67
309
  }
68
310
 
69
311
  /**
@@ -80,6 +322,104 @@ export interface Highlight {
80
322
  color?: string
81
323
  }
82
324
 
325
+ /**
326
+ * What the viewer draws over a clade. `highlight` fills the rows behind it,
327
+ * across the tree and the alignment. `bracket` draws a bar and the clade's
328
+ * `label` in the gutter right of the tip labels. `collapse` and `focus` seed
329
+ * the collapsed list and the subtree in focus at load.
330
+ */
331
+ export type CladeMark = 'highlight' | 'bracket' | 'collapse' | 'focus'
332
+
333
+ /**
334
+ * A clade of the tree and the mark drawn over it. `mrca` names tips whose most
335
+ * recent common ancestor is the clade; `range` names the first and last tip of
336
+ * a run in display order, in either order. `tips` is the leaf count the
337
+ * producer measured, and a clade that resolves to a different count is dropped.
338
+ * `label` names the clade beside a bracket, and a highlight carrying one draws
339
+ * the label without the bar. See docs/layers.md
340
+ */
341
+ export interface Clade {
342
+ mrca?: string[]
343
+ range?: [string, string]
344
+ tips: number
345
+ mark: CladeMark
346
+ color?: string
347
+ label?: string
348
+ }
349
+
350
+ /**
351
+ * A Clade resolved to the rows it covers, with its fill color settled. `color`
352
+ * is the highlight fill; `markColor` is the producer's own color for a bracket
353
+ * bar and its label, unset where the theme's text color stands. `nodeId` is the
354
+ * node an `mrca` resolved to, which `collapse` and `focus` seed themselves
355
+ * with, and a `range` record has none.
356
+ */
357
+ export interface ResolvedClade {
358
+ rows: [number, number]
359
+ mark: CladeMark
360
+ color: string
361
+ markColor?: string
362
+ label?: string
363
+ nodeId?: string
364
+ }
365
+
366
+ /**
367
+ * A span in Highlight coordinates: 1-based inclusive residues of `row`, or
368
+ * columns of the file without it
369
+ */
370
+ export interface Region {
371
+ row?: string
372
+ start: number
373
+ end: number
374
+ }
375
+
376
+ /**
377
+ * A cell of the alignment in the host's coordinates, 1-based like Highlight:
378
+ * `column` counts every column of the file, hidden gappy ones included, and
379
+ * `residue` counts the row's own letters, absent on a gap. A pointer over a
380
+ * track has a column and no row.
381
+ */
382
+ export interface Cell {
383
+ column: number
384
+ row?: string
385
+ residue?: number
386
+ letter?: string
387
+ }
388
+
389
+ /** the alignment columns on screen, 1-based and inclusive */
390
+ export interface Viewport {
391
+ startColumn: number
392
+ endColumn: number
393
+ }
394
+
395
+ /**
396
+ * A channel of a mark the viewer always draws. `tipLabel` colors each tip label
397
+ * in the tree, `rowTint` washes the row across the tree gutter and the
398
+ * alignment, and `branch` colors a tree edge whose tips all share one value;
399
+ * all three read a field of `rowData`. `featureFill` colors each span of the
400
+ * annotation overlay and `featureLabel` names the field drawn inside a span,
401
+ * both from a field of the feature table.
402
+ */
403
+ export type EncodingChannel =
404
+ | 'tipLabel'
405
+ | 'rowTint'
406
+ | 'branch'
407
+ | 'featureFill'
408
+ | 'featureLabel'
409
+
410
+ /**
411
+ * A channel, the field feeding it, and the scale it reads that field through.
412
+ * See docs/layers.md
413
+ */
414
+ export interface Encoding {
415
+ channel: EncodingChannel
416
+ field: string
417
+ scale?: ScaleSpec
418
+ }
419
+
420
+ /** an Encoding with its scale resolved against the values in the table */
421
+ export type ResolvedEncoding = Encoding & ResolvedScale
422
+
83
423
  /** a Highlight resolved to visible column indices and row indices */
84
424
  export interface ResolvedHighlight {
85
425
  startCol?: number
package/src/umd.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  import * as React from 'react'
2
2
 
3
- // a host that swaps models (the R htmlwidget on re-render) has to destroy the
4
- // old one, or the disposers its autoruns registered never run
3
+ // a page that builds models with MSAModelF destroys each one it replaces, so
4
+ // the disposers its autoruns registered run
5
5
  export { destroy } from '@jbrowse/mobx-state-tree'
6
6
  export { default as MSAView } from './components/Loading.tsx'
7
+ export { mount } from './mount.tsx'
8
+ export { defineMsaElement } from './element.ts'
7
9
  export { type MsaViewModel, default as MSAModelF } from './model.ts'
8
10
 
9
11
  export * from 'react-dom/client'