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,3 +1,20 @@
1
+ /**
2
+ * MSA Coordinate Systems:
3
+ *
4
+ * 1. **Global Column (globalCol)**: The column index in the full, unfiltered MSA.
5
+ * Range: 0 to (MSA width - 1)
6
+ * This is the "true" column position before any gap-hiding is applied.
7
+ *
8
+ * 2. **Visible Column (visibleCol)**: The column index after hiding gappy columns.
9
+ * Range: 0 to (numColumns - 1) where numColumns = MSA width - blanks.length
10
+ * This is what the user sees on screen when "Hide columns w/ N% gaps" is enabled.
11
+ * When gap hiding is disabled, visibleCol === globalCol.
12
+ *
13
+ * 3. **Sequence Position (seqPos)**: The position within a specific row's ungapped sequence.
14
+ * Range: 0 to (ungapped sequence length - 1)
15
+ * This counts only non-gap characters ('-' and '.' are gaps).
16
+ * Each row can have different seqPos values for the same globalCol due to gaps.
17
+ */
1
18
  /**
2
19
  * Convert a visible column index to a global column index.
3
20
  * This is used when translating mouse/screen coordinates to MSA coordinates.
@@ -21,40 +38,21 @@ export declare function globalColToVisibleCol(blanks: number[], globalCol: numbe
21
38
  * that is its own visible index; for a hidden one it is the index of the next
22
39
  * visible column, i.e. where the hidden column collapses to.
23
40
  *
24
- * That total answer is what spans want: resolving both ends of a span through
25
- * globalColToVisibleCol instead loses the whole span whenever either end lands
26
- * in a hidden column.
41
+ * Spans use this, since globalColToVisibleCol drops a span whenever either end
42
+ * lands in a hidden column.
27
43
  *
28
44
  * @param blanks - Sorted array of global column indices that are hidden
29
45
  * @param globalCol - The global column index in the full MSA
30
46
  */
31
47
  export declare function visibleColsBefore(blanks: number[], globalCol: number): number;
32
48
  /**
33
- * Convert a visible column to a row-specific sequence position.
34
- * Returns undefined if the position is a gap in the sequence.
49
+ * The ungapped position a row holds at a global column, or undefined when that
50
+ * column is a gap in the row or past its end.
35
51
  *
36
- * @param seq - The row's sequence string (including gaps)
37
- * @param blanks - Sorted array of global column indices that are hidden
38
- * @param visibleCol - The visible column index
39
- * @returns The sequence position, or undefined if it's a gap
40
- */
41
- export declare function visibleColToSeqPos({ seq, blanks, visibleCol, }: {
42
- seq: string;
43
- blanks: number[];
44
- visibleCol: number;
45
- }): number | undefined;
46
- /**
47
- * Convert a visible column to a row-specific sequence position, with row lookup.
52
+ * Binary-searches the row's ascending seqPos index; it runs on every mouse
53
+ * move, and scanning a 30k-column row per event takes the whole frame.
48
54
  *
49
- * @param rowName - The name of the row
50
- * @param visibleCol - The visible column index
51
- * @param rowMap - Map from row name to sequence string
52
- * @param blanks - Sorted array of global column indices that are hidden
53
- * @returns The sequence position, or undefined if row not found or position is a gap
55
+ * @param index - The row's seqPos -> global column index (buildSeqPosIndex)
56
+ * @param globalCol - The global column index in the full MSA
54
57
  */
