@jbrowse/plugin-dotplot-view 2.17.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) 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 +2 -3
  4. package/dist/DotplotDisplay/components/DotplotDisplay.js +7 -12
  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 +8 -45
  10. package/dist/DotplotDisplay/stateModelFactory.js +57 -100
  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 +8 -7
  18. package/dist/DotplotRenderer/DotplotRenderer.js +18 -9
  19. package/dist/DotplotRenderer/components/DotplotRendering.d.ts +2 -3
  20. package/dist/DotplotRenderer/components/DotplotRendering.js +2 -5
  21. package/dist/DotplotRenderer/configSchema.d.ts +0 -21
  22. package/dist/DotplotRenderer/configSchema.js +2 -27
  23. package/dist/DotplotRenderer/drawDotplot.d.ts +3 -3
  24. package/dist/DotplotRenderer/drawDotplot.js +3 -6
  25. package/dist/DotplotRenderer/index.d.ts +1 -1
  26. package/dist/DotplotRenderer/index.js +1 -1
  27. package/dist/DotplotView/1dview.d.ts +2 -77
  28. package/dist/DotplotView/1dview.js +4 -33
  29. package/dist/DotplotView/components/Axes.d.ts +5 -6
  30. package/dist/DotplotView/components/Axes.js +26 -40
  31. package/dist/DotplotView/components/CursorIcon.d.ts +3 -4
  32. package/dist/DotplotView/components/CursorIcon.js +3 -5
  33. package/dist/DotplotView/components/DotplotControls.d.ts +2 -3
  34. package/dist/DotplotView/components/DotplotControls.js +94 -97
  35. package/dist/DotplotView/components/DotplotTooltipClick.d.ts +2 -3
  36. package/dist/DotplotView/components/DotplotTooltipClick.js +3 -7
  37. package/dist/DotplotView/components/DotplotTooltipMouseover.d.ts +2 -3
  38. package/dist/DotplotView/components/DotplotTooltipMouseover.js +4 -8
  39. package/dist/DotplotView/components/DotplotView.d.ts +2 -3
  40. package/dist/DotplotView/components/DotplotView.js +80 -92
  41. package/dist/DotplotView/components/DotplotWarnings.d.ts +2 -3
  42. package/dist/DotplotView/components/DotplotWarnings.js +26 -21
  43. package/dist/DotplotView/components/ExportSvgDialog.d.ts +2 -3
  44. package/dist/DotplotView/components/ExportSvgDialog.js +32 -67
  45. package/dist/DotplotView/components/Grid.d.ts +3 -4
  46. package/dist/DotplotView/components/Grid.js +19 -32
  47. package/dist/DotplotView/components/Header.d.ts +2 -3
  48. package/dist/DotplotView/components/Header.js +4 -23
  49. package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +7 -0
  50. package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +129 -0
  51. package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +4 -6
  52. package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +17 -48
  53. package/dist/DotplotView/components/ImportForm/TrackSelector.d.ts +7 -0
  54. package/dist/DotplotView/components/ImportForm/TrackSelector.js +23 -0
  55. package/dist/DotplotView/components/ImportForm/getAdapter.d.ts +117 -0
  56. package/dist/DotplotView/components/ImportForm/getAdapter.js +68 -0
  57. package/dist/DotplotView/components/ImportForm/index.d.ts +3 -4
  58. package/dist/DotplotView/components/ImportForm/index.js +47 -97
  59. package/dist/DotplotView/components/ImportForm/util.js +1 -3
  60. package/dist/DotplotView/components/PanButtons.d.ts +2 -3
  61. package/dist/DotplotView/components/PanButtons.js +17 -36
  62. package/dist/DotplotView/components/WarningDialog.d.ts +7 -7
  63. package/dist/DotplotView/components/WarningDialog.js +12 -15
  64. package/dist/DotplotView/components/util.d.ts +2 -7
  65. package/dist/DotplotView/components/util.js +0 -5
  66. package/dist/DotplotView/index.d.ts +1 -1
  67. package/dist/DotplotView/index.js +17 -8
  68. package/dist/DotplotView/model.d.ts +11 -133
  69. package/dist/DotplotView/model.js +46 -222
  70. package/dist/DotplotView/svgcomponents/SVGBackground.d.ts +1 -2
  71. package/dist/DotplotView/svgcomponents/SVGBackground.js +3 -6
  72. package/dist/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
  73. package/dist/DotplotView/svgcomponents/SVGDotplotView.js +6 -24
  74. package/dist/DotplotView/types.d.ts +12 -0
  75. package/dist/DotplotView/types.js +2 -0
  76. package/dist/LaunchDotplotView.d.ts +1 -1
  77. package/dist/LaunchDotplotView.js +1 -4
  78. package/dist/ServerSideRenderedBlockContent.d.ts +2 -2
  79. package/dist/ServerSideRenderedBlockContent.js +11 -37
  80. package/dist/ServerSideSyntenyRendering.d.ts +1 -6
  81. package/dist/ServerSideSyntenyRendering.js +4 -26
  82. package/dist/index.d.ts +1 -1
  83. package/dist/index.js +3 -6
  84. package/dist/util.d.ts +1 -1
  85. package/esm/ComparativeRenderer/index.d.ts +3 -8
  86. package/esm/ComparativeRenderer/index.js +3 -8
  87. package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +2 -3
  88. package/esm/DotplotDisplay/components/DotplotDisplay.js +7 -9
  89. package/esm/DotplotDisplay/index.d.ts +1 -7
  90. package/esm/DotplotDisplay/index.js +2 -12
  91. package/esm/DotplotDisplay/renderDotplotBlock.d.ts +1 -1
  92. package/esm/DotplotDisplay/renderDotplotBlock.js +3 -6
  93. package/esm/DotplotDisplay/stateModelFactory.d.ts +8 -45
  94. package/esm/DotplotDisplay/stateModelFactory.js +58 -101
  95. package/esm/DotplotReadVsRef/DotplotReadVsRef.d.ts +2 -2
  96. package/esm/DotplotReadVsRef/DotplotReadVsRef.js +15 -16
  97. package/esm/DotplotReadVsRef/index.d.ts +1 -1
  98. package/esm/DotplotReadVsRef/index.js +0 -2
  99. package/esm/DotplotRenderer/ComparativeRenderRpc.d.ts +3 -8
  100. package/esm/DotplotRenderer/ComparativeRenderRpc.js +3 -8
  101. package/esm/DotplotRenderer/DotplotRenderer.d.ts +8 -7
  102. package/esm/DotplotRenderer/DotplotRenderer.js +1 -2
  103. package/esm/DotplotRenderer/components/DotplotRendering.d.ts +2 -3
  104. package/esm/DotplotRenderer/components/DotplotRendering.js +2 -2
  105. package/esm/DotplotRenderer/configSchema.d.ts +0 -21
  106. package/esm/DotplotRenderer/configSchema.js +2 -27
  107. package/esm/DotplotRenderer/drawDotplot.d.ts +3 -3
  108. package/esm/DotplotRenderer/drawDotplot.js +4 -7
  109. package/esm/DotplotRenderer/index.d.ts +1 -1
  110. package/esm/DotplotRenderer/index.js +1 -1
  111. package/esm/DotplotView/1dview.d.ts +2 -77
  112. package/esm/DotplotView/1dview.js +4 -33
  113. package/esm/DotplotView/components/Axes.d.ts +5 -6
  114. package/esm/DotplotView/components/Axes.js +26 -37
  115. package/esm/DotplotView/components/CursorIcon.d.ts +3 -4
  116. package/esm/DotplotView/components/CursorIcon.js +3 -5
  117. package/esm/DotplotView/components/DotplotControls.d.ts +2 -3
  118. package/esm/DotplotView/components/DotplotControls.js +94 -97
  119. package/esm/DotplotView/components/DotplotTooltipClick.d.ts +2 -3
  120. package/esm/DotplotView/components/DotplotTooltipClick.js +3 -7
  121. package/esm/DotplotView/components/DotplotTooltipMouseover.d.ts +2 -3
  122. package/esm/DotplotView/components/DotplotTooltipMouseover.js +4 -8
  123. package/esm/DotplotView/components/DotplotView.d.ts +2 -3
  124. package/esm/DotplotView/components/DotplotView.js +63 -85
  125. package/esm/DotplotView/components/DotplotWarnings.d.ts +2 -3
  126. package/esm/DotplotView/components/DotplotWarnings.js +9 -14
  127. package/esm/DotplotView/components/ExportSvgDialog.d.ts +2 -3
  128. package/esm/DotplotView/components/ExportSvgDialog.js +32 -44
  129. package/esm/DotplotView/components/Grid.d.ts +3 -4
  130. package/esm/DotplotView/components/Grid.js +19 -29
  131. package/esm/DotplotView/components/Header.d.ts +2 -3
  132. package/esm/DotplotView/components/Header.js +4 -23
  133. package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +7 -0
  134. package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +124 -0
  135. package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +4 -6
  136. package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +17 -25
  137. package/esm/DotplotView/components/ImportForm/TrackSelector.d.ts +7 -0
  138. package/esm/DotplotView/components/ImportForm/TrackSelector.js +18 -0
  139. package/esm/DotplotView/components/ImportForm/getAdapter.d.ts +117 -0
  140. package/esm/DotplotView/components/ImportForm/getAdapter.js +65 -0
  141. package/esm/DotplotView/components/ImportForm/index.d.ts +3 -4
  142. package/esm/DotplotView/components/ImportForm/index.js +48 -75
  143. package/esm/DotplotView/components/ImportForm/util.js +1 -3
  144. package/esm/DotplotView/components/PanButtons.d.ts +2 -3
  145. package/esm/DotplotView/components/PanButtons.js +17 -36
  146. package/esm/DotplotView/components/WarningDialog.d.ts +7 -7
  147. package/esm/DotplotView/components/WarningDialog.js +12 -12
  148. package/esm/DotplotView/components/util.d.ts +2 -7
  149. package/esm/DotplotView/components/util.js +0 -5
  150. package/esm/DotplotView/index.d.ts +1 -1
  151. package/esm/DotplotView/index.js +0 -1
  152. package/esm/DotplotView/model.d.ts +11 -133
  153. package/esm/DotplotView/model.js +30 -216
  154. package/esm/DotplotView/svgcomponents/SVGBackground.d.ts +1 -2
  155. package/esm/DotplotView/svgcomponents/SVGBackground.js +3 -3
  156. package/esm/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
  157. package/esm/DotplotView/svgcomponents/SVGDotplotView.js +6 -24
  158. package/esm/DotplotView/types.d.ts +12 -0
  159. package/esm/DotplotView/types.js +1 -0
  160. package/esm/LaunchDotplotView.d.ts +1 -1
  161. package/esm/LaunchDotplotView.js +1 -4
  162. package/esm/ServerSideRenderedBlockContent.d.ts +2 -2
  163. package/esm/ServerSideRenderedBlockContent.js +11 -14
  164. package/esm/ServerSideSyntenyRendering.d.ts +1 -6
  165. package/esm/ServerSideSyntenyRendering.js +4 -3
  166. package/esm/index.d.ts +1 -1
  167. package/esm/index.js +3 -6
  168. package/esm/util.d.ts +1 -1
  169. package/package.json +2 -4
  170. package/dist/DotplotView/components/ImportForm/ImportCustomTrack.d.ts +0 -11
  171. package/dist/DotplotView/components/ImportForm/ImportCustomTrack.js +0 -194
  172. package/esm/DotplotView/components/ImportForm/ImportCustomTrack.d.ts +0 -11
  173. package/esm/DotplotView/components/ImportForm/ImportCustomTrack.js +0 -169
