@jbrowse/plugin-linear-comparative-view 2.17.0 → 3.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 (231) hide show
  1. package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +6 -5
  2. package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +36 -60
  3. package/dist/LGVSyntenyDisplay/components/util.d.ts +9 -6
  4. package/dist/LGVSyntenyDisplay/components/util.js +6 -13
  5. package/dist/LGVSyntenyDisplay/configSchemaF.d.ts +19 -10
  6. package/dist/LGVSyntenyDisplay/configSchemaF.js +12 -9
  7. package/dist/LGVSyntenyDisplay/index.d.ts +1 -1
  8. package/dist/LGVSyntenyDisplay/index.js +1 -1
  9. package/dist/LGVSyntenyDisplay/model.d.ts +122 -69
  10. package/dist/LGVSyntenyDisplay/model.js +20 -37
  11. package/dist/LaunchLinearSyntenyView.d.ts +1 -1
  12. package/dist/LaunchLinearSyntenyView.js +1 -3
  13. package/dist/LinearComparativeDisplay/configSchemaF.d.ts +0 -3
  14. package/dist/LinearComparativeDisplay/configSchemaF.js +0 -6
  15. package/dist/LinearComparativeDisplay/index.d.ts +1 -1
  16. package/dist/LinearComparativeDisplay/stateModelFactory.d.ts +12 -69
  17. package/dist/LinearComparativeDisplay/stateModelFactory.js +13 -57
  18. package/dist/LinearComparativeView/components/Header.d.ts +2 -3
  19. package/dist/LinearComparativeView/components/Header.js +56 -86
  20. package/dist/LinearComparativeView/components/HeaderSearchBoxes.d.ts +2 -3
  21. package/dist/LinearComparativeView/components/HeaderSearchBoxes.js +5 -15
  22. package/dist/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +2 -3
  23. package/dist/LinearComparativeView/components/LinearComparativeRenderArea.js +17 -32
  24. package/dist/LinearComparativeView/components/LinearComparativeView.d.ts +2 -3
  25. package/dist/LinearComparativeView/components/LinearComparativeView.js +4 -9
  26. package/dist/LinearComparativeView/components/Rubberband.d.ts +2 -3
  27. package/dist/LinearComparativeView/components/Rubberband.js +36 -69
  28. package/dist/LinearComparativeView/components/VerticalGuide.d.ts +2 -3
  29. package/dist/LinearComparativeView/components/VerticalGuide.js +5 -9
  30. package/dist/LinearComparativeView/index.d.ts +1 -1
  31. package/dist/LinearComparativeView/index.js +17 -7
  32. package/dist/LinearComparativeView/model.d.ts +38 -90
  33. package/dist/LinearComparativeView/model.js +40 -107
  34. package/dist/LinearReadVsRef/LinearReadVsRef.d.ts +2 -3
  35. package/dist/LinearReadVsRef/LinearReadVsRef.js +10 -55
  36. package/dist/LinearReadVsRef/index.d.ts +1 -1
  37. package/dist/LinearReadVsRef/index.js +17 -9
  38. package/dist/LinearSyntenyDisplay/afterAttach.d.ts +1 -1
  39. package/dist/LinearSyntenyDisplay/afterAttach.js +8 -12
  40. package/dist/LinearSyntenyDisplay/components/Component.d.ts +2 -3
  41. package/dist/LinearSyntenyDisplay/components/Component.js +11 -36
  42. package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +2 -3
  43. package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +95 -106
  44. package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +3 -4
  45. package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.js +3 -6
  46. package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +1 -2
  47. package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.js +3 -4
  48. package/dist/LinearSyntenyDisplay/components/util.d.ts +3 -3
  49. package/dist/LinearSyntenyDisplay/components/util.js +0 -9
  50. package/dist/LinearSyntenyDisplay/configSchemaF.d.ts +1 -12
  51. package/dist/LinearSyntenyDisplay/configSchemaF.js +0 -15
  52. package/dist/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
  53. package/dist/LinearSyntenyDisplay/drawSynteny.js +1 -23
  54. package/dist/LinearSyntenyDisplay/index.d.ts +1 -1
  55. package/dist/LinearSyntenyDisplay/index.js +18 -9
  56. package/dist/LinearSyntenyDisplay/model.d.ts +8 -102
  57. package/dist/LinearSyntenyDisplay/model.js +18 -99
  58. package/dist/LinearSyntenyView/components/ExportSvgDialog.d.ts +2 -3
  59. package/dist/LinearSyntenyView/components/ExportSvgDialog.js +35 -76
  60. package/dist/LinearSyntenyView/components/Icons.d.ts +3 -4
  61. package/dist/LinearSyntenyView/components/Icons.js +3 -8
  62. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +8 -0
  63. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +130 -0
  64. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.d.ts +8 -0
  65. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.js +39 -0
  66. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.d.ts +7 -0
  67. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.js +22 -0
  68. package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +2 -3
  69. package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +49 -150
  70. package/dist/LinearSyntenyView/components/ImportForm/doSubmit.d.ts +5 -0
  71. package/dist/LinearSyntenyView/components/ImportForm/doSubmit.js +43 -0
  72. package/dist/LinearSyntenyView/components/ImportForm/getAdapter.d.ts +117 -0
  73. package/dist/LinearSyntenyView/components/ImportForm/getAdapter.js +68 -0
  74. package/dist/LinearSyntenyView/components/ImportForm/util.js +1 -3
  75. package/dist/LinearSyntenyView/components/LinearSyntenyView.d.ts +2 -3
  76. package/dist/LinearSyntenyView/components/LinearSyntenyView.js +20 -10
  77. package/dist/LinearSyntenyView/index.d.ts +1 -1
  78. package/dist/LinearSyntenyView/index.js +17 -7
  79. package/dist/LinearSyntenyView/model.d.ts +54 -58
  80. package/dist/LinearSyntenyView/model.js +61 -56
  81. package/dist/LinearSyntenyView/svgcomponents/SVGBackground.d.ts +1 -2
  82. package/dist/LinearSyntenyView/svgcomponents/SVGBackground.js +3 -6
  83. package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +2 -3
  84. package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +3 -11
  85. package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +1 -1
  86. package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +7 -24
  87. package/dist/LinearSyntenyView/types.d.ts +12 -0
  88. package/dist/LinearSyntenyView/types.js +2 -0
  89. package/dist/LinearSyntenyViewHelper/index.d.ts +1 -1
  90. package/dist/LinearSyntenyViewHelper/index.js +2 -2
  91. package/dist/LinearSyntenyViewHelper/stateModelFactory.d.ts +2 -14
  92. package/dist/LinearSyntenyViewHelper/stateModelFactory.js +2 -29
  93. package/dist/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +5 -0
  94. package/dist/SyntenyFeatureDetail/LinkToSyntenyView.js +87 -0
  95. package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +2 -11
  96. package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +5 -90
  97. package/dist/SyntenyFeatureDetail/index.d.ts +1 -1
  98. package/dist/SyntenyFeatureDetail/index.js +18 -14
  99. package/dist/SyntenyFeatureDetail/types.d.ts +9 -0
  100. package/dist/SyntenyFeatureDetail/types.js +2 -0
  101. package/dist/SyntenyTrack/configSchema.d.ts +1 -1
  102. package/dist/SyntenyTrack/configSchema.js +1 -9
  103. package/dist/SyntenyTrack/index.d.ts +1 -1
  104. package/dist/SyntenyTrack/index.js +1 -1
  105. package/dist/index.d.ts +1 -1
  106. package/dist/index.js +4 -4
  107. package/dist/util.d.ts +2 -2
  108. package/dist/util.js +1 -11
  109. package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +6 -5
  110. package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +35 -36
  111. package/esm/LGVSyntenyDisplay/components/util.d.ts +9 -6
  112. package/esm/LGVSyntenyDisplay/components/util.js +6 -13
  113. package/esm/LGVSyntenyDisplay/configSchemaF.d.ts +19 -10
  114. package/esm/LGVSyntenyDisplay/configSchemaF.js +12 -9
  115. package/esm/LGVSyntenyDisplay/index.d.ts +1 -1
  116. package/esm/LGVSyntenyDisplay/index.js +1 -1
  117. package/esm/LGVSyntenyDisplay/model.d.ts +122 -69
  118. package/esm/LGVSyntenyDisplay/model.js +4 -31
  119. package/esm/LaunchLinearSyntenyView.d.ts +1 -1
  120. package/esm/LaunchLinearSyntenyView.js +1 -3
  121. package/esm/LinearComparativeDisplay/configSchemaF.d.ts +0 -3
  122. package/esm/LinearComparativeDisplay/configSchemaF.js +0 -6
  123. package/esm/LinearComparativeDisplay/index.d.ts +1 -1
  124. package/esm/LinearComparativeDisplay/stateModelFactory.d.ts +12 -69
  125. package/esm/LinearComparativeDisplay/stateModelFactory.js +14 -58
  126. package/esm/LinearComparativeView/components/Header.d.ts +2 -3
  127. package/esm/LinearComparativeView/components/Header.js +56 -63
  128. package/esm/LinearComparativeView/components/HeaderSearchBoxes.d.ts +2 -3
  129. package/esm/LinearComparativeView/components/HeaderSearchBoxes.js +5 -12
  130. package/esm/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +2 -3
  131. package/esm/LinearComparativeView/components/LinearComparativeRenderArea.js +17 -29
  132. package/esm/LinearComparativeView/components/LinearComparativeView.d.ts +2 -3
  133. package/esm/LinearComparativeView/components/LinearComparativeView.js +4 -9
  134. package/esm/LinearComparativeView/components/Rubberband.d.ts +2 -3
  135. package/esm/LinearComparativeView/components/Rubberband.js +36 -46
  136. package/esm/LinearComparativeView/components/VerticalGuide.d.ts +2 -3
  137. package/esm/LinearComparativeView/components/VerticalGuide.js +5 -6
  138. package/esm/LinearComparativeView/index.d.ts +1 -1
  139. package/esm/LinearComparativeView/model.d.ts +38 -90
  140. package/esm/LinearComparativeView/model.js +24 -101
  141. package/esm/LinearReadVsRef/LinearReadVsRef.d.ts +2 -3
  142. package/esm/LinearReadVsRef/LinearReadVsRef.js +10 -32
  143. package/esm/LinearReadVsRef/index.d.ts +1 -1
  144. package/esm/LinearReadVsRef/index.js +1 -3
  145. package/esm/LinearSyntenyDisplay/afterAttach.d.ts +1 -1
  146. package/esm/LinearSyntenyDisplay/afterAttach.js +8 -12
  147. package/esm/LinearSyntenyDisplay/components/Component.d.ts +2 -3
  148. package/esm/LinearSyntenyDisplay/components/Component.js +11 -13
  149. package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +2 -3
  150. package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +79 -100
  151. package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +3 -4
  152. package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.js +3 -3
  153. package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +1 -2
  154. package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.js +3 -4
  155. package/esm/LinearSyntenyDisplay/components/util.d.ts +3 -3
  156. package/esm/LinearSyntenyDisplay/components/util.js +2 -11
  157. package/esm/LinearSyntenyDisplay/configSchemaF.d.ts +1 -12
  158. package/esm/LinearSyntenyDisplay/configSchemaF.js +0 -15
  159. package/esm/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
  160. package/esm/LinearSyntenyDisplay/drawSynteny.js +1 -23
  161. package/esm/LinearSyntenyDisplay/index.d.ts +1 -1
  162. package/esm/LinearSyntenyDisplay/index.js +1 -2
  163. package/esm/LinearSyntenyDisplay/model.d.ts +8 -102
  164. package/esm/LinearSyntenyDisplay/model.js +1 -92
  165. package/esm/LinearSyntenyView/components/ExportSvgDialog.d.ts +2 -3
  166. package/esm/LinearSyntenyView/components/ExportSvgDialog.js +35 -53
  167. package/esm/LinearSyntenyView/components/Icons.d.ts +3 -4
  168. package/esm/LinearSyntenyView/components/Icons.js +3 -5
  169. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +8 -0
  170. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +125 -0
  171. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.d.ts +8 -0
  172. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.js +37 -0
  173. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.d.ts +7 -0
  174. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.js +16 -0
  175. package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +2 -3
  176. package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +49 -127
  177. package/esm/LinearSyntenyView/components/ImportForm/doSubmit.d.ts +5 -0
  178. package/esm/LinearSyntenyView/components/ImportForm/doSubmit.js +40 -0
  179. package/esm/LinearSyntenyView/components/ImportForm/getAdapter.d.ts +117 -0
  180. package/esm/LinearSyntenyView/components/ImportForm/getAdapter.js +65 -0
  181. package/esm/LinearSyntenyView/components/ImportForm/util.js +1 -3
  182. package/esm/LinearSyntenyView/components/LinearSyntenyView.d.ts +2 -3
  183. package/esm/LinearSyntenyView/components/LinearSyntenyView.js +3 -3
  184. package/esm/LinearSyntenyView/index.d.ts +1 -1
  185. package/esm/LinearSyntenyView/model.d.ts +54 -58
  186. package/esm/LinearSyntenyView/model.js +44 -49
  187. package/esm/LinearSyntenyView/svgcomponents/SVGBackground.d.ts +1 -2
  188. package/esm/LinearSyntenyView/svgcomponents/SVGBackground.js +3 -3
  189. package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +2 -3
  190. package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +4 -9
  191. package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +1 -1
  192. package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +8 -25
  193. package/esm/LinearSyntenyView/types.d.ts +12 -0
  194. package/esm/LinearSyntenyView/types.js +1 -0
  195. package/esm/LinearSyntenyViewHelper/index.d.ts +1 -1
  196. package/esm/LinearSyntenyViewHelper/index.js +2 -2
  197. package/esm/LinearSyntenyViewHelper/stateModelFactory.d.ts +2 -14
  198. package/esm/LinearSyntenyViewHelper/stateModelFactory.js +2 -29
  199. package/esm/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +5 -0
  200. package/esm/SyntenyFeatureDetail/LinkToSyntenyView.js +52 -0
  201. package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +2 -11
  202. package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +6 -68
  203. package/esm/SyntenyFeatureDetail/index.d.ts +1 -1
  204. package/esm/SyntenyFeatureDetail/index.js +1 -7
  205. package/esm/SyntenyFeatureDetail/types.d.ts +9 -0
  206. package/esm/SyntenyFeatureDetail/types.js +1 -0
  207. package/esm/SyntenyTrack/configSchema.d.ts +1 -1
  208. package/esm/SyntenyTrack/configSchema.js +1 -9
  209. package/esm/SyntenyTrack/index.d.ts +1 -1
  210. package/esm/SyntenyTrack/index.js +1 -1
  211. package/esm/index.d.ts +1 -1
  212. package/esm/index.js +4 -4
  213. package/esm/util.d.ts +2 -2
  214. package/esm/util.js +1 -11
  215. package/package.json +2 -4
  216. package/dist/LinearSyntenyView/components/ImportForm/AddCustomTrack.d.ts +0 -10
  217. package/dist/LinearSyntenyView/components/ImportForm/AddCustomTrack.js +0 -194
  218. package/dist/LinearSyntenyView/components/ImportForm/Spacer.d.ts +0 -2
  219. package/dist/LinearSyntenyView/components/ImportForm/Spacer.js +0 -10
  220. package/dist/LinearSyntenyView/components/ImportForm/TrackSelector.d.ts +0 -10
  221. package/dist/LinearSyntenyView/components/ImportForm/TrackSelector.js +0 -59
  222. package/dist/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.d.ts +0 -14
  223. package/dist/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.js +0 -52
  224. package/esm/LinearSyntenyView/components/ImportForm/AddCustomTrack.d.ts +0 -10
  225. package/esm/LinearSyntenyView/components/ImportForm/AddCustomTrack.js +0 -169
  226. package/esm/LinearSyntenyView/components/ImportForm/Spacer.d.ts +0 -2
  227. package/esm/LinearSyntenyView/components/ImportForm/Spacer.js +0 -4
  228. package/esm/LinearSyntenyView/components/ImportForm/TrackSelector.d.ts +0 -10
  229. package/esm/LinearSyntenyView/components/ImportForm/TrackSelector.js +0 -34
  230. package/esm/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.d.ts +0 -14
  231. package/esm/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.js +0 -23
