@jbrowse/plugin-linear-comparative-view 3.7.0 → 4.0.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 (266) hide show
  1. package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +3 -3
  2. package/esm/LGVSyntenyDisplay/configSchemaF.d.ts +9 -9
  3. package/esm/LGVSyntenyDisplay/configSchemaF.js +1 -1
  4. package/esm/LGVSyntenyDisplay/index.js +2 -2
  5. package/esm/LGVSyntenyDisplay/model.d.ts +1179 -133
  6. package/esm/LGVSyntenyDisplay/model.js +2 -2
  7. package/esm/LaunchLinearSyntenyView.js +13 -86
  8. package/esm/LinearComparativeDisplay/configSchemaF.d.ts +1 -1
  9. package/esm/LinearComparativeDisplay/index.js +2 -2
  10. package/esm/LinearComparativeDisplay/stateModelFactory.d.ts +95 -135
  11. package/esm/LinearComparativeDisplay/stateModelFactory.js +18 -17
  12. package/esm/LinearComparativeView/components/ColorBySelector.d.ts +1 -1
  13. package/esm/LinearComparativeView/components/ColorBySelector.js +3 -4
  14. package/esm/LinearComparativeView/components/Header.d.ts +1 -1
  15. package/esm/LinearComparativeView/components/Header.js +8 -9
  16. package/esm/LinearComparativeView/components/HeaderSearchBoxes.js +2 -2
  17. package/esm/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +1 -1
  18. package/esm/LinearComparativeView/components/LinearComparativeRenderArea.js +9 -8
  19. package/esm/LinearComparativeView/components/LinearComparativeView.d.ts +1 -1
  20. package/esm/LinearComparativeView/components/LinearComparativeView.js +5 -5
  21. package/esm/LinearComparativeView/components/MinLengthSlider.d.ts +1 -1
  22. package/esm/LinearComparativeView/components/MinLengthSlider.js +7 -7
  23. package/esm/LinearComparativeView/components/OpacitySlider.d.ts +1 -1
  24. package/esm/LinearComparativeView/components/OpacitySlider.js +5 -6
  25. package/esm/LinearComparativeView/components/Rubberband.d.ts +1 -1
  26. package/esm/LinearComparativeView/components/Rubberband.js +5 -5
  27. package/esm/LinearComparativeView/components/RubberbandSpan.js +3 -5
  28. package/esm/LinearComparativeView/components/VerticalGuide.d.ts +1 -1
  29. package/esm/LinearComparativeView/components/VerticalGuide.js +2 -2
  30. package/esm/LinearComparativeView/components/useRangeSelect.d.ts +1 -1
  31. package/esm/LinearComparativeView/components/useRangeSelect.js +1 -1
  32. package/esm/LinearComparativeView/components/util.js +1 -1
  33. package/esm/LinearComparativeView/index.js +2 -2
  34. package/esm/LinearComparativeView/model.d.ts +474 -222
  35. package/esm/LinearComparativeView/model.js +50 -29
  36. package/esm/LinearReadVsRef/LinearReadVsRef.js +8 -9
  37. package/esm/LinearReadVsRef/index.js +1 -1
  38. package/esm/LinearSyntenyDisplay/afterAttach.d.ts +1 -1
  39. package/esm/LinearSyntenyDisplay/afterAttach.js +10 -11
  40. package/esm/LinearSyntenyDisplay/components/BlockError.js +1 -1
  41. package/esm/LinearSyntenyDisplay/components/BlockMessage.js +6 -15
  42. package/esm/LinearSyntenyDisplay/components/Component.d.ts +1 -1
  43. package/esm/LinearSyntenyDisplay/components/Component.js +5 -5
  44. package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +1 -1
  45. package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +10 -14
  46. package/esm/LinearSyntenyDisplay/components/LoadingMessage.js +1 -1
  47. package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +1 -1
  48. package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.js +8 -33
  49. package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +1 -1
  50. package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.js +1 -1
  51. package/esm/LinearSyntenyDisplay/components/util.d.ts +2 -2
  52. package/esm/LinearSyntenyDisplay/components/util.js +3 -3
  53. package/esm/LinearSyntenyDisplay/configSchemaF.d.ts +2 -2
  54. package/esm/LinearSyntenyDisplay/configSchemaF.js +1 -1
  55. package/esm/LinearSyntenyDisplay/drawMouseoverClickMap.d.ts +2 -0
  56. package/esm/LinearSyntenyDisplay/drawMouseoverClickMap.js +53 -0
  57. package/esm/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
  58. package/esm/LinearSyntenyDisplay/drawSynteny.js +3 -5
  59. package/esm/LinearSyntenyDisplay/index.js +3 -3
  60. package/esm/LinearSyntenyDisplay/model.d.ts +97 -137
  61. package/esm/LinearSyntenyDisplay/model.js +3 -3
  62. package/esm/LinearSyntenyView/components/DiagonalizationProgressDialog.d.ts +1 -1
  63. package/esm/LinearSyntenyView/components/DiagonalizationProgressDialog.js +2 -2
  64. package/esm/LinearSyntenyView/components/ExportSvgDialog.d.ts +1 -1
  65. package/esm/LinearSyntenyView/components/ExportSvgDialog.js +6 -2
  66. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +1 -1
  67. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +4 -4
  68. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.d.ts +1 -1
  69. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.js +4 -5
  70. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.d.ts +11 -1
  71. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.js +8 -4
  72. package/esm/LinearSyntenyView/components/ImportForm/LeftPanel.d.ts +1 -1
  73. package/esm/LinearSyntenyView/components/ImportForm/LeftPanel.js +26 -9
  74. package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +1 -1
  75. package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +5 -5
  76. package/esm/LinearSyntenyView/components/ImportForm/doSubmit.d.ts +1 -1
  77. package/esm/LinearSyntenyView/components/ImportForm/doSubmit.js +1 -2
  78. package/esm/LinearSyntenyView/components/ImportForm/selectors/AnchorsSelector.d.ts +1 -1
  79. package/esm/LinearSyntenyView/components/ImportForm/selectors/AnchorsSelector.js +2 -2
  80. package/esm/LinearSyntenyView/components/ImportForm/selectors/PifGzSelector.d.ts +1 -1
  81. package/esm/LinearSyntenyView/components/ImportForm/selectors/PifGzSelector.js +2 -2
  82. package/esm/LinearSyntenyView/components/ImportForm/selectors/StandardFormatSelector.d.ts +1 -1
  83. package/esm/LinearSyntenyView/components/ImportForm/selectors/StandardFormatSelector.js +3 -3
  84. package/esm/LinearSyntenyView/components/ImportForm/selectors/SwapAssemblies.js +3 -3
  85. package/esm/LinearSyntenyView/components/ImportForm/selectors/index.d.ts +4 -4
  86. package/esm/LinearSyntenyView/components/ImportForm/selectors/index.js +4 -4
  87. package/esm/LinearSyntenyView/components/LinearSyntenyView.d.ts +1 -1
  88. package/esm/LinearSyntenyView/components/LinearSyntenyView.js +14 -4
  89. package/esm/LinearSyntenyView/index.js +2 -2
  90. package/esm/LinearSyntenyView/model.d.ts +522 -254
  91. package/esm/LinearSyntenyView/model.js +99 -15
  92. package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +3 -1
  93. package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +3 -3
  94. package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +2 -2
  95. package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +34 -31
  96. package/esm/LinearSyntenyView/types.d.ts +10 -1
  97. package/esm/LinearSyntenyViewHelper/index.js +1 -1
  98. package/esm/LinearSyntenyViewHelper/stateModelFactory.d.ts +11 -11
  99. package/esm/LinearSyntenyViewHelper/stateModelFactory.js +5 -43
  100. package/esm/SyntenyFeatureDetail/Formatter.js +2 -2
  101. package/esm/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +1 -1
  102. package/esm/SyntenyFeatureDetail/LinkToSyntenyView.js +6 -7
  103. package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +1 -1
  104. package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +3 -3
  105. package/esm/SyntenyFeatureDetail/index.js +2 -2
  106. package/esm/SyntenyTrack/configSchema.d.ts +16 -11
  107. package/esm/SyntenyTrack/index.js +1 -1
  108. package/esm/index.d.ts +2 -0
  109. package/esm/index.js +11 -14
  110. package/esm/util.d.ts +1 -1
  111. package/esm/util.js +4 -8
  112. package/package.json +29 -35
  113. package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +0 -9
  114. package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +0 -53
  115. package/dist/LGVSyntenyDisplay/components/util.d.ts +0 -14
  116. package/dist/LGVSyntenyDisplay/components/util.js +0 -100
  117. package/dist/LGVSyntenyDisplay/configSchemaF.d.ts +0 -66
  118. package/dist/LGVSyntenyDisplay/configSchemaF.js +0 -38
  119. package/dist/LGVSyntenyDisplay/index.d.ts +0 -2
  120. package/dist/LGVSyntenyDisplay/index.js +0 -24
  121. package/dist/LGVSyntenyDisplay/model.d.ts +0 -418
  122. package/dist/LGVSyntenyDisplay/model.js +0 -118
  123. package/dist/LaunchLinearSyntenyView.d.ts +0 -2
  124. package/dist/LaunchLinearSyntenyView.js +0 -93
  125. package/dist/LinearComparativeDisplay/configSchemaF.d.ts +0 -2
  126. package/dist/LinearComparativeDisplay/configSchemaF.js +0 -10
  127. package/dist/LinearComparativeDisplay/index.d.ts +0 -2
  128. package/dist/LinearComparativeDisplay/index.js +0 -24
  129. package/dist/LinearComparativeDisplay/stateModelFactory.d.ts +0 -243
  130. package/dist/LinearComparativeDisplay/stateModelFactory.js +0 -146
  131. package/dist/LinearComparativeView/components/ColorBySelector.d.ts +0 -5
  132. package/dist/LinearComparativeView/components/ColorBySelector.js +0 -54
  133. package/dist/LinearComparativeView/components/Header.d.ts +0 -5
  134. package/dist/LinearComparativeView/components/Header.js +0 -87
  135. package/dist/LinearComparativeView/components/HeaderSearchBoxes.d.ts +0 -5
  136. package/dist/LinearComparativeView/components/HeaderSearchBoxes.js +0 -24
  137. package/dist/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +0 -5
  138. package/dist/LinearComparativeView/components/LinearComparativeRenderArea.js +0 -46
  139. package/dist/LinearComparativeView/components/LinearComparativeView.d.ts +0 -5
  140. package/dist/LinearComparativeView/components/LinearComparativeView.js +0 -30
  141. package/dist/LinearComparativeView/components/MinLengthSlider.d.ts +0 -5
  142. package/dist/LinearComparativeView/components/MinLengthSlider.js +0 -47
  143. package/dist/LinearComparativeView/components/OpacitySlider.d.ts +0 -5
  144. package/dist/LinearComparativeView/components/OpacitySlider.js +0 -46
  145. package/dist/LinearComparativeView/components/Rubberband.d.ts +0 -7
  146. package/dist/LinearComparativeView/components/Rubberband.js +0 -32
  147. package/dist/LinearComparativeView/components/RubberbandSpan.d.ts +0 -15
  148. package/dist/LinearComparativeView/components/RubberbandSpan.js +0 -38
  149. package/dist/LinearComparativeView/components/RubberbandTooltip.d.ts +0 -5
  150. package/dist/LinearComparativeView/components/RubberbandTooltip.js +0 -20
  151. package/dist/LinearComparativeView/components/SliderTooltip.d.ts +0 -2
  152. package/dist/LinearComparativeView/components/SliderTooltip.js +0 -9
  153. package/dist/LinearComparativeView/components/VerticalGuide.d.ts +0 -7
  154. package/dist/LinearComparativeView/components/VerticalGuide.js +0 -26
  155. package/dist/LinearComparativeView/components/useRangeSelect.d.ts +0 -59
  156. package/dist/LinearComparativeView/components/useRangeSelect.js +0 -124
  157. package/dist/LinearComparativeView/components/util.d.ts +0 -4
  158. package/dist/LinearComparativeView/components/util.js +0 -6
  159. package/dist/LinearComparativeView/index.d.ts +0 -2
  160. package/dist/LinearComparativeView/index.js +0 -55
  161. package/dist/LinearComparativeView/model.d.ts +0 -606
  162. package/dist/LinearComparativeView/model.js +0 -238
  163. package/dist/LinearReadVsRef/LinearReadVsRef.d.ts +0 -6
  164. package/dist/LinearReadVsRef/LinearReadVsRef.js +0 -241
  165. package/dist/LinearReadVsRef/index.d.ts +0 -2
  166. package/dist/LinearReadVsRef/index.js +0 -86
  167. package/dist/LinearSyntenyDisplay/afterAttach.d.ts +0 -2
  168. package/dist/LinearSyntenyDisplay/afterAttach.js +0 -104
  169. package/dist/LinearSyntenyDisplay/components/BlockError.d.ts +0 -3
  170. package/dist/LinearSyntenyDisplay/components/BlockError.js +0 -16
  171. package/dist/LinearSyntenyDisplay/components/BlockMessage.d.ts +0 -3
  172. package/dist/LinearSyntenyDisplay/components/BlockMessage.js +0 -24
  173. package/dist/LinearSyntenyDisplay/components/Component.d.ts +0 -5
  174. package/dist/LinearSyntenyDisplay/components/Component.js +0 -26
  175. package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +0 -5
  176. package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +0 -223
  177. package/dist/LinearSyntenyDisplay/components/LoadingMessage.d.ts +0 -3
  178. package/dist/LinearSyntenyDisplay/components/LoadingMessage.js +0 -21
  179. package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +0 -15
  180. package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.js +0 -56
  181. package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +0 -4
  182. package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.js +0 -13
  183. package/dist/LinearSyntenyDisplay/components/util.d.ts +0 -45
  184. package/dist/LinearSyntenyDisplay/components/util.js +0 -199
  185. package/dist/LinearSyntenyDisplay/configSchemaF.d.ts +0 -12
  186. package/dist/LinearSyntenyDisplay/configSchemaF.js +0 -23
  187. package/dist/LinearSyntenyDisplay/drawSynteny.d.ts +0 -6
  188. package/dist/LinearSyntenyDisplay/drawSynteny.js +0 -470
  189. package/dist/LinearSyntenyDisplay/index.d.ts +0 -2
  190. package/dist/LinearSyntenyDisplay/index.js +0 -56
  191. package/dist/LinearSyntenyDisplay/model.d.ts +0 -291
  192. package/dist/LinearSyntenyDisplay/model.js +0 -133
  193. package/dist/LinearSyntenyView/components/DiagonalizationProgressDialog.d.ts +0 -6
  194. package/dist/LinearSyntenyView/components/DiagonalizationProgressDialog.js +0 -87
  195. package/dist/LinearSyntenyView/components/ExportSvgDialog.d.ts +0 -7
  196. package/dist/LinearSyntenyView/components/ExportSvgDialog.js +0 -58
  197. package/dist/LinearSyntenyView/components/Icons.d.ts +0 -3
  198. package/dist/LinearSyntenyView/components/Icons.js +0 -12
  199. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +0 -8
  200. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +0 -81
  201. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.d.ts +0 -8
  202. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.js +0 -39
  203. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.d.ts +0 -7
  204. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.js +0 -22
  205. package/dist/LinearSyntenyView/components/ImportForm/LeftPanel.d.ts +0 -11
  206. package/dist/LinearSyntenyView/components/ImportForm/LeftPanel.js +0 -58
  207. package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +0 -5
  208. package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +0 -60
  209. package/dist/LinearSyntenyView/components/ImportForm/doSubmit.d.ts +0 -5
  210. package/dist/LinearSyntenyView/components/ImportForm/doSubmit.js +0 -43
  211. package/dist/LinearSyntenyView/components/ImportForm/getAdapter.d.ts +0 -117
  212. package/dist/LinearSyntenyView/components/ImportForm/getAdapter.js +0 -68
  213. package/dist/LinearSyntenyView/components/ImportForm/selectors/AnchorsSelector.d.ts +0 -3
  214. package/dist/LinearSyntenyView/components/ImportForm/selectors/AnchorsSelector.js +0 -13
  215. package/dist/LinearSyntenyView/components/ImportForm/selectors/PifGzSelector.d.ts +0 -3
  216. package/dist/LinearSyntenyView/components/ImportForm/selectors/PifGzSelector.js +0 -13
  217. package/dist/LinearSyntenyView/components/ImportForm/selectors/SelectorTypes.d.ts +0 -19
  218. package/dist/LinearSyntenyView/components/ImportForm/selectors/SelectorTypes.js +0 -10
  219. package/dist/LinearSyntenyView/components/ImportForm/selectors/StandardFormatSelector.d.ts +0 -3
  220. package/dist/LinearSyntenyView/components/ImportForm/selectors/StandardFormatSelector.js +0 -20
  221. package/dist/LinearSyntenyView/components/ImportForm/selectors/SwapAssemblies.d.ts +0 -13
  222. package/dist/LinearSyntenyView/components/ImportForm/selectors/SwapAssemblies.js +0 -32
  223. package/dist/LinearSyntenyView/components/ImportForm/selectors/index.d.ts +0 -4
  224. package/dist/LinearSyntenyView/components/ImportForm/selectors/index.js +0 -27
  225. package/dist/LinearSyntenyView/components/ImportForm/util.d.ts +0 -10
  226. package/dist/LinearSyntenyView/components/ImportForm/util.js +0 -24
  227. package/dist/LinearSyntenyView/components/LinearSyntenyView.d.ts +0 -5
  228. package/dist/LinearSyntenyView/components/LinearSyntenyView.js +0 -47
  229. package/dist/LinearSyntenyView/components/TextField2.d.ts +0 -2
  230. package/dist/LinearSyntenyView/components/TextField2.js +0 -8
  231. package/dist/LinearSyntenyView/index.d.ts +0 -2
  232. package/dist/LinearSyntenyView/index.js +0 -52
  233. package/dist/LinearSyntenyView/model.d.ts +0 -702
  234. package/dist/LinearSyntenyView/model.js +0 -240
  235. package/dist/LinearSyntenyView/svgcomponents/SVGBackground.d.ts +0 -5
  236. package/dist/LinearSyntenyView/svgcomponents/SVGBackground.js +0 -10
  237. package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +0 -11
  238. package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +0 -11
  239. package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +0 -3
  240. package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +0 -80
  241. package/dist/LinearSyntenyView/types.d.ts +0 -29
  242. package/dist/LinearSyntenyView/types.js +0 -2
  243. package/dist/LinearSyntenyView/util/diagonalize.d.ts +0 -27
  244. package/dist/LinearSyntenyView/util/diagonalize.js +0 -91
  245. package/dist/LinearSyntenyViewHelper/index.d.ts +0 -2
  246. package/dist/LinearSyntenyViewHelper/index.js +0 -25
  247. package/dist/LinearSyntenyViewHelper/stateModelFactory.d.ts +0 -18
  248. package/dist/LinearSyntenyViewHelper/stateModelFactory.js +0 -78
  249. package/dist/SyntenyFeatureDetail/Formatter.d.ts +0 -3
  250. package/dist/SyntenyFeatureDetail/Formatter.js +0 -23
  251. package/dist/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +0 -7
  252. package/dist/SyntenyFeatureDetail/LinkToSyntenyView.js +0 -87
  253. package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +0 -5
  254. package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +0 -19
  255. package/dist/SyntenyFeatureDetail/index.d.ts +0 -2
  256. package/dist/SyntenyFeatureDetail/index.js +0 -60
  257. package/dist/SyntenyFeatureDetail/types.d.ts +0 -9
  258. package/dist/SyntenyFeatureDetail/types.js +0 -2
  259. package/dist/SyntenyTrack/configSchema.d.ts +0 -80
  260. package/dist/SyntenyTrack/configSchema.js +0 -9
  261. package/dist/SyntenyTrack/index.d.ts +0 -2
  262. package/dist/SyntenyTrack/index.js +0 -19
  263. package/dist/index.d.ts +0 -7
  264. package/dist/index.js +0 -48
  265. package/dist/util.d.ts +0 -25
  266. package/dist/util.js +0 -67
