jbrowse-plugin-graphgenomeviewer 9.0.1 → 10.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 (331) hide show
  1. package/README.md +5 -0
  2. package/dist/chunks/AddTrackWorkflow-W7XIQ5F3.js +2 -0
  3. package/dist/chunks/AddTrackWorkflow-W7XIQ5F3.js.map +7 -0
  4. package/dist/chunks/{ChooseSamplesDialog-7RI573UO.js → ChooseSamplesDialog-5PTJ6ZDV.js} +2 -2
  5. package/dist/chunks/{ChooseWalksDialog-4LDYDQH2.js → ChooseWalksDialog-DN6J7FGD.js} +2 -2
  6. package/dist/chunks/GbzBaseSyntenyAdapter-JMYDJODG.js +9 -0
  7. package/dist/chunks/GbzBaseSyntenyAdapter-JMYDJODG.js.map +7 -0
  8. package/dist/chunks/GraphGenomeView-YWPL7SG6.js +10 -0
  9. package/dist/chunks/GraphGenomeView-YWPL7SG6.js.map +7 -0
  10. package/dist/chunks/GraphSettingsDialog-TW6UZMWK.js +2 -0
  11. package/dist/chunks/GraphSettingsDialog-TW6UZMWK.js.map +7 -0
  12. package/dist/chunks/HighlightColorDialog-EHUV75LC.js +2 -0
  13. package/dist/chunks/{HighlightColorDialog-6EOFDJDZ.js.map → HighlightColorDialog-EHUV75LC.js.map} +1 -1
  14. package/dist/chunks/LinearGraphDisplay-QXKYX5H2.js +2 -0
  15. package/dist/chunks/{LinearGraphDisplay-DHDMNOW4.js.map → LinearGraphDisplay-QXKYX5H2.js.map} +1 -1
  16. package/dist/chunks/MinigraphBubbleAdapter-N5BOXD7U.js +2 -0
  17. package/dist/chunks/{MinigraphBubbleAdapter-K2D7CW3M.js.map → MinigraphBubbleAdapter-N5BOXD7U.js.map} +1 -1
  18. package/dist/chunks/RgfaTabixAdapter-FZZ7W2HN.js +2 -0
  19. package/dist/chunks/{RgfaTabixAdapter-PF2RC3RZ.js.map → RgfaTabixAdapter-FZZ7W2HN.js.map} +1 -1
  20. package/dist/chunks/{TrackWarningsDialog-V5YSUFRO.js → TrackWarningsDialog-HXJSVKII.js} +2 -2
  21. package/dist/chunks/WalkFormsAdapter-TZW5UBRI.js +2 -0
  22. package/dist/chunks/WalkFormsAdapter-TZW5UBRI.js.map +7 -0
  23. package/dist/chunks/WalkTabixSyntenyAdapter-XM7HBNJA.js +2 -0
  24. package/dist/chunks/WalkTabixSyntenyAdapter-XM7HBNJA.js.map +7 -0
  25. package/dist/chunks/chunk-3GK5ZBUB.js +2 -0
  26. package/dist/chunks/chunk-3GK5ZBUB.js.map +7 -0
  27. package/dist/chunks/chunk-4HKASMM4.js +2 -0
  28. package/dist/chunks/chunk-4HKASMM4.js.map +7 -0
  29. package/dist/chunks/chunk-4RZCYOCW.js +2 -0
  30. package/dist/chunks/chunk-4RZCYOCW.js.map +7 -0
  31. package/dist/chunks/{chunk-6OZGIMZC.js → chunk-5IZ6O334.js} +2 -2
  32. package/dist/chunks/{chunk-TC265JAP.js → chunk-5L276I7O.js} +2 -2
  33. package/dist/chunks/{chunk-TC265JAP.js.map → chunk-5L276I7O.js.map} +2 -2
  34. package/dist/chunks/chunk-6HGDLU7H.js +9 -0
  35. package/dist/chunks/chunk-6HGDLU7H.js.map +7 -0
  36. package/dist/chunks/chunk-6TXZQA6S.js +2 -0
  37. package/dist/chunks/chunk-6TXZQA6S.js.map +7 -0
  38. package/dist/chunks/chunk-AVUNIRM5.js +5 -0
  39. package/dist/chunks/chunk-AVUNIRM5.js.map +7 -0
  40. package/dist/chunks/chunk-CTQBRAQH.js +6 -0
  41. package/dist/chunks/chunk-CTQBRAQH.js.map +7 -0
  42. package/dist/chunks/chunk-D3QZGLZ3.js +2 -0
  43. package/dist/chunks/chunk-D3QZGLZ3.js.map +7 -0
  44. package/dist/chunks/chunk-D6TY2QEG.js +2 -0
  45. package/dist/chunks/chunk-D6TY2QEG.js.map +7 -0
  46. package/dist/chunks/chunk-D7BAG2VJ.js +2 -0
  47. package/dist/chunks/chunk-D7BAG2VJ.js.map +7 -0
  48. package/dist/chunks/chunk-G6DZANDH.js +2 -0
  49. package/dist/chunks/chunk-G6DZANDH.js.map +7 -0
  50. package/dist/chunks/{chunk-WE7DQVXF.js → chunk-H42TSPVA.js} +2 -2
  51. package/dist/chunks/{chunk-WE7DQVXF.js.map → chunk-H42TSPVA.js.map} +2 -2
  52. package/dist/chunks/chunk-H5PFNYKH.js +2 -0
  53. package/dist/chunks/chunk-H5PFNYKH.js.map +7 -0
  54. package/dist/chunks/chunk-HTVBMX7V.js +2 -0
  55. package/dist/chunks/chunk-HTVBMX7V.js.map +7 -0
  56. package/dist/chunks/chunk-IK5G3JHR.js +2 -0
  57. package/dist/chunks/chunk-IK5G3JHR.js.map +7 -0
  58. package/dist/chunks/chunk-JLIDLLZG.js +2 -0
  59. package/dist/chunks/chunk-JLIDLLZG.js.map +7 -0
  60. package/dist/chunks/chunk-JM4W4PKP.js +2 -0
  61. package/dist/chunks/chunk-JM4W4PKP.js.map +7 -0
  62. package/dist/chunks/chunk-JWIFJIPZ.js +2 -0
  63. package/dist/chunks/chunk-JWIFJIPZ.js.map +7 -0
  64. package/dist/chunks/chunk-LRBNBP2K.js +4 -0
  65. package/dist/chunks/chunk-LRBNBP2K.js.map +7 -0
  66. package/dist/chunks/chunk-MYJVR2OX.js +2 -0
  67. package/dist/chunks/chunk-MYJVR2OX.js.map +7 -0
  68. package/dist/chunks/chunk-NDWP2KNR.js +5 -0
  69. package/dist/chunks/chunk-NDWP2KNR.js.map +7 -0
  70. package/dist/chunks/chunk-NLHJYXCS.js +4 -0
  71. package/dist/chunks/{chunk-5YY3OGK6.js.map → chunk-NLHJYXCS.js.map} +4 -4
  72. package/dist/chunks/{chunk-MSAVT4CG.js → chunk-NTXLYTF6.js} +1 -1
  73. package/dist/chunks/{chunk-MSAVT4CG.js.map → chunk-NTXLYTF6.js.map} +1 -1
  74. package/dist/chunks/chunk-OIGMGVI6.js +4 -0
  75. package/dist/chunks/chunk-OIGMGVI6.js.map +7 -0
  76. package/dist/chunks/chunk-OP2PTYDR.js +2 -0
  77. package/dist/chunks/chunk-OP2PTYDR.js.map +7 -0
  78. package/dist/chunks/chunk-RQSCKHNS.js +2 -0
  79. package/dist/chunks/chunk-RQSCKHNS.js.map +7 -0
  80. package/dist/chunks/chunk-WBJPOKQT.js +3 -0
  81. package/dist/chunks/chunk-WBJPOKQT.js.map +7 -0
  82. package/dist/chunks/{chunk-HHWF6AVX.js → chunk-YROUE32O.js} +2 -2
  83. package/dist/chunks/chunk-YROUE32O.js.map +7 -0
  84. package/dist/chunks/chunk-ZLQEXXMV.js +2 -0
  85. package/dist/chunks/chunk-ZLQEXXMV.js.map +7 -0
  86. package/dist/chunks/chunk-ZVMXECJA.js +2 -0
  87. package/dist/chunks/chunk-ZVMXECJA.js.map +7 -0
  88. package/dist/chunks/{executeDiagonalize-ZMW5BLEJ.js → executeDiagonalize-XP4MNCTJ.js} +2 -2
  89. package/dist/chunks/renderSvg-X3BRMJX3.js +2 -0
  90. package/dist/chunks/renderSvg-X3BRMJX3.js.map +7 -0
  91. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +1 -8
  92. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +4 -4
  93. package/package.json +3 -3
  94. package/src/GbzBaseSyntenyAdapter/GbzBaseSyntenyAdapter.test.ts +5 -3
  95. package/src/GbzBaseSyntenyAdapter/configSchema.ts +4 -3
  96. package/src/GetSubgraph.ts +4 -6
  97. package/src/GraphAddTrackWorkflow/AddTrackWorkflow.tsx +2 -2
  98. package/src/GraphAddTrackWorkflow/buildTrackConfig.ts +0 -5
  99. package/src/GraphAddTrackWorkflow/graphManifest.ts +1 -1
  100. package/src/GraphAddTrackWorkflow/walkReference.test.ts +1 -1
  101. package/src/GraphAddTrackWorkflow/walkReference.ts +1 -2
  102. package/src/GraphGenomeView/components/BubbleHalos.tsx +2 -2
  103. package/src/GraphGenomeView/components/EdgeMarksOverlay.tsx +52 -0
  104. package/src/GraphGenomeView/components/FacetPanels.test.tsx +2 -1
  105. package/src/GraphGenomeView/components/FacetPanels.tsx +6 -2
  106. package/src/GraphGenomeView/components/GenePins.tsx +2 -27
  107. package/src/GraphGenomeView/components/GraphCanvas.test.tsx +10 -0
  108. package/src/GraphGenomeView/components/GraphCanvas.tsx +35 -61
  109. package/src/GraphGenomeView/components/GraphGenomeView.test.tsx +4 -3
  110. package/src/GraphGenomeView/components/GraphLoadStatus.test.tsx +40 -0
  111. package/src/GraphGenomeView/components/GraphLoadStatus.tsx +41 -12
  112. package/src/GraphGenomeView/components/GraphSettingsDialog.tsx +5 -4
  113. package/src/GraphGenomeView/components/GraphStats.tsx +3 -3
  114. package/src/GraphGenomeView/components/GraphToolbar.tsx +3 -3
  115. package/src/GraphGenomeView/components/GraphTrackPicker.tsx +136 -0
  116. package/src/GraphGenomeView/components/HoverLayer.tsx +1 -1
  117. package/src/GraphGenomeView/components/HoverTooltip.test.tsx +139 -0
  118. package/src/GraphGenomeView/components/HoverTooltip.tsx +62 -23
  119. package/src/GraphGenomeView/components/ImportForm.test.tsx +149 -0
  120. package/src/GraphGenomeView/components/ImportForm.tsx +81 -9
  121. package/src/GraphGenomeView/components/LabelChip.tsx +3 -1
  122. package/src/GraphGenomeView/components/LabelLayer.test.tsx +72 -0
  123. package/src/GraphGenomeView/components/LabelLayer.tsx +86 -28
  124. package/src/GraphGenomeView/components/Legend.test.tsx +73 -0
  125. package/src/GraphGenomeView/components/Legend.tsx +28 -4
  126. package/src/GraphGenomeView/components/LegendSwatch.tsx +56 -4
  127. package/src/GraphGenomeView/components/Legends.settle.test.tsx +117 -0
  128. package/src/GraphGenomeView/components/PaneContextMenu.test.tsx +70 -0
  129. package/src/GraphGenomeView/components/PaneContextMenu.tsx +5 -6
  130. package/src/GraphGenomeView/components/PaneLayer.tsx +2 -1
  131. package/src/GraphGenomeView/components/PaneSvg.tsx +64 -64
  132. package/src/GraphGenomeView/components/PassBars.tsx +32 -0
  133. package/src/{LinearGraphDisplay → GraphGenomeView}/components/SubgraphContextSelect.test.tsx +5 -8
  134. package/src/{LinearGraphDisplay → GraphGenomeView}/components/SubgraphContextSelect.tsx +6 -4
  135. package/src/{LinearGraphDisplay → GraphGenomeView}/components/SubgraphHaplotypesField.test.tsx +4 -9
  136. package/src/{LinearGraphDisplay → GraphGenomeView}/components/SubgraphHaplotypesField.tsx +12 -12
  137. package/src/GraphGenomeView/components/WalkRowsOverlay.test.tsx +2 -1
  138. package/src/GraphGenomeView/components/WalkRowsOverlay.tsx +10 -4
  139. package/src/GraphGenomeView/components/WalkStrip.test.tsx +47 -1
  140. package/src/GraphGenomeView/components/WalkStrip.tsx +26 -11
  141. package/src/GraphGenomeView/components/legendStyles.ts +11 -2
  142. package/src/GraphGenomeView/components/usePaneGestures.test.tsx +185 -1
  143. package/src/GraphGenomeView/components/usePaneGestures.ts +17 -7
  144. package/src/GraphGenomeView/graphLayers.test.ts +9 -0
  145. package/src/GraphGenomeView/graphLayers.ts +10 -0
  146. package/src/GraphGenomeView/graphTrackChoices.test.ts +69 -0
  147. package/src/GraphGenomeView/graphTrackChoices.ts +75 -0
  148. package/src/GraphGenomeView/host.test.ts +76 -1
  149. package/src/GraphGenomeView/host.ts +49 -0
  150. package/src/GraphGenomeView/legendSections.test.ts +211 -111
  151. package/src/GraphGenomeView/legendSections.ts +267 -284
  152. package/src/GraphGenomeView/model.color.test.ts +645 -0
  153. package/src/GraphGenomeView/model.fit.test.ts +1106 -0
  154. package/src/GraphGenomeView/model.fold.test.ts +197 -0
  155. package/src/GraphGenomeView/model.geneNames.test.ts +371 -0
  156. package/src/GraphGenomeView/model.labelRuns.test.ts +425 -0
  157. package/src/GraphGenomeView/model.launch.test.ts +837 -0
  158. package/src/GraphGenomeView/model.layout.test.ts +1149 -0
  159. package/src/GraphGenomeView/model.load.test.ts +907 -0
  160. package/src/GraphGenomeView/model.passes.test.tsx +121 -0
  161. package/src/GraphGenomeView/model.ts +317 -18
  162. package/src/GraphGenomeView/model.walkRows.test.ts +1381 -0
  163. package/src/GraphGenomeView/modelTestMocks.ts +109 -0
  164. package/src/GraphGenomeView/modelTestSupport.ts +138 -0
  165. package/src/GraphGenomeView/pane/fitViews.ts +349 -79
  166. package/src/GraphGenomeView/pane/graphViews.ts +257 -90
  167. package/src/GraphGenomeView/pane/hostViews.ts +17 -3
  168. package/src/GraphGenomeView/pane/launchActions.ts +41 -3
  169. package/src/GraphGenomeView/pane/loadActions.ts +260 -145
  170. package/src/GraphGenomeView/pane/paneBase.test.ts +23 -0
  171. package/src/GraphGenomeView/pane/paneBase.ts +40 -14
  172. package/src/GraphGenomeView/pane/renderingActions.ts +96 -35
  173. package/src/GraphGenomeView/pane/settingActions.ts +64 -12
  174. package/src/GraphGenomeView/pane/tubeMapViews.ts +6 -2
  175. package/src/GraphGenomeView/pane/walkRowViews.ts +41 -20
  176. package/src/GraphGenomeView/readoutMeasure.ts +25 -0
  177. package/src/GraphGenomeView/skipStrokes.test.ts +226 -0
  178. package/src/GraphGenomeView/subgraphLoad.test.ts +270 -32
  179. package/src/GraphGenomeView/tubeMapPanels.test.ts +29 -5
  180. package/src/GraphGenomeView/tubeMapPanels.ts +22 -12
  181. package/src/GraphGenomeView/unloadedWalks.test.ts +92 -0
  182. package/src/GraphGenomeView/unloadedWalks.ts +53 -0
  183. package/src/GraphGenomeView/viewModel.ts +27 -30
  184. package/src/GraphGenomeView/walkRowGroups.test.ts +64 -0
  185. package/src/GraphGenomeView/walkRowGroups.ts +15 -21
  186. package/src/GraphGenomeView/walkRowSpans.test.ts +95 -10
  187. package/src/GraphGenomeView/walkRowSpans.ts +104 -36
  188. package/src/GraphGenomeView/walkRowsCut.ts +1 -0
  189. package/src/LinearGraphDisplay/LinearGraphDisplay.test.ts +1272 -132
  190. package/src/LinearGraphDisplay/configSchema.ts +19 -11
  191. package/src/LinearGraphDisplay/graphFacetConfigSchema.ts +0 -4
  192. package/src/LinearGraphDisplay/index.ts +1 -3
  193. package/src/LinearGraphDisplay/model.ts +319 -173
  194. package/src/MinigraphBubbleAdapter/configSchema.ts +1 -1
  195. package/src/RgfaTabixAdapter/configSchema.ts +6 -6
  196. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/build.sh +3 -3
  197. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/follow.GRCh38.walks.gz +0 -0
  198. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/follow.GRCh38.walks.gz.idx +1 -1
  199. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/header.GRCh38.walks.gz +0 -0
  200. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/header.GRCh38.walks.gz.idx +1 -1
  201. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/inversion.GRCh38.walks.gz +0 -0
  202. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/inversion.GRCh38.walks.gz.idx +1 -1
  203. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/lanepairs.GRCh38.walks.gz +0 -0
  204. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/lanepairs.GRCh38.walks.gz.idx +1 -1
  205. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/maxnode.GRCh38.walks.gz +0 -0
  206. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/maxnode.GRCh38.walks.gz.idx +1 -1
  207. package/src/RgfaTabixAdapter/test_data/walks8/rejoin.GRCh38.walks.gz +0 -0
  208. package/src/RgfaTabixAdapter/test_data/walks8/rejoin.GRCh38.walks.gz.idx +3 -0
  209. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/skip.GRCh38.walks.gz +0 -0
  210. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/skip.GRCh38.walks.gz.idx +1 -1
  211. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/skipfollow.GRCh38.walks.gz +0 -0
  212. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/skipfollow.GRCh38.walks.gz.idx +1 -1
  213. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/skipinv.GRCh38.walks.gz +0 -0
  214. package/src/RgfaTabixAdapter/test_data/walks8/skipinv.GRCh38.walks.gz.idx +3 -0
  215. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/twopart.GRCh38.walks.gz +0 -0
  216. package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/twopart.GRCh38.walks.gz.idx +1 -1
  217. package/src/RgfaTabixAdapter/walkCut.ts +12 -5
  218. package/src/RgfaTabixAdapter/walkFiles.test.ts +27 -33
  219. package/src/RgfaTabixAdapter/walkReader.ts +11 -28
  220. package/src/WalkFormsAdapter/WalkFormsAdapter.test.ts +2 -21
  221. package/src/WalkFormsAdapter/WalkFormsAdapter.ts +7 -18
  222. package/src/WalkFormsAdapter/configSchema.ts +15 -14
  223. package/src/WalkFormsAdapter/formRows.test.ts +3 -4
  224. package/src/WalkFormsAdapter/formRows.ts +4 -21
  225. package/src/WalkTabixSyntenyAdapter/WalkTabixSyntenyAdapter.test.ts +35 -1
  226. package/src/WalkTabixSyntenyAdapter/WalkTabixSyntenyAdapter.ts +44 -14
  227. package/src/WalkTabixSyntenyAdapter/configSchema.ts +9 -6
  228. package/src/WalkTabixSyntenyAdapter/gbzParity.test.ts +2 -2
  229. package/src/WalkTabixSyntenyAdapter/test_data/lane_colors.tsv +5 -0
  230. package/src/graphTrackConfig.ts +12 -0
  231. package/src/graphTrackDefaults/index.ts +1 -7
  232. package/src/graphTrackReach.ts +21 -0
  233. package/src/hoverSync/rowWalks.test.ts +10 -6
  234. package/src/hoverSync/rowWalks.ts +5 -7
  235. package/src/launchFromGraph/contributors.test.ts +27 -0
  236. package/src/launchFromGraph/contributors.ts +9 -1
  237. package/src/launchFromGraph/launchFromGraph.test.ts +31 -0
  238. package/src/launchFromGraph/launchFromGraph.ts +32 -0
  239. package/src/launchFromGraph/linearViewTarget.ts +9 -0
  240. package/src/nodeLimitError.ts +21 -0
  241. package/src/panSNAliases/panSNAliases.test.ts +2 -2
  242. package/src/panSNTabix.ts +1 -50
  243. package/src/slotDefaults.test.ts +12 -0
  244. package/src/slotDefaults.ts +12 -0
  245. package/src/synteny/sheetColors.ts +37 -0
  246. package/src/tabixSlots.ts +51 -0
  247. package/src/version.ts +1 -1
  248. package/dist/chunks/AddTrackWorkflow-VKX2F7EK.js +0 -2
  249. package/dist/chunks/AddTrackWorkflow-VKX2F7EK.js.map +0 -7
  250. package/dist/chunks/GbzBaseSyntenyAdapter-HN5P4AGF.js +0 -2
  251. package/dist/chunks/GbzBaseSyntenyAdapter-HN5P4AGF.js.map +0 -7
  252. package/dist/chunks/GraphGenomeView-GB6W6UZ4.js +0 -10
  253. package/dist/chunks/GraphGenomeView-GB6W6UZ4.js.map +0 -7
  254. package/dist/chunks/GraphTrackSettingsDialog-P2XQATEX.js +0 -4
  255. package/dist/chunks/GraphTrackSettingsDialog-P2XQATEX.js.map +0 -7
  256. package/dist/chunks/HighlightColorDialog-6EOFDJDZ.js +0 -2
  257. package/dist/chunks/LinearGraphDisplay-DHDMNOW4.js +0 -2
  258. package/dist/chunks/MinigraphBubbleAdapter-K2D7CW3M.js +0 -2
  259. package/dist/chunks/RgfaTabixAdapter-PF2RC3RZ.js +0 -2
  260. package/dist/chunks/WalkFormsAdapter-E5VINQZN.js +0 -2
  261. package/dist/chunks/WalkFormsAdapter-E5VINQZN.js.map +0 -7
  262. package/dist/chunks/WalkTabixSyntenyAdapter-AQ56UH4Y.js +0 -2
  263. package/dist/chunks/WalkTabixSyntenyAdapter-AQ56UH4Y.js.map +0 -7
  264. package/dist/chunks/chunk-2CSE6SGH.js +0 -2
  265. package/dist/chunks/chunk-2CSE6SGH.js.map +0 -7
  266. package/dist/chunks/chunk-3ETSJ4Z2.js +0 -3
  267. package/dist/chunks/chunk-3ETSJ4Z2.js.map +0 -7
  268. package/dist/chunks/chunk-57DOGFYN.js +0 -2
  269. package/dist/chunks/chunk-57DOGFYN.js.map +0 -7
  270. package/dist/chunks/chunk-5YY3OGK6.js +0 -4
  271. package/dist/chunks/chunk-CRMC2DTD.js +0 -4
  272. package/dist/chunks/chunk-CRMC2DTD.js.map +0 -7
  273. package/dist/chunks/chunk-EPSEVFYY.js +0 -4
  274. package/dist/chunks/chunk-EPSEVFYY.js.map +0 -7
  275. package/dist/chunks/chunk-GH6WRWYC.js +0 -2
  276. package/dist/chunks/chunk-GH6WRWYC.js.map +0 -7
  277. package/dist/chunks/chunk-HHWF6AVX.js.map +0 -7
  278. package/dist/chunks/chunk-I6NW3VGS.js +0 -2
  279. package/dist/chunks/chunk-I6NW3VGS.js.map +0 -7
  280. package/dist/chunks/chunk-IAB4ZGCR.js +0 -3
  281. package/dist/chunks/chunk-IAB4ZGCR.js.map +0 -7
  282. package/dist/chunks/chunk-M2D7NUOY.js +0 -2
  283. package/dist/chunks/chunk-M2D7NUOY.js.map +0 -7
  284. package/dist/chunks/chunk-NIGOHOFJ.js +0 -6
  285. package/dist/chunks/chunk-NIGOHOFJ.js.map +0 -7
  286. package/dist/chunks/chunk-OTHDGBEZ.js +0 -9
  287. package/dist/chunks/chunk-OTHDGBEZ.js.map +0 -7
  288. package/dist/chunks/chunk-P5SI66S3.js +0 -2
  289. package/dist/chunks/chunk-P5SI66S3.js.map +0 -7
  290. package/dist/chunks/chunk-RYM2UTLL.js +0 -2
  291. package/dist/chunks/chunk-RYM2UTLL.js.map +0 -7
  292. package/dist/chunks/chunk-T5X4OJJ2.js +0 -2
  293. package/dist/chunks/chunk-T5X4OJJ2.js.map +0 -7
  294. package/dist/chunks/chunk-T7NMFIRW.js +0 -2
  295. package/dist/chunks/chunk-T7NMFIRW.js.map +0 -7
  296. package/dist/chunks/chunk-UH3LQSHA.js +0 -2
  297. package/dist/chunks/chunk-UH3LQSHA.js.map +0 -7
  298. package/dist/chunks/chunk-ULWTJWXX.js +0 -2
  299. package/dist/chunks/chunk-ULWTJWXX.js.map +0 -7
  300. package/dist/chunks/chunk-VPKTQAAQ.js +0 -3
  301. package/dist/chunks/chunk-VPKTQAAQ.js.map +0 -7
  302. package/dist/chunks/chunk-WCFLR4AJ.js +0 -2
  303. package/dist/chunks/chunk-WCFLR4AJ.js.map +0 -7
  304. package/dist/chunks/chunk-XZU7RJUH.js +0 -2
  305. package/dist/chunks/chunk-XZU7RJUH.js.map +0 -7
  306. package/dist/chunks/chunk-ZN2NTCLU.js +0 -2
  307. package/dist/chunks/chunk-ZN2NTCLU.js.map +0 -7
  308. package/dist/chunks/renderSvg-CZH4IATB.js +0 -2
  309. package/dist/chunks/renderSvg-CZH4IATB.js.map +0 -7
  310. package/src/GraphGenomeView/model.test.ts +0 -5579
  311. package/src/GraphGenomeView/retiredNodeColor.test.ts +0 -46
  312. package/src/GraphGenomeView/retiredNodeColor.ts +0 -76
  313. package/src/LinearGraphDisplay/components/GraphTrackSettingsDialog.tsx +0 -22
  314. package/src/LinearGraphDisplay/graphFacetConfigSchema.test.ts +0 -13
  315. package/src/RgfaTabixAdapter/test_data/walks7/rejoin.GRCh38.walks.gz +0 -0
  316. package/src/RgfaTabixAdapter/test_data/walks7/rejoin.GRCh38.walks.gz.idx +0 -3
  317. package/src/RgfaTabixAdapter/test_data/walks7/skipinv.GRCh38.walks.gz.idx +0 -3
  318. /package/dist/chunks/{ChooseSamplesDialog-7RI573UO.js.map → ChooseSamplesDialog-5PTJ6ZDV.js.map} +0 -0
  319. /package/dist/chunks/{ChooseWalksDialog-4LDYDQH2.js.map → ChooseWalksDialog-DN6J7FGD.js.map} +0 -0
  320. /package/dist/chunks/{TrackWarningsDialog-V5YSUFRO.js.map → TrackWarningsDialog-HXJSVKII.js.map} +0 -0
  321. /package/dist/chunks/{chunk-6OZGIMZC.js.map → chunk-5IZ6O334.js.map} +0 -0
  322. /package/dist/chunks/{executeDiagonalize-ZMW5BLEJ.js.map → executeDiagonalize-XP4MNCTJ.js.map} +0 -0
  323. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/follow.GRCh38.gfa +0 -0
  324. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/header.GRCh38.gfa +0 -0
  325. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/inversion.GRCh38.gfa +0 -0
  326. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/lanepairs.GRCh38.gfa +0 -0
  327. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/maxnode.GRCh38.gfa +0 -0
  328. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/skip.GRCh38.gfa +0 -0
  329. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/skipfollow.GRCh38.gfa +0 -0
  330. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/skipinv.GRCh38.gfa +0 -0
  331. /package/src/RgfaTabixAdapter/test_data/{walks7 → walks8}/twopart.GRCh38.gfa +0 -0