@@ -1,38 +1,15 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.default = ReadVsRefDialog;
27
- const react_1 = __importStar(require("react"));
28
- const material_1 = require("@mui/material");
29
- const ui_1 = require("@jbrowse/core/ui");
30
- const mui_1 = require("tss-react/mui");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
31
6
  const configuration_1 = require("@jbrowse/core/configuration");
32
- const tracks_1 = require("@jbrowse/core/util/tracks");
7
+ const ui_1 = require("@jbrowse/core/ui");
33
8
  const util_1 = require("@jbrowse/core/util");
34
- // locals
9
+ const tracks_1 = require("@jbrowse/core/util/tracks");
35
10
  const plugin_alignments_1 = require("@jbrowse/plugin-alignments");
11
+ const material_1 = require("@mui/material");
12
+ const mui_1 = require("tss-react/mui");
36
13
  const { featurizeSA, getClip, getLength, getLengthSansClipping, getTag } = plugin_alignments_1.MismatchParser;
37
14
  const useStyles = (0, mui_1.makeStyles)()({
38
15
  root: {
@@ -41,16 +18,11 @@ const useStyles = (0, mui_1.makeStyles)()({
41
18
  });
42
19
  function ReadVsRefDialog({ track, feature: preFeature, handleClose, }) {
43
20
  const { classes } = useStyles();
44
- // window size stored as string, because it corresponds to a textfield which
45
- // is parsed as number on submit
46
21
  const [windowSizeText, setWindowSize] = (0, react_1.useState)('0');
47
22
  const [error, setError] = (0, react_1.useState)();
48
23
  const [primaryFeature, setPrimaryFeature] = (0, react_1.useState)();
49
24
  const windowSize = +windowSizeText;
50
- // we need to fetch the primary alignment if the selected feature is 2048.
51
- // this should be the first in the list of the SA tag
52
25
  (0, react_1.useEffect)(() => {
53
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
54
26
  ;
55
27
  (async () => {
56
28
  setError(undefined);
@@ -113,9 +85,6 @@ function ReadVsRefDialog({ track, feature: preFeature, handleClose, }) {
113
85
  const assemblyNames = [trackAssembly, readAssembly];
114
86
  const trackId = `track-${Date.now()}`;
115
87
  const trackName = `${readName}_vs_${trackAssembly}`;
116
- // get the canonical refname for the read because if the
117
- // read.get('refName') is chr1 and the actual fasta refName is 1 then no
118
- // tracks can be opened on the top panel of the linear read vs ref
119
88
  const { assemblyManager } = session;
120
89
  const assembly = assemblyManager.get(trackAssembly);
121
90
  if (!assembly) {
@@ -130,9 +99,6 @@ function ReadVsRefDialog({ track, feature: preFeature, handleClose, }) {
130
99
  start: clipPos,
131
100
  end: clipPos + getLengthSansClipping(cigar),
132
101
  };
133
- // if secondary alignment or supplementary, calculate length from SA[0]'s
134
- // CIGAR which is the primary alignments. otherwise it is the primary
135
- // alignment just use seq.length if primary alignment
136
102
  const totalLength = flags & 2048 ? getLength(suppAlns[0].CIGAR) : getLength(cigar);
137
103
  const features = [feat, ...suppAlns];
138
104
  features.forEach((f, idx) => {
@@ -143,8 +109,6 @@ function ReadVsRefDialog({ track, feature: preFeature, handleClose, }) {
143
109
  });
144
110
  features.sort((a, b) => a.clipPos - b.clipPos);
145
111
  const featSeq = feature.get('seq');
146
- // the config feature store includes synthetic mate features
147
- // mapped to the read assembly
148
112
  const configFeatureStore = [...features, ...features.map(f => f.mate)];
149
113
  const expand = 2 * windowSize;
150
114
  const refLen = features.reduce((a, f) => a + f.end - f.start + expand, 0);
@@ -170,7 +134,7 @@ function ReadVsRefDialog({ track, feature: preFeature, handleClose, }) {
170
134
  {
171
135
  start: 0,
172
136
  end: totalLength,
173
- seq: featSeq || '', // can be empty if user clicks secondary read
137
+ seq: featSeq || '',
174
138
  refName: readName,
175
139
  uniqueId: `${Math.random()}`,
176
140
  },
@@ -271,16 +235,7 @@ function ReadVsRefDialog({ track, feature: preFeature, handleClose, }) {
271
235
  setError(e);
272
236
  }
273
237
  }
274
- return (react_1.default.createElement(ui_1.Dialog, { open: true, onClose: handleClose, title: "Set window size" },
275
- react_1.default.createElement(material_1.DialogContent, null, error ? (react_1.default.createElement(material_1.Typography, { color: "error" }, `${error}`)) : !primaryFeature ? (react_1.default.createElement("div", null,
276
- react_1.default.createElement(material_1.Typography, null, "To accurately perform comparison we are fetching the primary alignment. Loading primary feature..."),
277
- react_1.default.createElement(material_1.CircularProgress, null))) : (react_1.default.createElement("div", { className: classes.root },
278
- primaryFeature.get('flags') & 256 ? (react_1.default.createElement(material_1.Typography, { style: { color: 'orange' } }, "Note: You selected a secondary alignment (which generally does not have SA tags or SEQ fields) so do a full reconstruction of the alignment")) : null,
279
- react_1.default.createElement(material_1.Typography, null, "Show an extra window size around each part of the split alignment. Using a larger value can allow you to see more genomic context."),
280
- react_1.default.createElement(material_1.TextField, { value: windowSize, onChange: event => {
281
- setWindowSize(event.target.value);
282
- }, label: "Set window size" })))),
283
- react_1.default.createElement(material_1.DialogActions, null,
284
- react_1.default.createElement(material_1.Button, { variant: "contained", color: "secondary", onClick: handleClose }, "Cancel"),
285
- react_1.default.createElement(material_1.Button, { disabled: !primaryFeature, variant: "contained", color: "primary", onClick: onSubmit }, "Submit"))));
238
+ return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, onClose: handleClose, title: "Set window size", children: [(0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: error ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { color: "error", children: `${error}` })) : !primaryFeature ? ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: "To accurately perform comparison we are fetching the primary alignment. Loading primary feature..." }), (0, jsx_runtime_1.jsx)(material_1.CircularProgress, {})] })) : ((0, jsx_runtime_1.jsxs)("div", { className: classes.root, children: [primaryFeature.get('flags') & 256 ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { style: { color: 'orange' }, children: "Note: You selected a secondary alignment (which generally does not have SA tags or SEQ fields) so do a full reconstruction of the alignment" })) : null, (0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Show an extra window size around each part of the split alignment. Using a larger value can allow you to see more genomic context." }), (0, jsx_runtime_1.jsx)(material_1.TextField, { value: windowSize, onChange: event => {
239
+ setWindowSize(event.target.value);
240
+ }, label: "Set window size" })] })) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", onClick: handleClose, children: "Cancel" }), (0, jsx_runtime_1.jsx)(material_1.Button, { disabled: !primaryFeature, variant: "contained", color: "primary", onClick: onSubmit, children: "Submit" })] })] }));
286
241
  }
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function LinearReadVsRefMenuItemF(pm: PluginManager): void;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -29,9 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
39
  exports.default = LinearReadVsRefMenuItemF;