@@ -2,13 +2,12 @@ import { lazy } from 'react';
2
2
  import BaseViewModel from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
3
3
  import { avg, getSession, isSessionModelWithWidgets } from '@jbrowse/core/util';
4
4
  import { ElementId } from '@jbrowse/core/util/types/mst';
5
+ import { addDisposer, addMiddleware, cast, getPath, types, } from '@jbrowse/mobx-state-tree';
5
6
  import FolderOpenIcon from '@mui/icons-material/FolderOpen';
6
7
  import { autorun } from 'mobx';
7
- import { addDisposer, cast, getPath, onAction, types } from 'mobx-state-tree';
8
8
  const ReturnToImportFormDialog = lazy(() => import('@jbrowse/core/ui/ReturnToImportFormDialog'));
9
9
  function stateModelFactory(pluginManager) {
10
- var _a;
11
- const LinearSyntenyViewHelper = (_a = pluginManager.getViewType('LinearSyntenyViewHelper')) === null || _a === void 0 ? void 0 : _a.stateModel;
10
+ const LinearSyntenyViewHelper = pluginManager.getViewType('LinearSyntenyViewHelper')?.stateModel;
12
11
  return types
13
12
  .compose('LinearComparativeView', BaseViewModel, types.model({
14
13
  id: ElementId,
@@ -25,6 +24,7 @@ function stateModelFactory(pluginManager) {
25
24
  }))
26
25
  .volatile(() => ({
27
26
  width: undefined,
27
+ isLoading: false,
28
28
  }))
29
29
  .views(self => ({
30
30
  get initialized() {
@@ -40,41 +40,49 @@ function stateModelFactory(pluginManager) {
40
40
  get assemblyNames() {
41
41
  return [...new Set(self.views.flatMap(v => v.assemblyNames))];
42
42
  },
43
+ get loadingMessage() {
44
+ return this.showLoading ? 'Loading' : undefined;
45
+ },
46
+ get showLoading() {
47
+ return self.isLoading || (!this.initialized && self.views.length > 0);
48
+ },
43
49
  }))
44
50
  .actions(self => ({
45
51
  afterAttach() {
46
- const actions = new Set([
47
- 'horizontalScroll',
48
- 'zoomTo',
49
- 'setScaleFactor',
50
- ]);
51
- addDisposer(self, onAction(self, param => {
52
- if (self.linkViews) {
53
- const { name, path, args } = param;
54
- if (actions.has(name) && path) {
55
- this.onSubviewAction(name, path, args);
52
+ addDisposer(self, addMiddleware(self, (rawCall, next) => {
53
+ if (rawCall.type === 'action' && rawCall.id === rawCall.rootId) {
54
+ const syncActions = [
55
+ 'horizontalScroll',
56
+ 'zoomTo',
57
+ 'setScaleFactor',
58
+ ];
59
+ if (self.linkViews && syncActions.includes(rawCall.name)) {
60
+ const sourcePath = getPath(rawCall.context);
61
+ next(rawCall);
62
+ for (const view of self.views) {
63
+ const viewPath = getPath(view);
64
+ if (viewPath !== sourcePath) {
65
+ view[rawCall.name](rawCall.args[0]);
66
+ }
67
+ }
68
+ return;
56
69
  }
57
70
  }
71
+ next(rawCall);
58
72
  }));
59
73
  },
60
74
  beforeDestroy() {
61
- var _a;
62
75
  const session = getSession(self);
63
76
  for (const name of self.assemblyNames) {
64
- (_a = session.removeTemporaryAssembly) === null || _a === void 0 ? void 0 : _a.call(session, name);
65
- }
66
- },
67
- onSubviewAction(actionName, path, args) {
68
- for (const view of self.views) {
69
- const ret = getPath(view);
70
- if (!ret.endsWith(path)) {
71
- view[actionName](args === null || args === void 0 ? void 0 : args[0]);
72
- }
77
+ session.removeTemporaryAssembly?.(name);
73
78
  }
74
79
  },
75
80
  setWidth(newWidth) {
76
81
  self.width = newWidth;
77
82
  },
83
+ setIsLoading(arg) {
84
+ self.isLoading = arg;
85
+ },
78
86
  setViews(views) {
79
87
  self.views = cast(views);
80
88
  const levels = [];
@@ -111,8 +119,7 @@ function stateModelFactory(pluginManager) {
111
119
  throw new Error(`invalid track selector type ${self.trackSelectorType}`);
112
120
  },
113
121
  toggleTrack(trackId, level = 0) {
114
- var _a;
115
- (_a = self.levels[level]) === null || _a === void 0 ? void 0 : _a.toggleTrack(trackId);
122
+ self.levels[level]?.toggleTrack(trackId);
116
123
  },
117
124
  showTrack(trackId, level = 0, initialSnapshot = {}) {
118
125
  if (!self.levels[level]) {
@@ -121,8 +128,7 @@ function stateModelFactory(pluginManager) {
121
128
  self.levels[level].showTrack(trackId, initialSnapshot);
122
129
  },
123
130
  hideTrack(trackId, level = 0) {
124
- var _a;
125
- (_a = self.levels[level]) === null || _a === void 0 ? void 0 : _a.hideTrack(trackId);
131
+ self.levels[level]?.hideTrack(trackId);
126
132
  },
127
133
  squareView() {
128
134
  const average = avg(self.views.map(v => v.bpPerPx));
@@ -180,13 +186,13 @@ function stateModelFactory(pluginManager) {
180
186
  }))
181
187
  .actions(self => ({
182
188
  afterAttach() {
183
- addDisposer(self, autorun(() => {
189
+ addDisposer(self, autorun(function comparativeViewWidthAutorun() {
184
190
  if (self.width) {
185
191
  for (const view of self.views) {
186
192
  view.setWidth(self.width);
187
193
  }
188
194
  }
189
- }));
195
+ }, { name: 'ComparativeViewWidth' }));
190
196
  },
191
197
  }))
192
198
  .preProcessSnapshot(snap => {
@@ -195,6 +201,21 @@ function stateModelFactory(pluginManager) {
195
201
  ...rest,
196
202
  levels,
197
203
  };
204
+ })
205
+ .postProcessSnapshot(snap => {
206
+ if (!snap) {
207
+ return snap;
208
+ }
209
+ const { trackSelectorType, showIntraviewLinks, linkViews, interactiveOverlay, showDynamicControls, viewTrackConfigs, ...rest } = snap;
210
+ return {
211
+ ...rest,
212
+ ...(trackSelectorType !== 'hierarchical' ? { trackSelectorType } : {}),
213
+ ...(!showIntraviewLinks ? { showIntraviewLinks } : {}),
214
+ ...(linkViews ? { linkViews } : {}),
215
+ ...(interactiveOverlay ? { interactiveOverlay } : {}),
216
+ ...(!showDynamicControls ? { showDynamicControls } : {}),
217
+ ...(viewTrackConfigs.length ? { viewTrackConfigs } : {}),
218
+ };
198
219
  });
199
220
  }
200
221
  export default stateModelFactory;
@@ -4,9 +4,9 @@ import { getConf } from '@jbrowse/core/configuration';
4
4
  import { Dialog } from '@jbrowse/core/ui';
5
5
  import { gatherOverlaps, getContainingView, getSession, } from '@jbrowse/core/util';
6
6
  import { getRpcSessionId } from '@jbrowse/core/util/tracks';
7
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
7
8
  import { MismatchParser } from '@jbrowse/plugin-alignments';
8
9
  import { Button, CircularProgress, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
9
- import { makeStyles } from 'tss-react/mui';
10
10
  const { featurizeSA, getClip, getLength, getLengthSansClipping, getTag } = MismatchParser;
11
11
  const useStyles = makeStyles()({
12
12
  root: {
@@ -63,7 +63,6 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
63
63
  })();
64
64
  }, [preFeature, track]);
65
65
  function onSubmit() {
66
- var _a;
67
66
  try {
68
67
  if (!primaryFeature) {
69
68
  return;
@@ -76,7 +75,7 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
76
75
  const origStrand = feature.get('strand');
77
76
  const SA = getTag(feature, 'SA') || '';
78
77
  const readName = feature.get('name');
79
- const clipPos = getClip(cigar, 1);
78
+ const clipLengthAtStartOfRead = getClip(cigar, 1);
80
79
  const readAssembly = `${readName}_assembly_${Date.now()}`;
81
80
  const [trackAssembly] = getConf(track, 'assemblyNames');
82
81
  const assemblyNames = [trackAssembly, readAssembly];
@@ -89,12 +88,12 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
89
88
  }
90
89
  const suppAlns = featurizeSA(SA, feature.id(), origStrand, readName, true);
91
90
  const feat = feature.toJSON();
92
- feat.clipPos = clipPos;
91
+ feat.clipLengthAtStartOfRead = clipLengthAtStartOfRead;
93
92
  feat.strand = 1;
94
93
  feat.mate = {
95
94
  refName: readName,
96
- start: clipPos,
97
- end: clipPos + getLengthSansClipping(cigar),
95
+ start: clipLengthAtStartOfRead,
96
+ end: clipLengthAtStartOfRead + getLengthSansClipping(cigar),
98
97
  };
99
98
  const totalLength = flags & 2048 ? getLength(suppAlns[0].CIGAR) : getLength(cigar);
100
99
  const features = [feat, ...suppAlns];
@@ -104,7 +103,7 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
104
103
  f.mate.syntenyId = idx;
105
104
  f.mate.uniqueId = `${f.uniqueId}_mate`;
106
105
  }
107
- features.sort((a, b) => a.clipPos - b.clipPos);
106
+ features.sort((a, b) => a.clipLengthAtStartOfRead - b.clipLengthAtStartOfRead);
108
107
  const featSeq = feature.get('seq');
109
108
  const configFeatureStore = [...features, ...features.map(f => f.mate)];
110
109
  const expand = 2 * windowSize;
@@ -117,7 +116,7 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
117
116
  end: f.end + windowSize,
118
117
  assemblyName: trackAssembly,
119
118
  })));
120
- (_a = session.addTemporaryAssembly) === null || _a === void 0 ? void 0 : _a.call(session, {
119
+ session.addTemporaryAssembly?.({
121
120
  name: readAssembly,
122
121
  sequence: {
123
122
  type: 'ReferenceSequenceTrack',
@@ -161,7 +160,7 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
161
160
  showReverse: true,
162
161
  showTranslation: false,
163
162
  height: 35,
164
- configuration: `${seqTrackId}-LinearReferenceSequenceDisplay`,
163
+ configuration: `${sequenceTrackConf.trackId}-LinearReferenceSequenceDisplay`,
165
164
  },
166
165
  ],
167
166
  },
@@ -1,7 +1,7 @@
1
1
  import { lazy } from 'react';
2
2
  import { getContainingTrack, getSession } from '@jbrowse/core/util';
3
3
  import AddIcon from '@mui/icons-material/Add';
4
- const ReadVsRefDialog = lazy(() => import('./LinearReadVsRef'));
4
+ const ReadVsRefDialog = lazy(() => import("./LinearReadVsRef.js"));
5
5
  function isDisplay(elt) {
6
6
  return elt.name === 'LinearPileupDisplay';
7
7
  }
@@ -1,2 +1,2 @@
1
- import type { LinearSyntenyDisplayModel } from './model';
1
+ import type { LinearSyntenyDisplayModel } from './model.ts';
2
2
  export declare function doAfterAttach(self: LinearSyntenyDisplayModel): void;
@@ -1,19 +1,18 @@
1
1
  import { getContainingView, getSession } from '@jbrowse/core/util';
2
2
  import { bpToPx } from '@jbrowse/core/util/Base1DUtils';
3
+ import { addDisposer, getSnapshot } from '@jbrowse/mobx-state-tree';
3
4
  import { MismatchParser } from '@jbrowse/plugin-alignments';
4
5
  import { autorun, reaction } from 'mobx';
5
- import { addDisposer, getSnapshot } from 'mobx-state-tree';
6
- import { drawCigarClickMap, drawMouseoverClickMap, drawRef, } from './drawSynteny';
6
+ import { drawCigarClickMap, drawMouseoverClickMap, drawRef, } from "./drawSynteny.js";
7
7
  export function doAfterAttach(self) {
8
- addDisposer(self, autorun(() => {
9
- var _a, _b;
8
+ addDisposer(self, autorun(function syntenyDrawAutorun() {
10
9
  const view = getContainingView(self);
11
10
  if (!view.initialized ||
12
11
  !view.views.every(a => a.displayedRegions.length > 0 && a.initialized)) {
13
12
  return;
14
13
  }
15
- const ctx1 = (_a = self.mainCanvas) === null || _a === void 0 ? void 0 : _a.getContext('2d');
16
- const ctx3 = (_b = self.cigarClickMapCanvas) === null || _b === void 0 ? void 0 : _b.getContext('2d');
14
+ const ctx1 = self.mainCanvas?.getContext('2d');
15
+ const ctx3 = self.cigarClickMapCanvas?.getContext('2d');
17
16
  if (!ctx1 || !ctx3) {
18
17
  return;
19
18
  }
@@ -23,8 +22,8 @@ export function doAfterAttach(self) {
23
22
  ctx1.clearRect(0, 0, width, height);
24
23
  drawRef(self, ctx1);
25
24
  drawCigarClickMap(self, ctx3);
26
- }));
27
- addDisposer(self, autorun(() => {
25
+ }, { name: 'SyntenyDraw' }));
26
+ addDisposer(self, autorun(function syntenyMouseoverAutorun() {
28
27
  const view = getContainingView(self);
29
28
  if (!view.initialized ||
30
29
  !view.views.every(a => a.displayedRegions.length > 0 && a.initialized)) {
@@ -32,7 +31,7 @@ export function doAfterAttach(self) {
32
31
  }
33
32
  const { clickId, mouseoverId } = self;
34
33
  drawMouseoverClickMap(self);
35
- }));
34
+ }, { name: 'SyntenyMouseover' }));
36
35
  addDisposer(self, reaction(() => {
37
36
  const view = getContainingView(self);
38
37
  return {
@@ -72,8 +71,8 @@ export function doAfterAttach(self) {
72
71
  const a2 = assemblyManager.get(mate.assemblyName);
73
72
  const r1 = f.get('refName');
74
73
  const r2 = mate.refName;
75
- const ref1 = (a1 === null || a1 === void 0 ? void 0 : a1.getCanonicalRefName(r1)) || r1;
76
- const ref2 = (a2 === null || a2 === void 0 ? void 0 : a2.getCanonicalRefName(r2)) || r2;
74
+ const ref1 = a1?.getCanonicalRefName(r1) || r1;
75
+ const ref2 = a2?.getCanonicalRefName(r2) || r2;
77
76
  const v1 = viewSnaps[level];
78
77
  const v2 = viewSnaps[level + 1];
79
78
  const p11 = bpToPx({ self: v1, refName: ref1, coord: f1s });
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { makeStyles } from 'tss-react/mui';
2
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
3
3
  const useStyles = makeStyles()({
4
4
  blockError: {
5
5
  background: '#f1f1f1',
@@ -1,19 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { makeStyles } from 'tss-react/mui';
3
- const useStyles = makeStyles()(theme => {
4
- const bg = theme.palette.action.disabledBackground;
5
- return {
6
- loading: {
7
- paddingLeft: '0.6em',
8
- backgroundColor: theme.palette.background.default,
9
- backgroundImage: `repeating-linear-gradient(45deg, transparent, transparent 5px, ${bg} 5px, ${bg} 10px)`,
10
- textAlign: 'center',
11
- },
12
- blockMessage: {
13
- background: '#f1f1f1',
14
- padding: 10,
15
- },
16
- };
2
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
3
+ const useStyles = makeStyles()({
4
+ blockMessage: {
5
+ background: '#f1f1f1',
6
+ padding: 10,
7
+ },
17
8
  });
18
9
  export default function BlockMessage({ messageText }) {
19
10
  const { classes } = useStyles();
@@ -1,4 +1,4 @@
1
- import type { LinearSyntenyDisplayModel } from '../model';
1
+ import type { LinearSyntenyDisplayModel } from '../model.ts';
2
2
  declare const ServerSideRenderedBlockContent: ({ model, }: {
3
3
  model: LinearSyntenyDisplayModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { observer } from 'mobx-react';
3
- import BlockError from './BlockError';
4
- import BlockMessage from './BlockMessage';
5
- import LinearSyntenyRendering from './LinearSyntenyRendering';
6
- import LoadingMessage from './LoadingMessage';
7
- const ServerSideRenderedBlockContent = observer(function ({ model, }) {
3
+ import BlockError from "./BlockError.js";
4
+ import BlockMessage from "./BlockMessage.js";
5
+ import LinearSyntenyRendering from "./LinearSyntenyRendering.js";
6
+ import LoadingMessage from "./LoadingMessage.js";
7
+ const ServerSideRenderedBlockContent = observer(function ServerSideRenderedBlockContent({ model, }) {
8
8
  if (model.error) {
9
9
  return _jsx(BlockError, { error: model.error });
10
10
  }
@@ -1,4 +1,4 @@
1
- import type { LinearSyntenyDisplayModel } from '../model';
1
+ import type { LinearSyntenyDisplayModel } from '../model.ts';
2
2
  declare const LinearSyntenyRendering: ({ model, }: {
3
3
  model: LinearSyntenyDisplayModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { lazy, useCallback, useEffect, useRef, useState } from 'react';
3
3
  import { getContainingView } from '@jbrowse/core/util';
4
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
4
5
  import { transaction } from 'mobx';
5
6
  import { observer } from 'mobx-react';
6
- import { makeStyles } from 'tss-react/mui';
7
- import { MAX_COLOR_RANGE, getId } from '../drawSynteny';
8
- import SyntenyContextMenu from './SyntenyContextMenu';
9
- import { getTooltip, onSynClick, onSynContextClick } from './util';
10
- const SyntenyTooltip = lazy(() => import('./SyntenyTooltip'));
7
+ import { MAX_COLOR_RANGE, getId } from "../drawSynteny.js";
8
+ import SyntenyContextMenu from "./SyntenyContextMenu.js";
9
+ import { getTooltip, onSynClick, onSynContextClick } from "./util.js";
10
+ const SyntenyTooltip = lazy(() => import("./SyntenyTooltip.js"));
11
11
  const useStyles = makeStyles()({
12
12
  pix: {
13
13
  imageRendering: 'pixelated',
@@ -26,7 +26,7 @@ const useStyles = makeStyles()({
26
26
  position: 'absolute',
27
27
  },
28
28
  });
29
- const LinearSyntenyRendering = observer(function ({ model, }) {
29
+ const LinearSyntenyRendering = observer(function LinearSyntenyRendering({ model, }) {
30
30
  const { classes } = useStyles();
31
31
  const { mouseoverId, height } = model;
32
32
  const xOffset = useRef(0);
@@ -50,7 +50,6 @@ const LinearSyntenyRendering = observer(function ({ model, }) {
50
50
  mainSyntenyCanvasRefp.current = ref;
51
51
  }, [model, height, width]);
52
52
  useEffect(() => {
53
- var _a;
54
53
  function onWheel(event) {
55
54
  event.preventDefault();
56
55
  if (event.ctrlKey) {
@@ -62,13 +61,12 @@ const LinearSyntenyRendering = observer(function ({ model, }) {
62
61
  clearTimeout(timeout.current);
63
62
  }
64
63
  timeout.current = setTimeout(() => {
65
- var _a;
66
64
  for (const v of view.views) {
67
65
  v.setScaleFactor(1);
68
66
  v.zoomTo(delta.current > 0
69
67
  ? v.bpPerPx * (1 + delta.current)
70
68
  : v.bpPerPx / (1 - delta.current), event.clientX -
71
- (((_a = mainSyntenyCanvasRefp.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().left) ||
69
+ (mainSyntenyCanvasRefp.current?.getBoundingClientRect().left ||
72
70
  0));
73
71
  }
74
72
  delta.current = 0;
@@ -92,10 +90,9 @@ const LinearSyntenyRendering = observer(function ({ model, }) {
92
90
  }
93
91
  }
94
92
  }
95
- (_a = mainSyntenyCanvasRefp.current) === null || _a === void 0 ? void 0 : _a.addEventListener('wheel', onWheel);
93
+ mainSyntenyCanvasRefp.current?.addEventListener('wheel', onWheel);
96
94
  return () => {
97
- var _a;
98
- (_a = mainSyntenyCanvasRefp.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('wheel', onWheel);
95
+ mainSyntenyCanvasRefp.current?.removeEventListener('wheel', onWheel);
99
96
  };
100
97
  }, [model, height, width]);
101
98
  const clickMapCanvasRef = useCallback((ref) => {
@@ -105,7 +102,6 @@ const LinearSyntenyRendering = observer(function ({ model, }) {
105
102
  model.setCigarClickMapCanvasRef(ref);
106
103
  }, [model, height, width]);
107
104
  return (_jsxs("div", { className: classes.rel, children: [_jsx("canvas", { ref: mouseoverDetectionCanvasRef, width: width, height: height, className: classes.mouseoverCanvas }), _jsx("canvas", { ref: mainSyntenyCanvasRef, onMouseMove: event => {
108
- var _a;
109
105
  if (mouseCurrDownX !== undefined) {
110
106
  xOffset.current += mouseCurrDownX - event.clientX;
111
107
  setMouseCurrDownX(event.clientX);
@@ -143,7 +139,7 @@ const LinearSyntenyRendering = observer(function ({ model, }) {
143
139
  const [r2, g2, b2] = ctx2.getImageData(x, y, 1, 1).data;
144
140
  const unitMultiplier = Math.floor(MAX_COLOR_RANGE / model.numFeats);
145
141
  const id = getId(r1, g1, b1, unitMultiplier);
146
- model.setMouseoverId((_a = model.featPositions[id]) === null || _a === void 0 ? void 0 : _a.f.id());
142
+ model.setMouseoverId(model.featPositions[id]?.f.id());
147
143
  if (id === -1) {
148
144
  setTooltip('');
149
145
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { LoadingEllipses } from '@jbrowse/core/ui';
3
- import { makeStyles } from 'tss-react/mui';
3
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
4
4
  const useStyles = makeStyles()(theme => {
5
5
  const bg = theme.palette.action.disabledBackground;
6
6
  return {
@@ -1,4 +1,4 @@
1
- import type { LinearSyntenyDisplayModel } from '../model';
1
+ import type { LinearSyntenyDisplayModel } from '../model.ts';
2
2
  import type { Feature } from '@jbrowse/core/util';
3
3
  interface ClickCoord {
4
4
  clientX: number;
@@ -1,30 +1,13 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Menu } from '@jbrowse/core/ui';
3
- import { getContainingView, getSession } from '@jbrowse/core/util';
3
+ import { getContainingView } from '@jbrowse/core/util';
4
4
  export default function SyntenyContextMenu({ model, onClose, anchorEl, }) {
5
5
  const view = getContainingView(model);
6
6
  const { clientX, clientY, feature } = anchorEl;
7
- return (_jsx(Menu, { onMenuItemClick: (event, callback) => {
8
- callback(event);
7
+ return (_jsx(Menu, { onMenuItemClick: (_, callback) => {
8
+ callback();
9
9
  onClose();
10
- }, anchorEl: {
11
- nodeType: 1,
12
- getBoundingClientRect: () => {
13
- const x = clientX;
14
- const y = clientY;
15
- return {
16
- top: y,
17
- left: x,
18
- bottom: y,
19
- right: x,
20
- width: 0,
21
- height: 0,
22
- x,
23
- y,
24
- toJSON() { },
25
- };
26
- },
27
- }, onClose: onClose, open: Boolean(anchorEl), menuItems: [
10
+ }, anchorReference: "anchorPosition", anchorPosition: { top: clientY, left: clientX }, onClose: onClose, open: Boolean(anchorEl), menuItems: [
28
11
  {
29
12
  label: 'Center on feature',
30
13
  onClick: () => {
@@ -35,18 +18,10 @@ export default function SyntenyContextMenu({ model, onClose, anchorEl, }) {
35
18
  const mate = f.get('mate');
36
19
  const l1 = view.views[model.level];
37
20
  const l2 = view.views[model.level + 1];
38
- const l1asm = l1.assemblyNames[0];
39
- const l2asm = l2.assemblyNames[0];
40
- l1.navToLocString(`${refName}:${start}-${end}`).catch((e) => {
41
- const err = `${l1asm}:${e}`;
42
- console.error(l1asm, err);
43
- getSession(model).notifyError(err, e);
44
- });
45
- l2.navToLocString(`${mate.refName}:${mate.start}-${mate.end}`).catch((e) => {
46
- const err = `${l2asm}:${e}`;
47
- console.error(l2asm, err);
48
- getSession(model).notifyError(err, e);
49
- });
21
+ const center1 = (start + end) / 2;
22
+ const center2 = (mate.start + mate.end) / 2;
23
+ l1.centerAt(center1, refName);
24
+ l2.centerAt(center2, mate.refName);
50
25
  },
51
26
  },
52
27
  ] }));
@@ -1,4 +1,4 @@
1
- declare const SyntenyTooltip: ({ title }: {
1
+ declare const SyntenyTooltip: ({ title, }: {
2
2
  title: string;
3
3
  }) => import("react/jsx-runtime").JSX.Element | null;
4
4
  export default SyntenyTooltip;
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { SanitizedHTML } from '@jbrowse/core/ui';
3
3
  import BaseTooltip from '@jbrowse/core/ui/BaseTooltip';
4
4
  import { observer } from 'mobx-react';
5
- const SyntenyTooltip = observer(function ({ title }) {
5
+ const SyntenyTooltip = observer(function SyntenyTooltip({ title, }) {
6
6
  return title ? (_jsx(BaseTooltip, { children: _jsx(SanitizedHTML, { html: title }) })) : null;
7
7
  });
8
8
  export default SyntenyTooltip;
@@ -1,5 +1,5 @@
1
1
  import type React from 'react';
2
- import type { LinearSyntenyDisplayModel } from '../model';
2
+ import type { LinearSyntenyDisplayModel } from '../model.ts';
3
3
  import type { Feature } from '@jbrowse/core/util';
4
4
  interface Pos {
5
5
  offsetPx: number;
@@ -35,7 +35,7 @@ export declare function draw(ctx: CanvasRenderingContext2D, x1: number, x2: numb
35
35
  export declare function drawLocationMarkers(ctx: CanvasRenderingContext2D, x1: number, x2: number, y1: number, x3: number, x4: number, y2: number, mid: number, bpPerPx1: number, bpPerPx2: number, drawCurves?: boolean): void;
36
36
  export declare function drawBox(ctx: CanvasRenderingContext2D, x1: number, x2: number, y1: number, x3: number, x4: number, y2: number): void;
37
37
  export declare function drawBezierBox(ctx: CanvasRenderingContext2D, x1: number, x2: number, y1: number, x3: number, x4: number, y2: number, mid: number): void;
38
- export declare function onSynClick(event: React.MouseEvent, model: LinearSyntenyDisplayModel): import("../model").FeatPos | undefined;
38
+ export declare function onSynClick(event: React.MouseEvent, model: LinearSyntenyDisplayModel): import("../model.ts").FeatPos | undefined;
39
39
  export declare function onSynContextClick(event: React.MouseEvent, model: LinearSyntenyDisplayModel, setAnchorEl: (arg: ClickCoord) => void): void;
40
40
  export declare function getTooltip({ feature, cigarOp, cigarOpLen, }: {
41
41
  feature: Feature;
@@ -1,5 +1,5 @@
1
1
  import { assembleLocString, doesIntersect2, getContainingTrack, getContainingView, getSession, isSessionModelWithWidgets, toLocale, } from '@jbrowse/core/util';
2
- import { MAX_COLOR_RANGE, getId } from '../drawSynteny';
2
+ import { MAX_COLOR_RANGE, getId } from "../drawSynteny.js";
3
3
  export function drawMatchSimple({ feature, ctx, offsets, level, cb, height, drawCurves, oobLimit, viewWidth, hideTiny, }) {
4
4
  const { p11, p12, p21, p22 } = feature;
5
5
  const x11 = p11.offsetPx - offsets[level];
@@ -177,8 +177,8 @@ export function getTooltip({ feature, cigarOp, cigarOpLen, }) {
177
177
  `Loc1: ${assembleLocString(f1)}`,
178
178
  `Loc2: ${assembleLocString(f2)}`,
179
179
  `Inverted: ${f1.strand === -1}`,
180
- `Query len: ${l1.toLocaleString('en-US')}`,
181
- `Target len: ${l2.toLocaleString('en-US')}`,
180
+ `Query len: ${toLocale(l1)}`,
181
+ `Target len: ${toLocale(l2)}`,
182
182
  identity ? `Identity: ${identity.toPrecision(2)}` : '',
183
183
  cigarOp ? `CIGAR operator: ${toLocale(+cigarOpLen)}${cigarOp}` : '',
184
184
  n1 ? `Name 1: ${n1}` : '',
@@ -1,5 +1,5 @@
1
1
  import type PluginManager from '@jbrowse/core/PluginManager';
2
- declare function configSchemaFactory(pluginManager: PluginManager): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
+ declare function configSchemaFactory(pluginManager: PluginManager): import("node_modules/@jbrowse/core/src/configuration/configurationSchema.ts").ConfigurationSchemaType<{
3
3
  trackIds: {
4
4
  type: string;
5
5
  defaultValue: never[];
@@ -8,5 +8,5 @@ declare function configSchemaFactory(pluginManager: PluginManager): import("@jbr
8
8
  type: string;
9
9
  defaultValue: boolean;
10
10
  };
11
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>;
11
+ }, import("node_modules/@jbrowse/core/src/configuration/configurationSchema.ts").ConfigurationSchemaOptions<import("node_modules/@jbrowse/core/src/configuration/configurationSchema.ts").ConfigurationSchemaType<{}, import("node_modules/@jbrowse/core/src/configuration/configurationSchema.ts").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>;
12
12
  export default configSchemaFactory;
@@ -1,5 +1,5 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
- import baseConfigFactory from '../LinearComparativeDisplay/configSchemaF';
2
+ import baseConfigFactory from "../LinearComparativeDisplay/configSchemaF.js";
3
3
  function configSchemaFactory(pluginManager) {
4
4
  return ConfigurationSchema('LinearSyntenyDisplay', {
5
5
  trackIds: {
@@ -0,0 +1,2 @@
1
+ import type { LinearSyntenyDisplayModel } from './model.ts';
2
+ export declare function drawMouseoverClickMap(model: LinearSyntenyDisplayModel): void;
@@ -0,0 +1,53 @@
1
+ import { getContainingView } from '@jbrowse/core/util';
2
+ import { drawMatchSimple } from "./components/util.js";
3
+ const oobLimit = 1600;
4
+ const fillCallback = (ctx) => {
5
+ ctx.fill();
6
+ };
7
+ const strokeCallback = (ctx) => {
8
+ ctx.stroke();
9
+ };
10
+ export function drawMouseoverClickMap(model) {
11
+ const { level, clickId, mouseoverId } = model;
12
+ const view = getContainingView(model);
13
+ const drawCurves = view.drawCurves;
14
+ const height = model.height;
15
+ const width = view.width;
16
+ const ctx = model.mouseoverCanvas?.getContext('2d');
17
+ const offsets = view.views.map(v => v.offsetPx);
18
+ if (!ctx) {
19
+ return;
20
+ }
21
+ ctx.resetTransform();
22
+ ctx.clearRect(0, 0, width, height);
23
+ ctx.strokeStyle = 'rgba(0, 0, 0, 0.9)';
24
+ ctx.fillStyle = 'rgba(0, 0, 0, 0.1)';
25
+ const feature1 = model.featMap[mouseoverId || ''];
26
+ if (feature1) {
27
+ drawMatchSimple({
28
+ cb: fillCallback,
29
+ feature: feature1,
30
+ level,
31
+ ctx,
32
+ oobLimit,
33
+ viewWidth: width,
34
+ drawCurves,
35
+ offsets,
36
+ height,
37
+ });
38
+ }
39
+ const feature2 = model.featMap[clickId || ''];
40
+ if (feature2) {
41
+ drawMatchSimple({
42
+ cb: strokeCallback,
43
+ feature: feature2,
44
+ ctx,
45
+ level,
46
+ oobLimit,
47
+ viewWidth: width,
48
+ drawCurves,
49
+ offsets,
50
+ height,
51
+ });
52
+ }
53
+ }