@jbrowse/plugin-dotplot-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 (153) hide show
  1. package/dist/ComparativeRenderer/index.d.ts +3 -8
  2. package/dist/ComparativeRenderer/index.js +3 -8
  3. package/dist/DotplotDisplay/components/DotplotDisplay.d.ts +1 -1
  4. package/dist/DotplotDisplay/components/DotplotDisplay.js +1 -1
  5. package/dist/DotplotDisplay/index.d.ts +1 -7
  6. package/dist/DotplotDisplay/index.js +2 -12
  7. package/dist/DotplotDisplay/renderDotplotBlock.d.ts +1 -1
  8. package/dist/DotplotDisplay/renderDotplotBlock.js +3 -9
  9. package/dist/DotplotDisplay/stateModelFactory.d.ts +7 -43
  10. package/dist/DotplotDisplay/stateModelFactory.js +55 -97
  11. package/dist/DotplotReadVsRef/DotplotReadVsRef.d.ts +2 -2
  12. package/dist/DotplotReadVsRef/DotplotReadVsRef.js +13 -14
  13. package/dist/DotplotReadVsRef/index.d.ts +1 -1
  14. package/dist/DotplotReadVsRef/index.js +0 -2
  15. package/dist/DotplotRenderer/ComparativeRenderRpc.d.ts +3 -8
  16. package/dist/DotplotRenderer/ComparativeRenderRpc.js +3 -8
  17. package/dist/DotplotRenderer/DotplotRenderer.d.ts +5 -4
  18. package/dist/DotplotRenderer/DotplotRenderer.js +1 -2
  19. package/dist/DotplotRenderer/components/DotplotRendering.d.ts +1 -1
  20. package/dist/DotplotRenderer/configSchema.d.ts +0 -21
  21. package/dist/DotplotRenderer/configSchema.js +2 -27
  22. package/dist/DotplotRenderer/drawDotplot.d.ts +3 -3
  23. package/dist/DotplotRenderer/drawDotplot.js +3 -6
  24. package/dist/DotplotRenderer/index.d.ts +1 -1
  25. package/dist/DotplotRenderer/index.js +1 -1
  26. package/dist/DotplotView/1dview.d.ts +2 -77
  27. package/dist/DotplotView/1dview.js +4 -33
  28. package/dist/DotplotView/components/Axes.d.ts +1 -1
  29. package/dist/DotplotView/components/Axes.js +3 -4
  30. package/dist/DotplotView/components/CursorIcon.d.ts +1 -1
  31. package/dist/DotplotView/components/CursorIcon.js +1 -1
  32. package/dist/DotplotView/components/DotplotControls.d.ts +1 -1
  33. package/dist/DotplotView/components/DotplotControls.js +5 -6
  34. package/dist/DotplotView/components/DotplotTooltipClick.d.ts +1 -1
  35. package/dist/DotplotView/components/DotplotTooltipClick.js +1 -1
  36. package/dist/DotplotView/components/DotplotTooltipMouseover.d.ts +1 -1
  37. package/dist/DotplotView/components/DotplotTooltipMouseover.js +1 -1
  38. package/dist/DotplotView/components/DotplotView.d.ts +1 -1
  39. package/dist/DotplotView/components/DotplotView.js +5 -12
  40. package/dist/DotplotView/components/DotplotWarnings.d.ts +1 -1
  41. package/dist/DotplotView/components/DotplotWarnings.js +0 -1
  42. package/dist/DotplotView/components/ExportSvgDialog.d.ts +1 -1
  43. package/dist/DotplotView/components/ExportSvgDialog.js +2 -4
  44. package/dist/DotplotView/components/Grid.d.ts +1 -1
  45. package/dist/DotplotView/components/Grid.js +2 -4
  46. package/dist/DotplotView/components/Header.d.ts +1 -1
  47. package/dist/DotplotView/components/Header.js +2 -2
  48. package/dist/DotplotView/components/ImportForm/ImportCustomTrack.d.ts +2 -2
  49. package/dist/DotplotView/components/ImportForm/ImportCustomTrack.js +1 -1
  50. package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +1 -1
  51. package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +5 -10
  52. package/dist/DotplotView/components/ImportForm/index.d.ts +1 -1
  53. package/dist/DotplotView/components/ImportForm/index.js +4 -5
  54. package/dist/DotplotView/components/ImportForm/util.js +1 -3
  55. package/dist/DotplotView/components/PanButtons.d.ts +1 -1
  56. package/dist/DotplotView/components/PanButtons.js +3 -4
  57. package/dist/DotplotView/components/WarningDialog.d.ts +6 -5
  58. package/dist/DotplotView/components/WarningDialog.js +10 -6
  59. package/dist/DotplotView/components/util.d.ts +2 -7
  60. package/dist/DotplotView/components/util.js +0 -5
  61. package/dist/DotplotView/index.d.ts +1 -1
  62. package/dist/DotplotView/index.js +0 -1
  63. package/dist/DotplotView/model.d.ts +5 -129
  64. package/dist/DotplotView/model.js +6 -192
  65. package/dist/DotplotView/svgcomponents/SVGBackground.js +1 -1
  66. package/dist/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
  67. package/dist/DotplotView/svgcomponents/SVGDotplotView.js +5 -9
  68. package/dist/LaunchDotplotView.d.ts +1 -1
  69. package/dist/LaunchDotplotView.js +1 -4
  70. package/dist/ServerSideRenderedBlockContent.d.ts +2 -1
  71. package/dist/ServerSideRenderedBlockContent.js +2 -3
  72. package/dist/ServerSideSyntenyRendering.d.ts +0 -4
  73. package/dist/ServerSideSyntenyRendering.js +1 -1
  74. package/dist/index.d.ts +1 -1
  75. package/dist/index.js +3 -6
  76. package/dist/util.d.ts +1 -1
  77. package/esm/ComparativeRenderer/index.d.ts +3 -8
  78. package/esm/ComparativeRenderer/index.js +3 -8
  79. package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +1 -1
  80. package/esm/DotplotDisplay/components/DotplotDisplay.js +1 -1
  81. package/esm/DotplotDisplay/index.d.ts +1 -7
  82. package/esm/DotplotDisplay/index.js +2 -12
  83. package/esm/DotplotDisplay/renderDotplotBlock.d.ts +1 -1
  84. package/esm/DotplotDisplay/renderDotplotBlock.js +3 -6
  85. package/esm/DotplotDisplay/stateModelFactory.d.ts +7 -43
  86. package/esm/DotplotDisplay/stateModelFactory.js +56 -98
  87. package/esm/DotplotReadVsRef/DotplotReadVsRef.d.ts +2 -2
  88. package/esm/DotplotReadVsRef/DotplotReadVsRef.js +15 -16
  89. package/esm/DotplotReadVsRef/index.d.ts +1 -1
  90. package/esm/DotplotReadVsRef/index.js +0 -2
  91. package/esm/DotplotRenderer/ComparativeRenderRpc.d.ts +3 -8
  92. package/esm/DotplotRenderer/ComparativeRenderRpc.js +3 -8
  93. package/esm/DotplotRenderer/DotplotRenderer.d.ts +5 -4
  94. package/esm/DotplotRenderer/DotplotRenderer.js +1 -2
  95. package/esm/DotplotRenderer/components/DotplotRendering.d.ts +1 -1
  96. package/esm/DotplotRenderer/configSchema.d.ts +0 -21
  97. package/esm/DotplotRenderer/configSchema.js +2 -27
  98. package/esm/DotplotRenderer/drawDotplot.d.ts +3 -3
  99. package/esm/DotplotRenderer/drawDotplot.js +4 -7
  100. package/esm/DotplotRenderer/index.d.ts +1 -1
  101. package/esm/DotplotRenderer/index.js +1 -1
  102. package/esm/DotplotView/1dview.d.ts +2 -77
  103. package/esm/DotplotView/1dview.js +4 -33
  104. package/esm/DotplotView/components/Axes.d.ts +1 -1
  105. package/esm/DotplotView/components/Axes.js +3 -4
  106. package/esm/DotplotView/components/CursorIcon.d.ts +1 -1
  107. package/esm/DotplotView/components/CursorIcon.js +1 -1
  108. package/esm/DotplotView/components/DotplotControls.d.ts +1 -1
  109. package/esm/DotplotView/components/DotplotControls.js +5 -6
  110. package/esm/DotplotView/components/DotplotTooltipClick.d.ts +1 -1
  111. package/esm/DotplotView/components/DotplotTooltipClick.js +1 -1
  112. package/esm/DotplotView/components/DotplotTooltipMouseover.d.ts +1 -1
  113. package/esm/DotplotView/components/DotplotTooltipMouseover.js +1 -1
  114. package/esm/DotplotView/components/DotplotView.d.ts +1 -1
  115. package/esm/DotplotView/components/DotplotView.js +6 -13
  116. package/esm/DotplotView/components/DotplotWarnings.d.ts +1 -1
  117. package/esm/DotplotView/components/DotplotWarnings.js +0 -1
  118. package/esm/DotplotView/components/ExportSvgDialog.d.ts +1 -1
  119. package/esm/DotplotView/components/ExportSvgDialog.js +2 -4
  120. package/esm/DotplotView/components/Grid.d.ts +1 -1
  121. package/esm/DotplotView/components/Grid.js +2 -4
  122. package/esm/DotplotView/components/Header.d.ts +1 -1
  123. package/esm/DotplotView/components/Header.js +2 -2
  124. package/esm/DotplotView/components/ImportForm/ImportCustomTrack.d.ts +2 -2
  125. package/esm/DotplotView/components/ImportForm/ImportCustomTrack.js +2 -2
  126. package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +1 -1
  127. package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +6 -11
  128. package/esm/DotplotView/components/ImportForm/index.d.ts +1 -1
  129. package/esm/DotplotView/components/ImportForm/index.js +6 -7
  130. package/esm/DotplotView/components/ImportForm/util.js +1 -3
  131. package/esm/DotplotView/components/PanButtons.d.ts +1 -1
  132. package/esm/DotplotView/components/PanButtons.js +3 -4
  133. package/esm/DotplotView/components/WarningDialog.d.ts +6 -5
  134. package/esm/DotplotView/components/WarningDialog.js +10 -6
  135. package/esm/DotplotView/components/util.d.ts +2 -7
  136. package/esm/DotplotView/components/util.js +0 -5
  137. package/esm/DotplotView/index.d.ts +1 -1
  138. package/esm/DotplotView/index.js +0 -1
  139. package/esm/DotplotView/model.d.ts +5 -129
  140. package/esm/DotplotView/model.js +7 -193
  141. package/esm/DotplotView/svgcomponents/SVGBackground.js +1 -1
  142. package/esm/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
  143. package/esm/DotplotView/svgcomponents/SVGDotplotView.js +5 -9
  144. package/esm/LaunchDotplotView.d.ts +1 -1
  145. package/esm/LaunchDotplotView.js +1 -4
  146. package/esm/ServerSideRenderedBlockContent.d.ts +2 -1
  147. package/esm/ServerSideRenderedBlockContent.js +2 -3
  148. package/esm/ServerSideSyntenyRendering.d.ts +0 -4
  149. package/esm/ServerSideSyntenyRendering.js +2 -2
  150. package/esm/index.d.ts +1 -1
  151. package/esm/index.js +3 -6
  152. package/esm/util.d.ts +1 -1
  153. package/package.json +2 -4