@@ -0,0 +1,121 @@
1
+ import { layoutEngine } from '@jbrowse/bandage-core/layoutEngines'
2
+ import { abgrHex } from '@jbrowse/bandage-core/renderer/colorBits'
3
+ import { render } from '@testing-library/react'
4
+
5
+ import PassBars from './components/PassBars'
6
+ import WalkStrip from './components/WalkStrip'
7
+ import { mockRpcCall } from './modelTestMocks'
8
+ import stateModelFactory from './viewModel'
9
+
10
+ import type { EngineRequest } from '@jbrowse/bandage-core/pipeline'
11
+
12
+ vi.mock('@jbrowse/core/util', async () =>
13
+ (await import('./modelTestMocks')).coreUtilMock(),
14
+ )
15
+ vi.mock(import('@jbrowse/core/configuration'), async importOriginal =>
16
+ (await import('./modelTestMocks')).configurationMock(await importOriginal()),
17
+ )
18
+ vi.mock('@jbrowse/core/util/io', async () =>
19
+ (await import('./modelTestMocks')).ioMock(),
20
+ )
21
+
22
+ // a repeat a, b, c, d the reference reads once and hap#1 three times
23
+ const GFA = [
24
+ 'S\tf1\tAAAAAAAAAA',
25
+ 'S\ta\tCCCC',
26
+ 'S\tb\tGGGG',
27
+ 'S\tc\tTTTT',
28
+ 'S\td\tAAAA',
29
+ 'S\tf2\tGGGGGGGGGG',
30
+ 'L\tf1\t+\ta\t+\t0M',
31
+ 'L\ta\t+\tb\t+\t0M',
32
+ 'L\tb\t+\tc\t+\t0M',
33
+ 'L\tc\t+\td\t+\t0M',
34
+ 'L\td\t+\ta\t+\t0M',
35
+ 'L\td\t+\tf2\t+\t0M',
36
+ 'W\tref\t0\tchr\t0\t26\t>f1>a>b>c>d>f2',
37
+ 'W\thap\t1\tctg\t0\t*\t>f1>a>b>c>d>a>b>c>d>a>b>c>d>f2',
38
+ '',
39
+ ].join('\n')
40
+
41
+ async function liftedByPass(walkStrip = false) {
42
+ mockRpcCall.mockImplementation(
43
+ (_session: unknown, method: string, request: EngineRequest) =>
44
+ method === 'GraphComputeLayout'
45
+ ? layoutEngine(request)
46
+ : Promise.reject(new Error(`Unexpected RPC: ${method}`)),
47
+ )
48
+ const model = stateModelFactory().create({
49
+ type: 'GraphGenomeView',
50
+ layoutMode: 'ordered',
51
+ layers: { walkStrip },
52
+ })
53
+ model.setWidth(1200)
54
+ await model.loadGFA(GFA, 'repeat')
55
+ model.setLegendSize({ width: 150, height: 60 })
56
+ model.setWalkLayers([
57
+ { walk: 'ref#0#chr' },
58
+ { walk: 'hap#1#ctg', color: { field: 'pass' } },
59
+ ])
60
+ model.zoomToFit()
61
+ const { batch, viewportBounds } = model.buildDrawing(model.walkLift, false)!
62
+ model.setGeometryMetrics(0, batch, {
63
+ scale: model.scale,
64
+ bounds: viewportBounds,
65
+ })
66
+ return model
67
+ }
68
+
69
+ test('each pass of a walk lifted by pass is named once on the graph, beside a thread of its own', async () => {
70
+ const model = await liftedByPass()
71
+ const placed = model.overlayLabels.passes
72
+ expect(placed.map(p => p.text).sort()).toEqual(['pass 1', 'pass 2', 'pass 3'])
73
+ for (const { item } of placed) {
74
+ expect(item.walk).toBe('hap#1#ctg')
75
+ expect(item.at.x).toBeGreaterThanOrEqual(0)
76
+ expect(item.at.x).toBeLessThanOrEqual(model.paneWidth)
77
+ }
78
+ model.setWalkLayers([{ walk: 'ref#0#chr' }, { walk: 'hap#1#ctg' }])
79
+ expect(model.overlayLabels.passes).toEqual([])
80
+ })
81
+
82
+ test('a view of its own draws a bar along each walk lifted by pass, colouring the stretches each pass steps again', async () => {
83
+ const model = await liftedByPass()
84
+ const [bar, ...more] = model.passBars
85
+ expect(more).toEqual([])
86
+ expect(bar!.walk).toBe('hap#1#ctg')
87
+ expect(bar!.passes.map(p => [p.text, p.start, p.end])).toEqual([
88
+ ['pass 1 · 16 bp', 10, 26],
89
+ ['pass 2 · 16 bp', 26, 42],
90
+ ['pass 3 · 16 bp', 42, 58],
91
+ ])
92
+ const { getAllByTestId } = render(<PassBars model={model} />)
93
+ const [drawn] = getAllByTestId('graph-pass-bar')
94
+ expect(drawn!.textContent).toContain('along its length')
95
+ for (const name of ['pass 1 · 16 bp', 'pass 2 · 16 bp', 'pass 3 · 16 bp']) {
96
+ expect(drawn!.textContent).toContain(name)
97
+ }
98
+ model.setWalkLayers([{ walk: 'ref#0#chr' }, { walk: 'hap#1#ctg' }])
99
+ expect(model.passBars).toEqual([])
100
+ })
101
+
102
+ test("the strip paints a walk lifted by pass in its passes' colours, and its pass bar goes while the strip draws its row", async () => {
103
+ const model = await liftedByPass(true)
104
+ const drawn = model.walkLift!.walks.find(w => w.name === 'hap#1#ctg')!
105
+ const passColors = drawn.walkPasses!.passes.map(pass => abgrHex(pass.ink))
106
+ expect(passColors).toHaveLength(3)
107
+ const { getByTestId } = render(<WalkStrip model={model} />)
108
+ const hapRow = [
109
+ ...getByTestId('graph-walk-strip').querySelectorAll(
110
+ '[data-testid="graph-walk-row"]',
111
+ ),
112
+ ].find(row => row.querySelector('linearGradient'))!
113
+ const stops = [...hapRow.querySelectorAll('stop')].map(stop =>
114
+ stop.getAttribute('stop-color'),
115
+ )
116
+ expect(stops).toEqual(expect.arrayContaining(passColors))
117
+ expect(model.passBars).toEqual([])
118
+ model.setWalkRowSamples(['ref'])
119
+ expect(model.walkStripRows!.rows).toEqual([])
120
+ expect(model.passBars.map(bar => bar.walk)).toEqual(['hap#1#ctg'])
121
+ })
@@ -1,23 +1,191 @@
1
- import { getSession } from '@jbrowse/core/util'
1
+ import { sameInkOnPane } from '@jbrowse/bandage-core/drawnInk'
2
+ import { drawnMarks, graphKey } from '@jbrowse/bandage-core/graphKey'
3
+ import { layoutLabels } from '@jbrowse/bandage-core/labelLayout'
4
+ import { passLabelCandidates } from '@jbrowse/bandage-core/passLabels'
5
+ import { keyedView } from '@jbrowse/bandage-core/viewport'
6
+ import { getRpcSessionId, getSession } from '@jbrowse/core/util'
7
+ import { addDisposer, isAlive } from '@jbrowse/mobx-state-tree'
8
+ import { computed, reaction, untracked } from 'mobx'
2
9
 
