@jbrowse/plugin-linear-genome-view 3.6.5 → 4.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 (392) hide show
  1. package/esm/BaseLinearDisplay/SVGLegend.d.ts +6 -0
  2. package/esm/BaseLinearDisplay/SVGLegend.js +17 -0
  3. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +2 -0
  4. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +11 -0
  5. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +3 -3
  6. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +13 -24
  7. package/esm/BaseLinearDisplay/components/Block.js +2 -2
  8. package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +2 -2
  9. package/esm/BaseLinearDisplay/components/BlockMsg.js +11 -2
  10. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +9 -0
  11. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +42 -0
  12. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +11 -0
  13. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +40 -0
  14. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +19 -0
  15. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +45 -0
  16. package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +5 -0
  17. package/esm/BaseLinearDisplay/components/FloatingLabels.js +89 -0
  18. package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +8 -0
  19. package/esm/BaseLinearDisplay/components/FloatingLegend.js +43 -0
  20. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -5
  21. package/esm/BaseLinearDisplay/components/LinearBlocks.js +5 -42
  22. package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +4 -0
  23. package/esm/BaseLinearDisplay/components/LoadingOverlay.js +49 -0
  24. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +4 -0
  25. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +26 -0
  26. package/esm/BaseLinearDisplay/components/MenuPage.d.ts +8 -0
  27. package/esm/BaseLinearDisplay/components/MenuPage.js +24 -0
  28. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +19 -0
  29. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +48 -0
  30. package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +12 -0
  31. package/esm/BaseLinearDisplay/components/RenderedBlocks.js +22 -0
  32. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +4 -4
  33. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +5 -8
  34. package/esm/BaseLinearDisplay/components/TooLargeMessage.js +3 -3
  35. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +2 -0
  36. package/esm/BaseLinearDisplay/components/Tooltip.js +10 -7
  37. package/esm/BaseLinearDisplay/components/types.d.ts +1 -0
  38. package/esm/BaseLinearDisplay/components/types.js +1 -0
  39. package/esm/BaseLinearDisplay/components/util.d.ts +21 -0
  40. package/esm/BaseLinearDisplay/components/util.js +116 -0
  41. package/esm/BaseLinearDisplay/index.d.ts +17 -8
  42. package/esm/BaseLinearDisplay/index.js +13 -6
  43. package/esm/BaseLinearDisplay/model.d.ts +1177 -0
  44. package/esm/BaseLinearDisplay/model.js +424 -0
  45. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +5 -5
  46. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +11 -14
  47. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +21 -0
  48. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +46 -0
  49. package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +3 -3
  50. package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +2 -3
  51. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +1 -1
  52. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +2 -3
  53. package/esm/BaseLinearDisplay/models/calculateLabelPositions.d.ts +24 -0
  54. package/esm/BaseLinearDisplay/models/calculateLabelPositions.js +60 -0
  55. package/esm/BaseLinearDisplay/models/configSchema.d.ts +2 -2
  56. package/esm/BaseLinearDisplay/models/configSchema.js +3 -3
  57. package/esm/BaseLinearDisplay/models/renderSvg.d.ts +3 -7
  58. package/esm/BaseLinearDisplay/models/renderSvg.js +22 -11
  59. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +37 -19
  60. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +151 -135
  61. package/esm/BaseLinearDisplay/models/util.d.ts +4 -4
  62. package/esm/BaseLinearDisplay/models/util.js +16 -13
  63. package/esm/BaseLinearDisplay/renderSvg.d.ts +3 -0
  64. package/esm/BaseLinearDisplay/renderSvg.js +59 -0
  65. package/esm/BaseLinearDisplay/types.d.ts +47 -0
  66. package/esm/BaseLinearDisplay/types.js +3 -0
  67. package/esm/BaseLinearDisplay/util.d.ts +15 -0
  68. package/esm/BaseLinearDisplay/util.js +61 -0
  69. package/esm/BasicTrack/configSchema.d.ts +16 -11
  70. package/esm/BasicTrack/index.js +1 -1
  71. package/esm/FeatureTrack/configSchema.d.ts +16 -11
  72. package/esm/FeatureTrack/index.js +1 -1
  73. package/esm/LaunchLinearGenomeView/index.js +12 -62
  74. package/esm/LinearBareDisplay/configSchema.d.ts +4 -4
  75. package/esm/LinearBareDisplay/configSchema.js +1 -1
  76. package/esm/LinearBareDisplay/index.d.ts +2 -2
  77. package/esm/LinearBareDisplay/index.js +5 -5
  78. package/esm/LinearBareDisplay/model.d.ts +959 -92
  79. package/esm/LinearBareDisplay/model.js +3 -6
  80. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +5 -0
  81. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +9 -0
  82. package/esm/LinearBasicDisplay/configSchema.d.ts +4 -4
  83. package/esm/LinearBasicDisplay/configSchema.js +1 -1
  84. package/esm/LinearBasicDisplay/index.d.ts +2 -2
  85. package/esm/LinearBasicDisplay/index.js +6 -6
  86. package/esm/LinearBasicDisplay/model.d.ts +1134 -122
  87. package/esm/LinearBasicDisplay/model.js +116 -116
  88. package/esm/{LinearBasicDisplay → LinearFeatureDisplay}/components/AddFiltersDialog.js +2 -2
  89. package/esm/{LinearBasicDisplay → LinearFeatureDisplay}/components/SetMaxHeightDialog.js +3 -3
  90. package/{dist/LinearBasicDisplay → esm/LinearFeatureDisplay}/configSchema.d.ts +4 -4
  91. package/esm/LinearFeatureDisplay/configSchema.js +11 -0
  92. package/esm/LinearFeatureDisplay/index.d.ts +3 -0
  93. package/esm/LinearFeatureDisplay/index.js +2 -0
  94. package/esm/LinearFeatureDisplay/model.d.ts +1415 -0
  95. package/esm/LinearFeatureDisplay/model.js +265 -0
  96. package/esm/LinearGenomeView/SVGErrorBox.d.ts +5 -0
  97. package/esm/LinearGenomeView/SVGErrorBox.js +4 -0
  98. package/esm/LinearGenomeView/afterAttach.d.ts +5 -0
  99. package/esm/LinearGenomeView/afterAttach.js +95 -0
  100. package/esm/LinearGenomeView/components/CenterLine.js +6 -4
  101. package/esm/LinearGenomeView/components/Cytobands.js +4 -4
  102. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +1 -1
  103. package/esm/LinearGenomeView/components/ExportSvgDialog.js +5 -1
  104. package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +8 -2
  105. package/esm/LinearGenomeView/components/GetSequenceDialog.js +13 -16
  106. package/esm/LinearGenomeView/components/Gridlines.js +18 -15
  107. package/esm/LinearGenomeView/components/Header.js +9 -9
  108. package/esm/LinearGenomeView/components/HeaderPanControls.js +2 -2
  109. package/esm/LinearGenomeView/components/HeaderRegionWidth.js +4 -5
  110. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +2 -2
  111. package/esm/LinearGenomeView/components/HeaderZoomControls.js +3 -3
  112. package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
  113. package/esm/LinearGenomeView/components/Highlight.js +6 -6
  114. package/esm/LinearGenomeView/components/ImportForm.d.ts +1 -1
  115. package/esm/LinearGenomeView/components/ImportForm.js +14 -12
  116. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +3 -3
  117. package/esm/LinearGenomeView/components/LinearGenomeView.js +7 -7
  118. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +7 -8
  119. package/esm/LinearGenomeView/components/MiniControls.js +6 -6
  120. package/esm/LinearGenomeView/components/NoTracksActiveButton.js +2 -2
  121. package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +1 -1
  122. package/esm/LinearGenomeView/components/OverviewHighlight.js +5 -5
  123. package/esm/LinearGenomeView/components/OverviewRubberband.js +4 -4
  124. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +9 -5
  125. package/esm/LinearGenomeView/components/OverviewScalebar.js +36 -28
  126. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +5 -5
  127. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +7 -7
  128. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +1 -1
  129. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +1 -1
  130. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +10 -10
  131. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +1 -1
  132. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +6 -4
  133. package/esm/LinearGenomeView/components/Rubberband.js +9 -7
  134. package/esm/LinearGenomeView/components/RubberbandSpan.js +4 -5
  135. package/esm/LinearGenomeView/components/Scalebar.js +8 -10
  136. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
  137. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +50 -17
  138. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
  139. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +13 -11
  140. package/esm/LinearGenomeView/components/SearchBox.d.ts +1 -1
  141. package/esm/LinearGenomeView/components/SearchBox.js +8 -9
  142. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +1 -1
  143. package/esm/LinearGenomeView/components/SearchResultsDialog.js +2 -2
  144. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +1 -1
  145. package/esm/LinearGenomeView/components/SearchResultsTable.js +4 -6
  146. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +6 -6
  147. package/esm/LinearGenomeView/components/TrackContainer.js +32 -20
  148. package/esm/LinearGenomeView/components/TrackLabel.js +10 -11
  149. package/esm/LinearGenomeView/components/TrackLabelContainer.js +7 -8
  150. package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +1 -1
  151. package/esm/LinearGenomeView/components/TrackLabelMenu.js +80 -68
  152. package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +1 -2
  153. package/esm/LinearGenomeView/components/TrackRenderingContainer.js +5 -5
  154. package/esm/LinearGenomeView/components/TracksContainer.js +18 -15
  155. package/esm/LinearGenomeView/components/VerticalGuide.js +5 -3
  156. package/esm/LinearGenomeView/components/fetchSequence.d.ts +7 -2
  157. package/esm/LinearGenomeView/components/useRangeSelect.d.ts +27 -2
  158. package/esm/LinearGenomeView/components/useRangeSelect.js +26 -20
  159. package/esm/LinearGenomeView/components/useWheelScroll.js +22 -12
  160. package/esm/LinearGenomeView/components/util.d.ts +2 -13
  161. package/esm/LinearGenomeView/components/util.js +12 -31
  162. package/esm/LinearGenomeView/index.d.ts +1 -1
  163. package/esm/LinearGenomeView/index.js +3 -3
  164. package/esm/LinearGenomeView/keyboardHandler.d.ts +2 -0
  165. package/esm/LinearGenomeView/keyboardHandler.js +29 -0
  166. package/esm/LinearGenomeView/menuItems.d.ts +7 -0
  167. package/esm/LinearGenomeView/menuItems.js +299 -0
  168. package/esm/LinearGenomeView/model.d.ts +92 -89
  169. package/esm/LinearGenomeView/model.js +166 -414
  170. package/esm/LinearGenomeView/svgExportUtil.d.ts +9 -0
  171. package/esm/LinearGenomeView/svgExportUtil.js +6 -0
  172. package/{dist/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts → esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts} +2 -2
  173. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +20 -0
  174. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +5 -5
  175. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +4 -3
  176. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +24 -12
  177. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +13 -5
  178. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +2 -2
  179. package/esm/LinearGenomeView/types.d.ts +5 -1
  180. package/esm/LinearGenomeView/util.d.ts +2 -2
  181. package/esm/LinearGenomeView/util.js +8 -6
  182. package/esm/index.d.ts +975 -94
  183. package/esm/index.js +37 -38
  184. package/esm/searchUtils.d.ts +1 -1
  185. package/esm/searchUtils.js +6 -4
  186. package/package.json +28 -33
  187. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
  188. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -72
  189. package/dist/BaseLinearDisplay/components/Block.d.ts +0 -14
  190. package/dist/BaseLinearDisplay/components/Block.js +0 -50
  191. package/dist/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
  192. package/dist/BaseLinearDisplay/components/BlockErrorMessage.js +0 -27
  193. package/dist/BaseLinearDisplay/components/BlockLoadingMessage.d.ts +0 -6
  194. package/dist/BaseLinearDisplay/components/BlockLoadingMessage.js +0 -26
  195. package/dist/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
  196. package/dist/BaseLinearDisplay/components/BlockMsg.js +0 -20
  197. package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -9
  198. package/dist/BaseLinearDisplay/components/LinearBlocks.js +0 -61
  199. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -11
  200. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -59
  201. package/dist/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
  202. package/dist/BaseLinearDisplay/components/TooLargeMessage.js +0 -25
  203. package/dist/BaseLinearDisplay/components/Tooltip.d.ts +0 -11
  204. package/dist/BaseLinearDisplay/components/Tooltip.js +0 -24
  205. package/dist/BaseLinearDisplay/index.d.ts +0 -8
  206. package/dist/BaseLinearDisplay/index.js +0 -20
  207. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +0 -311
  208. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +0 -325
  209. package/dist/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
  210. package/dist/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -122
  211. package/dist/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
  212. package/dist/BaseLinearDisplay/models/TrackHeightMixin.js +0 -35
  213. package/dist/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
  214. package/dist/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -33
  215. package/dist/BaseLinearDisplay/models/configSchema.d.ts +0 -29
  216. package/dist/BaseLinearDisplay/models/configSchema.js +0 -35
  217. package/dist/BaseLinearDisplay/models/renderSvg.d.ts +0 -7
  218. package/dist/BaseLinearDisplay/models/renderSvg.js +0 -80
  219. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -78
  220. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -229
  221. package/dist/BaseLinearDisplay/models/util.d.ts +0 -22
  222. package/dist/BaseLinearDisplay/models/util.js +0 -45
  223. package/dist/BasicTrack/configSchema.d.ts +0 -80
  224. package/dist/BasicTrack/configSchema.js +0 -10
  225. package/dist/BasicTrack/index.d.ts +0 -2
  226. package/dist/BasicTrack/index.js +0 -18
  227. package/dist/FeatureTrack/configSchema.d.ts +0 -80
  228. package/dist/FeatureTrack/configSchema.js +0 -10
  229. package/dist/FeatureTrack/index.d.ts +0 -2
  230. package/dist/FeatureTrack/index.js +0 -19
  231. package/dist/LaunchLinearGenomeView/index.d.ts +0 -2
  232. package/dist/LaunchLinearGenomeView/index.js +0 -70
  233. package/dist/LinearBareDisplay/configSchema.d.ts +0 -32
  234. package/dist/LinearBareDisplay/configSchema.js +0 -13
  235. package/dist/LinearBareDisplay/index.d.ts +0 -4
  236. package/dist/LinearBareDisplay/index.js +0 -26
  237. package/dist/LinearBareDisplay/model.d.ts +0 -309
  238. package/dist/LinearBareDisplay/model.js +0 -38
  239. package/dist/LinearBasicDisplay/components/AddFiltersDialog.js +0 -61
  240. package/dist/LinearBasicDisplay/components/SetMaxHeightDialog.js +0 -28
  241. package/dist/LinearBasicDisplay/configSchema.js +0 -13
  242. package/dist/LinearBasicDisplay/index.d.ts +0 -4
  243. package/dist/LinearBasicDisplay/index.js +0 -29
  244. package/dist/LinearBasicDisplay/model.d.ts +0 -346
  245. package/dist/LinearBasicDisplay/model.js +0 -192
  246. package/dist/LinearGenomeView/components/CenterLine.d.ts +0 -6
  247. package/dist/LinearGenomeView/components/CenterLine.js +0 -38
  248. package/dist/LinearGenomeView/components/Cytobands.d.ts +0 -9
  249. package/dist/LinearGenomeView/components/Cytobands.js +0 -89
  250. package/dist/LinearGenomeView/components/ExportSvgDialog.d.ts +0 -7
  251. package/dist/LinearGenomeView/components/ExportSvgDialog.js +0 -57
  252. package/dist/LinearGenomeView/components/GetSequenceDialog.d.ts +0 -6
  253. package/dist/LinearGenomeView/components/GetSequenceDialog.js +0 -109
  254. package/dist/LinearGenomeView/components/Gridlines.d.ts +0 -7
  255. package/dist/LinearGenomeView/components/Gridlines.js +0 -70
  256. package/dist/LinearGenomeView/components/Header.d.ts +0 -5
  257. package/dist/LinearGenomeView/components/Header.js +0 -38
  258. package/dist/LinearGenomeView/components/HeaderPanControls.d.ts +0 -6
  259. package/dist/LinearGenomeView/components/HeaderPanControls.js +0 -27
  260. package/dist/LinearGenomeView/components/HeaderRegionWidth.d.ts +0 -5
  261. package/dist/LinearGenomeView/components/HeaderRegionWidth.js +0 -21
  262. package/dist/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +0 -5
  263. package/dist/LinearGenomeView/components/HeaderTrackSelectorButton.js +0 -19
  264. package/dist/LinearGenomeView/components/HeaderZoomControls.d.ts +0 -5
  265. package/dist/LinearGenomeView/components/HeaderZoomControls.js +0 -109
  266. package/dist/LinearGenomeView/components/Highlight.d.ts +0 -12
  267. package/dist/LinearGenomeView/components/Highlight.js +0 -95
  268. package/dist/LinearGenomeView/components/ImportForm.d.ts +0 -6
  269. package/dist/LinearGenomeView/components/ImportForm.js +0 -80
  270. package/dist/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
  271. package/dist/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -32
  272. package/dist/LinearGenomeView/components/LinearGenomeView.d.ts +0 -5
  273. package/dist/LinearGenomeView/components/LinearGenomeView.js +0 -57
  274. package/dist/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +0 -5
  275. package/dist/LinearGenomeView/components/LinearGenomeViewContainer.js +0 -98
  276. package/dist/LinearGenomeView/components/MiniControls.d.ts +0 -5
  277. package/dist/LinearGenomeView/components/MiniControls.js +0 -36
  278. package/dist/LinearGenomeView/components/NoTracksActiveButton.d.ts +0 -5
  279. package/dist/LinearGenomeView/components/NoTracksActiveButton.js +0 -23
  280. package/dist/LinearGenomeView/components/OverviewHighlight.d.ts +0 -8
  281. package/dist/LinearGenomeView/components/OverviewHighlight.js +0 -50
  282. package/dist/LinearGenomeView/components/OverviewRubberband.d.ts +0 -9
  283. package/dist/LinearGenomeView/components/OverviewRubberband.js +0 -113
  284. package/dist/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +0 -10
  285. package/dist/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +0 -28
  286. package/dist/LinearGenomeView/components/OverviewScalebar.d.ts +0 -7
  287. package/dist/LinearGenomeView/components/OverviewScalebar.js +0 -146
  288. package/dist/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +0 -8
  289. package/dist/LinearGenomeView/components/OverviewScalebarPolygon.js +0 -41
  290. package/dist/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +0 -10
  291. package/dist/LinearGenomeView/components/OverviewScalebarTickLabels.js +0 -37
  292. package/dist/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -8
  293. package/dist/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -18
  294. package/dist/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
  295. package/dist/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -56
  296. package/dist/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
  297. package/dist/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -11
  298. package/dist/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
  299. package/dist/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -127
  300. package/dist/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
  301. package/dist/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -53
  302. package/dist/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +0 -6
  303. package/dist/LinearGenomeView/components/RegionWidthEditorDialog.js +0 -30
  304. package/dist/LinearGenomeView/components/Rubberband.d.ts +0 -7
  305. package/dist/LinearGenomeView/components/Rubberband.js +0 -35
  306. package/dist/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
  307. package/dist/LinearGenomeView/components/RubberbandSpan.js +0 -39
  308. package/dist/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
  309. package/dist/LinearGenomeView/components/RubberbandTooltip.js +0 -20
  310. package/dist/LinearGenomeView/components/Scalebar.d.ts +0 -10
  311. package/dist/LinearGenomeView/components/Scalebar.js +0 -40
  312. package/dist/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +0 -6
  313. package/dist/LinearGenomeView/components/ScalebarCoordinateLabels.js +0 -29
  314. package/dist/LinearGenomeView/components/ScalebarCoordinateTicks.d.ts +0 -6
  315. package/dist/LinearGenomeView/components/ScalebarCoordinateTicks.js +0 -38
  316. package/dist/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +0 -6
  317. package/dist/LinearGenomeView/components/ScalebarRefNameLabels.js +0 -46
  318. package/dist/LinearGenomeView/components/SearchBox.d.ts +0 -6
  319. package/dist/LinearGenomeView/components/SearchBox.js +0 -88
  320. package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +0 -9
  321. package/dist/LinearGenomeView/components/SearchResultsDialog.js +0 -15
  322. package/dist/LinearGenomeView/components/SearchResultsTable.d.ts +0 -8
  323. package/dist/LinearGenomeView/components/SearchResultsTable.js +0 -74
  324. package/dist/LinearGenomeView/components/SequenceSearchDialog.d.ts +0 -8
  325. package/dist/LinearGenomeView/components/SequenceSearchDialog.js +0 -67
  326. package/dist/LinearGenomeView/components/TrackContainer.d.ts +0 -8
  327. package/dist/LinearGenomeView/components/TrackContainer.js +0 -51
  328. package/dist/LinearGenomeView/components/TrackLabel.d.ts +0 -7
  329. package/dist/LinearGenomeView/components/TrackLabel.js +0 -49
  330. package/dist/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
  331. package/dist/LinearGenomeView/components/TrackLabelContainer.js +0 -31
  332. package/dist/LinearGenomeView/components/TrackLabelDragHandle.d.ts +0 -8
  333. package/dist/LinearGenomeView/components/TrackLabelDragHandle.js +0 -32
  334. package/dist/LinearGenomeView/components/TrackLabelMenu.d.ts +0 -5
  335. package/dist/LinearGenomeView/components/TrackLabelMenu.js +0 -93
  336. package/dist/LinearGenomeView/components/TrackRenderingContainer.d.ts +0 -9
  337. package/dist/LinearGenomeView/components/TrackRenderingContainer.js +0 -50
  338. package/dist/LinearGenomeView/components/TracksContainer.d.ts +0 -7
  339. package/dist/LinearGenomeView/components/TracksContainer.js +0 -84
  340. package/dist/LinearGenomeView/components/VerticalGuide.d.ts +0 -7
  341. package/dist/LinearGenomeView/components/VerticalGuide.js +0 -31
  342. package/dist/LinearGenomeView/components/fetchSequence.d.ts +0 -4
  343. package/dist/LinearGenomeView/components/fetchSequence.js +0 -29
  344. package/dist/LinearGenomeView/components/useRangeSelect.d.ts +0 -59
  345. package/dist/LinearGenomeView/components/useRangeSelect.js +0 -131
  346. package/dist/LinearGenomeView/components/useSideScroll.d.ts +0 -6
  347. package/dist/LinearGenomeView/components/useSideScroll.js +0 -60
  348. package/dist/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
  349. package/dist/LinearGenomeView/components/useWheelScroll.js +0 -62
  350. package/dist/LinearGenomeView/components/util.d.ts +0 -25
  351. package/dist/LinearGenomeView/components/util.js +0 -49
  352. package/dist/LinearGenomeView/consts.d.ts +0 -7
  353. package/dist/LinearGenomeView/consts.js +0 -10
  354. package/dist/LinearGenomeView/index.d.ts +0 -3
  355. package/dist/LinearGenomeView/index.js +0 -53
  356. package/dist/LinearGenomeView/model.d.ts +0 -268
  357. package/dist/LinearGenomeView/model.js +0 -1109
  358. package/dist/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
  359. package/dist/LinearGenomeView/svgcomponents/SVGBackground.js +0 -10
  360. package/dist/LinearGenomeView/svgcomponents/SVGHeader.d.ts +0 -7
  361. package/dist/LinearGenomeView/svgcomponents/SVGHeader.js +0 -47
  362. package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +0 -6
  363. package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +0 -42
  364. package/dist/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +0 -8
  365. package/dist/LinearGenomeView/svgcomponents/SVGRuler.d.ts +0 -7
  366. package/dist/LinearGenomeView/svgcomponents/SVGRuler.js +0 -39
  367. package/dist/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +0 -7
  368. package/dist/LinearGenomeView/svgcomponents/SVGScalebar.js +0 -17
  369. package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +0 -7
  370. package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.js +0 -14
  371. package/dist/LinearGenomeView/svgcomponents/SVGTracks.d.ts +0 -21
  372. package/dist/LinearGenomeView/svgcomponents/SVGTracks.js +0 -32
  373. package/dist/LinearGenomeView/svgcomponents/util.d.ts +0 -8
  374. package/dist/LinearGenomeView/svgcomponents/util.js +0 -8
  375. package/dist/LinearGenomeView/types.d.ts +0 -43
  376. package/dist/LinearGenomeView/types.js +0 -2
  377. package/dist/LinearGenomeView/util.d.ts +0 -26
  378. package/dist/LinearGenomeView/util.js +0 -138
  379. package/dist/index.d.ts +0 -353
  380. package/dist/index.js +0 -120
  381. package/dist/searchUtils.d.ts +0 -26
  382. package/dist/searchUtils.js +0 -80
  383. package/esm/BaseLinearDisplay/components/BlockLoadingMessage.d.ts +0 -6
  384. package/esm/BaseLinearDisplay/components/BlockLoadingMessage.js +0 -24
  385. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +0 -311
  386. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +0 -286
  387. package/esm/LinearBasicDisplay/components/AddFiltersDialog.d.ts +0 -9
  388. package/esm/LinearBasicDisplay/components/SetMaxHeightDialog.d.ts +0 -8
  389. package/esm/LinearGenomeView/components/ScalebarCoordinateTicks.d.ts +0 -6
  390. package/esm/LinearGenomeView/components/ScalebarCoordinateTicks.js +0 -36
  391. /package/{dist/LinearBasicDisplay → esm/LinearFeatureDisplay}/components/AddFiltersDialog.d.ts +0 -0
  392. /package/{dist/LinearBasicDisplay → esm/LinearFeatureDisplay}/components/SetMaxHeightDialog.d.ts +0 -0