30
40
  const react_1 = require("react");
31
41
  const util_1 = require("@jbrowse/core/util");
32
- // icons
33
42
  const Add_1 = __importDefault(require("@mui/icons-material/Add"));
34
- // locals
35
43
  const ReadVsRefDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./LinearReadVsRef'))));
36
44
  function isDisplay(elt) {
37
45
  return elt.name === 'LinearPileupDisplay';
@@ -1,2 +1,2 @@
1
- import { LinearSyntenyDisplayModel } from './model';
1
+ import type { LinearSyntenyDisplayModel } from './model';
2
2
  export declare function doAfterAttach(self: LinearSyntenyDisplayModel): void;
@@ -1,17 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.doAfterAttach = doAfterAttach;
4
- const mobx_1 = require("mobx");
5
- const mobx_state_tree_1 = require("mobx-state-tree");
6
4
  const util_1 = require("@jbrowse/core/util");
7
5
  const Base1DUtils_1 = require("@jbrowse/core/util/Base1DUtils");
8
6
  const plugin_alignments_1 = require("@jbrowse/plugin-alignments");
7
+ const mobx_1 = require("mobx");
8
+ const mobx_state_tree_1 = require("mobx-state-tree");
9
9
  const drawSynteny_1 = require("./drawSynteny");
10
10
  function doAfterAttach(self) {
11
11
  (0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
12
12
  var _a, _b;
13
13
  const view = (0, util_1.getContainingView)(self);
14
- if (!view.initialized) {
14
+ if (!view.initialized ||
15
+ !view.views.every(a => a.displayedRegions.length > 0 && a.initialized)) {
15
16
  return;
16
17
  }
17
18
  const ctx1 = (_a = self.mainCanvas) === null || _a === void 0 ? void 0 : _a.getContext('2d');
@@ -27,25 +28,20 @@ function doAfterAttach(self) {
27
28
  }));
28
29
  (0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
29
30
  const view = (0, util_1.getContainingView)(self);
30
- if (!view.initialized) {
31
+ if (!view.initialized ||
32
+ !view.views.every(a => a.displayedRegions.length > 0 && a.initialized)) {
31
33
  return;
32
34
  }
33
35
  (0, drawSynteny_1.drawMouseoverSynteny)(self);
34
36
  }));
35
- // this attempts to reduce recalculation of feature positions drawn by
36
- // the synteny view
37
- //
38
- // uses a reaction to say "we know the positions don't change in any
39
- // relevant way unless bpPerPx changes or displayedRegions changes"
40
37
  (0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.reaction)(() => {
41
38
  const view = (0, util_1.getContainingView)(self);
42
39
  return {
43
40
  bpPerPx: view.views.map(v => v.bpPerPx),
44
- // stringifying 'deeply' accesses the displayed regions, see
45
- // issue #3456
46
41
  displayedRegions: JSON.stringify(view.views.map(v => v.displayedRegions)),
47
42
  features: self.features,
48
- initialized: view.initialized,
43
+ initialized: view.initialized &&
44
+ view.views.every(a => a.displayedRegions.length > 0 && a.initialized),
49
45
  };
50
46
  }, ({ initialized }) => {
51
47
  if (!initialized) {
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
- import { LinearSyntenyDisplayModel } from '../model';
1
+ import type { LinearSyntenyDisplayModel } from '../model';
3
2
  declare const ServerSideRenderedBlockContent: ({ model, }: {
4
3
  model: LinearSyntenyDisplayModel;
5
- }) => React.JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element;
6
5
  export default ServerSideRenderedBlockContent;
@@ -1,36 +1,13 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
4
  };
28
5
  Object.defineProperty(exports, "__esModule", { value: true });
29
- const react_1 = __importStar(require("react"));
30
- const mui_1 = require("tss-react/mui");
31
- const mobx_react_1 = require("mobx-react");
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const react_1 = require("react");
32
8
  const ui_1 = require("@jbrowse/core/ui");
33
- // locals
9
+ const mobx_react_1 = require("mobx-react");
10
+ const mui_1 = require("tss-react/mui");
34
11
  const LinearSyntenyRendering_1 = __importDefault(require("./LinearSyntenyRendering"));
35
12
  const useStyles = (0, mui_1.makeStyles)()(theme => {
36
13
  const bg = theme.palette.action.disabledBackground;
@@ -53,7 +30,6 @@ const useStyles = (0, mui_1.makeStyles)()(theme => {
53
30
  };
54
31
  });
55
32
  function LoadingMessage() {
56
- // only show the loading message after 300ms to prevent excessive flickering
57
33
  const [shown, setShown] = (0, react_1.useState)(false);
58
34
  const { classes } = useStyles();
59
35
  (0, react_1.useEffect)(() => {
@@ -64,27 +40,26 @@ function LoadingMessage() {
64
40
  clearTimeout(timeout);
65
41
  };
66
42
  });
67
- return shown ? (react_1.default.createElement("div", { className: classes.loading },
68
- react_1.default.createElement(ui_1.LoadingEllipses, null))) : null;
43
+ return shown ? ((0, jsx_runtime_1.jsx)("div", { className: classes.loading, children: (0, jsx_runtime_1.jsx)(ui_1.LoadingEllipses, {}) })) : null;
69
44
  }
70
45
  function BlockMessage({ messageText }) {
71
46
  const { classes } = useStyles();
72
- return react_1.default.createElement("div", { className: classes.blockMessage }, messageText);
47
+ return (0, jsx_runtime_1.jsx)("div", { className: classes.blockMessage, children: messageText });
73
48
  }
74
49
  function BlockError({ error }) {
75
50
  const { classes } = useStyles();
76
- return react_1.default.createElement("div", { className: classes.blockError }, `${error}`);
51
+ return (0, jsx_runtime_1.jsx)("div", { className: classes.blockError, children: `${error}` });
77
52
  }
78
53
  const ServerSideRenderedBlockContent = (0, mobx_react_1.observer)(function ({ model, }) {
79
54
  if (model.error) {
80
- return react_1.default.createElement(BlockError, { error: model.error });
55
+ return (0, jsx_runtime_1.jsx)(BlockError, { error: model.error });
81
56
  }
82
57
  if (model.message) {
83
- return react_1.default.createElement(BlockMessage, { messageText: model.message });
58
+ return (0, jsx_runtime_1.jsx)(BlockMessage, { messageText: model.message });
84
59
  }
85
60
  if (!model.features) {
86
- return react_1.default.createElement(LoadingMessage, null);
61
+ return (0, jsx_runtime_1.jsx)(LoadingMessage, {});
87
62
  }
88
- return react_1.default.createElement(LinearSyntenyRendering_1.default, { model: model });
63
+ return (0, jsx_runtime_1.jsx)(LinearSyntenyRendering_1.default, { model: model });
89
64
  });
90
65
  exports.default = ServerSideRenderedBlockContent;
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
- import { LinearSyntenyDisplayModel } from '../model';
1
+ import type { LinearSyntenyDisplayModel } from '../model';
3
2
  declare const LinearSyntenyRendering: ({ model, }: {
4
3
  model: LinearSyntenyDisplayModel;
5
- }) => React.JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element;
6
5
  export default LinearSyntenyRendering;
@@ -15,21 +15,32 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
28
38
  Object.defineProperty(exports, "__esModule", { value: true });
29
- const react_1 = __importStar(require("react"));
30
- const mobx_react_1 = require("mobx-react");
39
+ const jsx_runtime_1 = require("react/jsx-runtime");
40
+ const react_1 = require("react");
31
41
  const util_1 = require("@jbrowse/core/util");
32
42
  const mobx_1 = require("mobx");
43
+ const mobx_react_1 = require("mobx-react");
33
44
  const mui_1 = require("tss-react/mui");
34
45
  const drawSynteny_1 = require("../drawSynteny");
35
46
  const SyntenyContextMenu_1 = __importDefault(require("./SyntenyContextMenu"));
@@ -61,30 +72,21 @@ const LinearSyntenyRendering = (0, mobx_react_1.observer)(function ({ model, })
61
72
  const width = view.width;
62
73
  const delta = (0, react_1.useRef)(0);
63
74
  const scheduled = (0, react_1.useRef)(false);
64
- const timeout = (0, react_1.useRef)();
75
+ const timeout = (0, react_1.useRef)(null);
65
76
  const [anchorEl, setAnchorEl] = (0, react_1.useState)();
66
77
  const [tooltip, setTooltip] = (0, react_1.useState)('');
67
78
  const [currX, setCurrX] = (0, react_1.useState)();
68
79
  const [mouseCurrDownX, setMouseCurrDownX] = (0, react_1.useState)();
69
80
  const [mouseInitialDownX, setMouseInitialDownX] = (0, react_1.useState)();
70
81
  const [currY, setCurrY] = (0, react_1.useState)();
71
- const mainSyntenyCanvasRefp = (0, react_1.useRef)();
72
- // these useCallbacks avoid new refs from being created on any mouseover,
73
- // etc.
74
- // biome-ignore lint/correctness/useExhaustiveDependencies:
82
+ const mainSyntenyCanvasRefp = (0, react_1.useRef)(null);
75
83
  const mouseoverDetectionCanvasRef = (0, react_1.useCallback)((ref) => {
76
84
  model.setMouseoverCanvasRef(ref);
77
- },
78
- // eslint-disable-next-line react-hooks/exhaustive-deps
79
- [model, height, width]);
80
- // biome-ignore lint/correctness/useExhaustiveDependencies:
85
+ }, [model, height, width]);
81
86
  const mainSyntenyCanvasRef = (0, react_1.useCallback)((ref) => {
82
87
  model.setMainCanvasRef(ref);
83
- mainSyntenyCanvasRefp.current = ref; // this ref is additionally used in useEffect below
84
- },
85
- // eslint-disable-next-line react-hooks/exhaustive-deps
86
- [model, height, width]);
87
- // biome-ignore lint/correctness/useExhaustiveDependencies:
88
+ mainSyntenyCanvasRefp.current = ref;
89
+ }, [model, height, width]);
88
90
  (0, react_1.useEffect)(() => {
89
91
  var _a;
90
92
  function onWheel(event) {
@@ -133,97 +135,84 @@ const LinearSyntenyRendering = (0, mobx_react_1.observer)(function ({ model, })
133
135
  var _a;
134
136
  (_a = mainSyntenyCanvasRefp.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('wheel', onWheel);
135
137
  };
136
- // eslint-disable-next-line react-hooks/exhaustive-deps
137
138
  }, [model, height, width]);
138
- // biome-ignore lint/correctness/useExhaustiveDependencies:
139
139
  const clickMapCanvasRef = (0, react_1.useCallback)((ref) => {
140
140
  model.setClickMapCanvasRef(ref);
141
- },
142
- // eslint-disable-next-line react-hooks/exhaustive-deps
143
- [model, height, width]);
144
- // biome-ignore lint/correctness/useExhaustiveDependencies:
141
+ }, [model, height, width]);
145
142
  const cigarClickMapCanvasRef = (0, react_1.useCallback)((ref) => {
146
143
  model.setCigarClickMapCanvasRef(ref);
147
- },
148
- // eslint-disable-next-line react-hooks/exhaustive-deps
149
- [model, height, width]);
150
- return (react_1.default.createElement("div", { className: classes.rel },
151
- react_1.default.createElement("canvas", { ref: mouseoverDetectionCanvasRef, width: width, height: height, className: classes.mouseoverCanvas }),
152
- react_1.default.createElement("canvas", { ref: mainSyntenyCanvasRef, onMouseMove: event => {
153
- var _a;
154
- if (mouseCurrDownX !== undefined) {
155
- xOffset.current += mouseCurrDownX - event.clientX;
156
- setMouseCurrDownX(event.clientX);
157
- if (!scheduled.current) {
158
- scheduled.current = true;
159
- window.requestAnimationFrame(() => {
160
- (0, mobx_1.transaction)(() => {
161
- for (const v of view.views) {
162
- v.horizontalScroll(xOffset.current);
163
- }
164
- xOffset.current = 0;
165
- scheduled.current = false;
144
+ }, [model, height, width]);
145
+ return ((0, jsx_runtime_1.jsxs)("div", { className: classes.rel, children: [(0, jsx_runtime_1.jsx)("canvas", { ref: mouseoverDetectionCanvasRef, width: width, height: height, className: classes.mouseoverCanvas }), (0, jsx_runtime_1.jsx)("canvas", { ref: mainSyntenyCanvasRef, onMouseMove: event => {
146
+ var _a;
147
+ if (mouseCurrDownX !== undefined) {
148
+ xOffset.current += mouseCurrDownX - event.clientX;
149
+ setMouseCurrDownX(event.clientX);
150
+ if (!scheduled.current) {
151
+ scheduled.current = true;
152
+ window.requestAnimationFrame(() => {
153
+ (0, mobx_1.transaction)(() => {
154
+ for (const v of view.views) {
155
+ v.horizontalScroll(xOffset.current);
156
+ }
157
+ xOffset.current = 0;
158
+ scheduled.current = false;
159
+ });
166
160
  });
167
- });
168
- }
169
- }
170
- else {
171
- const ref1 = model.clickMapCanvas;
172
- const ref2 = model.cigarClickMapCanvas;
173
- if (!ref1 || !ref2) {
174
- return;
161
+ }
175
162
  }
176
- const rect = ref1.getBoundingClientRect();
177
- const ctx1 = ref1.getContext('2d');
178
- const ctx2 = ref2.getContext('2d');
179
- if (!ctx1 || !ctx2) {
180
- return;
163
+ else {
164
+ const ref1 = model.clickMapCanvas;
165
+ const ref2 = model.cigarClickMapCanvas;
166
+ if (!ref1 || !ref2) {
167
+ return;
168
+ }
169
+ const rect = ref1.getBoundingClientRect();
170
+ const ctx1 = ref1.getContext('2d');
171
+ const ctx2 = ref2.getContext('2d');
172
+ if (!ctx1 || !ctx2) {
173
+ return;
174
+ }
175
+ const { clientX, clientY } = event;
176
+ const x = clientX - rect.left;
177
+ const y = clientY - rect.top;
178
+ setCurrX(clientX);
179
+ setCurrY(clientY);
180
+ const [r1, g1, b1] = ctx1.getImageData(x, y, 1, 1).data;
181
+ const [r2, g2, b2] = ctx2.getImageData(x, y, 1, 1).data;
182
+ const unitMultiplier = Math.floor(drawSynteny_1.MAX_COLOR_RANGE / model.numFeats);
183
+ const id = (0, drawSynteny_1.getId)(r1, g1, b1, unitMultiplier);
184
+ model.setMouseoverId((_a = model.featPositions[id]) === null || _a === void 0 ? void 0 : _a.f.id());
185
+ if (id === -1) {
186
+ setTooltip('');
187
+ }
188
+ else if (model.featPositions[id]) {
189
+ const { f, cigar } = model.featPositions[id];
190
+ const unitMultiplier2 = Math.floor(drawSynteny_1.MAX_COLOR_RANGE / cigar.length);
191
+ const cigarIdx = (0, drawSynteny_1.getId)(r2, g2, b2, unitMultiplier2);
192
+ setTooltip((0, util_2.getTooltip)({
193
+ feature: f,
194
+ cigarOp: cigar[cigarIdx],
195
+ cigarOpLen: cigar[cigarIdx + 1],
196
+ }));
197
+ }
181
198
  }
182
- const { clientX, clientY } = event;
183
- const x = clientX - rect.left;
184
- const y = clientY - rect.top;
185
- setCurrX(clientX);
186
- setCurrY(clientY);
187
- const [r1, g1, b1] = ctx1.getImageData(x, y, 1, 1).data;
188
- const [r2, g2, b2] = ctx2.getImageData(x, y, 1, 1).data;
189
- const unitMultiplier = Math.floor(drawSynteny_1.MAX_COLOR_RANGE / model.numFeats);
190
- const id = (0, drawSynteny_1.getId)(r1, g1, b1, unitMultiplier);
191
- model.setMouseoverId((_a = model.featPositions[id]) === null || _a === void 0 ? void 0 : _a.f.id());
192
- if (id === -1) {
193
- setTooltip('');
199
+ }, onMouseLeave: () => {
200
+ model.setMouseoverId(undefined);
201
+ setMouseInitialDownX(undefined);
202
+ setMouseCurrDownX(undefined);
203
+ }, onMouseDown: evt => {
204
+ setMouseCurrDownX(evt.clientX);
205
+ setMouseInitialDownX(evt.clientX);
206
+ }, onMouseUp: evt => {
207
+ setMouseCurrDownX(undefined);
208
+ if (mouseInitialDownX !== undefined &&
209
+ Math.abs(evt.clientX - mouseInitialDownX) < 5) {
210
+ (0, util_2.onSynClick)(evt, model);
194
211
  }
195
- else if (model.featPositions[id]) {
196
- const { f, cigar } = model.featPositions[id];
197
- const unitMultiplier2 = Math.floor(drawSynteny_1.MAX_COLOR_RANGE / cigar.length);
198
- const cigarIdx = (0, drawSynteny_1.getId)(r2, g2, b2, unitMultiplier2);
199
- setTooltip((0, util_2.getTooltip)({
200
- feature: f,
201
- cigarOp: cigar[cigarIdx],
202
- cigarOpLen: cigar[cigarIdx + 1],
203
- }));
204
- }
205
- }
206
- }, onMouseLeave: () => {
207
- model.setMouseoverId(undefined);
208
- setMouseInitialDownX(undefined);
209
- setMouseCurrDownX(undefined);
210
- }, onMouseDown: evt => {
211
- setMouseCurrDownX(evt.clientX);
212
- setMouseInitialDownX(evt.clientX);
213
- }, onMouseUp: evt => {
214
- setMouseCurrDownX(undefined);
215
- if (mouseInitialDownX !== undefined &&
216
- Math.abs(evt.clientX - mouseInitialDownX) < 5) {
217
- (0, util_2.onSynClick)(evt, model);
218
- }
219
- }, onContextMenu: evt => {
220
- (0, util_2.onSynContextClick)(evt, model, setAnchorEl);
221
- }, "data-testid": "synteny_canvas", className: classes.mainCanvas, width: width, height: height }),
222
- react_1.default.createElement("canvas", { ref: clickMapCanvasRef, className: classes.pix, width: width, height: height }),
223
- react_1.default.createElement("canvas", { ref: cigarClickMapCanvasRef, className: classes.pix, width: width, height: height }),
224
- mouseoverId && tooltip && currX && currY ? (react_1.default.createElement(SyntenyTooltip, { title: tooltip })) : null,
225
- anchorEl ? (react_1.default.createElement(SyntenyContextMenu_1.default, { model: model, anchorEl: anchorEl, onClose: () => {
226
- setAnchorEl(undefined);
227
- } })) : null));
212
+ }, onContextMenu: evt => {
213
+ (0, util_2.onSynContextClick)(evt, model, setAnchorEl);
214
+ }, "data-testid": "synteny_canvas", className: classes.mainCanvas, width: width, height: height }), (0, jsx_runtime_1.jsx)("canvas", { ref: clickMapCanvasRef, className: classes.pix, width: width, height: height }), (0, jsx_runtime_1.jsx)("canvas", { ref: cigarClickMapCanvasRef, className: classes.pix, width: width, height: height }), mouseoverId && tooltip && currX && currY ? ((0, jsx_runtime_1.jsx)(SyntenyTooltip, { title: tooltip })) : null, anchorEl ? ((0, jsx_runtime_1.jsx)(SyntenyContextMenu_1.default, { model: model, anchorEl: anchorEl, onClose: () => {
215
+ setAnchorEl(undefined);
216
+ } })) : null] }));
228
217
  });
229
218
  exports.default = LinearSyntenyRendering;
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
- import { Feature } from '@jbrowse/core/util';
3
- import { LinearSyntenyDisplayModel } from '../model';
1
+ import type { LinearSyntenyDisplayModel } from '../model';
2
+ import type { Feature } from '@jbrowse/core/util';
4
3
  interface ClickCoord {
5
4
  clientX: number;
6
5
  clientY: number;
@@ -12,5 +11,5 @@ export default function SyntenyContextMenu({ model, onClose, anchorEl, }: {
12
11
  onClose: () => void;
13
12
  model: LinearSyntenyDisplayModel;
14
13
  anchorEl: ClickCoord;
15
- }): React.JSX.Element;
14
+ }): import("react/jsx-runtime").JSX.Element;
16
15
  export {};
@@ -1,16 +1,13 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.default = SyntenyContextMenu;
7
- const react_1 = __importDefault(require("react"));
8
- const util_1 = require("@jbrowse/core/util");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
9
5
  const ui_1 = require("@jbrowse/core/ui");
6
+ const util_1 = require("@jbrowse/core/util");
10
7
  function SyntenyContextMenu({ model, onClose, anchorEl, }) {
11
8
  const view = (0, util_1.getContainingView)(model);
12
9
  const { clientX, clientY, feature } = anchorEl;
13
- return (react_1.default.createElement(ui_1.Menu, { onMenuItemClick: (event, callback) => {
10
+ return ((0, jsx_runtime_1.jsx)(ui_1.Menu, { onMenuItemClick: (event, callback) => {
14
11
  callback(event);
15
12
  onClose();
16
13
  }, anchorEl: {
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
1
  declare const SyntenyTooltip: ({ title }: {
3
2
  title: string;
4
- }) => React.JSX.Element | null;
3
+ }) => import("react/jsx-runtime").JSX.Element | null;
5
4
  export default SyntenyTooltip;