55
- export declare function visibleColToSeqPosForRow({ rowName, visibleCol, rowMap, blanks, }: {
56
- rowName: string;
57
- visibleCol: number;
58
- rowMap: Map<string, string>;
59
- blanks: number[];
60
- }): number | undefined;
58
+ export declare function seqPosOfGlobalCol(index: Int32Array | undefined, globalCol: number): number | undefined;
@@ -1,4 +1,3 @@
1
- import { isBlank } from './util.js';
2
1
  /**
3
2
  * MSA Coordinate Systems:
4
3
  *
@@ -71,9 +70,8 @@ function countBlanksBefore(blanks, globalCol) {
71
70
  * that is its own visible index; for a hidden one it is the index of the next
72
71
  * visible column, i.e. where the hidden column collapses to.
73
72
  *
74
- * That total answer is what spans want: resolving both ends of a span through
75
- * globalColToVisibleCol instead loses the whole span whenever either end lands
76
- * in a hidden column.
73
+ * Spans use this, since globalColToVisibleCol drops a span whenever either end
74
+ * lands in a hidden column.
77
75
  *
78
76
  * @param blanks - Sorted array of global column indices that are hidden
79
77
  * @param globalCol - The global column index in the full MSA
@@ -82,44 +80,20 @@ export function visibleColsBefore(blanks, globalCol) {
82
80
  return globalCol - countBlanksBefore(blanks, globalCol);
83
81
  }
84
82
  /**
85
- * Convert a visible column to a row-specific sequence position.
86
- * Returns undefined if the position is a gap in the sequence.
83
+ * The ungapped position a row holds at a global column, or undefined when that
84
+ * column is a gap in the row or past its end.
87
85
  *
88
- * @param seq - The row's sequence string (including gaps)
89
- * @param blanks - Sorted array of global column indices that are hidden
90
- * @param visibleCol - The visible column index
91
- * @returns The sequence position, or undefined if it's a gap
86
+ * Binary-searches the row's ascending seqPos index; it runs on every mouse
87
+ * move, and scanning a 30k-column row per event takes the whole frame.
88
+ *
89
+ * @param index - The row's seqPos -> global column index (buildSeqPosIndex)
90
+ * @param globalCol - The global column index in the full MSA
92
91
  */
