@jbrowse/plugin-linear-genome-view 4.3.0 → 5.0.0-beta.1

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 (357) hide show
  1. package/esm/FeatureTrack/configSchema.d.ts +104 -65
  2. package/esm/FeatureTrack/configSchema.js +47 -1
  3. package/esm/FeatureTrack/index.js +1 -1
  4. package/esm/LaunchLinearGenomeView/index.d.ts +14 -0
  5. package/esm/LaunchLinearGenomeView/index.js +17 -12
  6. package/esm/LinearGenomeView/FloatingSvgOverlay.d.ts +5 -0
  7. package/esm/LinearGenomeView/FloatingSvgOverlay.js +25 -0
  8. package/esm/LinearGenomeView/afterAttach.d.ts +20 -2
  9. package/esm/LinearGenomeView/afterAttach.js +253 -122
  10. package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
  11. package/esm/LinearGenomeView/components/CenterLine.js +16 -7
  12. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.d.ts +7 -0
  13. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +22 -0
  14. package/esm/LinearGenomeView/components/CrisprGuidePanel.d.ts +3 -0
  15. package/esm/LinearGenomeView/components/CrisprGuidePanel.js +144 -0
  16. package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -6
  17. package/esm/LinearGenomeView/components/Cytobands.js +76 -53
  18. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +7 -3
  19. package/esm/LinearGenomeView/components/ExportSvgDialog.js +11 -67
  20. package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +5 -9
  21. package/esm/LinearGenomeView/components/GetSequenceDialog.js +84 -88
  22. package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
  23. package/esm/LinearGenomeView/components/Gridlines.js +29 -58
  24. package/esm/LinearGenomeView/components/Header.d.ts +1 -1
  25. package/esm/LinearGenomeView/components/Header.js +32 -16
  26. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.d.ts +21 -0
  27. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +35 -0
  28. package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -2
  29. package/esm/LinearGenomeView/components/HeaderPanControls.js +16 -7
  30. package/esm/LinearGenomeView/components/HeaderRegionWidth.d.ts +1 -1
  31. package/esm/LinearGenomeView/components/HeaderRegionWidth.js +9 -6
  32. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.d.ts +6 -0
  33. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.js +27 -0
  34. package/esm/LinearGenomeView/components/HeaderSearchBoxes.d.ts +5 -0
  35. package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +28 -0
  36. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +3 -2
  37. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +11 -4
  38. package/esm/LinearGenomeView/components/HeaderZoomControls.d.ts +3 -2
  39. package/esm/LinearGenomeView/components/HeaderZoomControls.js +67 -51
  40. package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
  41. package/esm/LinearGenomeView/components/Highlight.js +19 -23
  42. package/esm/LinearGenomeView/components/HighlightBand.d.ts +3 -2
  43. package/esm/LinearGenomeView/components/HighlightBand.js +25 -8
  44. package/esm/LinearGenomeView/components/HighlightChip.d.ts +9 -0
  45. package/esm/LinearGenomeView/components/HighlightChip.js +15 -0
  46. package/esm/LinearGenomeView/components/HoverPositionHighlight.d.ts +12 -0
  47. package/esm/LinearGenomeView/components/HoverPositionHighlight.js +25 -0
  48. package/esm/LinearGenomeView/components/ImportForm.d.ts +3 -4
  49. package/esm/LinearGenomeView/components/ImportForm.js +95 -61
  50. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
  51. package/esm/LinearGenomeView/components/LinearGenomeView.js +6 -5
  52. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
  53. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +89 -30
  54. package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
  55. package/esm/LinearGenomeView/components/MiniControls.js +13 -10
  56. package/esm/LinearGenomeView/components/MotifListPanel.d.ts +3 -0
  57. package/esm/LinearGenomeView/components/MotifListPanel.js +59 -0
  58. package/esm/LinearGenomeView/components/NavigationAnnouncer.d.ts +32 -0
  59. package/esm/LinearGenomeView/components/NavigationAnnouncer.js +51 -0
  60. package/esm/LinearGenomeView/components/NoTracksActiveButton.d.ts +1 -1
  61. package/esm/LinearGenomeView/components/NoTracksActiveButton.js +1 -1
  62. package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +2 -4
  63. package/esm/LinearGenomeView/components/OverviewHighlight.js +23 -44
  64. package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +9 -0
  65. package/esm/LinearGenomeView/components/OverviewHighlightBand.js +26 -0
  66. package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
  67. package/esm/LinearGenomeView/components/OverviewRubberband.js +44 -57
  68. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +4 -5
  69. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +13 -20
  70. package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +3 -2
  71. package/esm/LinearGenomeView/components/OverviewScalebar.js +84 -79
  72. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
  73. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +55 -32
  74. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +4 -5
  75. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +16 -18
  76. package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +7 -0
  77. package/esm/LinearGenomeView/components/PaddingBlocks.js +51 -0
  78. package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
  79. package/esm/LinearGenomeView/components/RangeSelectOverlay.js +20 -0
  80. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +2 -3
  81. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +19 -26
  82. package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -1
  83. package/esm/LinearGenomeView/components/Rubberband.js +13 -16
  84. package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
  85. package/esm/LinearGenomeView/components/SVGHighlightBand.js +9 -0
  86. package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -2
  87. package/esm/LinearGenomeView/components/Scalebar.js +16 -21
  88. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
  89. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +54 -35
  90. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
  91. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +142 -126
  92. package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
  93. package/esm/LinearGenomeView/components/SearchBox.js +58 -66
  94. package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
  95. package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
  96. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +3 -3
  97. package/esm/LinearGenomeView/components/SearchResultsDialog.js +5 -7
  98. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +4 -3
  99. package/esm/LinearGenomeView/components/SearchResultsTable.js +45 -53
  100. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.d.ts +5 -0
  101. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +37 -0
  102. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.d.ts +2 -0
  103. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js +5 -0
  104. package/esm/LinearGenomeView/components/SequencePatternPanel.d.ts +3 -0
  105. package/esm/LinearGenomeView/components/SequencePatternPanel.js +42 -0
  106. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +1 -1
  107. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +31 -53
  108. package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +8 -0
  109. package/esm/LinearGenomeView/components/StrandCheckboxes.js +13 -0
  110. package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
  111. package/esm/LinearGenomeView/components/TrackContainer.js +83 -39
  112. package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
  113. package/esm/LinearGenomeView/components/TrackLabel.js +11 -24
  114. package/esm/LinearGenomeView/components/TrackLabelButtons.d.ts +7 -0
  115. package/esm/LinearGenomeView/components/TrackLabelButtons.js +33 -0
  116. package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +2 -5
  117. package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +6 -2
  118. package/esm/LinearGenomeView/components/TrackLabelMenu.d.ts +1 -1
  119. package/esm/LinearGenomeView/components/TrackLabelMenu.js +32 -85
  120. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
  121. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
  122. package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +1 -1
  123. package/esm/LinearGenomeView/components/TrackRenderingContainer.js +72 -18
  124. package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  125. package/esm/LinearGenomeView/components/TracksContainer.js +65 -32
  126. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +1 -1
  127. package/esm/LinearGenomeView/components/VerticalGuide.js +6 -13
  128. package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
  129. package/esm/LinearGenomeView/components/ZoomButton.js +22 -0
  130. package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
  131. package/esm/LinearGenomeView/components/ZoomTransform.js +33 -0
  132. package/esm/LinearGenomeView/components/defaultMotifs.d.ts +1 -0
  133. package/esm/LinearGenomeView/components/defaultMotifs.js +22 -0
  134. package/esm/LinearGenomeView/components/fetchSequence.d.ts +7 -8
  135. package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
  136. package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
  137. package/esm/LinearGenomeView/components/recentLocationsMenu.js +36 -0
  138. package/esm/LinearGenomeView/components/searchModes.d.ts +13 -0
  139. package/esm/LinearGenomeView/components/searchModes.js +22 -0
  140. package/esm/LinearGenomeView/components/trackLabelMenuItems.d.ts +7 -0
  141. package/esm/LinearGenomeView/components/trackLabelMenuItems.js +67 -0
  142. package/esm/LinearGenomeView/components/useRangeSelect.d.ts +11 -66
  143. package/esm/LinearGenomeView/components/useRangeSelect.js +82 -91
  144. package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
  145. package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
  146. package/esm/LinearGenomeView/components/useSideScroll.d.ts +1 -1
  147. package/esm/LinearGenomeView/components/useSideScroll.js +87 -19
  148. package/esm/LinearGenomeView/components/util.d.ts +20 -6
  149. package/esm/LinearGenomeView/components/util.js +27 -6
  150. package/esm/LinearGenomeView/consts.d.ts +7 -2
  151. package/esm/LinearGenomeView/consts.js +18 -2
  152. package/esm/LinearGenomeView/flyTo.d.ts +38 -0
  153. package/esm/LinearGenomeView/flyTo.js +135 -0
  154. package/esm/LinearGenomeView/headerFit.d.ts +27 -0
  155. package/esm/LinearGenomeView/headerFit.js +59 -0
  156. package/esm/LinearGenomeView/index.d.ts +31 -2
  157. package/esm/LinearGenomeView/index.js +8 -5
  158. package/esm/LinearGenomeView/initKeys.d.ts +13 -0
  159. package/esm/LinearGenomeView/initKeys.js +104 -0
  160. package/esm/LinearGenomeView/keyboardHandler.d.ts +7 -0
  161. package/esm/LinearGenomeView/keyboardHandler.js +10 -0
  162. package/esm/LinearGenomeView/lazyDialogs.d.ts +6 -10
  163. package/esm/LinearGenomeView/lazyDialogs.js +3 -3
  164. package/esm/LinearGenomeView/linkedViewSync.d.ts +20 -0
  165. package/esm/LinearGenomeView/linkedViewSync.js +52 -0
  166. package/esm/LinearGenomeView/menuItems.d.ts +27 -2
  167. package/esm/LinearGenomeView/menuItems.js +137 -101
  168. package/esm/LinearGenomeView/model.d.ts +1536 -146
  169. package/esm/LinearGenomeView/model.js +2348 -515
  170. package/esm/LinearGenomeView/sharedScaleContainer.d.ts +18 -0
  171. package/esm/LinearGenomeView/sharedScaleContainer.js +17 -0
  172. package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +35 -0
  173. package/esm/LinearGenomeView/showRegionsWithUndo.js +44 -0
  174. package/esm/LinearGenomeView/stickyChrome.d.ts +19 -0
  175. package/esm/LinearGenomeView/stickyChrome.js +30 -0
  176. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
  177. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +15 -16
  178. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +2 -3
  179. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +45 -33
  180. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +5 -0
  181. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +26 -0
  182. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +5 -0
  183. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +13 -0
  184. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -3
  185. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +77 -41
  186. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
  187. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +23 -3
  188. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
  189. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +37 -0
  190. package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
  191. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +64 -36
  192. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
  193. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +7 -5
  194. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
  195. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +43 -7
  196. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +8 -14
  197. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +16 -21
  198. package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +18 -0
  199. package/esm/LinearGenomeView/svgcomponents/SVGView.js +13 -0
  200. package/esm/LinearGenomeView/svgcomponents/figureContract.d.ts +45 -0
  201. package/esm/LinearGenomeView/svgcomponents/figureContract.js +130 -0
  202. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +76 -0
  203. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +66 -0
  204. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.d.ts +70 -0
  205. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +263 -0
  206. package/esm/LinearGenomeView/svgcomponents/util.d.ts +92 -5
  207. package/esm/LinearGenomeView/svgcomponents/util.js +236 -3
  208. package/esm/LinearGenomeView/types.d.ts +17 -31
  209. package/esm/LinearGenomeView/types.js +1 -0
  210. package/esm/LinearGenomeView/util.d.ts +332 -12
  211. package/esm/LinearGenomeView/util.js +606 -62
  212. package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
  213. package/esm/MultiLevelRubberband/MultiLevelRubberband.js +37 -0
  214. package/esm/MultiLevelRubberband/VerticalGuide.d.ts +6 -0
  215. package/esm/MultiLevelRubberband/VerticalGuide.js +21 -0
  216. package/esm/MultiLevelRubberband/index.d.ts +2 -0
  217. package/esm/MultiLevelRubberband/index.js +1 -0
  218. package/esm/MultiLevelRubberband/types.d.ts +6 -0
  219. package/esm/MultiLevelRubberband/useRangeSelect.d.ts +24 -0
  220. package/esm/MultiLevelRubberband/useRangeSelect.js +136 -0
  221. package/esm/displayKitTests/perRegionTestEnv.d.ts +1263 -0
  222. package/esm/displayKitTests/perRegionTestEnv.js +141 -0
  223. package/esm/index.d.ts +112 -1237
  224. package/esm/index.js +102 -24
  225. package/esm/lazyPluginExports.d.ts +23 -0
  226. package/esm/lazyPluginExports.js +36 -0
  227. package/esm/searchUtils.d.ts +52 -11
  228. package/esm/searchUtils.js +317 -46
  229. package/esm/shared/RubberbandSpan.d.ts +15 -0
  230. package/esm/shared/RubberbandSpan.js +33 -0
  231. package/esm/shared/coordLabels.d.ts +40 -0
  232. package/esm/shared/coordLabels.js +119 -0
  233. package/package.json +18 -19
  234. package/esm/BaseLinearDisplay/SVGLegend.d.ts +0 -6
  235. package/esm/BaseLinearDisplay/SVGLegend.js +0 -17
  236. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +0 -2
  237. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +0 -11
  238. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
  239. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -53
  240. package/esm/BaseLinearDisplay/components/Block.d.ts +0 -14
  241. package/esm/BaseLinearDisplay/components/Block.js +0 -45
  242. package/esm/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
  243. package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +0 -22
  244. package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
  245. package/esm/BaseLinearDisplay/components/BlockMsg.js +0 -26
  246. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +0 -9
  247. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +0 -42
  248. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +0 -11
  249. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +0 -40
  250. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +0 -19
  251. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +0 -45
  252. package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +0 -5
  253. package/esm/BaseLinearDisplay/components/FloatingLabels.js +0 -75
  254. package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +0 -8
  255. package/esm/BaseLinearDisplay/components/FloatingLegend.js +0 -43
  256. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -5
  257. package/esm/BaseLinearDisplay/components/LinearBlocks.js +0 -23
  258. package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +0 -5
  259. package/esm/BaseLinearDisplay/components/LoadingOverlay.js +0 -49
  260. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +0 -4
  261. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +0 -26
  262. package/esm/BaseLinearDisplay/components/MenuPage.d.ts +0 -8
  263. package/esm/BaseLinearDisplay/components/MenuPage.js +0 -24
  264. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +0 -21
  265. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +0 -52
  266. package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +0 -12
  267. package/esm/BaseLinearDisplay/components/RenderedBlocks.js +0 -22
  268. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -12
  269. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -18
  270. package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
  271. package/esm/BaseLinearDisplay/components/TooLargeMessage.js +0 -20
  272. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -13
  273. package/esm/BaseLinearDisplay/components/Tooltip.js +0 -22
  274. package/esm/BaseLinearDisplay/components/types.d.ts +0 -1
  275. package/esm/BaseLinearDisplay/components/util.d.ts +0 -21
  276. package/esm/BaseLinearDisplay/components/util.js +0 -107
  277. package/esm/BaseLinearDisplay/index.d.ts +0 -17
  278. package/esm/BaseLinearDisplay/index.js +0 -13
  279. package/esm/BaseLinearDisplay/model.d.ts +0 -1197
  280. package/esm/BaseLinearDisplay/model.js +0 -432
  281. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
  282. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -113
  283. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +0 -26
  284. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +0 -57
  285. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.d.ts +0 -8
  286. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.js +0 -19
  287. package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
  288. package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +0 -31
  289. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
  290. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -29
  291. package/esm/BaseLinearDisplay/models/configSchema.d.ts +0 -29
  292. package/esm/BaseLinearDisplay/models/configSchema.js +0 -33
  293. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -98
  294. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -242
  295. package/esm/BaseLinearDisplay/models/util.d.ts +0 -9
  296. package/esm/BaseLinearDisplay/models/util.js +0 -43
  297. package/esm/BaseLinearDisplay/renderSvg.d.ts +0 -3
  298. package/esm/BaseLinearDisplay/renderSvg.js +0 -63
  299. package/esm/BaseLinearDisplay/types.d.ts +0 -43
  300. package/esm/BaseLinearDisplay/types.js +0 -3
  301. package/esm/BaseLinearDisplay/util.d.ts +0 -16
  302. package/esm/BaseLinearDisplay/util.js +0 -71
  303. package/esm/BasicTrack/configSchema.d.ts +0 -85
  304. package/esm/BasicTrack/configSchema.js +0 -8
  305. package/esm/BasicTrack/index.d.ts +0 -2
  306. package/esm/BasicTrack/index.js +0 -12
  307. package/esm/LinearBareDisplay/configSchema.d.ts +0 -32
  308. package/esm/LinearBareDisplay/configSchema.js +0 -11
  309. package/esm/LinearBareDisplay/index.d.ts +0 -4
  310. package/esm/LinearBareDisplay/index.js +0 -20
  311. package/esm/LinearBareDisplay/model.d.ts +0 -1196
  312. package/esm/LinearBareDisplay/model.js +0 -32
  313. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +0 -5
  314. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +0 -9
  315. package/esm/LinearBasicDisplay/configSchema.d.ts +0 -32
  316. package/esm/LinearBasicDisplay/configSchema.js +0 -11
  317. package/esm/LinearBasicDisplay/index.d.ts +0 -4
  318. package/esm/LinearBasicDisplay/index.js +0 -20
  319. package/esm/LinearBasicDisplay/model.d.ts +0 -1391
  320. package/esm/LinearBasicDisplay/model.js +0 -158
  321. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +0 -9
  322. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +0 -58
  323. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.d.ts +0 -8
  324. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.js +0 -26
  325. package/esm/LinearFeatureDisplay/configSchema.d.ts +0 -32
  326. package/esm/LinearFeatureDisplay/configSchema.js +0 -11
  327. package/esm/LinearFeatureDisplay/index.d.ts +0 -3
  328. package/esm/LinearFeatureDisplay/index.js +0 -2
  329. package/esm/LinearFeatureDisplay/model.d.ts +0 -1443
  330. package/esm/LinearFeatureDisplay/model.js +0 -305
  331. package/esm/LinearGenomeView/SVGErrorBox.d.ts +0 -5
  332. package/esm/LinearGenomeView/SVGErrorBox.js +0 -4
  333. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
  334. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -27
  335. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -5
  336. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -13
  337. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
  338. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -17
  339. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
  340. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -8
  341. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
  342. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -101
  343. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
  344. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -45
  345. package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
  346. package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -32
  347. package/esm/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
  348. package/esm/LinearGenomeView/components/RubberbandTooltip.js +0 -17
  349. package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
  350. package/esm/LinearGenomeView/components/TrackLabelContainer.js +0 -25
  351. package/esm/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
  352. package/esm/LinearGenomeView/components/useWheelScroll.js +0 -69
  353. package/esm/LinearGenomeView/svgExportUtil.d.ts +0 -9
  354. package/esm/LinearGenomeView/svgExportUtil.js +0 -6
  355. package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
  356. package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +0 -7
  357. /package/esm/{BaseLinearDisplay/components → MultiLevelRubberband}/types.js +0 -0
