@jbrowse/plugin-linear-comparative-view 2.17.0 → 2.18.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 (184) hide show
  1. package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +1 -1
  2. package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +0 -2
  3. package/dist/LGVSyntenyDisplay/components/util.d.ts +3 -3
  4. package/dist/LGVSyntenyDisplay/components/util.js +0 -1
  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 +102 -63
  10. package/dist/LGVSyntenyDisplay/model.js +1 -29
  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 +1 -1
  19. package/dist/LinearComparativeView/components/Header.js +4 -5
  20. package/dist/LinearComparativeView/components/HeaderSearchBoxes.d.ts +1 -1
  21. package/dist/LinearComparativeView/components/HeaderSearchBoxes.js +3 -4
  22. package/dist/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +1 -1
  23. package/dist/LinearComparativeView/components/LinearComparativeRenderArea.js +8 -15
  24. package/dist/LinearComparativeView/components/LinearComparativeView.d.ts +1 -1
  25. package/dist/LinearComparativeView/components/LinearComparativeView.js +2 -4
  26. package/dist/LinearComparativeView/components/Rubberband.d.ts +1 -1
  27. package/dist/LinearComparativeView/components/Rubberband.js +17 -19
  28. package/dist/LinearComparativeView/components/VerticalGuide.d.ts +1 -1
  29. package/dist/LinearComparativeView/components/VerticalGuide.js +1 -1
  30. package/dist/LinearComparativeView/index.d.ts +1 -1
  31. package/dist/LinearComparativeView/model.d.ts +6 -62
  32. package/dist/LinearComparativeView/model.js +3 -99
  33. package/dist/LinearReadVsRef/LinearReadVsRef.d.ts +1 -1
  34. package/dist/LinearReadVsRef/LinearReadVsRef.js +5 -19
  35. package/dist/LinearReadVsRef/index.d.ts +1 -1
  36. package/dist/LinearReadVsRef/index.js +0 -2
  37. package/dist/LinearSyntenyDisplay/afterAttach.d.ts +1 -1
  38. package/dist/LinearSyntenyDisplay/afterAttach.js +2 -9
  39. package/dist/LinearSyntenyDisplay/components/Component.d.ts +1 -1
  40. package/dist/LinearSyntenyDisplay/components/Component.js +2 -4
  41. package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +1 -1
  42. package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +6 -22
  43. package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +2 -2
  44. package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.js +1 -1
  45. package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.js +1 -1
  46. package/dist/LinearSyntenyDisplay/components/util.d.ts +3 -3
  47. package/dist/LinearSyntenyDisplay/components/util.js +0 -9
  48. package/dist/LinearSyntenyDisplay/configSchemaF.d.ts +1 -12
  49. package/dist/LinearSyntenyDisplay/configSchemaF.js +0 -15
  50. package/dist/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
  51. package/dist/LinearSyntenyDisplay/drawSynteny.js +1 -23
  52. package/dist/LinearSyntenyDisplay/index.d.ts +1 -1
  53. package/dist/LinearSyntenyDisplay/index.js +1 -2
  54. package/dist/LinearSyntenyDisplay/model.d.ts +8 -102
  55. package/dist/LinearSyntenyDisplay/model.js +1 -92
  56. package/dist/LinearSyntenyView/components/ExportSvgDialog.d.ts +1 -1
  57. package/dist/LinearSyntenyView/components/ExportSvgDialog.js +2 -4
  58. package/dist/LinearSyntenyView/components/Icons.d.ts +1 -1
  59. package/dist/LinearSyntenyView/components/ImportForm/AddCustomTrack.d.ts +2 -2
  60. package/dist/LinearSyntenyView/components/ImportForm/AddCustomTrack.js +1 -1
  61. package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +1 -1
  62. package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +6 -8
  63. package/dist/LinearSyntenyView/components/ImportForm/TrackSelector.d.ts +1 -1
  64. package/dist/LinearSyntenyView/components/ImportForm/TrackSelector.js +3 -5
  65. package/dist/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.d.ts +3 -3
  66. package/dist/LinearSyntenyView/components/ImportForm/util.js +1 -3
  67. package/dist/LinearSyntenyView/components/LinearSyntenyView.d.ts +1 -1
  68. package/dist/LinearSyntenyView/components/LinearSyntenyView.js +0 -1
  69. package/dist/LinearSyntenyView/index.d.ts +1 -1
  70. package/dist/LinearSyntenyView/model.d.ts +5 -28
  71. package/dist/LinearSyntenyView/model.js +4 -41
  72. package/dist/LinearSyntenyView/svgcomponents/SVGBackground.js +1 -1
  73. package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +1 -1
  74. package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +1 -1
  75. package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +1 -1
  76. package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +5 -10
  77. package/dist/LinearSyntenyViewHelper/index.d.ts +1 -1
  78. package/dist/LinearSyntenyViewHelper/stateModelFactory.d.ts +2 -14
  79. package/dist/LinearSyntenyViewHelper/stateModelFactory.js +2 -29
  80. package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +1 -1
  81. package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +4 -13
  82. package/dist/SyntenyFeatureDetail/index.d.ts +1 -1
  83. package/dist/SyntenyFeatureDetail/index.js +1 -7
  84. package/dist/SyntenyTrack/configSchema.d.ts +1 -1
  85. package/dist/SyntenyTrack/configSchema.js +1 -9
  86. package/dist/SyntenyTrack/index.d.ts +1 -1
  87. package/dist/SyntenyTrack/index.js +1 -1
  88. package/dist/index.d.ts +1 -1
  89. package/dist/index.js +4 -4
  90. package/dist/util.d.ts +2 -2
  91. package/dist/util.js +1 -11
  92. package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +1 -1
  93. package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +0 -2
  94. package/esm/LGVSyntenyDisplay/components/util.d.ts +3 -3
  95. package/esm/LGVSyntenyDisplay/components/util.js +0 -1
  96. package/esm/LGVSyntenyDisplay/configSchemaF.d.ts +19 -10
  97. package/esm/LGVSyntenyDisplay/configSchemaF.js +12 -9
  98. package/esm/LGVSyntenyDisplay/index.d.ts +1 -1
  99. package/esm/LGVSyntenyDisplay/index.js +1 -1
  100. package/esm/LGVSyntenyDisplay/model.d.ts +102 -63
  101. package/esm/LGVSyntenyDisplay/model.js +2 -30
  102. package/esm/LaunchLinearSyntenyView.d.ts +1 -1
  103. package/esm/LaunchLinearSyntenyView.js +1 -3
  104. package/esm/LinearComparativeDisplay/configSchemaF.d.ts +0 -3
  105. package/esm/LinearComparativeDisplay/configSchemaF.js +0 -6
  106. package/esm/LinearComparativeDisplay/index.d.ts +1 -1
  107. package/esm/LinearComparativeDisplay/stateModelFactory.d.ts +12 -69
  108. package/esm/LinearComparativeDisplay/stateModelFactory.js +14 -58
  109. package/esm/LinearComparativeView/components/Header.d.ts +1 -1
  110. package/esm/LinearComparativeView/components/Header.js +4 -5
  111. package/esm/LinearComparativeView/components/HeaderSearchBoxes.d.ts +1 -1
  112. package/esm/LinearComparativeView/components/HeaderSearchBoxes.js +3 -4
  113. package/esm/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +1 -1
  114. package/esm/LinearComparativeView/components/LinearComparativeRenderArea.js +8 -15
  115. package/esm/LinearComparativeView/components/LinearComparativeView.d.ts +1 -1
  116. package/esm/LinearComparativeView/components/LinearComparativeView.js +2 -4
  117. package/esm/LinearComparativeView/components/Rubberband.d.ts +1 -1
  118. package/esm/LinearComparativeView/components/Rubberband.js +18 -20
  119. package/esm/LinearComparativeView/components/VerticalGuide.d.ts +1 -1
  120. package/esm/LinearComparativeView/components/VerticalGuide.js +1 -1
  121. package/esm/LinearComparativeView/index.d.ts +1 -1
  122. package/esm/LinearComparativeView/model.d.ts +6 -62
  123. package/esm/LinearComparativeView/model.js +4 -100
  124. package/esm/LinearReadVsRef/LinearReadVsRef.d.ts +1 -1
  125. package/esm/LinearReadVsRef/LinearReadVsRef.js +5 -19
  126. package/esm/LinearReadVsRef/index.d.ts +1 -1
  127. package/esm/LinearReadVsRef/index.js +1 -3
  128. package/esm/LinearSyntenyDisplay/afterAttach.d.ts +1 -1
  129. package/esm/LinearSyntenyDisplay/afterAttach.js +2 -9
  130. package/esm/LinearSyntenyDisplay/components/Component.d.ts +1 -1
  131. package/esm/LinearSyntenyDisplay/components/Component.js +2 -4
  132. package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +1 -1
  133. package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +8 -24
  134. package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +2 -2
  135. package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.js +1 -1
  136. package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.js +1 -1
  137. package/esm/LinearSyntenyDisplay/components/util.d.ts +3 -3
  138. package/esm/LinearSyntenyDisplay/components/util.js +2 -11
  139. package/esm/LinearSyntenyDisplay/configSchemaF.d.ts +1 -12
  140. package/esm/LinearSyntenyDisplay/configSchemaF.js +0 -15
  141. package/esm/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
  142. package/esm/LinearSyntenyDisplay/drawSynteny.js +1 -23
  143. package/esm/LinearSyntenyDisplay/index.d.ts +1 -1
  144. package/esm/LinearSyntenyDisplay/index.js +1 -2
  145. package/esm/LinearSyntenyDisplay/model.d.ts +8 -102
  146. package/esm/LinearSyntenyDisplay/model.js +1 -92
  147. package/esm/LinearSyntenyView/components/ExportSvgDialog.d.ts +1 -1
  148. package/esm/LinearSyntenyView/components/ExportSvgDialog.js +2 -4
  149. package/esm/LinearSyntenyView/components/Icons.d.ts +1 -1
  150. package/esm/LinearSyntenyView/components/ImportForm/AddCustomTrack.d.ts +2 -2
  151. package/esm/LinearSyntenyView/components/ImportForm/AddCustomTrack.js +2 -2
  152. package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +1 -1
  153. package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +6 -8
  154. package/esm/LinearSyntenyView/components/ImportForm/TrackSelector.d.ts +1 -1
  155. package/esm/LinearSyntenyView/components/ImportForm/TrackSelector.js +4 -6
  156. package/esm/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.d.ts +3 -3
  157. package/esm/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.js +1 -1
  158. package/esm/LinearSyntenyView/components/ImportForm/util.js +1 -3
  159. package/esm/LinearSyntenyView/components/LinearSyntenyView.d.ts +1 -1
  160. package/esm/LinearSyntenyView/components/LinearSyntenyView.js +0 -1
  161. package/esm/LinearSyntenyView/index.d.ts +1 -1
  162. package/esm/LinearSyntenyView/model.d.ts +5 -28
  163. package/esm/LinearSyntenyView/model.js +4 -41
  164. package/esm/LinearSyntenyView/svgcomponents/SVGBackground.js +1 -1
  165. package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +1 -1
  166. package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +2 -2
  167. package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +1 -1
  168. package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +6 -11
  169. package/esm/LinearSyntenyViewHelper/index.d.ts +1 -1
  170. package/esm/LinearSyntenyViewHelper/stateModelFactory.d.ts +2 -14
  171. package/esm/LinearSyntenyViewHelper/stateModelFactory.js +2 -29
  172. package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +1 -1
  173. package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +4 -13
  174. package/esm/SyntenyFeatureDetail/index.d.ts +1 -1
  175. package/esm/SyntenyFeatureDetail/index.js +1 -7
  176. package/esm/SyntenyTrack/configSchema.d.ts +1 -1
  177. package/esm/SyntenyTrack/configSchema.js +1 -9
  178. package/esm/SyntenyTrack/index.d.ts +1 -1
  179. package/esm/SyntenyTrack/index.js +1 -1
  180. package/esm/index.d.ts +1 -1
  181. package/esm/index.js +4 -4
  182. package/esm/util.d.ts +2 -2
  183. package/esm/util.js +1 -11
  184. package/package.json +2 -4