93
- export function visibleColToSeqPos({ seq, blanks, visibleCol, }) {
94
- // First convert the visible column to global column
95
- const globalCol = visibleColToGlobalCol(blanks, visibleCol);
96
- const seqLen = seq.length;
97
- // Check if the position in the sequence is a gap
98
- if (globalCol < seqLen && isBlank(seq[globalCol])) {
92
+ export function seqPosOfGlobalCol(index, globalCol) {
93
+ if (!index) {
99
94
  return undefined;
100
95
  }
101
- // Count non-gap characters up to the global position
102
- let seqPos = 0;
103
- for (let i = 0; i < globalCol && i < seqLen; i++) {
104
- if (!isBlank(seq[i])) {
105
- seqPos++;
106
- }
107
- }
108
- return globalCol < seqLen ? seqPos : undefined;
109
- }
110
- /**
111
- * Convert a visible column to a row-specific sequence position, with row lookup.
112
- *
113
- * @param rowName - The name of the row
114
- * @param visibleCol - The visible column index
115
- * @param rowMap - Map from row name to sequence string
116
- * @param blanks - Sorted array of global column indices that are hidden
117
- * @returns The sequence position, or undefined if row not found or position is a gap
118
- */
119
- export function visibleColToSeqPosForRow({ rowName, visibleCol, rowMap, blanks, }) {
120
- const seq = rowMap.get(rowName);
121
- return seq !== undefined
122
- ? visibleColToSeqPos({ seq, visibleCol, blanks })
123
- : undefined;
96
+ const seqPos = partitionPoint(index.length, i => index[i] >= globalCol);
97
+ return index[seqPos] === globalCol ? seqPos : undefined;
124
98
  }
125
99
  //# sourceMappingURL=rowCoordinateCalculations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rowCoordinateCalculations.js","sourceRoot":"","sources":["../src/rowCoordinateCalculations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;G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AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAgB,EAAE,SAAiB;IACnE,OAAO,SAAS,GAAG,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AACzD,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAA6B,EAC7B,SAAiB;IAEjB,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAE,IAAI,SAAS,CAAC,CAAA;IACxE,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;AACzD,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { LegendEntry } from './types.ts';
2
+ /** how a channel reads a field: a palette by name, or a color per value */
3
+ export interface ScaleSpec {
4
+ palette?: string;
5
+ map?: Record<string, string>;
6
+ }
7
+ export interface ResolvedScale {
8
+ kind: 'categorical';
9
+ colorOf: (value: string) => string | undefined;
10
+ legend: LegendEntry[];
11
+ }
12
+ /**
13
+ * The scale a channel reads its field through. `values` are the field's values,
14
+ * in any order and with repeats; the domain is their distinct values sorted, so
15
+ * a value keeps its color when rows are re-ordered, collapsed or filtered.
16
+ *
17
+ * `{map}` colors the values the producer named and leaves the rest uncolored.
18
+ * `{palette}` takes the colors of a named palette, and a spec with neither
19
+ * takes the ggplot palette of the domain's size. Every scale is categorical
20
+ * today; a continuous one waits for a caller.
21
+ */
22
+ export declare function resolveScale(spec: ScaleSpec | undefined, values: Iterable<string>): ResolvedScale;
package/dist/scales.js ADDED
@@ -0,0 +1,30 @@
1
+ import { createPaletteMap } from './createPaletteMap.js';
2
+ import { paletteNamed } from './ggplotPalettes.js';
3
+ /**
4
+ * The scale a channel reads its field through. `values` are the field's values,
5
+ * in any order and with repeats; the domain is their distinct values sorted, so
6
+ * a value keeps its color when rows are re-ordered, collapsed or filtered.
7
+ *
8
+ * `{map}` colors the values the producer named and leaves the rest uncolored.
9
+ * `{palette}` takes the colors of a named palette, and a spec with neither
10
+ * takes the ggplot palette of the domain's size. Every scale is categorical
11
+ * today; a continuous one waits for a caller.
12
+ */
13
+ export function resolveScale(spec, values) {
14
+ const domain = [...new Set(values)].sort((a, b) => a.localeCompare(b));
15
+ const { map, palette } = spec ?? {};
16
+ const colors = map ?? createPaletteMap(domain, paletteNamed(palette));
17
+ const present = new Set(domain);
18
+ const labels = map ? Object.keys(map).filter(v => present.has(v)) : domain;
19
+ return {
20
+ kind: 'categorical',
21
+ colorOf: (value) => colors[value],
22
+ // a categorical value is its own label, and the id a legend keys on
23
+ legend: labels.map(value => ({
24
+ id: value,
25
+ label: value,
26
+ color: colors[value],
27
+ })),
28
+ };
29
+ }
30
+ //# sourceMappingURL=scales.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scales.js","sourceRoot":"","sources":["../src/scales.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAgBlD;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAC1B,IAA2B,EAC3B,MAAwB;IAExB,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;IACtE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI,IAAI,EAAE,CAAA;IACnC,MAAM,MAAM,GAAG,GAAG,IAAI,gBAAgB,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAAA;IACrE,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAA;IAC/B,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;IAC1E,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;QACzC,oEAAoE;QACpE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC3B,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,MAAM,CAAC,KAAK,CAAE;SACtB,CAAC,CAAC;KACJ,CAAA;AACH,CAAC"}
@@ -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)
@@ -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,6 +18,8 @@ export function buildSeqPosIndex(row) {
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
  }
24
25
  //# sourceMappingURL=seqPosToGlobalCol.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"seqPosToGlobalCol.js","sourceRoot":"","sources":["../src/seqPosToGlobalCol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACxC,IAAI,CAAC,GAAG,CAAC,CAAA;IACT,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC;QAC1C,oEAAoE;QACpE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YAC7C,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAA;QAClB,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAC7B,CAAC"}
1
+ {"version":3,"file":"seqPosToGlobalCol.js","sourceRoot":"","sources":["../src/seqPosToGlobalCol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACxC,IAAI,CAAC,GAAG,CAAC,CAAA;IACT,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC;QAC1C,oEAAoE;QACpE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YAC7C,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAA;QAClB,CAAC;IACH,CAAC;IACD,2EAA2E;IAC3E,uEAAuE;IACvE,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAC1B,CAAC"}
@@ -12,17 +12,12 @@ export declare function maxBitsFor(sequenceType: 'dna' | 'rna' | 'amino'): numbe
12
12
  * stack bottom-up in array order.
13
13
  *
14
14
  * Heights follow Schneider & Stephens: the column's information content is
15
- * `log2(alphabet) - H` bits, and each residue takes the share of that its own
16
- * frequency earns. Frequencies come from the non-gap residues only, so a column
17
- * of two residues and eight gaps is read as a two-way choice rather than a
18
- * ten-way one -- otherwise every gappy column would look uninformative for the
19
- * wrong reason.
15
+ * `log2(alphabet) - H` bits, split among residues by frequency. Frequencies
16
+ * count non-gap residues only, so two residues and eight gaps form a two-way
17
+ * choice.
20
18
  *
21
- * The whole stack is then scaled by the non-gap fraction, which plain WebLogo
22
- * does not do. Here it earns its place: the track sits directly under an
23
- * alignment where the gaps are visible, and a column that is 90% gap drawing a
24
- * full-height stack off its one remaining pair of residues reads as a conserved
25
- * site. Scaling makes stack height mean "how much this column tells you about
26
- * the family", matching what the conservation track above it already plots.
19
+ * Unlike plain WebLogo, the stack is then scaled by the non-gap fraction, so a
20
+ * 90%-gap column with one conserved pair does not draw a full-height stack, and
21
+ * stack height matches the conservation track.
27
22
  */
28
23
  export declare function columnLogoStack(colStats: ColumnCounts, col: number, maxBits: number): LogoLetter[];
@@ -9,18 +9,13 @@ export function maxBitsFor(sequenceType) {
9
9
  * stack bottom-up in array order.
10
10
  *
11
11
  * Heights follow Schneider & Stephens: the column's information content is
12
- * `log2(alphabet) - H` bits, and each residue takes the share of that its own
13
- * frequency earns. Frequencies come from the non-gap residues only, so a column
14
- * of two residues and eight gaps is read as a two-way choice rather than a
15
- * ten-way one -- otherwise every gappy column would look uninformative for the
16
- * wrong reason.
12
+ * `log2(alphabet) - H` bits, split among residues by frequency. Frequencies
13
+ * count non-gap residues only, so two residues and eight gaps form a two-way
14
+ * choice.
17
15
  *
18
- * The whole stack is then scaled by the non-gap fraction, which plain WebLogo
19
- * does not do. Here it earns its place: the track sits directly under an
20
- * alignment where the gaps are visible, and a column that is 90% gap drawing a
21
- * full-height stack off its one remaining pair of residues reads as a conserved
22
- * site. Scaling makes stack height mean "how much this column tells you about
23
- * the family", matching what the conservation track above it already plots.
16
+ * Unlike plain WebLogo, the stack is then scaled by the non-gap fraction, so a
17
+ * 90%-gap column with one conserved pair does not draw a full-height stack, and
18
+ * stack height matches the conservation track.
24
19
  */
25
20
  export function columnLogoStack(colStats, col, maxBits) {
26
21
  const total = colStats.total(col);
@@ -1 +1 @@
1
- {"version":3,"file":"sequenceLogo.js","sourceRoot":"","sources":["../src/sequenceLogo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAUvD;uCACuC;AACvC,MAAM,UAAU,UAAU,CAAC,YAAqC;IAC9D,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACrD,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,eAAe,CAC7B,QAAsB,EACtB,GAAW,EACX,OAAe;IAEf,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACjC,MAAM,WAAW,GAAG,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;IAClD,IAAI,WAAW,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,CAAA;IACX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KAAK,CAAC,GAAG,CAAC,CAAA;IACjC,MAAM,WAAW,GAAG,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;IAClD,IAAI,WAAW,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,CAAA;IACX,CAAC;IAED,MAAM,kBAAkB,GACtB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC,CAAA;IACtE,IAAI,kBAAkB,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,CAAA;IACX,CAAC;IAED,MAAM,KAAK,GAAiB,EAAE,CAAA;IAC9B,QAAQ,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAC3C,KAAK,CAAC,IAAI,CAAC;YACT,MAAM,EAAE,mBAAmB,CAAC,IAAI,CAAC;YACjC,IAAI,EAAE,CAAC,KAAK,GAAG,WAAW,CAAC,GAAG,kBAAkB;SACjD,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IACF,8EAA8E;IAC9E,4DAA4D;IAC5D,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IACzE,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -2,20 +2,13 @@ import type { IAnyType, IOptionalIType, OptionalDefaultValueOrFunction } from '@
2
2
  /**
3
3
  * `types.stripDefault`, degrading to `types.optional` on hosts that lack it.
4
4
  *
5
- * stripDefault keeps defaulted properties out of snapshots, but it exists only
6
- * in the mobx-state-tree that ships with unreleased @jbrowse/core. This package
7
- * declares `@jbrowse/mobx-state-tree: ^5.0.0`, and inside jbrowse-web the host
8
- * supplies its own copy at runtime -- the plugin bundle externalizes it -- so we
9
- * genuinely do not know which version we are calling until we are running.
5
+ * stripDefault keeps defaulted properties out of snapshots, and only the
6
+ * mobx-state-tree in unreleased @jbrowse/core has it. The plugin bundle
7
+ * externalizes mobx-state-tree, so the host's copy is known only at runtime, and
8
+ * calling a missing stripDefault during model construction makes PluginLoader
9
+ * reject and the whole app show its error page.
10
10
  *
11
- * Calling it where it is absent throws while the model is being constructed,
12
- * which in a plugin bundle means PluginLoader rejects and the entire app renders
13
- * its error page. Losing minimal snapshots is a far better failure than losing
14
- * the session, so this degrades instead.
15
- *
16
- * The two signatures are identical, so behaviour differs only in that defaults
17
- * reappear in snapshots on older hosts (bigger session snapshots and shared
18
- * URLs, nothing incorrect). stripDefaultSnapshot.test.ts still pins the stripped
19
- * behaviour, since dev runs against a version that has it.
11
+ * The signatures are identical; on older hosts, defaults reappear in snapshots
12
+ * and shared URLs. stripDefaultSnapshot.test.ts pins the stripped behaviour.
20
13
  */
21
14
  export declare function stripDefault<IT extends IAnyType>(type: IT, defaultValue: OptionalDefaultValueOrFunction<IT>): IOptionalIType<IT, [undefined]>;
@@ -2,21 +2,14 @@ import { types } from '@jbrowse/mobx-state-tree';
2
2
  /**
3
3
  * `types.stripDefault`, degrading to `types.optional` on hosts that lack it.
4
4
  *
5
- * stripDefault keeps defaulted properties out of snapshots, but it exists only
6
- * in the mobx-state-tree that ships with unreleased @jbrowse/core. This package
7
- * declares `@jbrowse/mobx-state-tree: ^5.0.0`, and inside jbrowse-web the host
8
- * supplies its own copy at runtime -- the plugin bundle externalizes it -- so we
9
- * genuinely do not know which version we are calling until we are running.
5
+ * stripDefault keeps defaulted properties out of snapshots, and only the
6
+ * mobx-state-tree in unreleased @jbrowse/core has it. The plugin bundle
7
+ * externalizes mobx-state-tree, so the host's copy is known only at runtime, and
8
+ * calling a missing stripDefault during model construction makes PluginLoader
9
+ * reject and the whole app show its error page.
10
10
  *
11
- * Calling it where it is absent throws while the model is being constructed,
12
- * which in a plugin bundle means PluginLoader rejects and the entire app renders
13
- * its error page. Losing minimal snapshots is a far better failure than losing
14
- * the session, so this degrades instead.
15
- *
16
- * The two signatures are identical, so behaviour differs only in that defaults
17
- * reappear in snapshots on older hosts (bigger session snapshots and shared
18
- * URLs, nothing incorrect). stripDefaultSnapshot.test.ts still pins the stripped
19
- * behaviour, since dev runs against a version that has it.
11
+ * The signatures are identical; on older hosts, defaults reappear in snapshots
12
+ * and shared URLs. stripDefaultSnapshot.test.ts pins the stripped behaviour.
20
13
  */
21
14
  export function stripDefault(type, defaultValue) {
22
15
  return typeof types.stripDefault === 'function'
@@ -1 +1 @@
1
- {"version":3,"file":"stripDefault.js","sourceRoot":"","sources":["../src/stripDefault.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAQhD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAQ,EACR,YAAgD;IAEhD,OAAO,OAAO,KAAK,CAAC,YAAY,KAAK,UAAU;QAC7C,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC;QACxC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;AACxC,CAAC"}
1
+ {"version":3,"file":"stripDefault.js","sourceRoot":"","sources":["../src/stripDefault.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAQhD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAQ,EACR,YAAgD;IAEhD,OAAO,OAAO,KAAK,CAAC,YAAY,KAAK,UAAU;QAC7C,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC;QACxC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;AACxC,CAAC"}