@@ -29,22 +29,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.Dotplot1DView = void 0;
30
30
  exports.default = stateModelFactory;
31
31
  const react_1 = require("react");
32
- const mobx_state_tree_1 = require("mobx-state-tree");
33
- const file_saver_1 = require("file-saver");
34
- const mobx_1 = require("mobx");
35
- const tracks_1 = require("@jbrowse/core/util/tracks");
32
+ const configuration_1 = require("@jbrowse/core/configuration");
36
33
  const BaseViewModel_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/models/BaseViewModel"));
34
+ const Icons_1 = require("@jbrowse/core/ui/Icons");
37
35
  const util_1 = require("@jbrowse/core/util");
38
- const configuration_1 = require("@jbrowse/core/configuration");
36
+ const tracks_1 = require("@jbrowse/core/util/tracks");
39
37
  const mst_1 = require("@jbrowse/core/util/types/mst");
40
- // icons
41
- const Icons_1 = require("@jbrowse/core/ui/Icons");
42
38
  const FolderOpen_1 = __importDefault(require("@mui/icons-material/FolderOpen"));
43
39
  const PhotoCamera_1 = __importDefault(require("@mui/icons-material/PhotoCamera"));
44
- // locals
40
+ const file_saver_1 = require("file-saver");
41
+ const mobx_1 = require("mobx");
42
+ const mobx_state_tree_1 = require("mobx-state-tree");
45
43
  const _1dview_1 = require("./1dview");