@@ -0,0 +1,265 @@
1
+ import { lazy } from 'react';
2
+ import { ConfigurationReference, getConf, readConfObject, } from '@jbrowse/core/configuration';
3
+ import SerializableFilterChain from '@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain';
4
+ import { SimpleFeature, getSession } from '@jbrowse/core/util';
5
+ import { getRpcSessionId } from '@jbrowse/core/util/tracks';
6
+ import { cast, getParent, isAlive, types } from '@jbrowse/mobx-state-tree';
7
+ import VisibilityIcon from '@mui/icons-material/Visibility';
8
+ import { BaseLinearDisplay } from "../BaseLinearDisplay/index.js";
9
+ const SetMaxHeightDialog = lazy(() => import("./components/SetMaxHeightDialog.js"));
10
+ const AddFiltersDialog = lazy(() => import("./components/AddFiltersDialog.js"));
11
+ function stateModelFactory(configSchema) {
12
+ return types
13
+ .compose('LinearFeatureDisplay', BaseLinearDisplay, types.model({
14
+ type: types.literal('LinearFeatureDisplay'),
15
+ trackShowLabels: types.maybe(types.boolean),
16
+ trackShowDescriptions: types.maybe(types.boolean),
17
+ trackDisplayMode: types.maybe(types.string),
18
+ trackMaxHeight: types.maybe(types.number),
19
+ configuration: ConfigurationReference(configSchema),
20
+ jexlFilters: types.maybe(types.array(types.string)),
21
+ }))
22
+ .volatile(() => ({
23
+ featureUnderMouseVolatile: undefined,
24
+ }))
25
+ .views(self => ({
26
+ get activeFilters() {
27
+ return (self.jexlFilters ??
28
+ getConf(self, 'jexlFilters').map((r) => `jexl:${r}`));
29
+ },
30
+ get rendererTypeName() {
31
+ return getConf(self, ['renderer', 'type']);
32
+ },
33
+ get sequenceAdapter() {
34
+ const { assemblyManager } = getSession(self);
35
+ const track = getParent(self, 2);
36
+ const assemblyNames = readConfObject(track.configuration, 'assemblyNames');
37
+ const assembly = assemblyManager.get(assemblyNames[0]);
38
+ return assembly ? getConf(assembly, ['sequence', 'adapter']) : undefined;
39
+ },
40
+ get showLabels() {
41
+ return self.trackShowLabels ?? getConf(self, ['renderer', 'showLabels']);
42
+ },
43
+ get showDescriptions() {
44
+ return (self.trackShowDescriptions ??
45
+ getConf(self, ['renderer', 'showDescriptions']));
46
+ },
47
+ get maxHeight() {
48
+ return self.trackMaxHeight ?? getConf(self, ['renderer', 'maxHeight']);
49
+ },
50
+ get displayMode() {
51
+ return (self.trackDisplayMode ?? getConf(self, ['renderer', 'displayMode']));
52
+ },
53
+ }))
54
+ .views(self => ({
55
+ get rendererConfig() {
56
+ const configBlob = getConf(self, ['renderer']) || {};
57
+ const config = configBlob;
58
+ return {
59
+ ...config,
60
+ showLabels: self.trackShowLabels ?? config.showLabels,
61
+ showDescriptions: self.trackShowDescriptions ?? config.showDescriptions,
62
+ displayMode: self.trackDisplayMode ?? config.displayMode,
63
+ maxHeight: self.trackMaxHeight ?? config.maxHeight,
64
+ };
65
+ },
66
+ }))
67
+ .actions(self => ({
68
+ setJexlFilters(f) {
69
+ self.jexlFilters = cast(f);
70
+ },
71
+ setFeatureUnderMouse(feat) {
72
+ self.featureUnderMouseVolatile = feat;
73
+ },
74
+ toggleShowLabels() {
75
+ self.trackShowLabels = !self.showLabels;
76
+ },
77
+ toggleShowDescriptions() {
78
+ self.trackShowDescriptions = !self.showDescriptions;
79
+ },
80
+ setDisplayMode(val) {
81
+ self.trackDisplayMode = val;
82
+ },
83
+ setMaxHeight(val) {
84
+ self.trackMaxHeight = val;
85
+ },
86
+ }))
87
+ .views(self => ({
88
+ get featureUnderMouse() {
89
+ return self.featureUnderMouseVolatile;
90
+ },
91
+ }))
92
+ .views(self => {
93
+ const { trackMenuItems: superTrackMenuItems, renderProps: superRenderProps, renderingProps: superRenderingProps, } = self;
94
+ return {
95
+ renderProps() {
96
+ const superProps = superRenderProps();
97
+ return {
98
+ ...superProps,
99
+ config: self.rendererConfig,
100
+ filters: new SerializableFilterChain({
101
+ filters: self.activeFilters,
102
+ }),
103
+ sequenceAdapter: self.sequenceAdapter,
104
+ };
105
+ },
106
+ renderingProps() {
107
+ const superProps = superRenderingProps();
108
+ const session = getSession(self);
109
+ return {
110
+ ...superProps,
111
+ async onFeatureClick(_, featureId) {
112
+ const { rpcManager } = session;
113
+ const { parentTrack } = self;
114
+ try {
115
+ const f = featureId || self.featureIdUnderMouse;
116
+ if (!f) {
117
+ self.clearFeatureSelection();
118
+ }
119
+ else {
120
+ const sessionId = getRpcSessionId(self);
121
+ const { feature } = (await rpcManager.call(sessionId, 'CoreGetFeatureDetails', {
122
+ featureId: f,
123
+ sessionId,
124
+ trackInstanceId: parentTrack.id,
125
+ rendererType: self.rendererTypeName,
126
+ }));
127
+ if (isAlive(self) && feature) {
128
+ self.selectFeature(new SimpleFeature(feature));
129
+ }
130
+ }
131
+ }
132
+ catch (e) {
133
+ console.error(e);
134
+ session.notifyError(`${e}`, e);
135
+ }
136
+ },
137
+ async onFeatureContextMenu(_, featureId) {
138
+ const { rpcManager } = session;
139
+ const { parentTrack } = self;
140
+ try {
141
+ const f = featureId || self.featureIdUnderMouse;
142
+ if (!f) {
143
+ self.clearFeatureSelection();
144
+ }
145
+ else {
146
+ const sessionId = getRpcSessionId(self);
147
+ const { feature } = (await rpcManager.call(sessionId, 'CoreGetFeatureDetails', {
148
+ featureId: f,
149
+ sessionId,
150
+ trackInstanceId: parentTrack.id,
151
+ rendererType: self.rendererTypeName,
152
+ }));
153
+ if (isAlive(self) && feature) {
154
+ self.setContextMenuFeature(new SimpleFeature(feature));
155
+ }
156
+ }
157
+ }
158
+ catch (e) {
159
+ console.error(e);
160
+ session.notifyError(`${e}`, e);
161
+ }
162
+ },
163
+ };
164
+ },
165
+ trackMenuItems() {
166
+ return [
167
+ ...superTrackMenuItems(),
168
+ {
169
+ label: 'Show...',
170
+ icon: VisibilityIcon,
171
+ subMenu: [
172
+ {
173
+ label: 'Show tooltips',
174
+ type: 'checkbox',
175
+ checked: self.showTooltipsEnabled,
176
+ onClick: () => {
177
+ self.setShowTooltips(!self.showTooltipsEnabled);
178
+ },
179
+ },
180
+ {
181
+ label: 'Show labels',
182
+ type: 'checkbox',
183
+ checked: self.showLabels,
184
+ onClick: () => {
185
+ self.toggleShowLabels();
186
+ },
187
+ },
188
+ {
189
+ label: 'Show descriptions',
190
+ type: 'checkbox',
191
+ checked: self.showDescriptions,
192
+ onClick: () => {
193
+ self.toggleShowDescriptions();
194
+ },
195
+ },
196
+ ],
197
+ },
198
+ {
199
+ label: 'Display mode',
200
+ icon: VisibilityIcon,
201
+ subMenu: [
202
+ 'normal',
203
+ 'compact',
204
+ 'reducedRepresentation',
205
+ 'collapse',
206
+ ].map(val => ({
207
+ label: val,
208
+ type: 'radio',
209
+ checked: self.displayMode === val,
210
+ onClick: () => {
211
+ self.setDisplayMode(val);
212
+ },
213
+ })),
214
+ },
215
+ {
216
+ label: 'Set max track height',
217
+ onClick: () => {
218
+ getSession(self).queueDialog(handleClose => [
219
+ SetMaxHeightDialog,
220
+ {
221
+ model: self,
222
+ handleClose,
223
+ },
224
+ ]);
225
+ },
226
+ },
227
+ {
228
+ label: 'Filters',
229
+ subMenu: [
230
+ {
231
+ label: 'Edit filters...',
232
+ onClick: () => {
233
+ getSession(self).queueDialog(handleClose => [
234
+ AddFiltersDialog,
235
+ {
236
+ model: self,
237
+ handleClose,
238
+ },
239
+ ]);
240
+ },
241
+ },
242
+ ],
243
+ },
244
+ ];
245
+ },
246
+ };
247
+ })
248
+ .postProcessSnapshot(snap => {
249
+ if (!snap) {
250
+ return snap;
251
+ }
252
+ const { trackShowLabels, trackShowDescriptions, trackDisplayMode, trackMaxHeight, jexlFilters, ...rest } = snap;
253
+ return {
254
+ ...rest,
255
+ ...(trackShowLabels !== undefined ? { trackShowLabels } : {}),
256
+ ...(trackShowDescriptions !== undefined
257
+ ? { trackShowDescriptions }
258
+ : {}),
259
+ ...(trackDisplayMode !== undefined ? { trackDisplayMode } : {}),
260
+ ...(trackMaxHeight !== undefined ? { trackMaxHeight } : {}),
261
+ ...(jexlFilters?.length ? { jexlFilters } : {}),
262
+ };
263
+ });
264
+ }
265
+ export default stateModelFactory;
@@ -0,0 +1,5 @@
1
+ export declare function ErrorBox({ error, width, height, }: {
2
+ error: unknown;
3
+ width: number;
4
+ height: number;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function ErrorBox({ error, width, height, }) {
3
+ return (_jsxs(_Fragment, { children: [_jsx("rect", { x: 0, y: 0, width: width, height: height, fill: "#ffdddd" }), _jsx("text", { x: 10, y: height / 2, fill: "#cc0000", fontSize: 14, children: `${error}` })] }));
4
+ }
@@ -0,0 +1,5 @@
1
+ import type { LinearGenomeViewModel } from './model.ts';
2
+ export declare function setupInitAutorun(self: LinearGenomeViewModel): void;
3
+ export declare function setupCoarseDynamicBlocksAutorun(self: LinearGenomeViewModel): void;
4
+ export declare function setupLocalStorageAutorun(self: LinearGenomeViewModel): void;
5
+ export declare function doAfterAttach(self: LinearGenomeViewModel): void;
@@ -0,0 +1,95 @@
1
+ import { getSession, localStorageSetItem, parseLocString, } from '@jbrowse/core/util';
2
+ import { addDisposer } from '@jbrowse/mobx-state-tree';
3
+ import { autorun, when } from 'mobx';
4
+ export function setupInitAutorun(self) {
5
+ addDisposer(self, autorun(async function initAutorun() {
6
+ const { init, initialized } = self;
7
+ if (!initialized) {
8
+ return;
9
+ }
10
+ if (init) {
11
+ const session = getSession(self);
12
+ const { assemblyManager } = session;
13
+ if (init.tracklist) {
14
+ self.activateTrackSelector();
15
+ const currentWidth = self.volatileWidth;
16
+ await when(() => self.volatileWidth !== currentWidth, {
17
+ timeout: 500,
18
+ }).catch(() => {
19
+ });
20
+ }
21
+ try {
22
+ if (init.loc) {
23
+ await self.navToLocString(init.loc, init.assembly);
24
+ }
25
+ else {
26
+ self.showAllRegionsInAssembly(init.assembly);
27
+ }
28
+ }
29
+ catch (e) {
30
+ console.error(init, e);
31
+ session.notifyError(`${e}`, e);
32
+ }
33
+ if (init.tracks) {
34
+ const idsNotFound = [];
35
+ for (const t of init.tracks) {
36
+ try {
37
+ self.showTrack(t);
38
+ }
39
+ catch (e) {
40
+ if (/Could not resolve identifier/.exec(`${e}`)) {
41
+ idsNotFound.push(t);
42
+ }
43
+ else {
44
+ throw e;
45
+ }
46
+ }
47
+ }
48
+ if (idsNotFound.length) {
49
+ session.notifyError(`Could not resolve identifiers: ${idsNotFound.join(',')}`, new Error(`Could not resolve identifiers: ${idsNotFound.join(',')}`));
50
+ }
51
+ }
52
+ if (init.nav !== undefined) {
53
+ self.setHideHeader(!init.nav);
54
+ }
55
+ if (init.highlight) {
56
+ for (const h of init.highlight) {
57
+ const p = parseLocString(h, refName => assemblyManager.isValidRefName(refName, init.assembly));
58
+ const { start, end } = p;
59
+ if (start !== undefined && end !== undefined) {
60
+ self.addToHighlights({
61
+ ...p,
62
+ start,
63
+ end,
64
+ assemblyName: init.assembly,
65
+ });
66
+ }
67
+ }
68
+ }
69
+ self.setInit(undefined);
70
+ }
71
+ }, { name: 'LGVInit' }));
72
+ }
73
+ export function setupCoarseDynamicBlocksAutorun(self) {
74
+ addDisposer(self, autorun(function coarseDynamicBlocksAutorun() {
75
+ if (self.initialized) {
76
+ self.setCoarseDynamicBlocks(self.dynamicBlocks);
77
+ }
78
+ }, { delay: 500, name: 'LGVCoarseDynamicBlocks' }));
79
+ }
80
+ export function setupLocalStorageAutorun(self) {
81
+ addDisposer(self, autorun(function localStorageAutorun() {
82
+ const s = (s) => JSON.stringify(s);
83
+ const { showCytobandsSetting, showCenterLine, colorByCDS, showTrackOutlines, trackLabels, } = self;
84
+ localStorageSetItem('lgv-showCytobands', s(showCytobandsSetting));
85
+ localStorageSetItem('lgv-showCenterLine', s(showCenterLine));
86
+ localStorageSetItem('lgv-colorByCDS', s(colorByCDS));
87
+ localStorageSetItem('lgv-showTrackOutlines', s(showTrackOutlines));
88
+ localStorageSetItem('lgv-trackLabels', trackLabels);
89
+ }, { name: 'LGVLocalStorage' }));
90
+ }
91
+ export function doAfterAttach(self) {
92
+ setupInitAutorun(self);
93
+ setupCoarseDynamicBlocksAutorun(self);
94
+ setupLocalStorageAutorun(self);
95
+ }
@@ -1,13 +1,14 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useRef } from 'react';
3
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
3
4
  import { observer } from 'mobx-react';
4
- import { makeStyles } from 'tss-react/mui';
5
5
  const useStyles = makeStyles()(theme => ({
6
6
  centerLineContainer: {
7
7
  background: 'transparent',
8
8
  height: '100%',
9
9
  zIndex: 4,
10
10
  position: 'absolute',
11
+ left: 0,
11
12
  border: `1px ${theme.palette.action.active} dashed`,
12
13
  borderTop: 'none',
13
14
  borderBottom: 'none',
@@ -15,21 +16,22 @@ const useStyles = makeStyles()(theme => ({
15
16
  },
16
17
  centerLineText: {
17
18
  position: 'absolute',
19
+ left: 0,
18
20
  pointerEvents: 'none',
19
21
  whiteSpace: 'nowrap',
20
22
  fontWeight: 'bold',
21
23
  },
22
24
  }));
23
- const CenterLine = observer(function ({ model }) {
25
+ const CenterLine = observer(function CenterLine({ model }) {
24
26
  const { bpPerPx, centerLineInfo, trackHeights, tracks, width } = model;
25
27
  const ref = useRef(null);
26
28
  const { classes } = useStyles();
27
29
  const startingPosition = width / 2;
28
30
  return tracks.length ? (_jsx("div", { "data-testid": "centerline_container", className: classes.centerLineContainer, role: "presentation", ref: ref, style: {
29
- left: `${startingPosition}px`,
31
+ transform: `translateX(${startingPosition}px)`,
30
32
  width: Math.max(1 / bpPerPx, 1),
31
33
  }, children: centerLineInfo && (_jsxs("div", { "data-testid": "centerline_text", className: classes.centerLineText, role: "presentation", style: {
32
- left: Math.max(1 / bpPerPx, 1) + 5,
34
+ transform: `translateX(${Math.max(1 / bpPerPx, 1) + 5}px)`,
33
35
  top: trackHeights,
34
36
  }, children: [centerLineInfo.refName, ":", ' ', Math.max(Math.round(centerLineInfo.offset) + 1, 0)] })) })) : null;
35
37
  });
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { getFillProps } from '@jbrowse/core/util';
3
3
  import { observer } from 'mobx-react';
4
- import { getCytobands } from './util';
5
- import { HEADER_OVERVIEW_HEIGHT } from '../consts';
4
+ import { getCytobands } from "./util.js";
5
+ import { HEADER_OVERVIEW_HEIGHT } from "../consts.js";
6
6
  function rightRoundedRect(x, y, width, height, radius) {
7
7
  return `M${x},${y}h${width - radius}a${radius},${radius} 0 0 1 ${radius},${radius}v${height - 2 * radius}a${radius},${radius} 0 0 1 ${-radius},${radius}h${radius - width}z`;
8
8
  }
@@ -35,7 +35,7 @@ const colorMap = {
35
35
  stalk: 'rgb(127,127,127)',
36
36
  acen: '#800',
37
37
  };
38
- const Cytobands = observer(function ({ overview, block, assembly, }) {
38
+ const Cytobands = observer(function Cytobands({ overview, block, assembly, }) {
39
39
  const { offsetPx, reversed } = block;
40
40
  const cytobands = getCytobands(assembly, block.refName);
41
41
  const lcap = reversed ? cytobands.length - 1 : 0;
@@ -52,7 +52,7 @@ const Cytobands = observer(function ({ overview, block, assembly, }) {
52
52
  const l = Math.min(s, e);
53
53
  const w = Math.abs(e - s);
54
54
  if (type === 'n/a') {
55
- const match = name === null || name === void 0 ? void 0 : name.match(/^(\d+)([A-Za-z])/);
55
+ const match = name?.match(/^(\d+)([A-Za-z])/);
56
56
  const ret = match[1] + match[2];
57
57
  if (ret && ret !== curr) {
58
58
  curr = ret;
@@ -1,4 +1,4 @@
1
- import type { ExportSvgOptions } from '../types';
1
+ import type { ExportSvgOptions } from '../types.ts';
2
2
  export default function ExportSvgDialog({ model, handleClose, }: {
3
3
  model: {
4
4
  exportSvg(opts: ExportSvgOptions): Promise<void>;
@@ -16,6 +16,7 @@ export default function ExportSvgDialog({ model, handleClose, }) {
16
16
  const session = getSession(model);
17
17
  const offscreenCanvas = typeof OffscreenCanvas !== 'undefined';
18
18
  const [rasterizeLayers, setRasterizeLayers] = useState(offscreenCanvas);
19
+ const [showGridlines, setShowGridlines] = useSvgLocal('gridlines', false);
19
20
  const [loading, setLoading] = useState(false);
20
21
  const [error, setError] = useState();
21
22
  const [filename, setFilename] = useSvgLocal('file', 'jbrowse.svg');
@@ -27,7 +28,9 @@ export default function ExportSvgDialog({ model, handleClose, }) {
27
28
  setTrackLabels(event.target.value);
28
29
  }, children: [_jsx(MenuItem, { value: "offset", children: "Offset" }), _jsx(MenuItem, { value: "overlay", children: "Overlay" }), _jsx(MenuItem, { value: "left", children: "Left" }), _jsx(MenuItem, { value: "none", children: "None" })] }), session.allThemes ? (_jsx(TextField2, { select: true, label: "Theme", variant: "outlined", value: themeName, onChange: event => {
29
30
  setThemeName(event.target.value);
30
- }, children: Object.entries(session.allThemes()).map(([key, val]) => (_jsx(MenuItem, { value: key, children: val.name || '(Unknown name)' }, key))) })) : null, offscreenCanvas ? (_jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: rasterizeLayers, onChange: () => {
31
+ }, children: Object.entries(session.allThemes()).map(([key, val]) => (_jsx(MenuItem, { value: key, children: val.name || '(Unknown name)' }, key))) })) : null, _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: showGridlines, onChange: () => {
32
+ setShowGridlines(val => !val);
33
+ } }), label: "Show gridlines" }), offscreenCanvas ? (_jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: rasterizeLayers, onChange: () => {
31
34
  setRasterizeLayers(val => !val);
32
35
  } }), label: "Rasterize canvas based tracks? File may be much larger if this is turned off" })) : (_jsx(Typography, { children: "Note: rasterizing layers not yet supported in this browser, so SVG size may be large" }))] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
33
36
  handleClose();
@@ -40,6 +43,7 @@ export default function ExportSvgDialog({ model, handleClose, }) {
40
43
  filename,
41
44
  trackLabels,
42
45
  themeName,
46
+ showGridlines,
43
47
  });
44
48
  handleClose();
45
49
  }
@@ -1,6 +1,12 @@
1
- import type { LinearGenomeViewModel } from '..';
1
+ import type { BpOffset } from '../types.ts';
2
+ import type { Region } from '@jbrowse/core/util';
2
3
  declare const GetSequenceDialog: ({ model, handleClose, }: {
3
- model: LinearGenomeViewModel;
4
+ model: {
5
+ leftOffset?: BpOffset;
6
+ rightOffset?: BpOffset;
7
+ getSelectedRegions: (left?: BpOffset, right?: BpOffset) => Region[];
8
+ setOffsets: (left?: BpOffset, right?: BpOffset) => void;
9
+ };
4
10
  handleClose: () => void;
5
11
  }) => import("react/jsx-runtime").JSX.Element;
6
12
  export default GetSequenceDialog;
@@ -1,16 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from 'react';
3
3
  import { Dialog, ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui';
4
- import { complement, reverse } from '@jbrowse/core/util';
4
+ import { complement, reverse, toLocale } from '@jbrowse/core/util';
5
5
  import { formatSeqFasta } from '@jbrowse/core/util/formatFastaStrings';
6
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
6
7
  import ContentCopyIcon from '@mui/icons-material/ContentCopy';
7
8
  import GetAppIcon from '@mui/icons-material/GetApp';
8
9
  import { Button, Checkbox, DialogActions, DialogContent, FormControlLabel, FormGroup, TextField, Typography, } from '@mui/material';
9
- import copy from 'copy-to-clipboard';
10
- import { saveAs } from 'file-saver';
11
10
  import { observer } from 'mobx-react';
12
- import { makeStyles } from 'tss-react/mui';
13
- import { fetchSequence } from './fetchSequence';
11
+ import { fetchSequence } from "./fetchSequence.js";
14
12
  const useStyles = makeStyles()({
15
13
  dialogContent: {
16
14
  width: '80em',
@@ -18,11 +16,8 @@ const useStyles = makeStyles()({
18
16
  textAreaFont: {
19
17
  fontFamily: 'Courier New',
20
18
  },
21
- ml: {
22
- marginLeft: 10,
23
- },
24
19
  });
25
- const GetSequenceDialog = observer(function ({ model, handleClose, }) {
20
+ const GetSequenceDialog = observer(function GetSequenceDialog({ model, handleClose, }) {
26
21
  const { classes } = useStyles();
27
22
  const [error, setError] = useState();
28
23
  const [sequenceChunks, setSequenceChunks] = useState();
@@ -57,8 +52,8 @@ const GetSequenceDialog = observer(function ({ model, handleClose, }) {
57
52
  const chunkStart = chunk.get('start') + 1;
58
53
  const chunkEnd = chunk.get('end');
59
54
  const loc = `${chunkRefName}:${chunkStart}-${chunkEnd}`;
60
- if ((chunkSeq === null || chunkSeq === void 0 ? void 0 : chunkSeq.length) !== chunkEnd - chunkStart + 1) {
61
- throw new Error(`${loc} returned ${chunkSeq.length.toLocaleString()} bases, but should have returned ${(chunkEnd - chunkStart).toLocaleString()}`);
55
+ if (chunkSeq?.length !== chunkEnd - chunkStart + 1) {
56
+ throw new Error(`${loc} returned ${toLocale(chunkSeq.length)} bases, but should have returned ${toLocale(chunkEnd - chunkStart)}`);
62
57
  }
63
58
  if (rev) {
64
59
  chunkSeq = reverse(chunkSeq);
@@ -72,11 +67,11 @@ const GetSequenceDialog = observer(function ({ model, handleClose, }) {
72
67
  };
73
68
  }))
74
69
  : '';
75
- const sequenceTooLarge = sequence ? sequence.length > 1000000 : false;
76
- return (_jsxs(Dialog, { maxWidth: "xl", open: true, onClose: () => {
70
+ const sequenceTooLarge = sequence ? sequence.length > 1_000_000 : false;
71
+ return (_jsxs(Dialog, { maxWidth: "xl", open: true, title: "Reference sequence", onClose: () => {
77
72
  handleClose();
78
73
  model.setOffsets();
79
- }, title: "Reference sequence", children: [_jsxs(DialogContent, { children: [error ? (_jsx(ErrorMessage, { error: error })) : loading ? (_jsx(LoadingEllipses, { message: "Retrieving sequences" })) : null, _jsx(TextField, { "data-testid": "rubberband-sequence", variant: "outlined", multiline: true, minRows: 5, maxRows: 10, disabled: sequenceTooLarge, className: classes.dialogContent, fullWidth: true, value: sequenceTooLarge
74
+ }, children: [_jsxs(DialogContent, { children: [error ? (_jsx(ErrorMessage, { error: error })) : loading ? (_jsx(LoadingEllipses, { message: "Retrieving sequences" })) : null, _jsx(TextField, { variant: "outlined", multiline: true, minRows: 5, maxRows: 10, disabled: sequenceTooLarge, className: classes.dialogContent, fullWidth: true, value: sequenceTooLarge
80
75
  ? 'Reference sequence too large to display, use the download FASTA button'
81
76
  : sequence, slotProps: {
82
77
  input: {
@@ -89,13 +84,15 @@ const GetSequenceDialog = observer(function ({ model, handleClose, }) {
89
84
  setReverse(event.target.checked);
90
85
  } }), label: "Reverse sequence" }), _jsx(FormControlLabel, { control: _jsx(Checkbox, { value: comp, onChange: event => {
91
86
  setComplement(event.target.checked);
92
- } }), label: "Complement sequence" })] }), _jsx(Typography, { style: { margin: 10 }, children: "Note: Check both boxes for the \"reverse complement\"" })] }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: () => {
87
+ } }), label: "Complement sequence" })] }), _jsx(Typography, { style: { margin: 10 }, children: "Note: Check both boxes for the \"reverse complement\"" })] }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: async () => {
88
+ const { default: copy } = await import('copy-to-clipboard');
93
89
  copy(sequence);
94
90
  setCopied(true);
95
91
  setTimeout(() => {
96
92
  setCopied(false);
97
93
  }, 500);
98
- }, disabled: loading || !!error || sequenceTooLarge, color: "primary", startIcon: _jsx(ContentCopyIcon, {}), children: copied ? 'Copied' : 'Copy to clipboard' }), _jsx(Button, { onClick: () => {
94
+ }, disabled: loading || !!error || sequenceTooLarge, color: "primary", startIcon: _jsx(ContentCopyIcon, {}), children: copied ? 'Copied' : 'Copy to clipboard' }), _jsx(Button, { onClick: async () => {
95
+ const { saveAs } = await import('file-saver-es');
99
96
  saveAs(new Blob([sequence || ''], {
100
97
  type: 'text/x-fasta;charset=utf-8',
101
98
  }), 'jbrowse_ref_seq.fa');
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
2
3
  import { observer } from 'mobx-react';
3
- import { makeStyles } from 'tss-react/mui';
4
- import { ContentBlock as ContentBlockComponent, ElidedBlock as ElidedBlockComponent, InterRegionPaddingBlock as InterRegionPaddingBlockComponent, } from '../../BaseLinearDisplay/components/Block';
5
- import { makeTicks } from '../util';
4
+ import { ContentBlock as ContentBlockComponent, ElidedBlock as ElidedBlockComponent, InterRegionPaddingBlock as InterRegionPaddingBlockComponent, } from "../../BaseLinearDisplay/components/Block.js";
5
+ import { makeTicks } from "../util.js";
6
6
  const useStyles = makeStyles()(theme => ({
7
7
  verticalGuidesZoomContainer: {
8
8
  position: 'absolute',
@@ -30,16 +30,19 @@ const useStyles = makeStyles()(theme => ({
30
30
  },
31
31
  }));
32
32
  function RenderedBlockLines({ block, bpPerPx, }) {
33
- const { classes, cx } = useStyles();
34
- const ticks = makeTicks(block.start, block.end, bpPerPx);
33
+ const { classes } = useStyles();
34
+ const { start, end, reversed } = block;
35
+ const ticks = makeTicks(start, end, bpPerPx);
36
+ const majorTickClass = `${classes.tick} ${classes.majorTick}`;
37
+ const minorTickClass = `${classes.tick} ${classes.minorTick}`;
35
38
  return (_jsx(ContentBlockComponent, { block: block, children: ticks.map(({ type, base }) => {
36
- const x = (block.reversed ? block.end - base : base - block.start) / bpPerPx;
37
- return (_jsx("div", { className: cx(classes.tick, type === 'major' || type === 'labeledMajor'
38
- ? classes.majorTick
39
- : classes.minorTick), style: { left: x } }, base));
39
+ const x = (reversed ? end - base : base - start) / bpPerPx;
40
+ return (_jsx("div", { className: type === 'major' || type === 'labeledMajor'
41
+ ? majorTickClass
42
+ : minorTickClass, style: { left: x } }, base));
40
43
  }) }));
41
44
  }
42
- const RenderedVerticalGuides = observer(({ model }) => {
45
+ const RenderedVerticalGuides = observer(function RenderedVerticalGuides({ model, }) {
43
46
  const { staticBlocks, bpPerPx } = model;
44
47
  return (_jsx(_Fragment, { children: staticBlocks.map((block, index) => {
45
48
  const k = `${block.key}-${index}`;
@@ -55,14 +58,14 @@ const RenderedVerticalGuides = observer(({ model }) => {
55
58
  return null;
56
59
  }) }));
57
60
  });
58
- const Gridlines = observer(function ({ model, offset = 0, }) {
61
+ const Gridlines = observer(function Gridlines({ model, offset = 0, }) {
59
62
  const { classes } = useStyles();
60
- const offsetLeft = model.staticBlocks.offsetPx - model.offsetPx;
63
+ const { staticBlocks, scaleFactor } = model;
61
64
  return (_jsx("div", { className: classes.verticalGuidesZoomContainer, style: {
62
- transform: model.scaleFactor !== 1 ? `scaleX(${model.scaleFactor})` : undefined,
65
+ transform: scaleFactor !== 1 ? `scaleX(${scaleFactor})` : undefined,
63
66
  }, children: _jsx("div", { className: classes.verticalGuidesContainer, style: {
64
- left: offsetLeft - offset,
65
- width: model.staticBlocks.totalWidthPx,
67
+ left: `calc(${staticBlocks.offsetPx}px - var(--offset-px) - ${offset}px)`,
68
+ width: staticBlocks.totalWidthPx,
66
69
  }, children: _jsx(RenderedVerticalGuides, { model: model }) }) }));
67
70
  });
68
71
  export default Gridlines;