@@ -1,144 +1,275 @@
1
- import { getSession, localStorageSetItem, parseLocString, } from '@jbrowse/core/util';
2
- import { addDisposer } from '@jbrowse/mobx-state-tree';
1
+ import { getSession, isSessionModelWithWidgets, localStorageSetItem, resolveNamedRegions, } from '@jbrowse/core/util';
2
+ import { coerceHighlight } from '@jbrowse/core/util/highlights';
3
+ import { installInitAutorun } from '@jbrowse/core/util/installInitAutorun';
4
+ import { normalizeTrackInit } from '@jbrowse/core/util/tracks';
5
+ import { addDisposer, getPropertyMembers } from '@jbrowse/mobx-state-tree';
3
6
  import { autorun, when } from 'mobx';
4
- function tryParseJson(s) {
7
+ import { SearchResultsNotFoundError } from '../searchUtils.js';
8
+ import { partitionLaunchKeys, warnUnknownLaunchKeys } from './initKeys.js';
9
+ function warnInitKeyProblems(self, init) {
10
+ const { viewProps, unknown } = partitionLaunchKeys(init, new Set(Object.keys(getPropertyMembers(self).properties)));
11
+ const viewPropKeys = Object.keys(viewProps);
12
+ warnUnknownLaunchKeys('LinearGenomeView init', unknown);
13
+ if (viewPropKeys.length) {
14
+ console.warn(`LinearGenomeView init ignored view prop(s): ${viewPropKeys.join(', ')} — set these on the view alongside init, not inside it`);
15
+ }
16
+ }
17
+ // `init` is a frozen blob that often comes from hand-authored JSON, where a
18
+ // lone entry gets written bare (`tracks: 'genes'`). A string is iterable, so
19
+ // looping over it directly walked its characters — one track opened per letter.
20
+ function asArray(arg) {
21
+ return arg === undefined ? [] : Array.isArray(arg) ? arg : [arg];
22
+ }
23
+ // Activate tracklist first so the drawer opens before we navigate, so
24
+ // volatileWidth accounts for the drawer; otherwise navigation computes the
25
+ // region at full width and the drawer then obscures part of it. Opening the
26
+ // drawer shrinks the view, which the ResizeObserver reports as a volatileWidth
27
+ // change — but only if the drawer wasn't already taking that width. So wait for
28
+ // the change only when activating it actually opens the column.
29
+ async function openTracklist(self, session, superseded) {
30
+ // activateTrackSelector throws without widget support, which would abort the
31
+ // rest of init (navigation included) over an optional extra
32
+ if (isSessionModelWithWidgets(session)) {
33
+ // `poppedOut` — the visible widget rendered in a modal, leaving the drawer
34
+ // column free — lives on SessionWithDrawerWidgets, whose type guard is
35
+ // product-core's, so duck-type it here rather than take an upward
36
+ // dependency. A session without the key has no modal to pop out into, so
37
+ // false is the right answer for it.
38
+ const poppedOut = 'poppedOut' in session && session.poppedOut === true;
39
+ // the same line App.tsx draws to decide whether to render the drawer column
40
+ // at all. A *minimized* drawer still holds a visibleWidget while taking no
41
+ // width, and showWidget un-minimizes it (product-core's DrawerWidgets), so
42
+ // `!!visibleWidget` alone reads "already open", skips the wait below, and
43
+ // hands navigation the pre-drawer width — the exact thing this is here to
44
+ // prevent.
45
+ const drawerWasOpen = !!session.visibleWidget && !session.minimized && !poppedOut;
46
+ const widthBefore = self.volatileWidth;
47
+ self.activateTrackSelector();
48
+ // a width change is only coming if the drawer is about to start taking
49
+ // space; popped out it never does, so don't sit out the timeout for it
50
+ if (!drawerWasOpen && !poppedOut) {
51
+ // Bounded so init can't wedge here if the drawer doesn't shrink the view
52
+ // (e.g. embedded or modal-drawer layouts, where no width change is
53
+ // coming), and superseded so a re-launch landing mid-wait isn't held
54
+ // behind an init that no longer matters
55
+ await when(() => self.volatileWidth !== widthBefore || superseded(), {
56
+ timeout: 1000,
57
+ }).catch(() => { });
58
+ }
59
+ }
60
+ else {
61
+ session.notify('init.tracklist was ignored: this application has no track selector drawer', 'warning');
62
+ }
63
+ }
64
+ // Restrict a whole-genome view to a named subset of the assembly's regions, in
65
+ // the requested order. Entries may be globs (`*_hap1`) — see selectNamedRegions,
66
+ // shared with the dotplot's per-axis `displayedRegionNames` so both views read
67
+ // the same name list the same way.
68
+ function showNamedRegions(self, session, assemblyName, names) {
69
+ const assembly = session.assemblyManager.get(assemblyName);
70
+ const all = assembly?.regions;
71
+ if (all) {
72
+ // resolveNamedRegions is what reports a list that matched nothing —
73
+ // otherwise a typo'd refName silently shows the whole genome and reads as
74
+ // displayedRegionNames being ignored. The FALLBACK stays here because it is
75
+ // this view's alone: nothing shown yet means show the whole genome rather
76
+ // than an empty view, but already navigated (URL params layered onto a
77
+ // defaultSession) means keep what's there, since a typo shouldn't discard
78
+ // the session's own navigation.
79
+ const regions = resolveNamedRegions({
80
+ regions: all,
81
+ names,
82
+ assemblyName,
83
+ getCanonicalRefName: assembly.getCanonicalRefName2,
84
+ allRefNames: assembly.allRefNames,
85
+ notify: message => {
86
+ session.notify(message, 'warning');
87
+ },
88
+ });
89
+ if (regions) {
90
+ // showRegions, not showAllRegionsInAssembly: `displayedRegionNames` is
91
+ // the spec naming what it wants shown, so it gets the width
92
+ self.showRegions(regions);
93
+ }
94
+ else if (!self.hasDisplayedRegions) {
95
+ // The fallback IS "show me everything", so it keeps the margin.
96
+ self.showAllRegionsInAssembly(assemblyName);
97
+ }
98
+ }
99
+ }
100
+ async function navigateInit(self, session, init) {
5
101
  try {
6
- const v = JSON.parse(s);
7
- return v && typeof v === 'object'
8
- ? v
9
- : undefined;
102
+ if (init.loc) {
103
+ // navToLocString waits for the assembly itself, and this autorun only
104
+ // runs once `initialized` confirms init.assembly has loaded regions, so
105
+ // no explicit waitForAssembly is needed here
106
+ await self.navToLocString(init.loc, init.assembly, init.grow);
107
+ }
108
+ else if (init.displayedRegionNames?.length) {
109
+ // an explicit region list is a navigation request just like `loc`, so it
110
+ // applies even when regions already exist (URL params layered onto a
111
+ // defaultSession that already navigated)
112
+ //
113
+ // `?.length`, not the bare key: an empty array is truthy, so a spec
114
+ // writing `displayedRegionNames: []` took this path with nothing to name
115
+ // and got told its list of no names had matched no regions. That is why
116
+ // LinearSyntenyView's doSubmit omits the key rather than passing [].
117
+ showNamedRegions(self, session, init.assembly, init.displayedRegionNames);
118
+ }
119
+ else if (!self.hasDisplayedRegions) {
120
+ // a highlight-only init (nothing to navigate to) must not clobber a
121
+ // defaultSession's existing navigation, so only auto-navigate when
122
+ // nothing is shown yet
123
+ self.showAllRegionsInAssembly(init.assembly);
124
+ }
10
125
  }
11
- catch {
12
- return undefined;
126
+ catch (e) {
127
+ console.error(init, e);
128
+ if (e instanceof SearchResultsNotFoundError) {
129
+ // a &loc= gene name that matched nothing is a soft miss, not an app error
130
+ session.notify(e.message, 'warning');
131
+ }
132
+ else {
133
+ session.notifyError(`${e}`, e);
134
+ }
13
135
  }
14
136
  }
15
- export function setupInitAutorun(self) {
16
- addDisposer(self, autorun(async function initAutorun() {
17
- const { init, initialized } = self;
18
- if (!initialized) {
19
- return;
137
+ // showTrack funnels through showTrackGeneric, which surfaces any failure
138
+ // (unresolved id, bad config, etc) as its own snackbar
139
+ function showInitTracks(self, init) {
140
+ for (const t of asArray(init.tracks)) {
141
+ const { trackId, trackSnapshot, displaySnapshot } = normalizeTrackInit(t);
142
+ self.showTrack(trackId, trackSnapshot, displaySnapshot);
143
+ }
144
+ }
145
+ // backfill assemblyName on any session-authored highlights that omitted it so
146
+ // downstream code (bookmark widget grid, addBookmark, etc) doesn't have to keep
147
+ // falling back
148
+ function backfillHighlightAssemblies(self) {
149
+ const fallback = self.assemblyNames[0];
150
+ if (self.highlight.length && fallback) {
151
+ const normalized = self.highlight.map(h => h.assemblyName ? h : { ...h, assemblyName: fallback });
152
+ if (normalized.some((h, i) => h !== self.highlight[i])) {
153
+ self.setHighlight(normalized);
20
154
  }
21
- if (init) {
22
- const session = getSession(self);
23
- const { assemblyManager } = session;
24
- if (init.tracklist) {
25
- self.activateTrackSelector();
26
- const currentWidth = self.volatileWidth;
27
- await when(() => self.volatileWidth !== currentWidth, {
28
- timeout: 500,
29
- }).catch(() => {
30
- });
31
- }
32
- try {
33
- if (init.loc) {
34
- const asm = await assemblyManager.waitForAssembly(init.assembly);
35
- if (!asm) {
36
- throw new Error('Assembly not found');
37
- }
38
- await self.navToSearchString({
39
- input: init.loc,
40
- assembly: asm,
41
- });
42
- }
43
- else {
44
- self.showAllRegionsInAssembly(init.assembly);
45
- }
46
- }
47
- catch (e) {
48
- console.error(init, e);
49
- session.notifyError(`${e}`, e);
50
- }
51
- if (init.tracks) {
52
- const idsNotFound = [];
53
- for (const t of init.tracks) {
54
- try {
55
- if (typeof t === 'string') {
56
- self.showTrack(t);
57
- }
58
- else {
59
- self.showTrack(t.trackId, t.trackSnapshot ?? {}, t.displaySnapshot ?? {});
60
- }
61
- }
62
- catch (e) {
63
- const trackId = typeof t === 'string' ? t : t.trackId;
64
- if (/Could not resolve identifier/.exec(`${e}`)) {
65
- idsNotFound.push(trackId);
66
- }
67
- else {
68
- throw e;
69
- }
70
- }
71
- }
72
- if (idsNotFound.length) {
73
- session.notifyError(`Could not resolve identifiers: ${idsNotFound.join(',')}`, new Error(`Could not resolve identifiers: ${idsNotFound.join(',')}`));
74
- }
75
- }
76
- if (init.nav !== undefined) {
77
- self.setHideHeader(!init.nav);
78
- }
79
- if (self.highlight.length) {
80
- const fallback = self.assemblyNames[0];
81
- if (fallback) {
82
- const normalized = self.highlight.map(h => h.assemblyName ? h : { ...h, assemblyName: fallback });
83
- if (normalized.some((h, i) => h !== self.highlight[i])) {
84
- self.setHighlight(normalized);
85
- }
86
- }
87
- }
88
- if (init.highlight) {
89
- for (const h of init.highlight) {
90
- const json = h.trim().startsWith('{') && tryParseJson(h);
91
- if (json &&
92
- typeof json.refName === 'string' &&
93
- typeof json.start === 'number' &&
94
- typeof json.end === 'number') {
95
- self.addToHighlights({
96
- refName: json.refName,
97
- start: json.start,
98
- end: json.end,
99
- assemblyName: typeof json.assemblyName === 'string'
100
- ? json.assemblyName
101
- : init.assembly,
102
- color: typeof json.color === 'string' ? json.color : undefined,
103
- label: typeof json.label === 'string' ? json.label : undefined,
104
- });
105
- }
106
- else {
107
- const p = parseLocString(h, refName => assemblyManager.isValidRefName(refName, init.assembly));
108
- const { start, end } = p;
109
- if (start !== undefined && end !== undefined) {
110
- self.addToHighlights({
111
- ...p,
112
- start,
113
- end,
114
- assemblyName: init.assembly,
115
- });
116
- }
117
- }
118
- }
155
+ }
156
+ }
157
+ /**
158
+ * Apply an init blob's `highlight` entries to a view, coercing each locstring
159
+ * or wire-format object and reporting a bad one without taking out its
160
+ * siblings.
161
+ *
162
+ * Exported because a LinearSyntenyView row is a LinearGenomeView that does NOT
163
+ * go through this file's init autorun — the synteny view builds each row's
164
+ * snapshot and navigates it itself — so the row's own `highlight` had nowhere
165
+ * to be applied and was dropped in silence.
166
+ */
167
+ export function applyInitHighlights(self, session, init) {
168
+ for (const h of asArray(init.highlight)) {
169
+ // parseLocString throws on an unknown refName or a malformed locstring, and
170
+ // one bad entry must take out neither its siblings nor the rest of init
171
+ try {
172
+ const highlight = coerceHighlight(h, init.assembly, refName => session.assemblyManager.isValidRefName(refName, init.assembly));
173
+ if (highlight) {
174
+ self.addToHighlights(highlight);
119
175
  }
120
- self.setInit(undefined);
121
176
  }
122
- }, { name: 'LGVInit' }));
177
+ catch (e) {
178
+ console.error(e);
179
+ session.notifyError(`Invalid init highlight ${JSON.stringify(h)}: ${e}`, e);
180
+ }
181
+ }
123
182
  }
124
- export function setupCoarseDynamicBlocksAutorun(self) {
183
+ async function applyInit(self, init, { superseded }) {
184
+ const session = getSession(self);
185
+ warnInitKeyProblems(self, init);
186
+ if (init.tracklist) {
187
+ await openTracklist(self, session, superseded);
188
+ }
189
+ // `superseded`, not a bare isAlive: it subsumes the liveness check (the view
190
+ // may have been removed while the drawer or the navigation resolved, and
191
+ // reading or mutating a detached node throws) and also covers the case
192
+ // isAlive misses — a newer setInit landed mid-apply, so the rest of *this*
193
+ // blob is stale. Finishing it anyway appends its tracks and highlights under
194
+ // the one that replaced it, and addToHighlights pushes, so a re-launch of the
195
+ // same spec (a StrictMode remount) doubles the bands. The drain loop applies
196
+ // the newer init next either way.
197
+ //
198
+ // Checked after each await rather than once at the top, and as early returns
199
+ // rather than nesting, so a step added later takes a guard beside it instead
200
+ // of another level of indent.
201
+ if (superseded()) {
202
+ return;
203
+ }
204
+ await navigateInit(self, session, init);
205
+ if (superseded()) {
206
+ return;
207
+ }
208
+ showInitTracks(self, init);
209
+ if (init.nav !== undefined) {
210
+ self.setHideHeader(!init.nav);
211
+ }
212
+ backfillHighlightAssemblies(self);
213
+ applyInitHighlights(self, session, init);
214
+ }
215
+ /**
216
+ * Autorun that handles the init state - navigating to initial location,
217
+ * showing tracks, etc.
218
+ */
219
+ export function setupInitAutorun(self) {
220
+ installInitAutorun(self, {
221
+ name: 'LGVInit',
222
+ // `init` is what makes hasSomethingToShow / awaitingInitNavigation report
223
+ // "loading"
224
+ // until navigation populates displayedRegions, so the alternative gate
225
+ // (clearing `init` up front, the way SpreadsheetView does) would flash the
226
+ // import form mid-load.
227
+ ready: () => self.initialized,
228
+ // No pre-materialization phase to protect: the view is its own single row,
229
+ // and `error` already derives a failed init assembly declaratively (via
230
+ // initAssembly), so anything thrown out of applyInit is a failure of a
231
+ // step, not of the view coming up.
232
+ materialized: () => true,
233
+ apply: (init, ctx) => applyInit(self, init, ctx),
234
+ });
235
+ }
236
+ /**
237
+ * Autorun that updates coarse dynamic blocks with a delay
238
+ */
239
+ function setupCoarseDynamicBlocksAutorun(self) {
125
240
  addDisposer(self, autorun(function coarseDynamicBlocksAutorun() {
126
241
  if (self.initialized) {
127
- self.setCoarseDynamicBlocks(self.dynamicBlocks);
242
+ self.setCoarseDynamicBlocks(self.dynamicBlocks, self.bpPerPx);
128
243
  }
129
- }, { delay: 500, name: 'LGVCoarseDynamicBlocks' }));
244
+ }, {
245
+ delay: 500,
246
+ name: 'LGVCoarseDynamicBlocks',
247
+ }));
130
248
  }
131
- export function setupLocalStorageAutorun(self) {
249
+ /**
250
+ * Autorun that syncs view settings to localStorage
251
+ */
252
+ function setupLocalStorageAutorun(self) {
132
253
  addDisposer(self, autorun(function localStorageAutorun() {
133
254
  const s = (s) => JSON.stringify(s);
134
- const { showCytobandsSetting, showCenterLine, colorByCDS, showTrackOutlines, trackLabels, } = self;
135
- localStorageSetItem('lgv-showCytobands', s(showCytobandsSetting));
255
+ const { showCytobands, showCenterLine, colorByCDS, showAminoAcids, showTrackOutlines, trackLabels, } = self;
256
+ localStorageSetItem('lgv-showCytobands', s(showCytobands));
136
257
  localStorageSetItem('lgv-showCenterLine', s(showCenterLine));
137
258
  localStorageSetItem('lgv-colorByCDS', s(colorByCDS));
259
+ localStorageSetItem('lgv-showAminoAcids', s(showAminoAcids));
138
260
  localStorageSetItem('lgv-showTrackOutlines', s(showTrackOutlines));
139
- localStorageSetItem('lgv-trackLabels', trackLabels);
140
- }, { name: 'LGVLocalStorage' }));
261
+ // skip writing the empty default — otherwise reads later round-trip to
262
+ // '' instead of null, hiding the config-fallback path
263
+ if (trackLabels) {
264
+ localStorageSetItem('lgv-trackLabels', trackLabels);
265
+ }
266
+ }, {
267
+ name: 'LGVLocalStorage',
268
+ }));
141
269
  }
270
+ /**
271
+ * Sets up all afterAttach autoruns for the LinearGenomeView
272
+ */
142
273
  export function doAfterAttach(self) {
143
274
  setupInitAutorun(self);
144
275
  setupCoarseDynamicBlocksAutorun(self);
@@ -2,5 +2,5 @@ import type { LinearGenomeViewModel } from '../index.ts';
2
2
  type LGV = LinearGenomeViewModel;
3
3
  declare const CenterLine: ({ model }: {
4
4
  model: LGV;
5
- }) => import("react/jsx-runtime").JSX.Element | null;
5
+ }) => import("react").JSX.Element | null;
6
6
  export default CenterLine;
@@ -1,12 +1,13 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { useRef } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
2
  import { makeStyles } from '@jbrowse/core/util/tss-react';
3
+ import CloseIcon from '@mui/icons-material/Close';
4
+ import { IconButton, Tooltip } from '@mui/material';
4
5
  import { observer } from 'mobx-react';
5
6
  const useStyles = makeStyles()(theme => ({
6
7
  centerLineContainer: {
7
8
  background: 'transparent',
8
9
  height: '100%',
9
- zIndex: 4,
10
+ zIndex: 4, // above the track but under menu
10
11
  position: 'absolute',
11
12
  left: 0,
12
13
  border: `1px ${theme.palette.action.active} dashed`,
@@ -17,22 +18,30 @@ const useStyles = makeStyles()(theme => ({
17
18
  centerLineText: {
18
19
  position: 'absolute',
19
20
  left: 0,
20
- pointerEvents: 'none',
21
+ display: 'flex',
22
+ alignItems: 'center',
23
+ gap: 2,
21
24
  whiteSpace: 'nowrap',
22
25
  fontWeight: 'bold',
23
26
  },
27
+ dismiss: {
28
+ // re-enable clicks disabled on the pointer-events:none container
29
+ pointerEvents: 'auto',
30
+ padding: 2,
31
+ },
24
32
  }));
25
33
  const CenterLine = observer(function CenterLine({ model }) {
26
34
  const { bpPerPx, centerLineInfo, trackHeights, tracks, width } = model;
27
- const ref = useRef(null);
28
35
  const { classes } = useStyles();
29
36
  const startingPosition = width / 2;
30
- return tracks.length ? (_jsx("div", { "data-testid": "centerline_container", className: classes.centerLineContainer, role: "presentation", ref: ref, style: {
37
+ return tracks.length ? (_jsx("div", { "data-testid": "centerline_container", className: classes.centerLineContainer, role: "presentation", style: {
31
38
  transform: `translateX(${startingPosition}px)`,
32
39
  width: Math.max(1 / bpPerPx, 1),
33
40
  }, children: centerLineInfo && (_jsxs("div", { "data-testid": "centerline_text", className: classes.centerLineText, role: "presentation", style: {
34
41
  transform: `translateX(${Math.max(1 / bpPerPx, 1) + 5}px)`,
35
42
  top: trackHeights,
36
- }, children: [centerLineInfo.refName, ":", ' ', Math.max(Math.round(centerLineInfo.offset) + 1, 0)] })) })) : null;
43
+ }, children: [centerLineInfo.refName, ":", ' ', Math.max(Math.round(centerLineInfo.offset) + 1, 0).toLocaleString('en-US'), _jsx(Tooltip, { title: "Hide center line", children: _jsx(IconButton, { className: classes.dismiss, onClick: () => {
44
+ model.setShowCenterLine(false);
45
+ }, children: _jsx(CloseIcon, { fontSize: "inherit" }) }) })] })) })) : null;
37
46
  });
38
47
  export default CenterLine;
@@ -0,0 +1,7 @@
1
+ import type { LinearGenomeViewModel } from '../model.ts';
2
+ import type { HoverHighlightPosition } from './HoverPositionHighlight.tsx';
3
+ declare const ConnectedHoverHighlight: ({ model, getPosition, }: {
4
+ model: LinearGenomeViewModel;
5
+ getPosition: (widget: unknown, viewId: string) => HoverHighlightPosition | undefined;
6
+ }) => import("react").JSX.Element | null;
7
+ export default ConnectedHoverHighlight;
@@ -0,0 +1,22 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { getSession } from '@jbrowse/core/util';
3
+ import { observer } from 'mobx-react';
4
+ import HoverPositionHighlight from './HoverPositionHighlight.js';
5
+ // Draws a crosshair for every session widget "connected" to this view that is
6
+ // currently publishing a hover position. Each cross-widget hover overlay (the
7
+ // feature-detail sequence panel, the MAF sequence widget) supplies only its own
8
+ // `getPosition`, which narrows an arbitrary widget to its model and returns the
9
+ // hovered interval or undefined; the widget iteration and drawing are shared.
10
+ const ConnectedHoverHighlight = observer(function ConnectedHoverHighlight({ model, getPosition, }) {
11
+ const session = getSession(model);
12
+ const widgets = 'widgets' in session ? session.widgets : undefined;
13
+ return !widgets ? null : (_jsx(_Fragment, { children: [...widgets].flatMap(([id, widget]) => {
14
+ const position = getPosition(widget, model.id);
15
+ return position
16
+ ? [
17
+ _jsx(HoverPositionHighlight, { model: model, position: position }, `hover-${id}`),
18
+ ]
19
+ : [];
20
+ }) }));
21
+ });
22
+ export default ConnectedHoverHighlight;
@@ -0,0 +1,3 @@
1
+ import type { SequenceSearchModeProps } from './searchModes.ts';
2
+ declare const CrisprGuidePanel: ({ model, handleClose, }: SequenceSearchModeProps) => import("react").JSX.Element;
3
+ export default CrisprGuidePanel;
@@ -0,0 +1,144 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { LabeledCheckbox } from '@jbrowse/core/ui';
4
+ import { IUPAC_MOTIF_REGEX } from '@jbrowse/core/util';
5
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
6
+ import { MenuItem, TextField, ToggleButton, ToggleButtonGroup, Typography, } from '@mui/material';
7
+ import { observer } from 'mobx-react';
8
+ import SearchPanelForm from './SearchPanelForm.js';
9
+ import StrandCheckboxes from './StrandCheckboxes.js';
10
+ import { addReferenceScanTrack } from './searchModes.js';
11
+ const useStyles = makeStyles()({
12
+ row: {
13
+ display: 'flex',
14
+ gap: 12,
15
+ '& > *': {
16
+ flex: 1,
17
+ },
18
+ },
19
+ toggleRow: {
20
+ display: 'flex',
21
+ alignItems: 'center',
22
+ gap: 12,
23
+ },
24
+ });
25
+ // PAM 3' of the protospacer for Cas9-type enzymes, 5' for Cas12a. The two cut
26
+ // offsets are bp from the PAM-proximal end of the protospacer to each strand's
27
+ // cut: equal for a blunt cutter, staggered for Cas12a, which leaves a 5-nt 5'
28
+ // overhang.
29
+ const ENZYME_PRESETS = {
30
+ SpCas9: {
31
+ pam: 'NGG',
32
+ guideLength: 20,
33
+ pamLocation: '3prime',
34
+ cutOffset: 3,
35
+ cutOffsetBottom: 3,
36
+ },
37
+ SaCas9: {
38
+ pam: 'NNGRRT',
39
+ guideLength: 21,
40
+ pamLocation: '3prime',
41
+ cutOffset: 3,
42
+ cutOffsetBottom: 3,
43
+ },
44
+ 'Cas12a (Cpf1)': {
45
+ pam: 'TTTV',
46
+ guideLength: 23,
47
+ pamLocation: '5prime',
48
+ cutOffset: 18,
49
+ cutOffsetBottom: 23,
50
+ },
51
+ };
52
+ // The one filter preset the panel offers. The adapter's slots are a free GC
53
+ // range plus a poly-T flag; these are the conventional cutoffs, named in the
54
+ // checkbox label so the numbers aren't hidden behind a word like "usable".
55
+ const GC_FILTER = { minGcPercent: 40, maxGcPercent: 60 };
56
+ const NO_FILTER = { minGcPercent: 0, maxGcPercent: 100 };
57
+ const DEFAULT_ENZYME = 'SpCas9';
58
+ const DEFAULT_PRESET = ENZYME_PRESETS[DEFAULT_ENZYME];
59
+ const toBpCount = (str) => (str.trim() ? Number(str) : Number.NaN);
60
+ const CrisprGuidePanel = observer(function CrisprGuidePanel({ model, handleClose, }) {
61
+ const { classes } = useStyles();
62
+ const [enzyme, setEnzyme] = useState(DEFAULT_ENZYME);
63
+ const [pam, setPam] = useState(DEFAULT_PRESET.pam);
64
+ const [pamLocation, setPamLocation] = useState(DEFAULT_PRESET.pamLocation);
65
+ const [guideLengthStr, setGuideLengthStr] = useState(String(DEFAULT_PRESET.guideLength));
66
+ const [cutOffsetStr, setCutOffsetStr] = useState(String(DEFAULT_PRESET.cutOffset));
67
+ // presets carry this; Custom is treated as a blunt cutter, so the panel does
68
+ // not grow a second offset field for a case config can express directly
69
+ const [cutOffsetBottom, setCutOffsetBottom] = useState(DEFAULT_PRESET.cutOffsetBottom);
70
+ const [searchForward, setSearchForward] = useState(true);
71
+ const [searchReverse, setSearchReverse] = useState(true);
72
+ const [filterQuality, setFilterQuality] = useState(false);
73
+ // `Number('')` is 0, so an emptied field would otherwise read as a valid zero
74
+ const guideLength = toBpCount(guideLengthStr);
75
+ const cutOffset = toBpCount(cutOffsetStr);
76
+ // both are bp counts used for fixed-length string slicing, so a fractional
77
+ // value would silently truncate and skew the placement
78
+ const guideLengthValid = Number.isInteger(guideLength) && guideLength > 0;
79
+ // a cut beyond either end of the protospacer draws its tick outside the glyph
80
+ // that is supposed to carry it, and outside the box that can be clicked
81
+ const cutOffsetValid = Number.isInteger(cutOffset) && cutOffset >= 0 && cutOffset <= guideLength;
82
+ // each PAM position must be a single IUPAC code (one base); other characters
83
+ // would leak into the match regex and break the fixed-length placement
84
+ const pamValid = IUPAC_MOTIF_REGEX.test(pam);
85
+ const canSubmit = pamValid &&
86
+ guideLengthValid &&
87
+ cutOffsetValid &&
88
+ (searchForward || searchReverse);
89
+ // a staggered cutter shows both offsets, e.g. "cut 18/23 bp from PAM"
90
+ const cutSummary = cutOffsetBottom === cutOffset
91
+ ? cutOffset
92
+ : `${cutOffset}/${cutOffsetBottom}`;
93
+ const presetSummary = ENZYME_PRESETS[enzyme]
94
+ ? `PAM ${pam} · ${guideLength} bp guide · cut ${cutSummary} bp from PAM`
95
+ : 'Set a custom PAM and geometry below';
96
+ function applyPreset(name) {
97
+ setEnzyme(name);
98
+ const preset = ENZYME_PRESETS[name];
99
+ if (preset) {
100
+ setPam(preset.pam);
101
+ setPamLocation(preset.pamLocation);
102
+ setGuideLengthStr(String(preset.guideLength));
103
+ setCutOffsetStr(String(preset.cutOffset));
104
+ setCutOffsetBottom(preset.cutOffsetBottom);
105
+ }
106
+ }
107
+ function handleSubmit() {
108
+ addReferenceScanTrack(model, {
109
+ trackId: `crispr_guides_${Date.now()}`,
110
+ name: enzyme === 'Custom'
111
+ ? `CRISPR guides ${pam}`
112
+ : `CRISPR guides ${enzyme} (${pam})`,
113
+ adapter: {
114
+ type: 'CrisprGuideAdapter',
115
+ pam,
116
+ guideLength,
117
+ pamLocation,
118
+ cutOffset,
119
+ cutOffsetBottom: enzyme === 'Custom' ? cutOffset : cutOffsetBottom,
120
+ searchForward,
121
+ searchReverse,
122
+ excludePolyT: filterQuality,
123
+ ...(filterQuality ? GC_FILTER : NO_FILTER),
124
+ },
125
+ });
126
+ handleClose();
127
+ }
128
+ return (_jsxs(SearchPanelForm, { onSubmit: handleSubmit, handleClose: handleClose, submitDisabled: !canSubmit, children: [_jsx(TextField, { select: true, variant: "outlined", size: "small", label: "Enzyme", value: enzyme, helperText: presetSummary, onChange: event => {
129
+ applyPreset(event.target.value);
130
+ }, children: [...Object.keys(ENZYME_PRESETS), 'Custom'].map(name => (_jsx(MenuItem, { value: name, children: name }, name))) }), enzyme === 'Custom' ? (_jsxs(_Fragment, { children: [_jsx(TextField, { size: "small", label: "PAM (IUPAC)", value: pam, error: !pamValid, helperText: pamValid ? undefined : 'Use IUPAC codes only', onChange: event => {
131
+ setPam(event.target.value.toUpperCase());
132
+ } }), _jsxs("div", { className: classes.row, children: [_jsx(TextField, { size: "small", label: "Guide length (bp)", value: guideLengthStr, error: !guideLengthValid, helperText: guideLengthValid ? undefined : 'A whole number of bp', onChange: event => {
133
+ setGuideLengthStr(event.target.value);
134
+ } }), _jsx(TextField, { size: "small", label: "Cut offset (bp)", value: cutOffsetStr, error: !cutOffsetValid, helperText: cutOffsetValid ? undefined : 'bp from the PAM, within the guide', onChange: event => {
135
+ setCutOffsetStr(event.target.value);
136
+ } })] }), _jsxs("div", { className: classes.toggleRow, children: [_jsx(Typography, { variant: "body2", color: "textSecondary", children: "PAM location" }), _jsxs(ToggleButtonGroup, { exclusive: true, size: "small", value: pamLocation, onChange: (_event, value) => {
137
+ if (value) {
138
+ setPamLocation(value);
139
+ }
140
+ }, children: [_jsx(ToggleButton, { value: "3prime", children: "3\u2032 (Cas9)" }), _jsx(ToggleButton, { value: "5prime", children: "5\u2032 (Cas12a)" })] })] })] })) : null, _jsx(StrandCheckboxes, { searchForward: searchForward, searchReverse: searchReverse, setSearchForward: setSearchForward, setSearchReverse: setSearchReverse }), _jsx(LabeledCheckbox, { size: "small", checked: filterQuality, onChange: val => {
141
+ setFilterQuality(val);
142
+ }, label: "Keep only guides with 40-60% GC and no poly-T run" })] }));
143
+ });
144
+ export default CrisprGuidePanel;
@@ -1,9 +1,9 @@
1
- import type { Assembly } from '@jbrowse/core/assemblyManager/assembly';
2
- import type { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
1
+ import type { Cytoband } from './util.ts';
2
+ import type { ViewLayout } from '@jbrowse/core/util/Base1DUtils';
3
3
  import type { ContentBlock } from '@jbrowse/core/util/blockTypes';
4
- declare const Cytobands: ({ overview, block, assembly, }: {
5
- overview: Base1DViewModel;
6
- assembly?: Assembly;
4
+ declare const Cytobands: ({ overview, block, cytobands, }: {
5
+ overview: ViewLayout;
6
+ cytobands: Cytoband[];
7
7
  block: ContentBlock;
8
- }) => import("react/jsx-runtime").JSX.Element;
8
+ }) => import("react").JSX.Element;
9
9
  export default Cytobands;