46
44
  const util_2 = require("./components/util");
47
- // lazies
48
45
  const ExportSvgDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/ExportSvgDialog'))));
49
46
  const ReturnToImportFormDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@jbrowse/core/ui/ReturnToImportFormDialog'))));
50
47
  function stringLenPx(a) {
@@ -58,84 +55,28 @@ function pxWidthForBlocks(blocks, bpPerPx, hide) {
58
55
  .map(b => stringLenPx((0, util_1.getTickDisplayStr)(b.end, bpPerPx))),
59
56
  ]);
60
57
  }
61
- /**
62
- * #stateModel DotplotView
63
- * #category view
64
- * extends
65
- * - [BaseViewModel](../baseviewmodel)
66
- */
67
58
  function stateModelFactory(pm) {
68
59
  return mobx_state_tree_1.types
69
60
  .compose('DotplotView', BaseViewModel_1.default, mobx_state_tree_1.types.model({
70
- /**
71
- * #property
72
- */
73
61
  id: mst_1.ElementId,
74
- /**
75
- * #property
76
- */
77
62
  type: mobx_state_tree_1.types.literal('DotplotView'),
78
- /**
79
- * #property
80
- */
81
63
  height: 600,
82
- /**
83
- * #property
84
- */
85
64
  borderSize: 20,
86
- /**
87
- * #property
88
- */
89
65
  tickSize: 5,
90
- /**
91
- * #property
92
- */
93
66
  vtextRotation: 0,
94
- /**
95
- * #property
96
- */
97
67
  htextRotation: -90,
98
- /**
99
- * #property
100
- */
101
68
  fontSize: 15,
102
- /**
103
- * #property
104
- */
105
69
  trackSelectorType: 'hierarchical',
106
- /**
107
- * #property
108
- */
109
70
  assemblyNames: mobx_state_tree_1.types.array(mobx_state_tree_1.types.string),
110
- /**
111
- * #property
112
- */
113
71
  drawCigar: true,
114
- /**
115
- * #property
116
- */
117
72
  hview: mobx_state_tree_1.types.optional(_1dview_1.DotplotHView, {}),
118
- /**
119
- * #property
120
- */
121
73
  vview: mobx_state_tree_1.types.optional(_1dview_1.DotplotVView, {}),
122
- /**
123
- * #property
124
- */
125
74
  tracks: mobx_state_tree_1.types.array(pm.pluggableMstType('track', 'stateModel')),
126
- /**
127
- * #property
128
- * this represents tracks specific to this view specifically used
129
- * for read vs ref dotplots where this track would not really apply
130
- * elsewhere
131
- */
132
75
  viewTrackConfigs: mobx_state_tree_1.types.array(pm.pluggableConfigSchemaType('track')),
133
76
  }))
134
77
  .volatile(() => ({
135
78
  volatileWidth: undefined,
136
79
  volatileError: undefined,
137
- // these are 'personal preferences', stored in volatile and
138
- // loaded/written to localStorage
139
80
  cursorMode: (0, util_1.localStorageGetItem)('dotplot-cursorMode') || 'crosshair',
140
81
  showPanButtons: Boolean(JSON.parse((0, util_1.localStorageGetItem)('dotplot-showPanbuttons') || 'true')),
141
82
  wheelMode: (0, util_1.localStorageGetItem)('dotplot-wheelMode') || 'zoom',
@@ -143,9 +84,6 @@ function stateModelFactory(pm) {
143
84
  borderY: 100,
144
85
  }))
145
86
  .views(self => ({
146
- /**
147
- * #getter
148
- */
149
87
  get width() {
150
88
  if (!self.volatileWidth) {
151
89
  throw new Error('width not initialized');
@@ -154,9 +92,6 @@ function stateModelFactory(pm) {
154
92
  },
155
93
  }))
156
94
  .views(self => ({
157
- /**
158
- * #getter
159
- */
160
95
  get assemblyErrors() {
161
96
  const { assemblyManager } = (0, util_1.getSession)(self);
162
97
  return self.assemblyNames
@@ -164,27 +99,18 @@ function stateModelFactory(pm) {
164
99
  .filter(f => !!f)
165
100
  .join(', ');
166
101
  },
167
- /**
168
- * #getter
169
- */
170
102
  get assembliesInitialized() {
171
103
  const { assemblyManager } = (0, util_1.getSession)(self);
172
104
  return self.assemblyNames.every(n => { var _a, _b; return (_b = (_a = assemblyManager.get(n)) === null || _a === void 0 ? void 0 : _a.initialized) !== null && _b !== void 0 ? _b : true; });
173
105
  },
174
106
  }))
175
107
  .views(self => ({
176
- /**
177
- * #getter
178
- */
179
108
  get initialized() {
180
109
  return (self.volatileWidth !== undefined &&
181
110
  self.hview.displayedRegions.length > 0 &&
182
111
  self.vview.displayedRegions.length > 0 &&
183
112
  self.assembliesInitialized);
184
113
  },
185
- /**
186
- * #getter
187
- */
188
114
  get hticks() {
189
115
  const { hview } = self;
190
116
  const { dynamicBlocks, staticBlocks, bpPerPx } = hview;
@@ -192,9 +118,6 @@ function stateModelFactory(pm) {
192
118
  ? []
193
119
  : (0, util_2.makeTicks)(staticBlocks.contentBlocks, bpPerPx);
194
120
  },
195
- /**
196
- * #getter
197
- */
198
121
  get vticks() {
199
122
  const { vview } = self;
200
123
  const { dynamicBlocks, staticBlocks, bpPerPx } = vview;
@@ -202,33 +125,18 @@ function stateModelFactory(pm) {
202
125
  ? []
203
126
  : (0, util_2.makeTicks)(staticBlocks.contentBlocks, bpPerPx);
204
127
  },
205
- /**
206
- * #getter
207
- */
208
128
  get loading() {
209
129
  return self.assemblyNames.length > 0 && !this.initialized;
210
130
  },
211
- /**
212
- * #getter
213
- */
214
131
  get viewWidth() {
215
132
  return self.width - self.borderX;
216
133
  },
217
- /**
218
- * #getter
219
- */
220
134
  get viewHeight() {
221
135
  return self.height - self.borderY;
222
136
  },
223
- /**
224
- * #getter
225
- */
226
137
  get views() {
227
138
  return [self.hview, self.vview];
228
139
  },
229
- /**
230
- * #method
231
- */
232
140
  renderProps() {
233
141
  const session = (0, util_1.getSession)(self);
234
142
  return {
@@ -239,89 +147,49 @@ function stateModelFactory(pm) {
239
147
  },
240
148
  }))
241
149
  .actions(self => ({
242
- /**
243
- * #action
244
- */
245
150
  setShowPanButtons(flag) {
246
151
  self.showPanButtons = flag;
247
152
  },
248
- /**
249
- * #action
250
- */
251
153
  setWheelMode(str) {
252
154
  self.wheelMode = str;
253
155
  },
254
- /**
255
- * #action
256
- */
257
156
  setCursorMode(str) {
258
157
  self.cursorMode = str;
259
158
  },
260
- /**
261
- * #action
262
- */
263
159
  setDrawCigar(flag) {
264
160
  self.drawCigar = flag;
265
161
  },
266
- /**
267
- * #action
268
- * returns to the import form
269
- */
270
162
  clearView() {
271
163
  self.hview.setDisplayedRegions([]);
272
164
  self.vview.setDisplayedRegions([]);
273
165
  self.assemblyNames = (0, mobx_state_tree_1.cast)([]);
274
166
  self.tracks.clear();
275
167
  },
276
- /**
277
- * #action
278
- */
279
168
  setBorderX(n) {
280
169
  self.borderX = n;
281
170
  },
282
- /**
283
- * #action
284
- */
285
171
  setBorderY(n) {
286
172
  self.borderY = n;
287
173
  },
288
- /**
289
- * #action
290
- */
291
174
  setWidth(newWidth) {
292
175
  self.volatileWidth = newWidth;
293
176
  return self.volatileWidth;
294
177
  },
295
- /**
296
- * #action
297
- */
298
178
  setHeight(newHeight) {
299
179
  self.height = newHeight;
300
180
  return self.height;
301
181
  },
302
- /**
303
- * #action
304
- */
305
182
  setError(e) {
306
183
  self.volatileError = e;
307
184
  },
308
- /**
309
- * #action
310
- */
311
185
  zoomOut() {
312
186
  self.hview.zoomOut();
313
187
  self.vview.zoomOut();
314
188
  },
315
- /**
316
- * #action
317
- */
318
189
  zoomIn() {
319
190
  self.hview.zoomIn();
320
191
  self.vview.zoomIn();
321
192
  },
322
- /**
323
- * #action
324
- */
325
193
  activateTrackSelector() {
326
194
  if (self.trackSelectorType === 'hierarchical') {
327
195
  const session = (0, util_1.getSession)(self);
@@ -333,9 +201,6 @@ function stateModelFactory(pm) {
333
201
  }
334
202
  throw new Error(`invalid track selector type ${self.trackSelectorType}`);
335
203
  },
336
- /**
337
- * #action
338
- */
339
204
  showTrack(trackId, initialSnapshot = {}) {
340
205
  const schema = pm.pluggableConfigSchemaType('track');
341
206
  const conf = (0, mobx_state_tree_1.resolveIdentifier)(schema, (0, mobx_state_tree_1.getRoot)(self), trackId);
@@ -356,9 +221,6 @@ function stateModelFactory(pm) {
356
221
  });
357
222
  self.tracks.push(track);
358
223
  },
359
- /**
360
- * #action
361
- */
362
224
  hideTrack(trackId) {
363
225
  const schema = pm.pluggableConfigSchemaType('track');
364
226
  const conf = (0, mobx_state_tree_1.resolveIdentifier)(schema, (0, mobx_state_tree_1.getRoot)(self), trackId);
@@ -368,9 +230,6 @@ function stateModelFactory(pm) {
368
230
  });
369
231
  return t.length;
370
232
  },
371
- /**
372
- * #action
373
- */
374
233
  toggleTrack(trackId) {
375
234
  const hiddenCount = this.hideTrack(trackId);
376
235
  if (!hiddenCount) {
@@ -379,22 +238,13 @@ function stateModelFactory(pm) {
379
238
  }
380
239
  return false;
381
240
  },
382
- /**
383
- * #action
384
- */
385
241
  setAssemblyNames(target, query) {
386
242
  self.assemblyNames = (0, mobx_state_tree_1.cast)([target, query]);
387
243
  },
388
- /**
389
- * #action
390
- */
391
244
  setViews(arr) {
392
245
  self.hview = (0, mobx_state_tree_1.cast)(arr[0]);
393
246
  self.vview = (0, mobx_state_tree_1.cast)(arr[1]);
394
247
  },
395
- /**
396
- * #action
397
- */
398
248
  getCoords(mousedown, mouseup) {
399
249
  const [xmin, xmax] = (0, util_1.minmax)(mouseup[0], mousedown[0]);
400
250
  const [ymin, ymax] = (0, util_1.minmax)(mouseup[1], mousedown[1]);
@@ -407,10 +257,6 @@ function stateModelFactory(pm) {
407
257
  ]
408
258
  : undefined;
409
259
  },
410
- /**
411
- * #action
412
- * zooms into clicked and dragged region
413
- */
414
260
  zoomInToMouseCoords(mousedown, mouseup) {
415
261
  const result = this.getCoords(mousedown, mouseup);
416
262
  if (result) {
@@ -419,19 +265,12 @@ function stateModelFactory(pm) {
419
265
  self.vview.moveTo(y2, y1);
420
266
  }
421
267
  },
422
- /**
423
- * #action
424
- */
425
268
  showAllRegions() {
426
269
  self.hview.zoomTo(self.hview.maxBpPerPx);
427
270
  self.vview.zoomTo(self.vview.maxBpPerPx);
428
271
  self.vview.center();
429
272
  self.hview.center();
430
273
  },
431
- /**
432
- * #action
433
- * creates a linear synteny view from the clicked and dragged region
434
- */
435
274
  onDotplotView(mousedown, mouseup) {
436
275
  const result = this.getCoords(mousedown, mouseup);
437
276
  if (result) {
@@ -453,9 +292,6 @@ function stateModelFactory(pm) {
453
292
  d2.moveTo(y2, y1);
454
293
  d1.zoomTo(d1.bpPerPx / (self.width / self.hview.width), 0);
455
294
  d2.zoomTo(d2.bpPerPx / (self.width / self.vview.width), 0);
456
- // add the specific evidence tracks to the LGVs in the split view
457
- // note: scales the bpPerPx by scaling proportional of the dotplot
458
- // width to the eventual lgv width
459
295
  const tracks = self.tracks
460
296
  .map(track => track.configuration.displays.find((display) => display.type === 'LinearSyntenyDisplay'))
461
297
  .filter(f => !!f)
@@ -494,17 +330,12 @@ function stateModelFactory(pm) {
494
330
  },
495
331
  }))
496
332
  .actions(self => ({
497
- /**
498
- * #action
499
- * creates an svg export and save using FileSaver
500
- */
501
333
  async exportSvg(opts = {}) {
502
334
  const { renderToSvg } = await Promise.resolve().then(() => __importStar(require('./svgcomponents/SVGDotplotView')));
503
335
  const html = await renderToSvg(self, opts);
504
336
  const blob = new Blob([html], { type: 'image/svg+xml' });
505
337
  (0, file_saver_1.saveAs)(blob, opts.filename || 'image.svg');
506
338
  },
507
- // if any of our assemblies are temporary assemblies
508
339
  beforeDestroy() {
509
340
  var _a;
510
341
  const session = (0, util_1.getSession)(self);
@@ -524,13 +355,10 @@ function stateModelFactory(pm) {
524
355
  }));
525
356
  (0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
526
357
  const session = (0, util_1.getSession)(self);
527
- // don't operate if width not set yet
528
358
  if (self.volatileWidth === undefined ||
529
359
  !self.assembliesInitialized) {
530
360
  return;
531
361
  }
532
- // also don't operate if displayedRegions already set, this is a
533
- // helper autorun to load regions from assembly
534
362
  if (self.hview.displayedRegions.length > 0 &&
535
363
  self.vview.displayedRegions.length > 0) {
536
364
  return;
@@ -546,7 +374,6 @@ function stateModelFactory(pm) {
546
374
  });
547
375
  }, { delay: 1000 }));
548
376
  (0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(function borderSetter() {
549
- // make sure we have a width on the view before trying to load
550
377
  if (self.volatileWidth === undefined) {
551
378
  return;
552
379
  }
@@ -560,14 +387,10 @@ function stateModelFactory(pm) {
560
387
  const hhide = (0, util_2.getBlockLabelKeysToHide)(hblocks, viewWidth, hoffset);
561
388
  const by = pxWidthForBlocks(hblocks, vview.bpPerPx, hhide);
562
389
  const bx = pxWidthForBlocks(vblocks, hview.bpPerPx, vhide);
563
- // these are set via autorun to avoid dependency cycle
564
390
  self.setBorderY(Math.max(by + padding, 50));
565
391
  self.setBorderX(Math.max(bx + padding, 50));
566
392
  }));
567
393
  },
568
- /**
569
- * #action
570
- */
571
394
  squareView() {
572
395
  const { hview, vview } = self;
573
396
  const avg = (hview.bpPerPx + vview.bpPerPx) / 2;
@@ -578,9 +401,6 @@ function stateModelFactory(pm) {
578
401
  vview.setBpPerPx(avg);
579
402
  vview.centerAt(vpx.coord, vpx.refName, vpx.index);
580
403
  },
581
- /**
582
- * #action
583
- */
584
404
  squareViewProportional() {
585
405
  const { hview, vview } = self;
586
406
  const ratio = hview.width / vview.width;
@@ -594,9 +414,6 @@ function stateModelFactory(pm) {
594
414
  },
595
415
  }))
596
416
  .views(self => ({
597
- /**
598
- * #method
599
- */
600
417
  menuItems() {
601
418
  const session = (0, util_1.getSession)(self);
602
419
  return [
@@ -649,9 +466,6 @@ function stateModelFactory(pm) {
649
466
  : []),
650
467
  ];
651
468
  },
652
- /**
653
- * #getter
654
- */
655
469
  get error() {
656
470
  return self.volatileError || self.assemblyErrors;
657
471
  },
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = SVGBackground;
7
7
  const react_1 = __importDefault(require("react"));
8
- const material_1 = require("@mui/material");
9
8
  const util_1 = require("@jbrowse/core/util");
9
+ const material_1 = require("@mui/material");
10
10
  function SVGBackground({ width, height, }) {
11
11
  const theme = (0, material_1.useTheme)();
12
12
  return (react_1.default.createElement("rect", { x: 0, y: 0, width: width, height: height, fill: (0, util_1.stripAlpha)(theme.palette.background.default) }));
@@ -1,2 +1,2 @@
1
- import { DotplotViewModel, ExportSvgOptions } from '../model';
1
+ import type { DotplotViewModel, ExportSvgOptions } from '../model';
2
2
  export declare function renderToSvg(model: DotplotViewModel, opts: ExportSvgOptions): Promise<string>;
@@ -5,15 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.renderToSvg = renderToSvg;
7
7
  const react_1 = __importDefault(require("react"));
8
- const mobx_1 = require("mobx");
8
+ const ui_1 = require("@jbrowse/core/ui");
9
9
  const util_1 = require("@jbrowse/core/util");
10
10
  const material_1 = require("@mui/material");
11
- const ui_1 = require("@jbrowse/core/ui");
11
+ const mobx_1 = require("mobx");
12
12
  const mobx_state_tree_1 = require("mobx-state-tree");
13
- const Grid_1 = require("../components/Grid");
14
- const Axes_1 = require("../components/Axes");
15
13
  const SVGBackground_1 = __importDefault(require("./SVGBackground"));
16
- // render LGV to SVG
14
+ const Axes_1 = require("../components/Axes");
15
+ const Grid_1 = require("../components/Grid");
17
16
  async function renderToSvg(model, opts) {
18
17
  var _a;
19
18
  await (0, mobx_1.when)(() => model.initialized);
@@ -29,7 +28,6 @@ async function renderToSvg(model, opts) {
29
28
  return { track, result: await display.renderSvg({ ...opts, theme }) };
30
29
  }));
31
30
  const w = width + shift * 2;
32
- // the xlink namespace is used for rendering <image> tag
33
31
  return (0, util_1.renderToStaticMarkup)(react_1.default.createElement(material_1.ThemeProvider, { theme: (0, ui_1.createJBrowseTheme)(theme) },
34
32
  react_1.default.createElement(Wrapper, null,
35
33
  react_1.default.createElement("svg", { width: width, height: height, xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: [0, 0, w, height].toString() },
@@ -40,9 +38,7 @@ async function renderToSvg(model, opts) {
40
38
  react_1.default.createElement("defs", null,
41
39
  react_1.default.createElement("clipPath", { id: "clip-ruler" },
42
40
  react_1.default.createElement("rect", { x: 0, y: 0, width: viewWidth, height: viewHeight }))),
43
- react_1.default.createElement("g", { clipPath: "url(#clip-ruler)" }, displayResults.map(({ result }, i) => (
44
- /* biome-ignore lint/suspicious/noArrayIndexKey: */
45
- react_1.default.createElement("g", { key: i }, result))))),
41
+ react_1.default.createElement("g", { clipPath: "url(#clip-ruler)" }, displayResults.map(({ result }, i) => (react_1.default.createElement("g", { key: i }, result))))),
46
42
  react_1.default.createElement("g", { transform: `translate(${borderX} ${viewHeight})` },
47
43
  react_1.default.createElement(Axes_1.HorizontalAxisRaw, { model: model }))))), createRootFn);
48
44
  }
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function LaunchDotplotView(pluginManager: PluginManager): void;
@@ -3,9 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = LaunchDotplotView;
4
4
  const mobx_1 = require("mobx");
5
5
  function LaunchDotplotView(pluginManager) {
6
- pluginManager.addToExtensionPoint('LaunchView-DotplotView',
7
- // @ts-expect-error
8
- async ({ session, views, tracks = [], }) => {
6
+ pluginManager.addToExtensionPoint('LaunchView-DotplotView', async ({ session, views, tracks = [], }) => {
9
7
  try {
10
8
  const model = session.addView('DotplotView', {});
11
9
  const assemblyNames = views.map(view => view.assembly);
@@ -16,7 +14,6 @@ function LaunchDotplotView(pluginManager) {
16
14
  ]);
17
15
  model.setAssemblyNames(assemblyNames[0], assemblyNames[1]);
18
16
  });
19
- // http://localhost:3000/?config=test_data%2Fvolvox%2Fconfig.json&session=spec-{"views":[{"type":"DotplotView","views":[{"assembly":"volvox"},{"assembly":"volvox"}],"tracks":["volvox_fake_synteny"]}]}
20
17
  const idsNotFound = [];
21
18
  tracks.forEach(track => {
22
19
  tryTrack(model, track, idsNotFound);
@@ -1,4 +1,5 @@
1
- import React, { CSSProperties } from 'react';
1
+ import type { CSSProperties } from 'react';
2
+ import React from 'react';
2
3
  declare const ServerSideRenderedDotplotContent: ({ model, style, }: {
3
4
  model: {
4
5
  error?: unknown;
@@ -24,10 +24,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  const react_1 = __importStar(require("react"));
27
- const mui_1 = require("tss-react/mui");
28
- const material_1 = require("@mui/material");
29
27
  const ui_1 = require("@jbrowse/core/ui");
28
+ const material_1 = require("@mui/material");
30
29
  const mobx_react_1 = require("mobx-react");
30
+ const mui_1 = require("tss-react/mui");
31
31
  const useStyles = (0, mui_1.makeStyles)()(theme => {
32
32
  const bg = theme.palette.action.disabledBackground;
33
33
  return {
@@ -49,7 +49,6 @@ const useStyles = (0, mui_1.makeStyles)()(theme => {
49
49
  };
50
50
  });
51
51
  function LoadingMessage() {
52
- // only show the loading message after 300ms to prevent excessive flickering
53
52
  const [shown, setShown] = (0, react_1.useState)(false);
54
53
  const { classes } = useStyles();
55
54
  (0, react_1.useEffect)(() => {
@@ -1,8 +1,4 @@
1
1
  import React from 'react';
2
- /**
3
- * A block whose content is rendered outside of the main thread and hydrated by
4
- * this component.
5
- */
6
2
  interface ModelType {
7
3
  imageData: string;
8
4
  style: Record<string, string>;
@@ -24,8 +24,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  const react_1 = __importStar(require("react"));
27
- const mobx_react_1 = require("mobx-react");
28
27
  const offscreenCanvasPonyfill_1 = require("@jbrowse/core/util/offscreenCanvasPonyfill");
28
+ const mobx_react_1 = require("mobx-react");
29
29
  const ServerSideSyntenyRendering = (0, mobx_react_1.observer)(function ({ model, }) {
30
30
  const { imageData, style, renderProps } = model;
31
31
  const { width, height, highResolutionScaling = 1 } = renderProps;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Plugin from '@jbrowse/core/Plugin';
2
- import PluginManager from '@jbrowse/core/PluginManager';
2
+ import type PluginManager from '@jbrowse/core/PluginManager';
3
3
  export default class DotplotPlugin extends Plugin {
4
4
  name: string;
5
5
  install(pluginManager: PluginManager): void;
package/dist/index.js CHANGED
@@ -5,15 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const Plugin_1 = __importDefault(require("@jbrowse/core/Plugin"));
7
7
  const util_1 = require("@jbrowse/core/util");
8
- // icons
9
8
  const Timeline_1 = __importDefault(require("@mui/icons-material/Timeline"));
10
- // locals
11
- const DotplotView_1 = __importDefault(require("./DotplotView"));
9
+ const ComparativeRenderer_1 = __importDefault(require("./ComparativeRenderer"));
12
10
  const DotplotDisplay_1 = __importDefault(require("./DotplotDisplay"));
11
+ const DotplotReadVsRef_1 = __importDefault(require("./DotplotReadVsRef"));
13
12
  const DotplotRenderer_1 = __importDefault(require("./DotplotRenderer"));
13
+ const DotplotView_1 = __importDefault(require("./DotplotView"));
14
14
  const LaunchDotplotView_1 = __importDefault(require("./LaunchDotplotView"));
15
- const ComparativeRenderer_1 = __importDefault(require("./ComparativeRenderer"));
16
- const DotplotReadVsRef_1 = __importDefault(require("./DotplotReadVsRef"));
17
15
  class DotplotPlugin extends Plugin_1.default {
18
16
  constructor() {
19
17
  super(...arguments);
@@ -25,7 +23,6 @@ class DotplotPlugin extends Plugin_1.default {
25
23
  (0, DotplotRenderer_1.default)(pluginManager);
26
24
  (0, LaunchDotplotView_1.default)(pluginManager);
27
25
  (0, DotplotReadVsRef_1.default)(pluginManager);
28
- // install our comparative rendering rpc callback
29
26
  pluginManager.addRpcMethod(() => new ComparativeRenderer_1.default(pluginManager));
30
27
  }
31
28
  configure(pluginManager) {
package/dist/util.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Feature } from '@jbrowse/core/util';
1
+ import type { Feature } from '@jbrowse/core/util';
2
2
  export interface ReducedFeature {
3
3
  refName: string;
4
4
  start: number;
@@ -1,6 +1,6 @@
1
1
  import RpcMethodType from '@jbrowse/core/pluggableElementTypes/RpcMethodType';
2
- import ComparativeRenderer, { RenderArgs as ComparativeRenderArgs, RenderArgsSerialized as ComparativeRenderArgsSerialized, RenderResults, ResultsSerialized } from '@jbrowse/core/pluggableElementTypes/renderers/ComparativeServerSideRendererType';
3
- import { RemoteAbortSignal } from '@jbrowse/core/rpc/remoteAbortSignals';
2
+ import type { RenderArgs as ComparativeRenderArgs, RenderArgsSerialized as ComparativeRenderArgsSerialized, RenderResults, ResultsSerialized } from '@jbrowse/core/pluggableElementTypes/renderers/ComparativeServerSideRendererType';
3
+ import type ComparativeRenderer from '@jbrowse/core/pluggableElementTypes/renderers/ComparativeServerSideRendererType';
4
4
  interface RenderArgs extends ComparativeRenderArgs {
5
5
  adapterConfig: Record<string, unknown>;
6
6
  rendererType: string;
@@ -9,18 +9,13 @@ interface RenderArgsSerialized extends ComparativeRenderArgsSerialized {
9
9
  adapterConfig: Record<string, unknown>;
10
10
  rendererType: string;
11
11
  }
12
- /**
13
- * call a synteny renderer with the given args
14
- * param views: a set of views that each contain a set of regions
15
- * used instead of passing regions directly as in render()
16
- */
17
12
  export default class ComparativeRender extends RpcMethodType {
18
13
  name: string;
19
14
  renameRegionsIfNeeded(args: RenderArgs, rend: ComparativeRenderer): Promise<ComparativeRenderArgs>;
20
15
  getRenderer(rendererType: string): ComparativeRenderer;
21
16
  serializeArguments(args: RenderArgs, rpcDriver: string): Promise<ComparativeRenderArgs | import("@jbrowse/core/pluggableElementTypes/renderers/ServerSideRendererType").RenderArgsSerialized>;
22
17
  execute(args: RenderArgsSerialized & {
23
- signal?: RemoteAbortSignal;
18
+ stopToken?: string;
24
19
  }, rpcDriver: string): Promise<RenderResults | import("@jbrowse/core/pluggableElementTypes/renderers/ServerSideRendererType").ResultsSerialized>;
25
20
  deserializeReturn(val: RenderResults | ResultsSerialized, args: RenderArgs, rpcDriver: string): Promise<unknown>;
26
21
  }