@@ -1,32 +1,21 @@
1
- import React from 'react';
2
- import { types } from 'mobx-state-tree';
3
- import { getConf, ConfigurationReference, } from '@jbrowse/core/configuration';
4
- import { getParentRenderProps } from '@jbrowse/core/util/tracks';
5
- import { getContainingView, makeAbortableReaction, ReactRendering, } from '@jbrowse/core/util';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ConfigurationReference, getConf } from '@jbrowse/core/configuration';
6
3
  import { BaseDisplay } from '@jbrowse/core/pluggableElementTypes/models';
7
- // locals
4
+ import { ReactRendering, getContainingView, makeAbortableReaction, } from '@jbrowse/core/util';
5
+ import { getParentRenderProps } from '@jbrowse/core/util/tracks';
6
+ import { types } from 'mobx-state-tree';
8
7
  import ServerSideRenderedBlockContent from '../ServerSideRenderedBlockContent';
9
8
  import { renderBlockData, renderBlockEffect } from './renderDotplotBlock';
10
- /**
11
- * #stateModel DotplotDisplay
12
- * #category display
13
- */
14
9
  export function stateModelFactory(configSchema) {
15
10
  return types
16
11
  .compose('DotplotDisplay', BaseDisplay, types
17
12
  .model({
18
- /**
19
- * #property
20
- */
21
13
  type: types.literal('DotplotDisplay'),
22
- /**
23
- * #property
24
- */
25
14
  configuration: ConfigurationReference(configSchema),
26
15
  })
27
16
  .volatile(() => ({
17
+ stopToken: undefined,
28
18
  warnings: [],
29
- renderInProgress: undefined,
30
19
  filled: false,
31
20
  data: undefined,
32
21
  reactElement: undefined,
@@ -40,15 +29,9 @@ export function stateModelFactory(configSchema) {
40
29
  return (vview.bpPerPx === self.data.bpPerPxY &&
41
30
  hview.bpPerPx === self.data.bpPerPxX);
42
31
  },
43
- /**
44
- * #getter
45
- */
46
32
  get rendererTypeName() {
47
33
  return getConf(self, ['renderer', 'type']);
48
34
  },
49
- /**
50
- * #method
51
- */
52
35
  renderProps() {
53
36
  return {
54
37
  ...getParentRenderProps(self),
@@ -59,9 +42,6 @@ export function stateModelFactory(configSchema) {
59
42
  },
60
43
  }))
61
44
  .views(self => ({
62
- /**
63
- * #method
64
- */
65
45
  async renderSvg(opts) {
66
46
  const props = renderBlockData(self);
67
47
  if (!props) {
@@ -76,81 +56,58 @@ export function stateModelFactory(configSchema) {
76
56
  const { hview, vview } = getContainingView(self);
77
57
  const offX = -hview.offsetPx + rendering.offsetX;
78
58
  const offY = -vview.offsetPx + rendering.offsetY;
79
- return (React.createElement("g", { transform: `translate(${offX} ${-offY})` },
80
- React.createElement(ReactRendering, { rendering: rendering })));
59
+ return (_jsx("g", { transform: `translate(${offX} ${-offY})`, children: _jsx(ReactRendering, { rendering: rendering }) }));
81
60
  },
82
61
  }))
83
- .actions(self => {
84
- let renderInProgress;
85
- return {
86
- afterAttach() {
87
- makeAbortableReaction(self, () => renderBlockData(self), blockData => renderBlockEffect(blockData), {
88
- name: `${self.type} ${self.id} rendering`,
89
- delay: 500,
90
- fireImmediately: true,
91
- }, this.setLoading, this.setRendered, this.setError);
92
- },
93
- /**
94
- * #action
95
- */
96
- setLoading(abortController) {
97
- self.filled = false;
98
- self.message = undefined;
99
- self.reactElement = undefined;
100
- self.data = undefined;
101
- self.error = undefined;
102
- self.renderingComponent = undefined;
103
- renderInProgress = abortController;
104
- },
105
- /**
106
- * #action
107
- */
108
- setMessage(messageText) {
109
- if (renderInProgress && !renderInProgress.signal.aborted) {
110
- renderInProgress.abort();
111
- }
112
- self.filled = false;
113
- self.message = messageText;
114
- self.reactElement = undefined;
115
- self.data = undefined;
116
- self.error = undefined;
117
- self.renderingComponent = undefined;
118
- renderInProgress = undefined;
119
- },
120
- /**
121
- * #action
122
- */
123
- setRendered(args) {
124
- if (args === undefined) {
125
- return;
126
- }
127
- const { data, reactElement, renderingComponent } = args;
128
- self.warnings = data.warnings;
129
- self.filled = true;
130
- self.message = undefined;
131
- self.reactElement = reactElement;
132
- self.data = data;
133
- self.error = undefined;
134
- self.renderingComponent = renderingComponent;
135
- renderInProgress = undefined;
136
- },
137
- /**
138
- * #action
139
- */
140
- setError(error) {
141
- console.error(error);
142
- if (renderInProgress && !renderInProgress.signal.aborted) {
143
- renderInProgress.abort();
144
- }
145
- // the rendering failed for some reason
146
- self.filled = false;
147
- self.message = undefined;
148
- self.reactElement = undefined;
149
- self.data = undefined;
150
- self.error = error;
151
- self.renderingComponent = undefined;
152
- renderInProgress = undefined;
153
- },
154
- };
155
- });
62
+ .actions(self => ({
63
+ afterAttach() {
64
+ makeAbortableReaction(self, () => renderBlockData(self), blockData => renderBlockEffect(blockData), {
65
+ name: `${self.type} ${self.id} rendering`,
66
+ delay: 500,
67
+ fireImmediately: true,
68
+ }, this.setLoading, this.setRendered, this.setError);
69
+ },
70
+ setLoading(stopToken) {
71
+ self.filled = false;
72
+ self.message = undefined;
73
+ self.reactElement = undefined;
74
+ self.data = undefined;
75
+ self.error = undefined;
76
+ self.renderingComponent = undefined;
77
+ self.stopToken = stopToken;
78
+ },
79
+ setMessage(messageText) {
80
+ self.filled = false;
81
+ self.message = messageText;
82
+ self.reactElement = undefined;
83
+ self.data = undefined;
84
+ self.error = undefined;
85
+ self.renderingComponent = undefined;
86
+ self.stopToken = undefined;
87
+ },
88
+ setRendered(args) {
89
+ if (args === undefined) {
90
+ return;
91
+ }
92
+ const { data, reactElement, renderingComponent } = args;
93
+ self.warnings = data.warnings;
94
+ self.filled = true;
95
+ self.message = undefined;
96
+ self.reactElement = reactElement;
97
+ self.data = data;
98
+ self.error = undefined;
99
+ self.renderingComponent = renderingComponent;
100
+ self.stopToken = undefined;
101
+ },
102
+ setError(error) {
103
+ console.error(error);
104
+ self.filled = false;
105
+ self.message = undefined;
106
+ self.reactElement = undefined;
107
+ self.data = undefined;
108
+ self.error = error;
109
+ self.renderingComponent = undefined;
110
+ self.stopToken = undefined;
111
+ },
112
+ }));
156
113
  }
@@ -1,3 +1,3 @@
1
- import { Feature } from '@jbrowse/core/util';
2
- import { LinearPileupDisplayModel } from '@jbrowse/plugin-alignments';
1
+ import type { Feature } from '@jbrowse/core/util';
2
+ import type { LinearPileupDisplayModel } from '@jbrowse/plugin-alignments';
3
3
  export declare function onClick(feature: Feature, self: LinearPileupDisplayModel): void;
@@ -1,6 +1,6 @@
1
1
  import { getConf } from '@jbrowse/core/configuration';
2
- import { getSession, gatherOverlaps } from '@jbrowse/core/util';
3
- import { MismatchParser, } from '@jbrowse/plugin-alignments';
2
+ import { gatherOverlaps, getSession, sum } from '@jbrowse/core/util';
3
+ import { MismatchParser } from '@jbrowse/plugin-alignments';
4
4
  const { featurizeSA, getClip, getLength, getLengthSansClipping } = MismatchParser;
5
5
  export function onClick(feature, self) {
6
6
  var _a;
@@ -19,25 +19,24 @@ export function onClick(feature, self) {
19
19
  const trackName = `${readName}_vs_${trackAssembly}`;
20
20
  const SA = (_a = feature.get('tags')) === null || _a === void 0 ? void 0 : _a.SA;
21
21
  const SA2 = featurizeSA(SA, feature.id(), strand, readName, true);
22
- const feat = feature.toJSON();
23
- feat.strand = 1;
24
- feat.mate = {
25
- refName: readName,
26
- start: clipPos,
27
- end: clipPos + getLengthSansClipping(cigar),
28
- };
29
- // if secondary alignment or supplementary, calculate length from SA[0]'s
30
- // CIGAR which is the primary alignments. otherwise it is the primary
31
- // alignment just use seq.length if primary alignment
32
22
  const totalLength = getLength(flags & 2048 ? SA2[0].CIGAR : cigar);
33
- const features = [feat, ...SA2];
34
- features.sort((a, b) => a.clipPos - b.clipPos);
35
- const refLength = features.reduce((a, f) => a + f.end - f.start, 0);
23
+ const features = [
24
+ {
25
+ ...feature.toJSON(),
26
+ strand: 1,
27
+ mate: {
28
+ refName: readName,
29
+ start: clipPos,
30
+ end: clipPos + getLengthSansClipping(cigar),
31
+ },
32
+ },
33
+ ...SA2,
34
+ ].sort((a, b) => a.clipPos - b.clipPos);
36
35
  session.addView('DotplotView', {
37
36
  type: 'DotplotView',
38
37
  hview: {
39
38
  offsetPx: 0,
40
- bpPerPx: refLength / 800,
39
+ bpPerPx: sum(features.map(a => a.end - a.start)) / 800,
41
40
  displayedRegions: gatherOverlaps(features.map((f, index) => {
42
41
  const { start, end, refName } = f;
43
42
  return {
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function DotplotReadVsRefMenuItem(pluginManager: PluginManager): void;
@@ -1,6 +1,4 @@
1
- // icons
2
1
  import AddIcon from '@mui/icons-material/Add';
3
- // local
4
2
  import { onClick } from './DotplotReadVsRef';
5
3
  export default function DotplotReadVsRefMenuItem(pluginManager) {
6
4
  pluginManager.addToExtensionPoint('Core-extendPluggableElement', (pluggableElement) => {
@@ -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
  }
@@ -1,10 +1,5 @@
1
- import { checkAbortSignal } from '@jbrowse/core/util';
2
1
  import RpcMethodType from '@jbrowse/core/pluggableElementTypes/RpcMethodType';
3
- /**
4
- * call a synteny renderer with the given args
5
- * param views: a set of views that each contain a set of regions
6
- * used instead of passing regions directly as in render()
7
- */
2
+ import { checkStopToken } from '@jbrowse/core/util/stopToken';
8
3
  export default class ComparativeRender extends RpcMethodType {
9
4
  constructor() {
10
5
  super(...arguments);
@@ -31,11 +26,11 @@ export default class ComparativeRender extends RpcMethodType {
31
26
  if (rpcDriver !== 'MainThreadRpcDriver') {
32
27
  deserializedArgs = await this.deserializeArguments(args, rpcDriver);
33
28
  }
34
- const { sessionId, rendererType, signal } = deserializedArgs;
29
+ const { sessionId, rendererType, stopToken } = deserializedArgs;
35
30
  if (!sessionId) {
36
31
  throw new Error('must pass a unique session id');
37
32
  }
38
- checkAbortSignal(signal);
33
+ checkStopToken(stopToken);
39
34
  const renderer = this.getRenderer(rendererType);
40
35
  return rpcDriver === 'MainThreadRpcDriver'
41
36
  ? renderer.render(deserializedArgs)
@@ -1,7 +1,8 @@
1
- import { AnyConfigurationModel } from '@jbrowse/core/configuration';
2
- import { Region } from '@jbrowse/core/util';
3
- import ComparativeRenderer, { RenderArgsDeserialized, RenderArgs } from '@jbrowse/core/pluggableElementTypes/renderers/ComparativeServerSideRendererType';
4
- import { Dotplot1DViewModel } from '../DotplotView/model';
1
+ import ComparativeRenderer from '@jbrowse/core/pluggableElementTypes/renderers/ComparativeServerSideRendererType';
2
+ import type { Dotplot1DViewModel } from '../DotplotView/model';
3
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
4
+ import type { RenderArgs, RenderArgsDeserialized } from '@jbrowse/core/pluggableElementTypes/renderers/ComparativeServerSideRendererType';
5
+ import type { Region } from '@jbrowse/core/util';
5
6
  export interface DotplotRenderArgsDeserialized extends RenderArgsDeserialized {
6
7
  adapterConfig: AnyConfigurationModel;
7
8
  height: number;
@@ -35,7 +36,7 @@ export default class DotplotRenderer extends ComparativeRenderer {
35
36
  bpPerPxX: number;
36
37
  bpPerPxY: number;
37
38
  canvasRecordedData: any;
38
- reactElement?: import("react").ReactElement;
39
+ reactElement?: React.ReactElement;
39
40
  html?: string;
40
41
  } | {
41
42
  height: number;
@@ -44,7 +45,7 @@ export default class DotplotRenderer extends ComparativeRenderer {
44
45
  offsetY: number;
45
46
  bpPerPxX: number;
46
47
  bpPerPxY: number;
47
- reactElement: React.JSX.Element;
48
+ reactElement: import("react/jsx-runtime").JSX.Element;
48
49
  html?: string;
49
50
  } | {
50
51
  height: number;
@@ -54,7 +55,7 @@ export default class DotplotRenderer extends ComparativeRenderer {
54
55
  bpPerPxX: number;
55
56
  bpPerPxY: number;
56
57
  imageData: any;
57
- reactElement?: import("react").ReactElement;
58
+ reactElement?: React.ReactElement;
58
59
  html?: string;
59
60
  }>;
60
61
  }
@@ -1,6 +1,5 @@
1
- import { renameRegionsIfNeeded, renderToAbstractCanvas, } from '@jbrowse/core/util';
2
1
  import ComparativeRenderer from '@jbrowse/core/pluggableElementTypes/renderers/ComparativeServerSideRendererType';
3
- // locals
2
+ import { renameRegionsIfNeeded, renderToAbstractCanvas, } from '@jbrowse/core/util';
4
3
  import { Dotplot1DView } from '../DotplotView/model';
5
4
  export default class DotplotRenderer extends ComparativeRenderer {
6
5
  constructor() {
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
- import { DotplotRenderArgsDeserialized } from '../DotplotRenderer';
3
- declare const DotplotRendering: (props: DotplotRenderArgsDeserialized) => React.JSX.Element;
1
+ import type { DotplotRenderArgsDeserialized } from '../DotplotRenderer';
2
+ declare const DotplotRendering: (props: DotplotRenderArgsDeserialized) => import("react/jsx-runtime").JSX.Element;
4
3
  export default DotplotRendering;
@@ -1,7 +1,7 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { PrerenderedCanvas } from '@jbrowse/core/ui';
3
3
  import { observer } from 'mobx-react';
4
4
  const DotplotRendering = observer(function (props) {
5
- return React.createElement(PrerenderedCanvas, { ...props });
5
+ return _jsx(PrerenderedCanvas, { ...props });
6
6
  });
7
7
  export default DotplotRendering;
@@ -1,57 +1,36 @@
1
1
  declare const _default: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
2
- /**
3
- * #slot
4
- */
5
2
  color: {
6
3
  type: string;
7
4
  description: string;
8
5
  defaultValue: string;
9
6
  contextVariable: string[];
10
7
  };
11
- /**
12
- * #slot
13
- */
14
8
  posColor: {
15
9
  type: string;
16
10
  description: string;
17
11
  defaultValue: string;
18
12
  };
19
- /**
20
- * #slot
21
- */
22
13
  negColor: {
23
14
  type: string;
24
15
  description: string;
25
16
  defaultValue: string;
26
17
  };
27
- /**
28
- * #slot
29
- */
30
18
  lineWidth: {
31
19
  type: string;
32
20
  description: string;
33
21
  defaultValue: number;
34
22
  };
35
- /**
36
- * #slot
37
- */
38
23
  colorBy: {
39
24
  type: string;
40
25
  model: import("mobx-state-tree").ISimpleType<string>;
41
26
  description: string;
42
27
  defaultValue: string;
43
28
  };
44
- /**
45
- * #slot
46
- */
47
29
  thresholdsPalette: {
48
30
  type: string;
49
31
  defaultValue: string[];
50
32
  description: string;
51
33
  };
52
- /**
53
- * #slot
54
- */
55
34
  thresholds: {
56
35
  type: string;
57
36
  defaultValue: string[];
@@ -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({