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
package/dist/types.d.ts CHANGED
@@ -1,16 +1,25 @@
1
+ import type { ResolvedScale, ScaleSpec } from './scales.ts';
1
2
  import type { Annotation } from 'msa-parsers';
2
3
  export interface Accession {
3
4
  accession: string;
4
5
  name: string;
5
6
  description: string;
6
7
  }
7
- export type TrackKind = 'text' | 'bar' | 'logo';
8
+ export type TrackKind = 'text' | 'bar' | 'logo' | 'arc' | 'ruler';
9
+ /**
10
+ * Which channel the color scheme paints. `fill` colors the cell a residue sits
11
+ * in, `color` colors the letter itself, the same distinction a grammar of
12
+ * graphics draws between a shape's interior and its own ink.
13
+ */
14
+ export type ResidueEncoding = 'fill' | 'color';
8
15
  export interface BasicTrackModel {
9
16
  id: string;
10
17
  name: string;
11
18
  associatedRowName?: string;
12
19
  height: number;
13
20
  kind: TrackKind;
21
+ heightKey?: string;
22
+ defaultOff?: boolean;
14
23
  }
15
24
  export interface TextTrackModel extends BasicTrackModel {
16
25
  customColorScheme?: Record<string, string>;
@@ -19,22 +28,200 @@ export interface TextTrackModel extends BasicTrackModel {
19
28
  export interface BarTrackModel extends BasicTrackModel {
20
29
  barColor?: string;
21
30
  }
31
+ export interface Arc {
32
+ start: number;
33
+ end: number;
34
+ color?: string;
35
+ }
36
+ export interface ArcTrackModel extends BasicTrackModel {
37
+ arcs?: Arc[];
38
+ arcColor?: string;
39
+ }
22
40
  export interface BasicTrack {
23
41
  ReactComponent: React.FC<any>;
24
- model: TextTrackModel & BarTrackModel;
42
+ model: TextTrackModel & BarTrackModel & ArcTrackModel;
43
+ }
44
+ export interface ArcSpec {
45
+ start: number;
46
+ end: number;
47
+ color?: string;
25
48
  }
26
49
  export interface ColumnTrackSpec {
27
50
  id: string;
28
51
  name: string;
29
- kind: 'bar' | 'text';
52
+ kind: 'bar' | 'text' | 'arc';
30
53
  values?: number[];
31
54
  data?: string;
55
+ arcs?: ArcSpec[];
32
56
  max?: number;
33
57
  color?: string;
34
58
  colors?: Record<string, string>;
35
59
  row?: string;
36
60
  height?: number;
37
61
  }
62
+ /**
63
+ * A strip panel: one cell per row, colored from a `rowData` field through
64
+ * `scale`, which is ggtree's `gheatmap`. `width` is in pixels and defaults to
65
+ * the row height, and `header` labels the column and defaults to the field.
66
+ * `legend` titles the strip's legend and defaults to the field, and strips
67
+ * naming one title share one legend.
68
+ */
69
+ export interface RowStripSpec {
70
+ kind: 'strip';
71
+ field: string;
72
+ scale?: ScaleSpec;
73
+ width?: number;
74
+ header?: string;
75
+ legend?: string;
76
+ }
77
+ /** the channels a `features` panel reads off the feature table */
78
+ export interface FeatureEncodingSpec {
79
+ color?: {
80
+ field: string;
81
+ scale?: ScaleSpec;
82
+ };
83
+ label?: string;
84
+ }
85
+ /**
86
+ * Shifts each row so that the first feature named `on` starts at zero, which
87
+ * is gggenes' `make_alignment_dummies`. Only `x: "position"` reads it.
88
+ */
89
+ export interface AlignTransform {
90
+ type: 'align';
91
+ on: string;
92
+ }
93
+ /**
94
+ * A features panel: the GFF's spans per row, as arrows where they carry a
95
+ * strand. `x: "column"` draws them in the alignment's columns, and
96
+ * `x: "position"` in each row's own residue positions on one linear scale, so
97
+ * a genome with no alignment has an x.
98
+ */
99
+ export interface RowFeaturesSpec {
100
+ kind: 'features';
101
+ x: 'column' | 'position';
102
+ width?: number;
103
+ header?: string;
104
+ encoding?: FeatureEncodingSpec;
105
+ transform?: AlignTransform[];
106
+ }
107
+ /**
108
+ * A panel left of the alignment on the row scale, the counterpart of
109
+ * ColumnTrackSpec on the column scale. See docs/layers.md
110
+ */
111
+ export type RowPanelSpec = RowStripSpec | RowFeaturesSpec;
112
+ interface ResolvedPanelBase {
113
+ id: string;
114
+ header: string;
115
+ width: number;
116
+ offsetX: number;
117
+ legend: LegendEntry[];
118
+ /** the legend this panel's entries go under; absent means the domain key */
119
+ legendTitle?: string;
120
+ }
121
+ /**
122
+ * A strip with its scale resolved: the color each row takes, keyed by row
123
+ * name, and the pixel column the panel draws in.
124
+ */
125
+ export interface ResolvedStripPanel extends ResolvedPanelBase {
126
+ kind: 'strip';
127
+ field: string;
128
+ colors: Map<string, string>;
129
+ }
130
+ /** one feature of a features panel, at its pixel span inside the panel */
131
+ export interface RowPanelSpan {
132
+ annotation: Annotation;
133
+ xStart: number;
134
+ xEnd: number;
135
+ lane: number;
136
+ laneCount: number;
137
+ }
138
+ /**
139
+ * A features panel with its x mapping and its scale resolved: the spans per
140
+ * row name in panel pixels, the fill and outline of each feature, and the
141
+ * label its `label` channel draws. `field` is the field its color scale reads,
142
+ * which its legend is titled by.
143
+ */
144
+ export interface ResolvedFeaturePanel extends ResolvedPanelBase {
145
+ kind: 'features';
146
+ x: 'column' | 'position';
147
+ field?: string;
148
+ spans: Map<string, RowPanelSpan[]>;
149
+ colors: Map<Annotation, {
150
+ fill: string;
151
+ stroke: string;
152
+ }>;
153
+ labels?: Map<Annotation, string>;
154
+ }
155
+ export type ResolvedRowPanel = ResolvedStripPanel | ResolvedFeaturePanel;
156
+ export interface ResidueSegment {
157
+ rowStart: number;
158
+ rowEnd: number;
159
+ structStart: number;
160
+ structEnd: number;
161
+ }
162
+ export interface MappedStructure {
163
+ id: string;
164
+ kind?: 'experimental' | 'predicted';
165
+ asymId?: string;
166
+ url?: string;
167
+ }
168
+ /**
169
+ * The structure residue for each residue of a row, computed outside the viewer
170
+ * (SIFTS, an AlphaFold model, a curator). Sequence equality misplaces tagged
171
+ * constructs, truncations and subsequence rows; see docs/layers.md.
172
+ *
173
+ * Positions are 1-based and inclusive on both sides, as GFF and `highlights`
174
+ * are. Structure positions are `label_seq_id`, the index into the entity's
175
+ * SEQRES; author numbering carries insertion codes and is not used.
176
+ *
177
+ * `unobserved` is in structure positions: present in SEQRES with no
178
+ * coordinates, as distinct from a residue the structure lacks.
179
+ */
180
+ export interface ResidueMapping {
181
+ row: string;
182
+ accession?: string;
183
+ structure: MappedStructure;
184
+ segments: ResidueSegment[];
185
+ unobserved?: [number, number][];
186
+ /**
187
+ * ungapped length of the row this was computed against. When set, the viewer
188
+ * ignores the mapping if the loaded row's length differs, as it does after a
189
+ * re-alignment, revision or swapped sequence.
190
+ */
191
+ rowLength?: number;
192
+ generated?: {
193
+ by?: string;
194
+ date?: string;
195
+ sourceSha256?: string;
196
+ };
197
+ }
198
+ export interface ResidueMappingProblem {
199
+ row: string;
200
+ structureId: string;
201
+ /**
202
+ * `mapping` ignores the whole mapping, because the problem concerns its row.
203
+ * `segment` ignores only that segment and keeps the rest.
204
+ */
205
+ scope: 'mapping' | 'segment';
206
+ reason: string;
207
+ }
208
+ export interface StructureResidue {
209
+ structure: MappedStructure;
210
+ position: number;
211
+ observed: boolean;
212
+ }
213
+ export interface RowResidue {
214
+ rowName: string;
215
+ seqPos: number;
216
+ }
217
+ /**
218
+ * One loaded document that the snapshot omits, and its size. `what` uses the
219
+ * import form's names for the documents.
220
+ */
221
+ export interface UnshareableData {
222
+ what: 'alignment' | 'tree' | 'annotations' | 'row metadata' | 'data tracks';
223
+ bytes: number;
224
+ }
38
225
  export type { Annotation };
39
226
  export type TidyDomainAnnotation = Annotation;
40
227
  export interface DomainBand {
@@ -42,6 +229,27 @@ export interface DomainBand {
42
229
  startCol: number;
43
230
  endCol: number;
44
231
  stackIndex: number;
232
+ lane: number;
233
+ laneCount: number;
234
+ }
235
+ /**
236
+ * One swatch of a categorical color key. `id` is the value the scale read, and
237
+ * `label` is the text drawn beside the swatch.
238
+ */
239
+ export interface LegendEntry {
240
+ id: string;
241
+ label: string;
242
+ color: string;
243
+ }
244
+ /**
245
+ * A categorical color key, drawn by the on-screen overlay and reserved as a
246
+ * column in the SVG export. `title` names the legend where the viewer draws
247
+ * more than one.
248
+ */
249
+ export interface Legend {
250
+ id: string;
251
+ title: string;
252
+ entries: LegendEntry[];
45
253
  }
46
254
  /**
47
255
  * A persistent, labeled highlight. Coordinates are 1-based and inclusive, as
@@ -56,6 +264,90 @@ export interface Highlight {
56
264
  label?: string;
57
265
  color?: string;
58
266
  }
267
+ /**
268
+ * What the viewer draws over a clade. `highlight` fills the rows behind it,
269
+ * across the tree and the alignment. `bracket` draws a bar and the clade's
270
+ * `label` in the gutter right of the tip labels. `collapse` and `focus` seed
271
+ * the collapsed list and the subtree in focus at load.
272
+ */
273
+ export type CladeMark = 'highlight' | 'bracket' | 'collapse' | 'focus';
274
+ /**
275
+ * A clade of the tree and the mark drawn over it. `mrca` names tips whose most
276
+ * recent common ancestor is the clade; `range` names the first and last tip of
277
+ * a run in display order, in either order. `tips` is the leaf count the
278
+ * producer measured, and a clade that resolves to a different count is dropped.
279
+ * `label` names the clade beside a bracket, and a highlight carrying one draws
280
+ * the label without the bar. See docs/layers.md
281
+ */
282
+ export interface Clade {
283
+ mrca?: string[];
284
+ range?: [string, string];
285
+ tips: number;
286
+ mark: CladeMark;
287
+ color?: string;
288
+ label?: string;
289
+ }
290
+ /**
291
+ * A Clade resolved to the rows it covers, with its fill color settled. `color`
292
+ * is the highlight fill; `markColor` is the producer's own color for a bracket
293
+ * bar and its label, unset where the theme's text color stands. `nodeId` is the
294
+ * node an `mrca` resolved to, which `collapse` and `focus` seed themselves
295
+ * with, and a `range` record has none.
296
+ */
297
+ export interface ResolvedClade {
298
+ rows: [number, number];
299
+ mark: CladeMark;
300
+ color: string;
301
+ markColor?: string;
302
+ label?: string;
303
+ nodeId?: string;
304
+ }
305
+ /**
306
+ * A span in Highlight coordinates: 1-based inclusive residues of `row`, or
307
+ * columns of the file without it
308
+ */
309
+ export interface Region {
310
+ row?: string;
311
+ start: number;
312
+ end: number;
313
+ }
314
+ /**
315
+ * A cell of the alignment in the host's coordinates, 1-based like Highlight:
316
+ * `column` counts every column of the file, hidden gappy ones included, and
317
+ * `residue` counts the row's own letters, absent on a gap. A pointer over a
318
+ * track has a column and no row.
319
+ */
320
+ export interface Cell {
321
+ column: number;
322
+ row?: string;
323
+ residue?: number;
324
+ letter?: string;
325
+ }
326
+ /** the alignment columns on screen, 1-based and inclusive */
327
+ export interface Viewport {
328
+ startColumn: number;
329
+ endColumn: number;
330
+ }
331
+ /**
332
+ * A channel of a mark the viewer always draws. `tipLabel` colors each tip label
333
+ * in the tree, `rowTint` washes the row across the tree gutter and the
334
+ * alignment, and `branch` colors a tree edge whose tips all share one value;
335
+ * all three read a field of `rowData`. `featureFill` colors each span of the
336
+ * annotation overlay and `featureLabel` names the field drawn inside a span,
337
+ * both from a field of the feature table.
338
+ */
339
+ export type EncodingChannel = 'tipLabel' | 'rowTint' | 'branch' | 'featureFill' | 'featureLabel';
340
+ /**
341
+ * A channel, the field feeding it, and the scale it reads that field through.
342
+ * See docs/layers.md
343
+ */
344
+ export interface Encoding {
345
+ channel: EncodingChannel;
346
+ field: string;
347
+ scale?: ScaleSpec;
348
+ }
349
+ /** an Encoding with its scale resolved against the values in the table */
350
+ export type ResolvedEncoding = Encoding & ResolvedScale;
59
351
  /** a Highlight resolved to visible column indices and row indices */
60
352
  export interface ResolvedHighlight {
61
353
  startCol?: number;
package/dist/umd.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import * as React from 'react';
2
2
  export { destroy } from '@jbrowse/mobx-state-tree';
3
3
  export { default as MSAView } from './components/Loading.tsx';
4
+ export { mount } from './mount.tsx';
5
+ export { defineMsaElement } from './element.ts';
4
6
  export { type MsaViewModel, default as MSAModelF } from './model.ts';
5
7
  export * from 'react-dom/client';
6
8
  export { React };
package/dist/umd.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import * as React from 'react';
2
- // a host that swaps models (the R htmlwidget on re-render) has to destroy the
3
- // old one, or the disposers its autoruns registered never run
2
+ // a page that builds models with MSAModelF destroys each one it replaces, so
3
+ // the disposers its autoruns registered run
4
4
  export { destroy } from '@jbrowse/mobx-state-tree';
5
5
  export { default as MSAView } from './components/Loading.js';
6
+ export { mount } from './mount.js';
7
+ export { defineMsaElement } from './element.js';
6
8
  export { default as MSAModelF } from './model.js';
7
9
  export * from 'react-dom/client';
8
10
  export { React };
package/dist/umd.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"umd.js","sourceRoot":"","sources":["../src/umd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,8EAA8E;AAC9E,8DAA8D;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,yBAA0B,CAAA;AAC7D,OAAO,EAAqB,OAAO,IAAI,SAAS,EAAE,MAAM,YAAY,CAAA;AAEpE,cAAc,kBAAkB,CAAA;AAEhC,OAAO,EAAE,KAAK,EAAE,CAAA"}
1
+ {"version":3,"file":"umd.js","sourceRoot":"","sources":["../src/umd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,6EAA6E;AAC7E,4CAA4C;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,yBAA0B,CAAA;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAa,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAqB,OAAO,IAAI,SAAS,EAAE,MAAM,YAAY,CAAA;AAEpE,cAAc,kBAAkB,CAAA;AAEhC,OAAO,EAAE,KAAK,EAAE,CAAA"}
@@ -1,17 +1,12 @@
1
1
  import type React from 'react';
2
2
  /**
3
3
  * Wires a canvas ref to a mobx autorun: grabs the 2d context once the canvas
4
- * mounts and re-runs `draw` whenever any observable it reads changes. Collapses
5
- * the getContext/null-guard/autorun-dispose boilerplate repeated by every canvas
6
- * block host.
4
+ * mounts and re-runs `draw` whenever any observable it reads changes.
7
5
  *
8
- * `width`/`height` are the canvas *backing store* size the caller renders onto
9
- * the element (logical size times the high-res scale factor), and they are load
10
- * bearing rather than informational. Assigning either resets the canvas bitmap,
11
- * and React assigns them on every commit where they changed -- which lands
12
- * *after* the mobx reaction that already redrew at the old size. Without a redraw
13
- * on the far side of that commit the canvas is left blank: it is what blanked the
14
- * tree on a tree-area resize and the consensus tracks on a vertical zoom.
6
+ * `width`/`height` are the canvas backing store size (logical size times the
7
+ * high-res scale factor). Assigning either clears the bitmap, and React assigns
8
+ * them after the mobx reaction has drawn at the old size, so the effect redraws
9
+ * when they change.
15
10
  *
16
11
  * `deps` covers everything else the effect should re-subscribe on, matching a
17
12
  * normal useEffect dep array.
@@ -2,17 +2,12 @@ import { useEffect, useRef } from 'react';
2
2
  import { autorun } from 'mobx';
3
3
  /**
4
4
  * Wires a canvas ref to a mobx autorun: grabs the 2d context once the canvas
5
- * mounts and re-runs `draw` whenever any observable it reads changes. Collapses
6
- * the getContext/null-guard/autorun-dispose boilerplate repeated by every canvas
7
- * block host.
5
+ * mounts and re-runs `draw` whenever any observable it reads changes.
8
6
  *
9
- * `width`/`height` are the canvas *backing store* size the caller renders onto
10
- * the element (logical size times the high-res scale factor), and they are load
11
- * bearing rather than informational. Assigning either resets the canvas bitmap,
12
- * and React assigns them on every commit where they changed -- which lands
13
- * *after* the mobx reaction that already redrew at the old size. Without a redraw
14
- * on the far side of that commit the canvas is left blank: it is what blanked the
15
- * tree on a tree-area resize and the consensus tracks on a vertical zoom.
7
+ * `width`/`height` are the canvas backing store size (logical size times the
8
+ * high-res scale factor). Assigning either clears the bitmap, and React assigns
9
+ * them after the mobx reaction has drawn at the old size, so the effect redraws
10
+ * when they change.
16
11
  *
17
12
  * `deps` covers everything else the effect should re-subscribe on, matching a
18
13
  * normal useEffect dep array.
@@ -1 +1 @@
1
- {"version":3,"file":"useCanvasAutorun.js","sourceRoot":"","sources":["../src/useCanvasAutorun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAI9B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAC/B,IAAI,EACJ,KAAK,EACL,MAAM,EACN,IAAI,GAML;IACC,MAAM,GAAG,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAA;IAC3C,8EAA8E;IAC9E,0EAA0E;IAC1E,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;QACzC,OAAO,GAAG;YACR,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE;gBACX,IAAI,CAAC,GAAG,CAAC,CAAA;YACX,CAAC,CAAC;YACJ,CAAC,CAAC,SAAS,CAAA;QACb,uDAAuD;IACzD,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;IAC5B,OAAO,GAAG,CAAA;AACZ,CAAC"}
1
+ {"version":3,"file":"useCanvasAutorun.js","sourceRoot":"","sources":["../src/useCanvasAutorun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAI9B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAC/B,IAAI,EACJ,KAAK,EACL,MAAM,EACN,IAAI,GAML;IACC,MAAM,GAAG,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAA;IAC3C,8EAA8E;IAC9E,0EAA0E;IAC1E,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;QACzC,OAAO,GAAG;YACR,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE;gBACX,IAAI,CAAC,GAAG,CAAC,CAAA;YACX,CAAC,CAAC;YACJ,CAAC,CAAC,SAAS,CAAA;QACb,uDAAuD;IACzD,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;IAC5B,OAAO,GAAG,CAAA;AACZ,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { MsaViewModel } from './model.ts';
2
+ import type { Theme } from '@mui/material';
3
+ export interface MsaSvgFigure {
4
+ /** the SVG document for what is on screen, once the first draw finishes */
5
+ svg?: string;
6
+ error?: unknown;
7
+ }
8
+ /**
9
+ * The viewer's SVG export of its viewport, as markup for the page to insert.
10
+ * It redraws after the view settles: `delay` ms after the last scroll, zoom,
11
+ * resize or change to the snapshot. A draw a later one overtakes is dropped.
12
+ *
13
+ * The figure's row names and letters are SVG text, so the browser's find
14
+ * locates them, a reader can select them, and print stylesheets apply.
15
+ */
16
+ export declare function useMsaSvgFigure(model: MsaViewModel, { theme, includeTracks, delay, }?: {
17
+ theme?: Theme;
18
+ includeTracks?: boolean;
19
+ delay?: number;
20
+ }): MsaSvgFigure;
@@ -0,0 +1,46 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { createJBrowseTheme } from '@jbrowse/core/ui/theme';
3
+ import { getSnapshot } from '@jbrowse/mobx-state-tree';
4
+ import { compareStructural, reaction } from 'mobx';
5
+ import { renderToSvg } from './renderToSvg.js';
6
+ /**
7
+ * The viewer's SVG export of its viewport, as markup for the page to insert.
8
+ * It redraws after the view settles: `delay` ms after the last scroll, zoom,
9
+ * resize or change to the snapshot. A draw a later one overtakes is dropped.
10
+ *
11
+ * The figure's row names and letters are SVG text, so the browser's find
12
+ * locates them, a reader can select them, and print stylesheets apply.
13
+ */
14
+ export function useMsaSvgFigure(model, { theme, includeTracks = false, delay = 300, } = {}) {
15
+ const [figure, setFigure] = useState({});
16
+ useEffect(() => {
17
+ let latest = 0;
18
+ const dispose = reaction(() => model.viewInitialized && model.dataInitialized
19
+ ? [getSnapshot(model), model.width, model.height]
20
+ : undefined, key => {
21
+ if (!key) {
22
+ return;
23
+ }
24
+ const draw = ++latest;
25
+ renderToSvg(model, {
26
+ theme: theme ?? createJBrowseTheme(),
27
+ exportType: 'viewport',
28
+ includeTracks,
29
+ }).then(svg => {
30
+ if (draw === latest) {
31
+ setFigure({ svg });
32
+ }
33
+ }, (error) => {
34
+ if (draw === latest) {
35
+ setFigure({ error });
36
+ }
37
+ });
38
+ }, { delay, fireImmediately: true, equals: compareStructural });
39
+ return () => {
40
+ latest = -1;
41
+ dispose();
42
+ };
43
+ }, [model, theme, includeTracks, delay]);
44
+ return figure;
45
+ }
46
+ //# sourceMappingURL=useMsaSvgFigure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMsaSvgFigure.js","sourceRoot":"","sources":["../src/useMsaSvgFigure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAA;AAW/C;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAmB,EACnB,EACE,KAAK,EACL,aAAa,GAAG,KAAK,EACrB,KAAK,GAAG,GAAG,GACZ,GAA+D,EAAE;IAElE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAe,EAAE,CAAC,CAAA;IACtD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,MAAM,GAAG,CAAC,CAAA;QACd,MAAM,OAAO,GAAG,QAAQ,CACtB,GAAG,EAAE,CACH,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe;YAC5C,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;YACjD,CAAC,CAAC,SAAS,EACf,GAAG,CAAC,EAAE;YACJ,IAAI,CAAC,GAAG,EAAE,CAAC;gBACT,OAAM;YACR,CAAC;YACD,MAAM,IAAI,GAAG,EAAE,MAAM,CAAA;YACrB,WAAW,CAAC,KAAK,EAAE;gBACjB,KAAK,EAAE,KAAK,IAAI,kBAAkB,EAAE;gBACpC,UAAU,EAAE,UAAU;gBACtB,aAAa;aACd,CAAC,CAAC,IAAI,CACL,GAAG,CAAC,EAAE;gBACJ,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;oBACpB,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC,CAAA;gBACpB,CAAC;YACH,CAAC,EACD,CAAC,KAAc,EAAE,EAAE;gBACjB,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;oBACpB,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;gBACtB,CAAC;YACH,CAAC,CACF,CAAA;QACH,CAAC,EACD,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAC5D,CAAA;QACD,OAAO,GAAG,EAAE;YACV,MAAM,GAAG,CAAC,CAAC,CAAA;YACX,OAAO,EAAE,CAAA;QACX,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAA;IACxC,OAAO,MAAM,CAAA;AACf,CAAC"}
package/dist/util.d.ts CHANGED
@@ -1,11 +1,18 @@
1
1
  import type { Theme } from '@mui/material';
2
2
  export declare function adjustColorForContrast(color: string, bg: string): string;
3
+ export declare function withAlpha(color: string, alpha: number): string;
4
+ export declare function outlineColor(fill: string): string;
3
5
  export declare function transform<T>(obj: Record<string, T>, cb: (arg0: [string, T]) => [string, T]): {
4
6
  [k: string]: T;
5
7
  };
6
- export declare function colorContrast(colorScheme: Record<string, string>, theme: Theme): {
7
- [k: string]: string;
8
- };
8
+ /**
9
+ * Readable letter color over a given cell color, memoized per theme.
10
+ *
11
+ * Keyed by cell color, since a dynamic scheme has no letter->color table; this
12
+ * covers static schemes and a track's own `colors` too. An uncolored cell gets
13
+ * the theme's text color, which stays readable in the dark theme.
14
+ */
15
+ export declare function contrastTextFn(theme: Theme): (color: string | undefined) => string;
9
16
  export declare function dropBlanks<T>(blanks: number[], arr: T[]): T[];
10
17
  export declare function skipBlanks(blanks: number[], str: string): string;
11
18
  export declare function computeRowInsertions(blanks: number[], seq: string): {
@@ -16,4 +23,3 @@ export declare function len(a: {
16
23
  end: number;
17
24
  start: number;
18
25
  }): number;
19
- export declare function isBlank(s?: string): s is "-" | ".";
package/dist/util.js CHANGED
@@ -23,14 +23,46 @@ export function adjustColorForContrast(color, bg) {
23
23
  contrastAdjustCache.set(cacheKey, result);
24
24
  return result;
25
25
  }
26
+ // a wash over the alignment or the tree: a color carrying its own alpha draws
27
+ // at that alpha, and one with none takes `alpha` so the marks under it stay
28
+ // readable
29
+ export function withAlpha(color, alpha) {
30
+ const parsed = colord(color);
31
+ return parsed.alpha() === 1 ? parsed.alpha(alpha).toRgbString() : color;
32
+ }
33
+ export function outlineColor(fill) {
34
+ return colord(fill).darken(0.1).toHex();
35
+ }
26
36
  export function transform(obj, cb) {
27
37
  return Object.fromEntries(Object.entries(obj).map(cb));
28
38
  }
29
- export function colorContrast(colorScheme, theme) {
30
- return transform(colorScheme, ([letter, color]) => [
31
- letter,
32
- theme.palette.getContrastText(colord(color).toHex()),
33
- ]);
39
+ const contrastTextCaches = new WeakMap();
40
+ /**
41
+ * Readable letter color over a given cell color, memoized per theme.
42
+ *
43
+ * Keyed by cell color, since a dynamic scheme has no letter->color table; this
44
+ * covers static schemes and a track's own `colors` too. An uncolored cell gets
45
+ * the theme's text color, which stays readable in the dark theme.
46
+ */
47
+ export function contrastTextFn(theme) {
48
+ let cache = contrastTextCaches.get(theme);
49
+ if (!cache) {
50
+ cache = new Map();
51
+ contrastTextCaches.set(theme, cache);
52
+ }
53
+ const fallback = theme.palette.text.primary;
54
+ return (color) => {
55
+ if (!color) {
56
+ return fallback;
57
+ }
58
+ const hit = cache.get(color);
59
+ if (hit !== undefined) {
60
+ return hit;
61
+ }
62
+ const out = theme.palette.getContrastText(colord(color).toHex());
63
+ cache.set(color, out);
64
+ return out;
65
+ };
34
66
  }
35
67
  export function dropBlanks(blanks, arr) {
36
68
  if (blanks.length === 0) {
@@ -95,9 +127,4 @@ export function computeRowInsertions(blanks, seq) {
95
127
  export function len(a) {
96
128
  return a.end - a.start;
97
129
  }
98
- // https://sonnhammer.sbc.su.se/Stockholm.html
99
- // gaps can be a . or - in stockholm
100
- export function isBlank(s) {
101
- return s === '-' || s === '.';
102
- }
103
130
  //# sourceMappingURL=util.js.map
package/dist/util.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAC5C,OAAO,WAAW,MAAM,sBAAsB,CAAA;AAI9C,MAAM,CAAC,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,CAAA;AAEjC,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAkB,CAAA;AAErD,0EAA0E;AAC1E,uEAAuE;AACvE,8DAA8D;AAC9D,MAAM,UAAU,sBAAsB,CAAC,KAAa,EAAE,EAAU;IAC9D,MAAM,QAAQ,GAAG,GAAG,KAAK,IAAI,EAAE,EAAE,CAAA;IACjC,MAAM,MAAM,GAAG,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAChD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,MAAM,CAAA;IACf,CAAC;IACD,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IACrB,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC;QACtB,MAAM,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,GAAG,GAAG,CAAA;QAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,CAA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D,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,CAAiC;IACnD,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,CAAA;AACxB,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "6.5.0";
1
+ export declare const version = "8.0.0";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const version = '6.5.0';
1
+ export const version = '8.0.0';
2
2
  //# sourceMappingURL=version.js.map
package/dist/wuss.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ export interface BasePair {
2
+ /** 0-based column */
3
+ start: number;
4
+ /** 0-based column */
5
+ end: number;
6
+ /** the pair crosses a helix rather than nesting inside one */
7
+ pseudoknot: boolean;
8
+ }
9
+ /**
10
+ * The base pairs a WUSS string encodes, as 0-based column indexes. Unmatched
11
+ * brackets are dropped rather than throwing: a hand-edited or truncated
12
+ * alignment should still draw the helices it does close.
13
+ */
14
+ export declare function parseWuss(ss: string): BasePair[];