@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
@@ -1,47 +1,28 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration';
2
2
  import { types } from 'mobx-state-tree';
3
- /**
4
- * #config DotplotRenderer
5
- * #category renderer
6
- */
7
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ function x() { }
8
4
  export default ConfigurationSchema('DotplotRenderer', {
9
- /**
10
- * #slot
11
- */
12
5
  color: {
13
6
  type: 'color',
14
7
  description: 'the color of each feature in a synteny, used with colorBy:default',
15
8
  defaultValue: '#f0f',
16
9
  contextVariable: ['feature'],
17
10
  },
18
- /**
19
- * #slot
20
- */
21
11
  posColor: {
22
12
  type: 'color',
23
13
  description: 'the color for forward alignments, used with colorBy:strand',
24
14
  defaultValue: 'blue',
25
15
  },
26
- /**
27
- * #slot
28
- */
29
16
  negColor: {
30
17
  type: 'color',
31
18
  description: 'the color for reverse alignments, used with colorBy:strand',
32
19
  defaultValue: 'red',
33
20
  },
34
- /**
35
- * #slot
36
- */
37
21
  lineWidth: {
38
22
  type: 'number',
39
23
  description: 'width of the lines to be drawn',
40
- defaultValue: 2.5, // 2.5 is similar to D-GENIES
24
+ defaultValue: 2.5,
41
25
  },
42
- /**
43
- * #slot
44
- */
45
26
  colorBy: {
46
27
  type: 'stringEnum',
47
28
  model: types.enumeration('colorBy', [
@@ -61,17 +42,11 @@ export default ConfigurationSchema('DotplotRenderer', {
61
42
  </ul>`,
62
43
  defaultValue: 'default',
63
44
  },
64
- /**
65
- * #slot
66
- */
67
45
  thresholdsPalette: {
68
46
  type: 'stringArray',
69
47
  defaultValue: ['#094b09', '#2ebd40', '#d5670b', '#ffd84b'],
70
48
  description: 'threshold colors, used with colorBy:identity',
71
49
  },
72
- /**
73
- * #slot
74
- */
75
50
  thresholds: {
76
51
  type: 'stringArray',
77
52
  defaultValue: ['0.75', '0.5', '0.25', '0'],
@@ -1,6 +1,6 @@
1
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
2
- import { RenderArgsDeserialized } from '@jbrowse/core/pluggableElementTypes/renderers/ComparativeServerSideRendererType';
3
- import { Dotplot1DViewModel } from '../DotplotView/model';
1
+ import type { Dotplot1DViewModel } from '../DotplotView/model';
2
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
+ import type { RenderArgsDeserialized } from '@jbrowse/core/pluggableElementTypes/renderers/ComparativeServerSideRendererType';
4
4
  export interface DotplotRenderArgsDeserialized extends RenderArgsDeserialized {
5
5
  adapterConfig: AnyConfigurationModel;
6
6
  height: number;
@@ -1,13 +1,13 @@
1
- import { readConfObject, } from '@jbrowse/core/configuration';
1
+ import { readConfObject } from '@jbrowse/core/configuration';
2
+ import { createJBrowseTheme } from '@jbrowse/core/ui';
2
3
  import { bpToPx } from '@jbrowse/core/util/Base1DUtils';
3
- import { getSnapshot } from 'mobx-state-tree';
4
4
  import { MismatchParser } from '@jbrowse/plugin-alignments';
5
- import { createJBrowseTheme } from '@jbrowse/core/ui';
5
+ import { getSnapshot } from 'mobx-state-tree';
6
6
  const { parseCigar } = MismatchParser;
7
7
  const r = 'fell outside of range due to CIGAR string';
8
8
  const lt = '(less than min coordinate of feature)';
9
9
  const gt = '(greater than max coordinate of feature)';
10
- const fudgeFactor = 1; // allow 1px fuzzyness before warn
10
+ const fudgeFactor = 1;
11
11
  function drawCir(ctx, x, y, r = 1) {
12
12
  ctx.beginPath();
13
13
  ctx.arc(x, y, r / 2, 0, 2 * Math.PI);
@@ -30,8 +30,6 @@ export async function drawDotplot(ctx, props) {
30
30
  const db2 = (_b = vview.dynamicBlocks.contentBlocks[0]) === null || _b === void 0 ? void 0 : _b.offsetPx;
31
31
  const warnings = [];
32
32
  ctx.lineWidth = lineWidth;
33
- // we operate on snapshots of these attributes of the hview/vview because
34
- // it is significantly faster than accessing the mobx objects
35
33
  const { bpPerPx: hBpPerPx } = hview;
36
34
  const { bpPerPx: vBpPerPx } = vview;
37
35
  function clampWithWarnX(num, min, max, feature) {
@@ -174,7 +172,6 @@ export async function drawDotplot(ctx, props) {
174
172
  }
175
173
  currX = clampWithWarnX(currX, b1, b2, feature);
176
174
  currY = clampWithWarnY(currY, e1, e2, feature);
177
- // only draw a line segment if it is bigger than 0.5px
178
175
  if (Math.abs(currX - lastDrawnX) > 0.5 ||
179
176
  Math.abs(currY - lastDrawnY) > 0.5) {
180
177
  ctx.lineTo(currX, height - currY);
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function DotplotRendererF(pluginManager: PluginManager): void;
@@ -1,5 +1,5 @@
1
- import ReactComponent from './components/DotplotRendering';
2
1
  import DotplotRenderer from './DotplotRenderer';
2
+ import ReactComponent from './components/DotplotRendering';
3
3
  import configSchema from './configSchema';
4
4
  export default function DotplotRendererF(pluginManager) {
5
5
  pluginManager.addRendererType(() => new DotplotRenderer({
@@ -1,4 +1,4 @@
1
- import { Instance } from 'mobx-state-tree';
1
+ import type { Instance } from 'mobx-state-tree';
2
2
  declare const Dotplot1DView: import("mobx-state-tree").IModelType<{
3
3
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
4
4
  displayedRegions: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[]>, [undefined]>;
@@ -53,39 +53,14 @@ declare const Dotplot1DView: import("mobx-state-tree").IModelType<{
53
53
  } & {
54
54
  moveTo(start?: import("@jbrowse/core/util/Base1DUtils").BpOffset, end?: import("@jbrowse/core/util/Base1DUtils").BpOffset): void;
55
55
  } & {
56
- /**
57
- * #action
58
- */
59
56
  setScaleFactor(n: number): void;
60
- /**
61
- * #action
62
- */
63
57
  center(): void;
64
58
  } & {
65
- /**
66
- * #getter
67
- * this uses padding=false and elision=false
68
- */
69
59
  readonly dynamicBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
70
- /**
71
- * #getter
72
- */
73
60
  readonly scaleFactor: number;
74
- /**
75
- * #getter
76
- */
77
61
  readonly maxBpPerPx: number;
78
- /**
79
- * #getter
80
- */
81
62
  readonly minBpPerPx: number;
82
- /**
83
- * #getter
84
- */
85
63
  readonly maxOffset: number;
86
- /**
87
- * #getter
88
- */
89
64
  readonly minOffset: number;
90
65
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
91
66
  declare const DotplotHView: import("mobx-state-tree").IModelType<{
@@ -142,39 +117,14 @@ declare const DotplotHView: import("mobx-state-tree").IModelType<{
142
117
  } & {
143
118
  moveTo(start?: import("@jbrowse/core/util/Base1DUtils").BpOffset, end?: import("@jbrowse/core/util/Base1DUtils").BpOffset): void;
144
119
  } & {
145
- /**
146
- * #action
147
- */
148
120
  setScaleFactor(n: number): void;
149
- /**
150
- * #action
151
- */
152
121
  center(): void;
153
122
  } & {
154
- /**
155
- * #getter
156
- * this uses padding=false and elision=false
157
- */
158
123
  readonly dynamicBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
159
- /**
160
- * #getter
161
- */
162
124
  readonly scaleFactor: number;
163
- /**
164
- * #getter
165
- */
166
125
  readonly maxBpPerPx: number;
167
- /**
168
- * #getter
169
- */
170
126
  readonly minBpPerPx: number;
171
- /**
172
- * #getter
173
- */
174
127
  readonly maxOffset: number;
175
- /**
176
- * #getter
177
- */
178
128
  readonly minOffset: number;
179
129
  } & {
180
130
  readonly width: any;
@@ -233,42 +183,17 @@ declare const DotplotVView: import("mobx-state-tree").IModelType<{
233
183
  } & {
234
184
  moveTo(start?: import("@jbrowse/core/util/Base1DUtils").BpOffset, end?: import("@jbrowse/core/util/Base1DUtils").BpOffset): void;
235
185
  } & {
236
- /**
237
- * #action
238
- */
239
186
  setScaleFactor(n: number): void;
240
- /**
241
- * #action
242
- */
243
187
  center(): void;
244
188
  } & {
245
- /**
246
- * #getter
247
- * this uses padding=false and elision=false
248
- */
249
189
  readonly dynamicBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
250
- /**
251
- * #getter
252
- */
253
190
  readonly scaleFactor: number;
254
- /**
255
- * #getter
256
- */
257
191
  readonly maxBpPerPx: number;
258
- /**
259
- * #getter
260
- */
261
192
  readonly minBpPerPx: number;
262
- /**
263
- * #getter
264
- */
265
193
  readonly maxOffset: number;
266
- /**
267
- * #getter
268
- */
269
194
  readonly minOffset: number;
270
195
  } & {
271
196
  readonly width: any;
272
197
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
273
- export { DotplotVView, DotplotHView, Dotplot1DView };
198
+ export { Dotplot1DView, DotplotHView, DotplotVView };
274
199
  export type Dotplot1DViewModel = Instance<typeof Dotplot1DView>;
@@ -1,64 +1,35 @@
1
- import { getParent } from 'mobx-state-tree';
2
- import { observable } from 'mobx';
3
1
  import Base1DView from '@jbrowse/core/util/Base1DViewModel';
4
2
  import calculateDynamicBlocks from '@jbrowse/core/util/calculateDynamicBlocks';
5
- /**
6
- * #stateModel Dotplot1DView
7
- * ref https://mobx-state-tree.js.org/concepts/volatiles on volatile state used here
8
- */
9
- function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ import { observable } from 'mobx';
4
+ import { getParent } from 'mobx-state-tree';
5
+ function x() { }
10
6
  const Dotplot1DView = Base1DView.extend(self => {
11
7
  const scaleFactor = observable.box(1);
12
8
  return {
13
9
  views: {
14
- /**
15
- * #getter
16
- * this uses padding=false and elision=false
17
- */
18
10
  get dynamicBlocks() {
19
11
  return calculateDynamicBlocks(self, false, false);
20
12
  },
21
- /**
22
- * #getter
23
- */
24
13
  get scaleFactor() {
25
14
  return scaleFactor.get();
26
15
  },
27
- /**
28
- * #getter
29
- */
30
16
  get maxBpPerPx() {
31
17
  return self.totalBp / (self.width - 50);
32
18
  },
33
- /**
34
- * #getter
35
- */
36
19
  get minBpPerPx() {
37
20
  return 1 / 50;
38
21
  },
39
- /**
40
- * #getter
41
- */
42
22
  get maxOffset() {
43
23
  return self.displayedRegionsTotalPx - self.width * 0.2;
44
24
  },
45
- /**
46
- * #getter
47
- */
48
25
  get minOffset() {
49
26
  return -self.width * 0.8;
50
27
  },
51
28
  },
52
29
  actions: {
53
- /**
54
- * #action
55
- */
56
30
  setScaleFactor(n) {
57
31
  scaleFactor.set(n);
58
32
  },
59
- /**
60
- * #action
61
- */
62
33
  center() {
63
34
  const centerBp = self.totalBp / 2;
64
35
  const centerPx = centerBp / self.bpPerPx;
@@ -81,4 +52,4 @@ const DotplotVView = Dotplot1DView.extend(self => ({
81
52
  },
82
53
  },
83
54
  }));
84
- export { DotplotVView, DotplotHView, Dotplot1DView };
55
+ export { Dotplot1DView, DotplotHView, DotplotVView };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DotplotViewModel } from '../model';
2
+ import type { DotplotViewModel } from '../model';
3
3
  export declare const HorizontalAxis: ({ model, }: {
4
4
  model: DotplotViewModel;
5
5
  }) => React.JSX.Element;
@@ -1,11 +1,10 @@
1
1
  import React from 'react';
2
- import { makeStyles } from 'tss-react/mui';
3
- import { observer } from 'mobx-react';
4
- import { getSnapshot } from 'mobx-state-tree';
5
2
  import { getFillProps, getStrokeProps, getTickDisplayStr, } from '@jbrowse/core/util';
6
3
  import { bpToPx } from '@jbrowse/core/util/Base1DUtils';
7
4
  import { useTheme } from '@mui/material';
8
- // locals
5
+ import { observer } from 'mobx-react';
6
+ import { getSnapshot } from 'mobx-state-tree';
7
+ import { makeStyles } from 'tss-react/mui';
9
8
  import { getBlockLabelKeysToHide } from './util';
10
9
  const useStyles = makeStyles()(() => ({
11
10
  vtext: {
@@ -1,4 +1,4 @@
1
- import { SvgIconProps } from '@mui/material/SvgIcon';
2
1
  import React from 'react';
2
+ import type { SvgIconProps } from '@mui/material/SvgIcon';
3
3
  export declare function CursorMove(props: SvgIconProps): React.JSX.Element;
4
4
  export declare function CursorMouse(props: SvgIconProps): React.JSX.Element;
@@ -1,5 +1,5 @@
1
- import SvgIcon from '@mui/material/SvgIcon';
2
1
  import React from 'react';
2
+ import SvgIcon from '@mui/material/SvgIcon';
3
3
  export function CursorMove(props) {
4
4
  return (React.createElement(SvgIcon, { ...props },
5
5
  React.createElement("path", { fill: "currentColor", d: "M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z" })));
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DotplotViewModel } from '../model';
2
+ import type { DotplotViewModel } from '../model';
3
3
  declare const DotplotControls: ({ model, }: {
4
4
  model: DotplotViewModel;
5
5
  }) => React.JSX.Element;
@@ -1,13 +1,12 @@
1
1
  import React from 'react';
2
- import { IconButton } from '@mui/material';
3
- import { observer } from 'mobx-react';
4
2
  import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
5
- // icons
6
- import ZoomOut from '@mui/icons-material/ZoomOut';
7
- import ZoomIn from '@mui/icons-material/ZoomIn';
3
+ import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons';
8
4
  import MoreVert from '@mui/icons-material/MoreVert';
5
+ import ZoomIn from '@mui/icons-material/ZoomIn';
6
+ import ZoomOut from '@mui/icons-material/ZoomOut';
7
+ import { IconButton } from '@mui/material';
8
+ import { observer } from 'mobx-react';
9
9
  import { CursorMouse, CursorMove } from './CursorIcon';
10
- import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons';
11
10
  const DotplotControls = observer(function ({ model, }) {
12
11
  return (React.createElement("div", null,
13
12
  React.createElement(IconButton, { onClick: () => {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DotplotViewModel } from '../model';
2
+ import type { DotplotViewModel } from '../model';
3
3
  type Coord = [number, number] | undefined;
4
4
  export declare const DotplotTooltipClick: ({ model, mousedown, mousedownClient, xdistance, ydistance, }: {
5
5
  model: DotplotViewModel;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { observer } from 'mobx-react';
3
2
  import BaseTooltip from '@jbrowse/core/ui/BaseTooltip';
3
+ import { observer } from 'mobx-react';
4
4
  import { locstr } from './util';
5
5
  export const DotplotTooltipClick = observer(function ({ model, mousedown, mousedownClient, xdistance, ydistance, }) {
6
6
  const { hview, vview, viewHeight } = model;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DotplotViewModel } from '../model';
2
+ import type { DotplotViewModel } from '../model';
3
3
  type Coord = [number, number] | undefined;
4
4
  declare const DotplotTooltipMouseover: ({ model, mouserect, mouserectClient, xdistance, }: {
5
5
  model: DotplotViewModel;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { observer } from 'mobx-react';
3
2
  import BaseTooltip from '@jbrowse/core/ui/BaseTooltip';
3
+ import { observer } from 'mobx-react';
4
4
  import { locstr } from './util';
5
5
  const DotplotTooltipMouseover = observer(function ({ model, mouserect, mouserectClient, xdistance, }) {
6
6
  const { hview, vview, viewHeight } = model;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DotplotViewModel } from '../model';
2
+ import type { DotplotViewModel } from '../model';
3
3
  declare const DotplotView: ({ model }: {
4
4
  model: DotplotViewModel;
5
5
  }) => React.JSX.Element;
@@ -1,12 +1,12 @@
1
- import React, { useState, useEffect, useRef, lazy, Suspense } from 'react';
1
+ import React, { Suspense, lazy, useEffect, useRef, useState } from 'react';
2
2
  import { LoadingEllipses, Menu, ResizeHandle } from '@jbrowse/core/ui';
3
- import { observer } from 'mobx-react';
4
3
  import { transaction } from 'mobx';
4
+ import { observer } from 'mobx-react';
5
5
  import { makeStyles } from 'tss-react/mui';
6
- import ImportForm from './ImportForm';
7
- import Header from './Header';
6
+ import { HorizontalAxis, VerticalAxis } from './Axes';
8
7
  import Grid from './Grid';
9
- import { VerticalAxis, HorizontalAxis } from './Axes';
8
+ import Header from './Header';
9
+ import ImportForm from './ImportForm';
10
10
  const TooltipWhereClicked = lazy(() => import('./DotplotTooltipClick'));
11
11
  const TooltipWhereMouseovered = lazy(() => import('./DotplotTooltipMouseover'));
12
12
  const blank = { left: 0, top: 0, width: 0, height: 0 };
@@ -32,7 +32,7 @@ const useStyles = makeStyles()(theme => ({
32
32
  width: '100%',
33
33
  gridRow: '1/2',
34
34
  gridColumn: '2/2',
35
- zIndex: 100, // needs to be below controls
35
+ zIndex: 100,
36
36
  '& path': {
37
37
  cursor: 'crosshair',
38
38
  fill: 'none',
@@ -50,8 +50,6 @@ const useStyles = makeStyles()(theme => ({
50
50
  borderTop: '1px solid #fafafa',
51
51
  },
52
52
  }));
53
- // produces offsetX/offsetY coordinates from a clientX and an element's
54
- // getBoundingClientRect
55
53
  function getOffset(coord, rect) {
56
54
  return coord && [coord[0] - rect.left, coord[1] - rect.top];
57
55
  }
@@ -91,7 +89,6 @@ const DotplotViewInternal = observer(function ({ model, }) {
91
89
  (cursorMode === 'crosshair' && ctrlKeyWasUsed);
92
90
  const validSelect = (cursorMode === 'move' && ctrlKeyWasUsed) ||
93
91
  (cursorMode === 'crosshair' && !ctrlKeyWasUsed);
94
- // use non-React wheel handler to properly prevent body scrolling
95
92
  useEffect(() => {
96
93
  function onWheel(event) {
97
94
  event.preventDefault();
@@ -160,8 +157,6 @@ const DotplotViewInternal = observer(function ({ model, }) {
160
157
  window.addEventListener('keyup', globalCtrlKeyUp);
161
158
  };
162
159
  }, []);
163
- // detect a mouseup after a mousedown was submitted, autoremoves mouseup once
164
- // that single mouseup is set
165
160
  useEffect(() => {
166
161
  function globalMouseUp(event) {
167
162
  if (Math.abs(xdistance) > 3 && Math.abs(ydistance) > 3 && validSelect) {
@@ -229,7 +224,6 @@ const DotplotViewInternal = observer(function ({ model, }) {
229
224
  if (mousedown && mouseup) {
230
225
  model.zoomInToMouseCoords(mousedown, mouseup);
231
226
  }
232
- // below line is needed to prevent tooltip from sticking
233
227
  setMouseOvered(false);
234
228
  },
235
229
  },
@@ -239,7 +233,6 @@ const DotplotViewInternal = observer(function ({ model, }) {
239
233
  if (mousedown && mouseup) {
240
234
  model.onDotplotView(mousedown, mouseup);
241
235
  }
242
- // below line is needed to prevent tooltip from sticking
243
236
  setMouseOvered(false);
244
237
  },
245
238
  },
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DotplotViewModel } from '../model';
2
+ import type { DotplotViewModel } from '../model';
3
3
  declare const DotplotWarnings: ({ model, }: {
4
4
  model: DotplotViewModel;
5
5
  }) => React.JSX.Element | null;
@@ -1,7 +1,6 @@
1
1
  import React, { lazy, useState } from 'react';
2
2
  import { Alert, Button } from '@mui/material';
3
3
  import { observer } from 'mobx-react';
4
- // lazy components
5
4
  const WarningDialog = lazy(() => import('./WarningDialog'));
6
5
  const DotplotWarnings = observer(function ({ model, }) {
7
6
  const trackWarnings = model.tracks.filter(t => { var _a; return (_a = t.displays[0].warnings) === null || _a === void 0 ? void 0 : _a.length; });
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ExportSvgOptions } from '../model';
2
+ import type { ExportSvgOptions } from '../model';
3
3
  export default function ExportSvgDialog({ model, handleClose, }: {
4
4
  model: {
5
5
  exportSvg(opts: ExportSvgOptions): Promise<void>;
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from 'react';
2
- import { Button, Checkbox, CircularProgress, DialogActions, DialogContent, FormControlLabel, MenuItem, TextField, Typography, } from '@mui/material';
3
2
  import { Dialog, ErrorMessage } from '@jbrowse/core/ui';
4
3
  import { getSession, useLocalStorage } from '@jbrowse/core/util';
4
+ import { Button, Checkbox, CircularProgress, DialogActions, DialogContent, FormControlLabel, MenuItem, TextField, Typography, } from '@mui/material';
5
5
  function LoadingMessage() {
6
6
  return (React.createElement("div", null,
7
7
  React.createElement(CircularProgress, { size: 20, style: { marginRight: 20 } }),
@@ -30,9 +30,7 @@ export default function ExportSvgDialog({ model, handleClose, }) {
30
30
  } }),
31
31
  session.allThemes ? (React.createElement(TextField2, { select: true, label: "Theme", value: themeName, onChange: event => {
32
32
  setThemeName(event.target.value);
33
- } }, Object.entries(session.allThemes()).map(([key, val]) => (React.createElement(MenuItem, { key: key, value: key },
34
- // @ts-expect-error
35
- val.name || '(Unknown name)'))))) : null,
33
+ } }, Object.entries(session.allThemes()).map(([key, val]) => (React.createElement(MenuItem, { key: key, value: key }, val.name || '(Unknown name)'))))) : null,
36
34
  offscreenCanvas ? (React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: rasterizeLayers, onChange: () => {
37
35
  setRasterizeLayers(val => !val);
38
36
  } }), label: "Rasterize canvas based tracks? File may be much larger if this is turned off" })) : (React.createElement(Typography, null, "Note: rasterizing layers not yet supported in this browser, so SVG size may be large"))),
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DotplotViewModel } from '../model';
2
+ import type { DotplotViewModel } from '../model';
3
3
  export declare const GridRaw: ({ model, children, }: {
4
4
  model: DotplotViewModel;
5
5
  children?: React.ReactNode;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { observer } from 'mobx-react';
3
- import { useTheme } from '@mui/material';
4
2
  import { getFillProps, getStrokeProps } from '@jbrowse/core/util';
3
+ import { useTheme } from '@mui/material';
4
+ import { observer } from 'mobx-react';
5
5
  export const GridRaw = observer(function ({ model, children, }) {
6
6
  const { viewWidth, viewHeight, hview, vview } = model;
7
7
  const hblocks = hview.dynamicBlocks.contentBlocks;
@@ -15,8 +15,6 @@ export const GridRaw = observer(function ({ model, children, }) {
15
15
  const vbottom = vblocks[0].offsetPx - vview.offsetPx;
16
16
  const theme = useTheme();
17
17
  const stroke = theme.palette.divider;
18
- // Uses math.max/min avoid making very large SVG rect offscreen element,
19
- // which can sometimes fail to draw
20
18
  const rx = Math.max(hbottom, 0);
21
19
  const ry = Math.max(viewHeight - vtop, 0);
22
20
  const w = Math.min(htop - hbottom, viewWidth);
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DotplotViewModel } from '../model';
2
+ import type { DotplotViewModel } from '../model';
3
3
  declare const DotplotHeader: ({ model, selection, }: {
4
4
  model: DotplotViewModel;
5
5
  selection?: {
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
+ import { getBpDisplayStr } from '@jbrowse/core/util';
2
3
  import { Typography } from '@mui/material';
3
4
  import { observer } from 'mobx-react';
4
5
  import { makeStyles } from 'tss-react/mui';
5
- import { getBpDisplayStr } from '@jbrowse/core/util';
6
+ import DotplotControls from './DotplotControls';
6
7
  import DotplotWarnings from './DotplotWarnings';
7
8
  import PanButtons from './PanButtons';
8
- import DotplotControls from './DotplotControls';
9
9
  const useStyles = makeStyles()({
10
10
  bp: {
11
11
  display: 'flex',
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { SnapshotIn } from 'mobx-state-tree';
3
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
2
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
+ import type { SnapshotIn } from 'mobx-state-tree';
4
4
  type Conf = SnapshotIn<AnyConfigurationModel>;
5
5
  declare const ImportCustomTrack: ({ assembly1, assembly2, setSessionTrackData, }: {
6
6
  sessionTrackData: Conf;
@@ -1,6 +1,6 @@
1
- import React, { useState, useEffect } from 'react';
2
- import { FormControlLabel, Grid, Paper, Radio, RadioGroup, Typography, } from '@mui/material';
1
+ import React, { useEffect, useState } from 'react';
3
2
  import { ErrorMessage, FileSelector } from '@jbrowse/core/ui';
3
+ import { FormControlLabel, Grid, Paper, Radio, RadioGroup, Typography, } from '@mui/material';
4
4
  import { observer } from 'mobx-react';
5
5
  import { basename, extName, getName, stripGz } from './util';
6
6
  function getAdapter({ radioOption, assembly1, assembly2, fileLocation, indexFileLocation, bed1Location, bed2Location, }) {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DotplotViewModel } from '../../model';
2
+ import type { DotplotViewModel } from '../../model';
3
3
  declare const Selector: ({ model, assembly1, assembly2, setShowTrackId, }: {
4
4
  model: DotplotViewModel;
5
5
  assembly1: string;