3
10
  import {
4
11
  configHaplotypes,
5
12
  graphReferenceAssembly,
6
13
  offReferenceProblem,
14
+ walkIndexed,
7
15
  } from '../graphTrackConfig'
8
16
  import { canonicalAssemblyName } from '../launchFromGraph/launchFromGraph'
9
17
  import { withLaunchActions } from './pane/launchActions'
18
+ import { VIEWPORT_DEBOUNCE_MS } from './pane/paneBase'
10
19
 
11
20
  import type { SubgraphCutOptions, SubgraphRegion } from '../GetSubgraph'
12
- import type { LayoutModeValue } from '@jbrowse/bandage-core/layoutModes'
21
+ import type { PaneLayout } from './tubeMapPanels'
22
+ import type { GraphKey, GraphKeyEntry } from '@jbrowse/bandage-core/graphKey'
23
+ import type { LabelLayout } from '@jbrowse/bandage-core/labelLayout'
24
+ import type { Bounds } from '@jbrowse/bandage-core/pipeline'
13
25
  import type { Instance } from '@jbrowse/mobx-state-tree'
14
26
 
15
27
  export { MAX_GRAPH_REGION_BP, fileName, formatSpanBp } from './pane/paneBase'
16
28
 
29
+ const NO_LABELS: LabelLayout = {
30
+ bubbles: [],
31
+ ticks: [],
32
+ genes: [],
33
+ passes: [],
34
+ sizes: [],
35
+ }
36
+
37
+ const sameBounds = (a: Bounds, b: Bounds) =>
38
+ a.minX === b.minX &&
39
+ a.maxX === b.maxX &&
40
+ a.minY === b.minY &&
41
+ a.maxY === b.maxY
42
+
43
+ const sameEntry = (a: GraphKeyEntry, b: GraphKeyEntry | undefined) =>
44
+ !!b &&
45
+ a.key === b.key &&
46
+ a.text === b.text &&
47
+ a.strong === b.strong &&
48
+ a.under === b.under &&
49
+ a.hover === b.hover &&
50
+ a.walk === b.walk &&
51
+ JSON.stringify(a.swatch) === JSON.stringify(b.swatch)
52
+
53
+ const sameKey = (a: GraphKey, b: GraphKey) =>
54
+ a.length === b.length &&
55
+ a.every((section, i) => {
56
+ const other = b[i]
57
+ return (
58
+ !!other &&
59
+ section.id === other.id &&
60
+ section.group === other.group &&
61
+ section.entries.length === other.entries.length &&
62
+ section.entries.every((entry, j) => sameEntry(entry, other.entries[j]))
63
+ )
64
+ })
65
+
17
66
  // The pane every graph drawing is: a view of its own, or a display inside a
