@jbrowse/plugin-linear-comparative-view 3.7.0 → 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 (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
package/esm/util.d.ts CHANGED
@@ -8,7 +8,7 @@ export interface ReducedLinearGenomeView {
8
8
  dynamicBlocks: Region[];
9
9
  displayedRegions: Region[];
10
10
  headerHeight: number;
11
- scaleBarHeight: number;
11
+ scalebarHeight: number;
12
12
  height: number;
13
13
  features: Feature[];
14
14
  tracks: {
package/esm/util.js CHANGED
@@ -1,17 +1,14 @@
1
- import { clamp } from '@jbrowse/core/util';
1
+ import { clamp, sum } from '@jbrowse/core/util';
2
2
  const [, TOP, , BOTTOM] = [0, 1, 2, 3];
3
3
  export function cheight(chunk) {
4
4
  return chunk[BOTTOM] - chunk[TOP];
5
5
  }
6
6
  function heightFromSpecificLevel(views, trackConfigId, level) {
7
- const heightUpUntilThisPoint = views
8
- .slice(0, level)
9
- .map(v => v.height + 7)
10
- .reduce((a, b) => a + b, 0);
7
+ const heightUpUntilThisPoint = sum(views.slice(0, level).map(v => v.height + 7));
11
8
  const v = views[level];
12
9
  return (heightUpUntilThisPoint +
13
10
  v.headerHeight +
14
- v.scaleBarHeight +
11
+ v.scalebarHeight +
15
12
  getTrackPos(v, trackConfigId) +
16
13
  1);
17
14
  }
@@ -24,8 +21,7 @@ export function getTrackPos(view, trackConfigId) {
24
21
  return accum;
25
22
  }
26
23
  export function getPxFromCoordinate(view, refName, coord) {
27
- var _a;
28
- return (((_a = bpToPx(view, { refName, coord })) === null || _a === void 0 ? void 0 : _a.offsetPx) || 0) - view.offsetPx;
24
+ return (bpToPx(view, { refName, coord })?.offsetPx || 0) - view.offsetPx;
29
25
  }
30
26
  export function overlayYPos(trackConfigId, level, views, c, cond) {
31
27
  const track = views[level].tracks.find(t => t.configuration === trackConfigId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-linear-comparative-view",
3
- "version": "3.7.0",
3
+ "version": "4.0.0",
4
4
  "description": "JBrowse 2 linear comparative view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -15,49 +15,43 @@
15
15
  "directory": "plugins/linear-comparative-view"
16
16
  },
17
17
  "author": "JBrowse Team",
18
- "distMain": "dist/index.js",
19
- "srcMain": "src/index.ts",
20
- "main": "dist/index.js",
18
+ "main": "esm/index.js",
21
19
  "files": [
22
- "dist",
23
20
  "esm"
24
21
  ],
25
- "scripts": {
26
- "build": "npm-run-all build:*",
27
- "test": "cd ../..; jest --passWithNoTests plugins/linear-comparative-view",
28
- "prepublishOnly": "yarn test",
29
- "prepack": "yarn build && yarn useDist",
30
- "postpack": "yarn useSrc",
31
- "useDist": "node ../../scripts/useDist.js",
32
- "useSrc": "node ../../scripts/useSrc.js",
33
- "prebuild": "npm run clean",
34
- "build:esm": "tsc --build tsconfig.build.esm.json",
35
- "build:commonjs": "tsc --build tsconfig.build.commonjs.json",
36
- "clean": "rimraf dist esm *.tsbuildinfo"
37
- },
38
22
  "dependencies": {
39
- "@jbrowse/core": "^3.7.0",
40
- "@jbrowse/plugin-alignments": "^3.7.0",
41
- "@jbrowse/plugin-linear-genome-view": "^3.7.0",
42
- "@mui/icons-material": "^7.0.0",
43
- "@mui/material": "^7.0.0",
44
- "copy-to-clipboard": "^3.3.1",
45
- "file-saver": "^2.0.0",
46
- "mobx": "^6.0.0",
47
- "mobx-react": "^9.0.0",
48
- "mobx-state-tree": "^5.0.0",
49
- "rxjs": "^7.0.0",
50
- "tss-react": "^4.0.0"
23
+ "@jbrowse/mobx-state-tree": "^5.5.0",
24
+ "@mui/icons-material": "^7.3.6",
25
+ "@mui/material": "^7.3.6",
26
+ "copy-to-clipboard": "^3.3.3",
27
+ "@types/file-saver-es": "^2.0.3",
28
+ "file-saver-es": "^2.0.5",
29
+ "mobx": "^6.15.0",
30
+ "mobx-react": "^9.2.1",
31
+ "@jbrowse/core": "^4.0.0",
32
+ "@jbrowse/plugin-linear-genome-view": "^4.0.0",
33
+ "@jbrowse/plugin-alignments": "^4.0.0"
51
34
  },
52
35
  "peerDependencies": {
53
36
  "react": ">=18.0.0",
54
37
  "react-dom": ">=18.0.0"
55
38
  },
56
- "distModule": "esm/index.js",
57
- "srcModule": "src/index.ts",
58
- "module": "esm/index.js",
59
39
  "publishConfig": {
60
40
  "access": "public"
61
41
  },
62
- "gitHead": "85bdd0d58286b7adbfd408146b15847676317635"
63
- }
42
+ "sideEffects": false,
43
+ "scripts": {
44
+ "build": "pnpm run /^build:/",
45
+ "test": "cd ../..; jest --passWithNoTests plugins/linear-comparative-view",
46
+ "prebuild": "pnpm clean",
47
+ "build:esm": "tsc -p tsconfig.build.esm.json",
48
+ "clean": "rimraf esm *.tsbuildinfo"
49
+ },
50
+ "types": "esm/index.d.ts",
51
+ "exports": {
52
+ ".": {
53
+ "types": "./esm/index.d.ts",
54
+ "import": "./esm/index.js"
55
+ }
56
+ }
57
+ }
@@ -1,9 +0,0 @@
1
- import type { AbstractSessionModel, Feature } from '@jbrowse/core/util';
2
- import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
3
- export default function LaunchSyntenyViewDialog({ session, view, feature, trackId, handleClose, }: {
4
- session: AbstractSessionModel;
5
- view?: LinearGenomeViewModel;
6
- feature: Feature;
7
- trackId: string;
8
- handleClose: () => void;
9
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = LaunchSyntenyViewDialog;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const ui_1 = require("@jbrowse/core/ui");
7
- const material_1 = require("@mui/material");
8
- const mui_1 = require("tss-react/mui");
9
- const util_1 = require("./util");
10
- const useStyles = (0, mui_1.makeStyles)()({
11
- padding: {
12
- margin: 10,
13
- border: '1px solid #ccc',
14
- },
15
- });
16
- function LaunchSyntenyViewDialog({ session, view, feature, trackId, handleClose, }) {
17
- const { classes } = useStyles();
18
- const inverted = feature.get('strand') === -1;
19
- const hasCIGAR = !!feature.get('CIGAR');
20
- const [horizontallyFlip, setHorizontallyFlip] = (0, react_1.useState)(inverted);
21
- const [windowSize, setWindowSize] = (0, react_1.useState)('1000');
22
- const [useRegionOfInterest, setUseRegionOfInterest] = (0, react_1.useState)(true);
23
- return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, title: "Launch synteny view", onClose: handleClose, children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [view && hasCIGAR ? ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { className: classes.padding, control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: useRegionOfInterest, onChange: event => {
24
- setUseRegionOfInterest(event.target.checked);
25
- } }), label: "Use CIGAR string to navigate the current visible to the target" })) : null, inverted ? ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { className: classes.padding, control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: horizontallyFlip, onChange: event => {
26
- setHorizontallyFlip(event.target.checked);
27
- } }), label: "Note: The feature is inverted in orientation on the target\n sequence. This will result in the lower panel having genomic\n coordinates decreasing left to right. Horizontally flip?" })) : null, (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Add window size in bp", value: windowSize, onChange: event => {
28
- setWindowSize(event.target.value);
29
- } })] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
30
- ;
31
- (async () => {
32
- try {
33
- await (0, util_1.navToSynteny)({
34
- feature,
35
- windowSize: +windowSize,
36
- horizontallyFlip,
37
- trackId,
38
- session,
39
- region: useRegionOfInterest
40
- ? view === null || view === void 0 ? void 0 : view.dynamicBlocks.contentBlocks[0]
41
- : undefined,
42
- });
43
- }
44
- catch (e) {
45
- console.error(e);
46
- session.notifyError(`${e}`, e);
47
- }
48
- })();
49
- handleClose();
50
- }, children: "Submit" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
51
- handleClose();
52
- }, children: "Cancel" })] })] }));
53
- }
@@ -1,14 +0,0 @@
1
- import type { AbstractSessionModel, Feature } from '@jbrowse/core/util';
2
- export interface SimpleRegion {
3
- refName: string;
4
- start: number;
5
- end: number;
6
- }
7
- export declare function navToSynteny({ feature, windowSize: ws, session, trackId, region, horizontallyFlip, }: {
8
- windowSize: number;
9
- trackId: string;
10
- horizontallyFlip: boolean;
11
- feature: Feature;
12
- session: AbstractSessionModel;
13
- region?: SimpleRegion;
14
- }): Promise<void>;
@@ -1,100 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.navToSynteny = navToSynteny;
4
- const plugin_alignments_1 = require("@jbrowse/plugin-alignments");
5
- const { parseCigar } = plugin_alignments_1.MismatchParser;
6
- function findPosInCigar(cigar, startX) {
7
- let featX = 0;
8
- let mateX = 0;
9
- for (let i = 0; i < cigar.length; i++) {
10
- const len = +cigar[i];
11
- const op = cigar[i + 1];
12
- const min = Math.min(len, startX - featX);
13
- if (featX >= startX) {
14
- break;
15
- }
16
- if (op === 'I') {
17
- mateX += len;
18
- }
19
- else if (op === 'D') {
20
- featX += min;
21
- }
22
- else if (op === 'M' || op === '=' || op === 'X') {
23
- mateX += min;
24
- featX += min;
25
- }
26
- }
27
- return [featX, mateX];
28
- }
29
- async function navToSynteny({ feature, windowSize: ws, session, trackId, region, horizontallyFlip, }) {
30
- const cigar = feature.get('CIGAR');
31
- const strand = feature.get('strand');
32
- const featRef = feature.get('refName');
33
- const featAsm = feature.get('assemblyName');
34
- const featStart = feature.get('start');
35
- const featEnd = feature.get('end');
36
- const mate = feature.get('mate');
37
- const mateStart = mate.start;
38
- const mateEnd = mate.end;
39
- const mateAsm = mate.assemblyName;
40
- const mateRef = mate.refName;
41
- let rMateStart;
42
- let rMateEnd;
43
- let rFeatStart;
44
- let rFeatEnd;
45
- if (region && cigar) {
46
- const regStart = region.start;
47
- const regEnd = region.end;
48
- const p = parseCigar(cigar);
49
- const [fStartX, mStartX] = findPosInCigar(p, regStart - featStart);
50
- const [fEndX, mEndX] = findPosInCigar(p, regEnd - featStart);
51
- const flipper = strand === -1 ? -1 : 1;
52
- rFeatStart = featStart + fStartX;
53
- rFeatEnd = featStart + fEndX;
54
- rMateStart = (strand === -1 ? mateEnd : mateStart) + mStartX * flipper;
55
- rMateEnd = (strand === -1 ? mateEnd : mateStart) + mEndX * flipper;
56
- }
57
- else {
58
- rFeatStart = featStart;
59
- rFeatEnd = featEnd;
60
- rMateStart = mateStart;
61
- rMateEnd = mateEnd;
62
- }
63
- const l1 = `${featRef}:${Math.floor(rFeatStart - ws)}-${Math.floor(rFeatEnd + ws)}`;
64
- const m1 = Math.min(rMateStart, rMateEnd);
65
- const m2 = Math.max(rMateStart, rMateEnd);
66
- const l2 = `${mateRef}:${Math.floor(m1 - ws)}-${Math.floor(m2 + ws)}${horizontallyFlip ? '[rev]' : ''}`;
67
- session.addView('LinearSyntenyView', {
68
- type: 'LinearSyntenyView',
69
- views: [
70
- {
71
- type: 'LinearGenomeView',
72
- hideHeader: true,
73
- init: {
74
- assembly: featAsm,
75
- loc: l1,
76
- },
77
- },
78
- {
79
- type: 'LinearGenomeView',
80
- hideHeader: true,
81
- init: {
82
- assembly: mateAsm,
83
- loc: l2,
84
- },
85
- },
86
- ],
87
- tracks: [
88
- {
89
- configuration: trackId,
90
- type: 'SyntenyTrack',
91
- displays: [
92
- {
93
- type: 'LinearSyntenyDisplay',
94
- configuration: `${trackId}-LinearSyntenyDisplay`,
95
- },
96
- ],
97
- },
98
- ],
99
- });
100
- }
@@ -1,66 +0,0 @@
1
- import type PluginManager from '@jbrowse/core/PluginManager';
2
- declare function configSchemaF(pluginManager: PluginManager): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
3
- mouseover: {
4
- type: string;
5
- defaultValue: string;
6
- };
7
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
8
- defaultRendering: {
9
- type: string;
10
- model: import("mobx-state-tree").ISimpleType<string>;
11
- defaultValue: string;
12
- };
13
- renderers: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
14
- PileupRenderer: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
15
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
16
- maxFeatureScreenDensity: {
17
- type: string;
18
- description: string;
19
- defaultValue: number;
20
- };
21
- colorBy: {
22
- type: string;
23
- description: string;
24
- defaultValue: {
25
- type: string;
26
- };
27
- };
28
- filterBy: {
29
- type: string;
30
- description: string;
31
- defaultValue: {
32
- flagInclude: number;
33
- flagExclude: number;
34
- };
35
- };
36
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
37
- renderer: import("mobx-state-tree").IAnyModelType;
38
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
39
- maxFeatureScreenDensity: {
40
- type: string;
41
- description: string;
42
- defaultValue: number;
43
- };
44
- fetchSizeLimit: {
45
- type: string;
46
- defaultValue: number;
47
- description: string;
48
- };
49
- height: {
50
- type: string;
51
- defaultValue: number;
52
- description: string;
53
- };
54
- mouseover: {
55
- type: string;
56
- description: string;
57
- defaultValue: string;
58
- contextVariable: string[];
59
- };
60
- jexlFilters: {
61
- type: string;
62
- description: string;
63
- defaultValue: never[];
64
- };
65
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>, undefined>>, undefined>>;
66
- export default configSchemaF;
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const configuration_1 = require("@jbrowse/core/configuration");
4
- const util_1 = require("@jbrowse/core/util");
5
- const plugin_alignments_1 = require("@jbrowse/plugin-alignments");
6
- function configSchemaF(pluginManager) {
7
- pluginManager.jexl.addFunction('lgvSyntenyTooltip', (f) => {
8
- const mate = f.get('mate');
9
- const l1name = f.get('name') || f.get('id');
10
- const l2name = (mate === null || mate === void 0 ? void 0 : mate.name) || (mate === null || mate === void 0 ? void 0 : mate.id);
11
- return [
12
- l1name ? `Name1: ${l1name}` : '',
13
- l2name ? `Name2: ${l2name}` : '',
14
- `Loc1: ${(0, util_1.assembleLocString)({
15
- refName: f.get('refName'),
16
- start: f.get('start'),
17
- end: f.get('end'),
18
- })} (${(0, util_1.toLocale)(f.get('end') - f.get('start'))}bp)`,
19
- `Loc2: ${(0, util_1.assembleLocString)({
20
- refName: mate.refName,
21
- start: mate.start,
22
- end: mate.end,
23
- })} (${(0, util_1.toLocale)(mate.end - mate.start)}bp)`,
24
- ]
25
- .filter(f => !!f)
26
- .join('<br/>');
27
- });
28
- return (0, configuration_1.ConfigurationSchema)('LGVSyntenyDisplay', {
29
- mouseover: {
30
- type: 'string',
31
- defaultValue: 'jexl:lgvSyntenyTooltip(feature)',
32
- },
33
- }, {
34
- baseConfiguration: (0, plugin_alignments_1.linearPileupDisplayConfigSchemaFactory)(pluginManager),
35
- explicitlyTyped: true,
36
- });
37
- }
38
- exports.default = configSchemaF;
@@ -1,2 +0,0 @@
1
- import type PluginManager from '@jbrowse/core/PluginManager';
2
- export default function LGVSyntenyDisplayF(pluginManager: PluginManager): void;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.default = LGVSyntenyDisplayF;
7
- const DisplayType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/DisplayType"));
8
- const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
9
- const configSchemaF_1 = __importDefault(require("./configSchemaF"));
10
- const model_1 = __importDefault(require("./model"));
11
- function LGVSyntenyDisplayF(pluginManager) {
12
- pluginManager.addDisplayType(() => {
13
- const configSchema = (0, configSchemaF_1.default)(pluginManager);
14
- const stateModel = (0, model_1.default)(configSchema);
15
- return new DisplayType_1.default({
16
- name: 'LGVSyntenyDisplay',
17
- configSchema,
18
- stateModel,
19
- trackType: 'SyntenyTrack',
20
- viewType: 'LinearGenomeView',
21
- ReactComponent: plugin_linear_genome_view_1.BaseLinearDisplayComponent,
22
- });
23
- });
24
- }