@@ -1,97 +1,45 @@
1
1
  import { lazy } from 'react';
2
- import { addDisposer, cast, getPath, types, } from 'mobx-state-tree';
3
- import { autorun } from 'mobx';
4
- // jbrowse
5
2
  import BaseViewModel from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
6
- import { getSession, isSessionModelWithWidgets, avg } from '@jbrowse/core/util';
3
+ import { avg, getSession, isSessionModelWithWidgets } from '@jbrowse/core/util';
7
4
  import { ElementId } from '@jbrowse/core/util/types/mst';
8
- // icons
9
5
  import FolderOpenIcon from '@mui/icons-material/FolderOpen';
10
- // lazies
6
+ import { autorun } from 'mobx';
7
+ import { addDisposer, cast, getPath, types } from 'mobx-state-tree';
11
8
  const ReturnToImportFormDialog = lazy(() => import('@jbrowse/core/ui/ReturnToImportFormDialog'));
12
- /**
13
- * #stateModel LinearComparativeView
14
- * extends
15
- * - [BaseViewModel](../baseviewmodel)
16
- */
17
9
  function stateModelFactory(pluginManager) {
18
10
  var _a;
19
11
  const LinearSyntenyViewHelper = (_a = pluginManager.getViewType('LinearSyntenyViewHelper')) === null || _a === void 0 ? void 0 : _a.stateModel;
20
12
  return types
21
13
  .compose('LinearComparativeView', BaseViewModel, types.model({
22
- /**
23
- * #property
24
- */
25
14
  id: ElementId,
26
- /**
27
- * #property
28
- */
29
15
  type: types.literal('LinearComparativeView'),
30
- /**
31
- * #property
32
- */
33
16
  trackSelectorType: 'hierarchical',
34
- /**
35
- * #property
36
- */
37
17
  showIntraviewLinks: true,
38
- /**
39
- * #property
40
- */
41
18
  interactToggled: false,
42
- /**
43
- * #property
44
- */
45
19
  levels: types.array(LinearSyntenyViewHelper),
46
- /**
47
- * #property
48
- * currently this is limited to an array of two
49
- */
50
20
  views: types.array(pluginManager.getViewType('LinearGenomeView')
51
21
  .stateModel),
52
- /**
53
- * #property
54
- * this represents tracks specific to this view specifically used for
55
- * read vs ref dotplots where this track would not really apply
56
- * elsewhere
57
- */
58
22
  viewTrackConfigs: types.array(pluginManager.pluggableConfigSchemaType('track')),
59
23
  }))
60
24
  .volatile(() => ({
61
- /**
62
- * #volatile
63
- */
64
25
  width: undefined,
65
26
  }))
66
27
  .views(self => ({
67
- /**
68
- * #getter
69
- */
70
28
  get initialized() {
71
- return (
72
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
73
- self.width !== undefined &&
29
+ return (self.width !== undefined &&
74
30
  self.views.length > 0 &&
75
31
  self.views.every(view => view.initialized));
76
32
  },
77
- /**
78
- * #getter
79
- */
80
33
  get refNames() {
81
34
  return self.views.map(v => [
82
35
  ...new Set(v.staticBlocks.map(m => m.refName)),
83
36
  ]);
84
37
  },
85
- /**
86
- * #getter
87
- */
88
38
  get assemblyNames() {
89
39
  return [...new Set(self.views.flatMap(v => v.assemblyNames))];
90
40
  },
91
41
  }))
92
42
  .actions(self => ({
93
- // automatically removes session assemblies associated with this view
94
- // e.g. read vs ref
95
43
  beforeDestroy() {
96
44
  var _a;
97
45
  const session = getSession(self);
@@ -103,40 +51,24 @@ function stateModelFactory(pluginManager) {
103
51
  self.views.forEach(view => {
104
52
  const ret = getPath(view);
105
53
  if (!ret.endsWith(path)) {
106
- // @ts-expect-error
107
54
  view[actionName](args === null || args === void 0 ? void 0 : args[0]);
108
55
  }
109
56
  });
110
57
  },
111
- /**
112
- * #action
113
- */
114
58
  setWidth(newWidth) {
115
59
  self.width = newWidth;
116
60
  },
117
- /**
118
- * #action
119
- */
120
61
  setViews(views) {
121
62
  self.views = cast(views);
122
63
  },
123
- /**
124
- * #action
125
- */
126
64
  removeView(view) {
127
65
  self.views.remove(view);
128
66
  },
129
- /**
130
- * #action
131
- */
132
67
  setLevelHeight(newHeight, level = 0) {
133
68
  const l = self.levels[level];
134
69
  l.setHeight(newHeight);
135
70
  return l.height;
136
71
  },
137
- /**
138
- * #action
139
- */
140
72
  activateTrackSelector(level) {
141
73
  if (self.trackSelectorType === 'hierarchical') {
142
74
  const session = getSession(self);
@@ -150,32 +82,20 @@ function stateModelFactory(pluginManager) {
150
82
  }
151
83
  throw new Error(`invalid track selector type ${self.trackSelectorType}`);
152
84
  },
153
- /**
154
- * #action
155
- */
156
85
  toggleTrack(trackId, level = 0) {
157
86
  var _a;
158
87
  (_a = self.levels[level]) === null || _a === void 0 ? void 0 : _a.toggleTrack(trackId);
159
88
  },
160
- /**
161
- * #action
162
- */
163
89
  showTrack(trackId, level = 0, initialSnapshot = {}) {
164
90
  if (!self.levels[level]) {
165
91
  self.levels[level] = cast({ level });
166
92
  }
167
93
  self.levels[level].showTrack(trackId, initialSnapshot);
168
94
  },
169
- /**
170
- * #action
171
- */
172
95
  hideTrack(trackId, level = 0) {
173
96
  var _a;
174
97
  (_a = self.levels[level]) === null || _a === void 0 ? void 0 : _a.hideTrack(trackId);
175
98
  },
176
- /**
177
- * #action
178
- */
179
99
  squareView() {
180
100
  const average = avg(self.views.map(v => v.bpPerPx));
181
101
  for (const view of self.views) {
@@ -186,28 +106,17 @@ function stateModelFactory(pluginManager) {
186
106
  }
187
107
  }
188
108
  },
189
- /**
190
- * #action
191
- */
192
109
  clearView() {
193
110
  self.views = cast([]);
194
111
  self.levels = cast([]);
195
112
  },
196
113
  }))
197
114
  .views(() => ({
198
- /**
199
- * #method
200
- * includes a subset of view menu options because the full list is a
201
- * little overwhelming. overridden by subclasses
202
- */
203
115
  headerMenuItems() {
204
116
  return [];
205
117
  },
206
118
  }))
207
119
  .views(self => ({
208
- /**
209
- * #method
210
- */
211
120
  menuItems() {
212
121
  return [
213
122
  {
@@ -225,9 +134,6 @@ function stateModelFactory(pluginManager) {
225
134
  },
226
135
  ];
227
136
  },
228
- /**
229
- * #method
230
- */
231
137
  rubberBandMenuItems() {
232
138
  return [
233
139
  {
@@ -256,8 +162,6 @@ function stateModelFactory(pluginManager) {
256
162
  },
257
163
  }))
258
164
  .preProcessSnapshot(snap => {
259
- // @ts-expect-error
260
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
261
165
  const { tracks, levels = [{ tracks, level: 0 }], ...rest } = snap || {};
262
166
  return {
263
167
  ...rest,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Feature } from '@jbrowse/core/util';
2
+ import type { Feature } from '@jbrowse/core/util';
3
3
  export default function ReadVsRefDialog({ track, feature: preFeature, handleClose, }: {
4
4
  feature: Feature;
5
5
  handleClose: () => void;
@@ -1,12 +1,11 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { Button, CircularProgress, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
3
- import { Dialog } from '@jbrowse/core/ui';
4
- import { makeStyles } from 'tss-react/mui';
5
2
  import { getConf } from '@jbrowse/core/configuration';
3
+ import { Dialog } from '@jbrowse/core/ui';
4
+ import { gatherOverlaps, getContainingView, getSession, } from '@jbrowse/core/util';
6
5
  import { getRpcSessionId } from '@jbrowse/core/util/tracks';
7
- import { getSession, getContainingView, gatherOverlaps, } from '@jbrowse/core/util';
8
- // locals
9
6
  import { MismatchParser } from '@jbrowse/plugin-alignments';
7
+ import { Button, CircularProgress, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
8
+ import { makeStyles } from 'tss-react/mui';
10
9
  const { featurizeSA, getClip, getLength, getLengthSansClipping, getTag } = MismatchParser;
11
10
  const useStyles = makeStyles()({
12
11
  root: {
@@ -15,16 +14,11 @@ const useStyles = makeStyles()({
15
14
  });
16
15
  export default function ReadVsRefDialog({ track, feature: preFeature, handleClose, }) {
17
16
  const { classes } = useStyles();
18
- // window size stored as string, because it corresponds to a textfield which
19
- // is parsed as number on submit
20
17
  const [windowSizeText, setWindowSize] = useState('0');
21
18
  const [error, setError] = useState();
22
19
  const [primaryFeature, setPrimaryFeature] = useState();
23
20
  const windowSize = +windowSizeText;
24
- // we need to fetch the primary alignment if the selected feature is 2048.
25
- // this should be the first in the list of the SA tag
26
21
  useEffect(() => {
27
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
28
22
  ;
29
23
  (async () => {
30
24
  setError(undefined);
@@ -87,9 +81,6 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
87
81
  const assemblyNames = [trackAssembly, readAssembly];
88
82
  const trackId = `track-${Date.now()}`;
89
83
  const trackName = `${readName}_vs_${trackAssembly}`;
90
- // get the canonical refname for the read because if the
91
- // read.get('refName') is chr1 and the actual fasta refName is 1 then no
92
- // tracks can be opened on the top panel of the linear read vs ref
93
84
  const { assemblyManager } = session;
94
85
  const assembly = assemblyManager.get(trackAssembly);
95
86
  if (!assembly) {
@@ -104,9 +95,6 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
104
95
  start: clipPos,
105
96
  end: clipPos + getLengthSansClipping(cigar),
106
97
  };
107
- // if secondary alignment or supplementary, calculate length from SA[0]'s
108
- // CIGAR which is the primary alignments. otherwise it is the primary
109
- // alignment just use seq.length if primary alignment
110
98
  const totalLength = flags & 2048 ? getLength(suppAlns[0].CIGAR) : getLength(cigar);
111
99
  const features = [feat, ...suppAlns];
112
100
  features.forEach((f, idx) => {
@@ -117,8 +105,6 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
117
105
  });
118
106
  features.sort((a, b) => a.clipPos - b.clipPos);
119
107
  const featSeq = feature.get('seq');
120
- // the config feature store includes synthetic mate features
121
- // mapped to the read assembly
122
108
  const configFeatureStore = [...features, ...features.map(f => f.mate)];
123
109
  const expand = 2 * windowSize;
124
110
  const refLen = features.reduce((a, f) => a + f.end - f.start + expand, 0);
@@ -144,7 +130,7 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
144
130
  {
145
131
  start: 0,
146
132
  end: totalLength,
147
- seq: featSeq || '', // can be empty if user clicks secondary read
133
+ seq: featSeq || '',
148
134
  refName: readName,
149
135
  uniqueId: `${Math.random()}`,
150
136
  },
@@ -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;
@@ -1,8 +1,6 @@
1
1
  import { lazy } from 'react';
2
- import { getSession, getContainingTrack } from '@jbrowse/core/util';
3
- // icons
2
+ import { getContainingTrack, getSession } from '@jbrowse/core/util';
4
3
  import AddIcon from '@mui/icons-material/Add';
5
- // locals
6
4
  const ReadVsRefDialog = lazy(() => import('./LinearReadVsRef'));
7
5
  function isDisplay(elt) {
8
6
  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,8 +1,8 @@
1
- import { reaction, autorun } from 'mobx';
2
- import { addDisposer, getSnapshot } from 'mobx-state-tree';
3
1
  import { getContainingView, getSession } from '@jbrowse/core/util';
4
2
  import { bpToPx } from '@jbrowse/core/util/Base1DUtils';
5
3
  import { MismatchParser } from '@jbrowse/plugin-alignments';
4
+ import { autorun, reaction } from 'mobx';
5
+ import { addDisposer, getSnapshot } from 'mobx-state-tree';
6
6
  import { drawMouseoverSynteny, drawRef } from './drawSynteny';
7
7
  export function doAfterAttach(self) {
8
8
  addDisposer(self, autorun(() => {
@@ -29,17 +29,10 @@ export function doAfterAttach(self) {
29
29
  }
30
30
  drawMouseoverSynteny(self);
31
31
  }));
32
- // this attempts to reduce recalculation of feature positions drawn by
33
- // the synteny view
34
- //
35
- // uses a reaction to say "we know the positions don't change in any
36
- // relevant way unless bpPerPx changes or displayedRegions changes"
37
32
  addDisposer(self, reaction(() => {
38
33
  const view = getContainingView(self);
39
34
  return {
40
35
  bpPerPx: view.views.map(v => v.bpPerPx),
41
- // stringifying 'deeply' accesses the displayed regions, see
42
- // issue #3456
43
36
  displayedRegions: JSON.stringify(view.views.map(v => v.displayedRegions)),
44
37
  features: self.features,
45
38
  initialized: view.initialized,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { LinearSyntenyDisplayModel } from '../model';
2
+ import type { LinearSyntenyDisplayModel } from '../model';
3
3
  declare const ServerSideRenderedBlockContent: ({ model, }: {
4
4
  model: LinearSyntenyDisplayModel;
5
5
  }) => React.JSX.Element;
@@ -1,8 +1,7 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { makeStyles } from 'tss-react/mui';
3
- import { observer } from 'mobx-react';
4
2
  import { LoadingEllipses } from '@jbrowse/core/ui';
5
- // locals
3
+ import { observer } from 'mobx-react';
4
+ import { makeStyles } from 'tss-react/mui';
6
5
  import LinearSyntenyRendering from './LinearSyntenyRendering';
7
6
  const useStyles = makeStyles()(theme => {
8
7
  const bg = theme.palette.action.disabledBackground;
@@ -25,7 +24,6 @@ const useStyles = makeStyles()(theme => {
25
24
  };
26
25
  });
27
26
  function LoadingMessage() {
28
- // only show the loading message after 300ms to prevent excessive flickering
29
27
  const [shown, setShown] = useState(false);
30
28
  const { classes } = useStyles();
31
29
  useEffect(() => {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { LinearSyntenyDisplayModel } from '../model';
2
+ import type { LinearSyntenyDisplayModel } from '../model';
3
3
  declare const LinearSyntenyRendering: ({ model, }: {
4
4
  model: LinearSyntenyDisplayModel;
5
5
  }) => React.JSX.Element;
@@ -1,9 +1,9 @@
1
- import React, { useState, useCallback, useRef, lazy, useEffect } from 'react';
2
- import { observer } from 'mobx-react';
1
+ import React, { lazy, useCallback, useEffect, useRef, useState } from 'react';
3
2
  import { getContainingView } from '@jbrowse/core/util';
4
3
  import { transaction } from 'mobx';
4
+ import { observer } from 'mobx-react';
5
5
  import { makeStyles } from 'tss-react/mui';
6
- import { getId, MAX_COLOR_RANGE } from '../drawSynteny';
6
+ import { MAX_COLOR_RANGE, getId } from '../drawSynteny';
7
7
  import SyntenyContextMenu from './SyntenyContextMenu';
8
8
  import { getTooltip, onSynClick, onSynContextClick } from './util';
9
9
  const SyntenyTooltip = lazy(() => import('./SyntenyTooltip'));
@@ -41,22 +41,13 @@ const LinearSyntenyRendering = observer(function ({ model, }) {
41
41
  const [mouseInitialDownX, setMouseInitialDownX] = useState();
42
42
  const [currY, setCurrY] = useState();
43
43
  const mainSyntenyCanvasRefp = useRef();
44
- // these useCallbacks avoid new refs from being created on any mouseover,
45
- // etc.
46
- // biome-ignore lint/correctness/useExhaustiveDependencies:
47
44
  const mouseoverDetectionCanvasRef = useCallback((ref) => {
48
45
  model.setMouseoverCanvasRef(ref);
49
- },
50
- // eslint-disable-next-line react-hooks/exhaustive-deps
51
- [model, height, width]);
52
- // biome-ignore lint/correctness/useExhaustiveDependencies:
46
+ }, [model, height, width]);
53
47
  const mainSyntenyCanvasRef = useCallback((ref) => {
54
48
  model.setMainCanvasRef(ref);
55
- mainSyntenyCanvasRefp.current = ref; // this ref is additionally used in useEffect below
56
- },
57
- // eslint-disable-next-line react-hooks/exhaustive-deps
58
- [model, height, width]);
59
- // biome-ignore lint/correctness/useExhaustiveDependencies:
49
+ mainSyntenyCanvasRefp.current = ref;
50
+ }, [model, height, width]);
60
51
  useEffect(() => {
61
52
  var _a;
62
53
  function onWheel(event) {
@@ -105,20 +96,13 @@ const LinearSyntenyRendering = observer(function ({ model, }) {
105
96
  var _a;
106
97
  (_a = mainSyntenyCanvasRefp.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('wheel', onWheel);
107
98
  };
108
- // eslint-disable-next-line react-hooks/exhaustive-deps
109
99
  }, [model, height, width]);
110
- // biome-ignore lint/correctness/useExhaustiveDependencies:
111
100
  const clickMapCanvasRef = useCallback((ref) => {
112
101
  model.setClickMapCanvasRef(ref);
113
- },
114
- // eslint-disable-next-line react-hooks/exhaustive-deps
115
- [model, height, width]);
116
- // biome-ignore lint/correctness/useExhaustiveDependencies:
102
+ }, [model, height, width]);
117
103
  const cigarClickMapCanvasRef = useCallback((ref) => {
118
104
  model.setCigarClickMapCanvasRef(ref);
119
- },
120
- // eslint-disable-next-line react-hooks/exhaustive-deps
121
- [model, height, width]);
105
+ }, [model, height, width]);
122
106
  return (React.createElement("div", { className: classes.rel },
123
107
  React.createElement("canvas", { ref: mouseoverDetectionCanvasRef, width: width, height: height, className: classes.mouseoverCanvas }),
124
108
  React.createElement("canvas", { ref: mainSyntenyCanvasRef, onMouseMove: event => {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { Feature } from '@jbrowse/core/util';
3
- import { LinearSyntenyDisplayModel } from '../model';
2
+ import type { LinearSyntenyDisplayModel } from '../model';
3
+ import type { Feature } from '@jbrowse/core/util';
4
4
  interface ClickCoord {
5
5
  clientX: number;
6
6
  clientY: number;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { getContainingView, getSession } from '@jbrowse/core/util';
3
2
  import { Menu } from '@jbrowse/core/ui';
3
+ import { getContainingView, getSession } 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;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { observer } from 'mobx-react';
3
2
  import { SanitizedHTML } from '@jbrowse/core/ui';
4
3
  import BaseTooltip from '@jbrowse/core/ui/BaseTooltip';
4
+ import { observer } from 'mobx-react';
5
5
  const SyntenyTooltip = observer(function ({ title }) {
6
6
  return title ? (React.createElement(BaseTooltip, null,
7
7
  React.createElement(SanitizedHTML, { html: title }))) : null;
@@ -1,6 +1,6 @@
1
- import React from 'react';
2
- import { Feature } from '@jbrowse/core/util';
3
- import { LinearSyntenyDisplayModel } from '../model';
1
+ import type React from 'react';
2
+ import type { LinearSyntenyDisplayModel } from '../model';
3
+ import type { Feature } from '@jbrowse/core/util';
4
4
  interface Pos {
5
5
  offsetPx: number;
6
6
  }
@@ -1,6 +1,5 @@
1
- import { assembleLocString, doesIntersect2, getSession, isSessionModelWithWidgets, getContainingTrack, getContainingView, } from '@jbrowse/core/util';
2
- // locals
3
- import { getId, MAX_COLOR_RANGE } from '../drawSynteny';
1
+ import { assembleLocString, doesIntersect2, getContainingTrack, getContainingView, getSession, isSessionModelWithWidgets, } from '@jbrowse/core/util';
2
+ import { MAX_COLOR_RANGE, getId } from '../drawSynteny';
4
3
  export function drawMatchSimple({ feature, ctx, offsets, level, cb, height, drawCurves, oobLimit, viewWidth, hideTiny, }) {
5
4
  const { p11, p12, p21, p22 } = feature;
6
5
  const x11 = p11.offsetPx - offsets[level];
@@ -17,11 +16,7 @@ export function drawMatchSimple({ feature, ctx, offsets, level, cb, height, draw
17
16
  if (!doesIntersect2(minX, maxX, -oobLimit, viewWidth + oobLimit)) {
18
17
  return;
19
18
  }
20
- // drawing a line if the results are thin: drawing a line results in much
21
- // less pixellation than filling in a thin polygon
22
19
  if (l1 <= 1 && l2 <= 1) {
23
- // hideTiny can be used to avoid drawing mouseover for thin lines in this
24
- // case
25
20
  if (!hideTiny) {
26
21
  ctx.beginPath();
27
22
  ctx.moveTo(x11, y1);
@@ -58,9 +53,6 @@ export function drawBox(ctx, x1, x2, y1, x3, x4, y2) {
58
53
  export function drawBezierBox(ctx, x1, x2, y1, x3, x4, y2, mid) {
59
54
  const len1 = Math.abs(x1 - x2);
60
55
  const len2 = Math.abs(x1 - x2);
61
- // heuristic to not draw hourglass inversions with bezier curves when they
62
- // are thin and far apart because it results in areas that are not drawn well
63
- // demo https://codesandbox.io/s/fast-glitter-q3b1or?file=/src/index.js
64
56
  if (len1 < 5 && len2 < 5 && x2 < x1 && Math.abs(x1 - x3) > 100) {
65
57
  const tmp = x1;
66
58
  x1 = x2;
@@ -134,7 +126,6 @@ export function onSynContextClick(event, model, setAnchorEl) {
134
126
  }
135
127
  }
136
128
  export function getTooltip({ feature, cigarOp, cigarOpLen, }) {
137
- // @ts-expect-error
138
129
  const f1 = feature.toJSON();
139
130
  const f2 = f1.mate;
140
131
  const l1 = f1.end - f1.start;
@@ -1,20 +1,9 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
2
- /**
3
- * #config LinearSyntenyDisplay
4
- */
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
5
2
  declare function configSchemaFactory(pluginManager: PluginManager): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
6
- /**
7
- * #slot
8
- * currently unused
9
- */
10
3
  trackIds: {
11
4
  type: string;
12
5
  defaultValue: never[];
13
6
  };
14
- /**
15
- * #slot
16
- * currently unused
17
- */
18
7
  middle: {
19
8
  type: string;
20
9
  defaultValue: boolean;
@@ -1,28 +1,13 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
2
  import baseConfigFactory from '../LinearComparativeDisplay/configSchemaF';
3
- /**
4
- * #config LinearSyntenyDisplay
5
- */
6
3
  function configSchemaFactory(pluginManager) {
7
4
  return ConfigurationSchema('LinearSyntenyDisplay', {
8
- /**
9
- * #slot
10
- * currently unused
11
- */
12
5
  trackIds: {
13
6
  type: 'stringArray',
14
7
  defaultValue: [],
15
8
  },
16
- /**
17
- * #slot
18
- * currently unused
19
- */
20
9
  middle: { type: 'boolean', defaultValue: true },
21
10
  }, {
22
- /**
23
- * #baseConfiguration
24
- * this refers to the LinearComparativeDisplay
25
- */
26
11
  baseConfiguration: baseConfigFactory(pluginManager),
27
12
  explicitlyTyped: true,
28
13
  });
@@ -1,4 +1,4 @@
1
- import { LinearSyntenyDisplayModel } from './model';
1
+ import type { LinearSyntenyDisplayModel } from './model';
2
2
  export declare const MAX_COLOR_RANGE: number;
3
3
  export declare function getId(r: number, g: number, b: number, unitMultiplier: number): number;
4
4
  export declare function drawRef(model: LinearSyntenyDisplayModel, ctx1: CanvasRenderingContext2D, ctx3?: CanvasRenderingContext2D): void;