18
67
  // linear view. Built in stages under pane/, each extending the one before,
19
68
  // and given here the cut options both hosts share.
20
69
  export const GraphPane = withLaunchActions
70
+ // Each facet panel's drawing, which the panel paints and the key reads
71
+ .views(self => ({
72
+ get facetDrawings() {
73
+ return self.facetPanels?.map(panel => self.buildDrawing(panel, false))
74
+ },
75
+ }))
76
+ // The view the key keys, set once a pan or zoom has settled (afterAttach),
77
+ // so the key, and the labels that wait on its measure, hold still through a
78
+ // gesture. Until one is set on the drawing's layout, the pane's view as it
79
+ // is.
80
+ .volatile(() => ({
81
+ settledKeyView: undefined as
82
+ { view: Bounds; layout: PaneLayout | undefined } | undefined,
83
+ }))
84
+ .actions(self => ({
85
+ setSettledKeyView(view: Bounds) {
86
+ self.settledKeyView = { view, layout: self.layoutResult }
87
+ },
88
+ }))
89
+ .views(self => ({
90
+ get liveKeyView() {
91
+ return keyedView(self, self.axisScale, {
92
+ paneWidth: self.drawingClip ? self.drawingWidth : self.paneWidth,
93
+ canvasHeight: self.canvasHeight,
94
+ referenceStripZonePx: self.referenceStripZonePx,
95
+ })
96
+ },
97
+ get keyView() {
98
+ const settled = self.settledKeyView
99
+ return settled && settled.layout === self.layoutResult
100
+ ? settled.view
101
+ : this.liveKeyView
102
+ },
103
+ }))
104
+ // bandage-core's key for the graph on screen, which the legend and the
105
+ // facet key draw: of the drawing the pane shows beside the key, or of
106
+ // every facet panel's whole. A view that brings no mark in or out leaves it
107
+ // as it was.
108
+ .views(self => {
109
+ const key = computed(
110
+ () => {
111
+ const graph = self.drawnGraph
112
+ const drawings = self.facetDrawings
113
+ return graph
114
+ ? graphKey(graph, self.layoutResult ?? {}, {
115
+ region: self.graphRegion,
116
+ referenceRamp: self.referenceRamp,
117
+ lift: self.walkLift,
118
+ panels: self.facetPanels,
119
+ walkLabel: name => self.walkLabel(name),
120
+ nodeWidth: self.nodeWidth,
121
+ contigThickness: self.contigThickness,
122
+ edgeWidth: self.linkWidth,
123
+ connectorThickness: self.connectorThickness,
124
+ drawsNodes: self.drawsNodes,
125
+ marks: drawings
126
+ ? drawnMarks(
127
+ drawings.flatMap(drawing =>
128
+ drawing ? [drawing.batch] : [],
129
+ ),
130
+ )
131
+ : drawnMarks([self.settledBatch], self.keyView),
132
+ genePins: self.genePins,
133
+ halos: self.bubbleHalos,
134
+ stripOverhangs: self.referenceStripOverhangs || self.runsPastEdge,
135
+ unlabelled: self.labelsNodeSizes ? 'reserved' : undefined,
136
+ })
137
+ : []
138
+ },
139
+ { equals: sameKey },
140
+ )
141
+ return {
142
+ get graphKey() {
143
+ return key.get()
144
+ },
145
+ }
146
+ })
147
+ // Each lifted walk's passes named on the graph, which the labels place
148
+ // with the rest; a faceted pane names none
149
+ .views(self => ({
150
+ get passLabels() {
151
+ return !self.facetPanels &&
152
+ self.walkLift?.walks.some(walk => walk.walkPasses)
153
+ ? passLabelCandidates(
154
+ self.drawnBatch,
155
+ self.walkLift,
156
+ self.screenTransform,
157
+ { width: self.paneWidth, height: self.canvasHeight },
158
+ )
159
+ : []
160
+ },
161
+ }))
162
+ // The pane's batch as the labels read its ink: a rebuild that paints the
163
+ // same ink on the pane, as the one after a settled fit or a pan does, is
164
+ // not news to them, so it does not lay them out again
165
+ .views(self => {
166
+ const inkOnPane = computed(() => self.drawnBatch, {
167
+ equals: (a, b) =>
168
+ untracked(() =>
169
+ sameInkOnPane(a, b, {
170
+ ...self.screenTransform,
171
+ width: self.paneWidth,
172
+ height: self.canvasHeight,
173
+ }),
174
+ ),
175
+ })
176
+ return {
177
+ get drawnInk() {
178
+ inkOnPane.get()
179
+ return untracked(() => self.drawnBatch)
180
+ },
181
+ }
182
+ })
183
+ // The labels, placed once the frame is settled (labelFrameSettled)
184
+ .views(self => ({
185
+ get overlayLabels() {
186
+ return self.labelFrameSettled ? layoutLabels(self) : NO_LABELS
187
+ },
188
+ }))
21
189
  .views(self => ({
22
190
  // the config's defaultHaplotypes, which a cut is for until the user
23
191
  // picks others
@@ -44,34 +212,165 @@ export const GraphPane = withLaunchActions
44
212
  canonicalAssemblyName(session, region.assemblyName),
45
213
  )
46
214
  },
47
- // A layout change that changes the cut options cuts the track again:
48
- // whole walks (cutsWholeWalksIn), or the walk-row step budget.
49
- cutChangedFrom(from: LayoutModeValue) {
50
- return (
51
- self.cutsWholeWalks !== self.cutsWholeWalksIn(from) ||
52
- (from === 'walkrows') !== (self.chosenLayoutMode === 'walkrows')
53
- )
54
- },
55
215
  }))
56
216
  .views(self => ({
57
217
  get cutOptions(): SubgraphCutOptions {
58
218
  return {
59
219
  hops: self.subgraphContext,
60
220
  haplotypes: self.cutHaplotypes,
61
- ...(self.chosenLayoutMode === 'walkrows'
62
- ? {
63
- walkRows: true,
64
- ...(self.walkRowSamples?.length
65
- ? { expandSamples: self.walkRowSamples }
66
- : {}),
67
- }
68
- : {}),
221
+ ...(self.chosenLayoutMode === 'walkrows' ? { walkRows: true } : {}),
69
222
  ...(self.cutsWholeWalks ? { snarls: 'overlapping' as const } : {}),
70
223
  ...(self.expandedWalks.length > 0
71
224
  ? { expand: self.expandedWalks }
72
225
  : {}),
226
+ ...(self.forcedByteBudget
227
+ ? { forcedByteBudget: self.forcedByteBudget }
228
+ : {}),
73
229
  }
74
230
  },
75
231
  }))
232
+ .views(self => ({
233
+ get cutKey() {
234
+ return JSON.stringify(self.cutOptions)
235
+ },
236
+ }))
237
+ .views(self => ({
238
+ get cutStale() {
239
+ return (
240
+ self.cutKeyOnRecord !== undefined && self.cutKeyOnRecord !== self.cutKey
241
+ )
242
+ },
243
+ }))
244
+ .actions(self => ({
245
+ markCut() {
246
+ self.cutKeyOnRecord = self.cutKey
247
+ },
248
+ setSubgraphContext(hops: number) {
249
+ self.subgraphContext = hops
250
+ },
251
+ setSubgraphHaplotypes(haplotypes: string[] | undefined) {
252
+ self.subgraphHaplotypes = haplotypes
253
+ },
254
+ setHaplotypeNames(names: string[] | undefined) {
255
+ self.haplotypeNames = names
256
+ },
257
+ }))
258
+ .actions(self => ({
259
+ // A failed read leaves the picker taking typed names
260
+ async fetchHaplotypeNames(
261
+ adapterConfig: Record<string, unknown>,
262
+ signal?: AbortSignal,
263
+ ) {
264
+ try {
265
+ const names = await getSession(self).rpcManager.call(
266
+ getRpcSessionId(self),
267
+ 'GetGraphHaplotypes',
268
+ // eslint-disable-next-line no-restricted-syntax -- a background read for the haplotype picker, which has no status line; the pane's belongs to the cut
269
+ { adapterConfig, signal },
270
+ )
271
+ if (isAlive(self) && !signal?.aborted) {
272
+ self.setHaplotypeNames(names)
273
+ }
274
+ } catch (e) {
275
+ if (!signal?.aborted) {
276
+ console.warn('[GraphGenomeView] no haplotype names', e)
277
+ }
278
+ }
279
+ },
280
+ }))
281
+ .actions(self => ({
282
+ afterAttach() {
283
+ let namesRead: AbortController | undefined
284
+ addDisposer(self, () => {
285
+ namesRead?.abort()
286
+ })
287
+ addDisposer(
288
+ self,
289
+ reaction(
290
+ () => {
291
+ const adapter = self.sourceAdapter
292
+ return adapter && walkIndexed(adapter) ? adapter : undefined
293
+ },
294
+ adapterConfig => {
295
+ namesRead?.abort()
296
+ namesRead = undefined
297
+ self.setHaplotypeNames(undefined)
298
+ if (adapterConfig) {
299
+ namesRead = new AbortController()
300
+ void self.fetchHaplotypeNames(adapterConfig, namesRead.signal)
301
+ }
302
+ },
303
+ {
304
+ fireImmediately: true,
305
+ // a lane adapter's config is rebuilt whenever an assembly is
306
+ // added, which would drop and re-read the names
307
+ equals: (a, b) => JSON.stringify(a) === JSON.stringify(b),
308
+ name: 'GraphHaplotypeNames',
309
+ },
310
+ ),
311
+ )
312
+ addDisposer(
313
+ self,
314
+ reaction(
315
+ () => self.liveKeyView,
316
+ view => {
317
+ self.setSettledKeyView(view)
318
+ },
319
+ {
320
+ delay: VIEWPORT_DEBOUNCE_MS,
321
+ fireImmediately: true,
322
+ equals: sameBounds,
323
+ name: 'GraphKeyView',
324
+ },
325
+ ),
326
+ )
327
+ // The key's frame holds from the moment the view the key keys moves,
328
+ // or the drawing is rebuilt for a moved view, until the key changes
329
+ // with neither, as a setting changes it, or a new layout or pane width
330
+ // comes
331
+ addDisposer(
332
+ self,
333
+ reaction(
334
+ () => ({
335
+ shape: self.keyShape,
336
+ view: self.keyView,
337
+ rebuilt: self.builtViewport?.viewportDirty,
338
+ layout: self.layoutResult,
339
+ width: self.paneWidth,
340
+ owner: self.viewportOwner,
341
+ }),
342
+ (now, was) => {
343
+ const moved =
344
+ !sameBounds(now.view, was.view) || now.rebuilt !== was.rebuilt
345
+ self.setKeyFrameHeld(
346
+ now.owner !== 'fit' &&
347
+ now.layout === was.layout &&
348
+ now.width === was.width &&
349
+ (moved || (now.shape === was.shape && self.keyFrameHeld)),
350
+ )
351
+ },
352
+ { name: 'GraphKeyFrame' },
353
+ ),
354
+ )
355
+ // A cut option changed by anything cuts again: a setting, the config
356
+ // editor, undo or a session delta. A change of layout mode cuts through
357
+ // relayout.
358
+ addDisposer(
359
+ self,
360
+ reaction(
361
+ () => ({ mode: self.chosenLayoutMode, key: self.cutKey }),
362
+ (now, was) => {
363
+ if (now.mode === was.mode && self.cutStale) {
364
+ self.retryLoad()
365
+ }
366
+ },
367
+ {
368
+ equals: (a, b) => a.mode === b.mode && a.key === b.key,
369
+ name: 'GraphCutOptions',
370
+ },
371
+ ),
372
+ )
373
+ },
374
+ }))
76
375
 
77
376
  export type GraphPaneModel = Instance<typeof GraphPane>