@jbrowse/plugin-dotplot-view 2.6.2 → 2.7.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.
- package/dist/DotplotDisplay/components/DotplotDisplay.d.ts +3 -4
- package/dist/DotplotDisplay/components/DotplotDisplay.js +3 -3
- package/dist/DotplotDisplay/stateModelFactory.d.ts +4 -4
- package/dist/DotplotDisplay/stateModelFactory.js +3 -3
- package/dist/DotplotRenderer/DotplotRenderer.js +12 -4
- package/dist/DotplotRenderer/components/DotplotRendering.d.ts +2 -3
- package/dist/DotplotRenderer/components/DotplotRendering.js +3 -3
- package/dist/DotplotView/blockTypes.d.ts +1 -9
- package/dist/DotplotView/blockTypes.js +2 -15
- package/dist/DotplotView/components/Axes.js +37 -35
- package/dist/DotplotView/components/DotplotControls.d.ts +6 -0
- package/dist/DotplotView/components/DotplotControls.js +94 -0
- package/dist/DotplotView/components/DotplotTooltip.d.ts +0 -1
- package/dist/DotplotView/components/DotplotTooltip.js +1 -2
- package/dist/DotplotView/components/DotplotWarnings.d.ts +2 -2
- package/dist/DotplotView/components/DotplotWarnings.js +2 -1
- package/dist/DotplotView/components/Header.d.ts +2 -2
- package/dist/DotplotView/components/Header.js +5 -120
- package/dist/DotplotView/components/ImportCustomTrack.d.ts +1 -1
- package/dist/DotplotView/components/ImportCustomTrack.js +1 -1
- package/dist/DotplotView/components/ImportSyntenyTrackSelector.js +4 -1
- package/dist/DotplotView/components/PanButtons.d.ts +2 -2
- package/dist/DotplotView/components/PanButtons.js +2 -1
- package/dist/DotplotView/components/WarningDialog.d.ts +2 -2
- package/dist/DotplotView/components/WarningDialog.js +2 -1
- package/dist/DotplotView/components/util.js +2 -5
- package/dist/DotplotView/model.d.ts +74 -45
- package/dist/DotplotView/model.js +15 -4
- package/dist/DotplotView/svgcomponents/SVGBackground.js +2 -1
- package/dist/ServerSideRenderedBlockContent.d.ts +2 -2
- package/dist/ServerSideRenderedBlockContent.js +2 -1
- package/dist/ServerSideSyntenyRendering.d.ts +11 -16
- package/dist/ServerSideSyntenyRendering.js +3 -11
- package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +3 -4
- package/esm/DotplotDisplay/components/DotplotDisplay.js +3 -3
- package/esm/DotplotDisplay/stateModelFactory.d.ts +4 -4
- package/esm/DotplotDisplay/stateModelFactory.js +3 -3
- package/esm/DotplotRenderer/DotplotRenderer.js +12 -4
- package/esm/DotplotRenderer/components/DotplotRendering.d.ts +2 -3
- package/esm/DotplotRenderer/components/DotplotRendering.js +3 -3
- package/esm/DotplotView/blockTypes.d.ts +1 -9
- package/esm/DotplotView/blockTypes.js +2 -15
- package/esm/DotplotView/components/Axes.js +37 -35
- package/esm/DotplotView/components/DotplotControls.d.ts +6 -0
- package/esm/DotplotView/components/DotplotControls.js +89 -0
- package/esm/DotplotView/components/DotplotTooltip.d.ts +0 -1
- package/esm/DotplotView/components/DotplotTooltip.js +1 -1
- package/esm/DotplotView/components/DotplotView.js +1 -1
- package/esm/DotplotView/components/DotplotWarnings.d.ts +2 -2
- package/esm/DotplotView/components/DotplotWarnings.js +2 -1
- package/esm/DotplotView/components/Header.d.ts +2 -2
- package/esm/DotplotView/components/Header.js +5 -97
- package/esm/DotplotView/components/ImportCustomTrack.d.ts +1 -1
- package/esm/DotplotView/components/ImportCustomTrack.js +1 -1
- package/esm/DotplotView/components/ImportSyntenyTrackSelector.js +4 -1
- package/esm/DotplotView/components/PanButtons.d.ts +2 -2
- package/esm/DotplotView/components/PanButtons.js +2 -1
- package/esm/DotplotView/components/WarningDialog.d.ts +2 -2
- package/esm/DotplotView/components/WarningDialog.js +2 -1
- package/esm/DotplotView/components/util.js +2 -5
- package/esm/DotplotView/model.d.ts +74 -45
- package/esm/DotplotView/model.js +15 -4
- package/esm/DotplotView/svgcomponents/SVGBackground.js +2 -1
- package/esm/ServerSideRenderedBlockContent.d.ts +2 -2
- package/esm/ServerSideRenderedBlockContent.js +2 -1
- package/esm/ServerSideSyntenyRendering.d.ts +11 -16
- package/esm/ServerSideSyntenyRendering.js +4 -12
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DotplotViewModel } from '../model';
|
|
3
|
-
declare const
|
|
3
|
+
declare const PanButtons: ({ model, }: {
|
|
4
4
|
model: DotplotViewModel;
|
|
5
5
|
}) => React.JSX.Element;
|
|
6
|
-
export default
|
|
6
|
+
export default PanButtons;
|
|
@@ -29,7 +29,7 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
29
29
|
margin: 0,
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
|
-
|
|
32
|
+
const PanButtons = (0, mobx_react_1.observer)(function PanButtons({ model, }) {
|
|
33
33
|
const { classes } = useStyles();
|
|
34
34
|
return (react_1.default.createElement(material_1.Paper, { className: classes.dpad, elevation: 6 },
|
|
35
35
|
react_1.default.createElement("div", null),
|
|
@@ -57,3 +57,4 @@ exports.default = (0, mobx_react_1.observer)(function PanButtons({ model, }) {
|
|
|
57
57
|
} },
|
|
58
58
|
react_1.default.createElement(ZoomOut_1.default, null))));
|
|
59
59
|
});
|
|
60
|
+
exports.default = PanButtons;
|
|
@@ -9,8 +9,8 @@ interface TrackWarning {
|
|
|
9
9
|
}[];
|
|
10
10
|
}[];
|
|
11
11
|
}
|
|
12
|
-
declare const
|
|
12
|
+
declare const WarningDialog: ({ trackWarnings, handleClose, }: {
|
|
13
13
|
handleClose: () => void;
|
|
14
14
|
trackWarnings: TrackWarning[];
|
|
15
15
|
}) => React.JSX.Element;
|
|
16
|
-
export default
|
|
16
|
+
export default WarningDialog;
|
|
@@ -16,7 +16,7 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
16
16
|
minWidth: 600,
|
|
17
17
|
},
|
|
18
18
|
});
|
|
19
|
-
|
|
19
|
+
const WarningDialog = (0, mobx_react_1.observer)(function WarningDialog({ trackWarnings, handleClose, }) {
|
|
20
20
|
const { classes } = useStyles();
|
|
21
21
|
const rows = [];
|
|
22
22
|
for (let i = 0; i < trackWarnings.length; i++) {
|
|
@@ -38,3 +38,4 @@ exports.default = (0, mobx_react_1.observer)(function WarningDialog({ trackWarni
|
|
|
38
38
|
react_1.default.createElement("div", { style: { height: 600, width: '100%', overflow: 'auto' } },
|
|
39
39
|
react_1.default.createElement(x_data_grid_1.DataGrid, { rows: rows, columns: columns, disableRowSelectionOnClick: true, rowHeight: 25, disableColumnMenu: true })))));
|
|
40
40
|
});
|
|
41
|
+
exports.default = WarningDialog;
|
|
@@ -66,9 +66,7 @@ function makeTicks(regions, bpPerPx, emitMajor = true, emitMinor = true) {
|
|
|
66
66
|
const ticks = [];
|
|
67
67
|
const gridPitch = chooseGridPitch(bpPerPx, 60, 15);
|
|
68
68
|
const iterPitch = gridPitch.minorPitch || gridPitch.majorPitch;
|
|
69
|
-
for (
|
|
70
|
-
const region = regions[i];
|
|
71
|
-
const { start, end, refName } = region;
|
|
69
|
+
for (const { start, end, refName } of regions) {
|
|
72
70
|
let index = 0;
|
|
73
71
|
const minBase = start;
|
|
74
72
|
const maxBase = end;
|
|
@@ -77,8 +75,7 @@ function makeTicks(regions, bpPerPx, emitMajor = true, emitMinor = true) {
|
|
|
77
75
|
ticks.push({ type: 'minor', base: base - 1, index, refName });
|
|
78
76
|
index += 1;
|
|
79
77
|
}
|
|
80
|
-
else if (emitMajor &&
|
|
81
|
-
Math.abs(base - region.start) > gridPitch.minorPitch) {
|
|
78
|
+
else if (emitMajor && Math.abs(base - start) > gridPitch.minorPitch) {
|
|
82
79
|
ticks.push({ type: 'major', base: base - 1, index, refName });
|
|
83
80
|
index += 1;
|
|
84
81
|
}
|
|
@@ -58,15 +58,15 @@ export default function stateModelFactory(pm: PluginManager): import("mobx-state
|
|
|
58
58
|
readonly width: number;
|
|
59
59
|
readonly assemblyNames: string[];
|
|
60
60
|
readonly displayedRegionsTotalPx: number;
|
|
61
|
-
readonly maxOffset: number;
|
|
62
|
-
|
|
61
|
+
readonly maxOffset: number;
|
|
62
|
+
readonly minOffset: number; /**
|
|
63
|
+
* #stateModel DotplotView
|
|
64
|
+
* #category view
|
|
65
|
+
* extends `BaseViewModel`
|
|
63
66
|
*/
|
|
64
|
-
readonly minOffset: number;
|
|
65
67
|
readonly totalBp: number;
|
|
66
68
|
} & {
|
|
67
|
-
readonly dynamicBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
68
|
-
* #property
|
|
69
|
-
*/
|
|
69
|
+
readonly dynamicBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
70
70
|
readonly staticBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
71
71
|
readonly currBp: number;
|
|
72
72
|
} & {
|
|
@@ -82,14 +82,20 @@ export default function stateModelFactory(pm: PluginManager): import("mobx-state
|
|
|
82
82
|
reversed: boolean;
|
|
83
83
|
};
|
|
84
84
|
bpToPx({ refName, coord, regionNumber, }: {
|
|
85
|
-
refName: string;
|
|
85
|
+
refName: string; /**
|
|
86
|
+
* #property
|
|
87
|
+
*/
|
|
86
88
|
coord: number;
|
|
87
|
-
regionNumber?: number | undefined;
|
|
89
|
+
regionNumber?: number | undefined; /**
|
|
90
|
+
* #property
|
|
91
|
+
*/
|
|
88
92
|
}): number | undefined;
|
|
89
93
|
} & {
|
|
90
94
|
setFeatures(features: import("@jbrowse/core/util").Feature[]): void;
|
|
91
95
|
showAllRegions(): void;
|
|
92
|
-
zoomOut(): void;
|
|
96
|
+
zoomOut(): void; /**
|
|
97
|
+
* #property
|
|
98
|
+
*/
|
|
93
99
|
zoomIn(): void;
|
|
94
100
|
zoomTo(bpPerPx: number, offset?: number | undefined): number;
|
|
95
101
|
scrollTo(offsetPx: number): number;
|
|
@@ -137,15 +143,15 @@ export default function stateModelFactory(pm: PluginManager): import("mobx-state
|
|
|
137
143
|
readonly width: number;
|
|
138
144
|
readonly assemblyNames: string[];
|
|
139
145
|
readonly displayedRegionsTotalPx: number;
|
|
140
|
-
readonly maxOffset: number;
|
|
141
|
-
|
|
146
|
+
readonly maxOffset: number;
|
|
147
|
+
readonly minOffset: number; /**
|
|
148
|
+
* #stateModel DotplotView
|
|
149
|
+
* #category view
|
|
150
|
+
* extends `BaseViewModel`
|
|
142
151
|
*/
|
|
143
|
-
readonly minOffset: number;
|
|
144
152
|
readonly totalBp: number;
|
|
145
153
|
} & {
|
|
146
|
-
readonly dynamicBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
147
|
-
* #property
|
|
148
|
-
*/
|
|
154
|
+
readonly dynamicBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
149
155
|
readonly staticBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
150
156
|
readonly currBp: number;
|
|
151
157
|
} & {
|
|
@@ -161,14 +167,20 @@ export default function stateModelFactory(pm: PluginManager): import("mobx-state
|
|
|
161
167
|
reversed: boolean;
|
|
162
168
|
};
|
|
163
169
|
bpToPx({ refName, coord, regionNumber, }: {
|
|
164
|
-
refName: string;
|
|
170
|
+
refName: string; /**
|
|
171
|
+
* #property
|
|
172
|
+
*/
|
|
165
173
|
coord: number;
|
|
166
|
-
regionNumber?: number | undefined;
|
|
174
|
+
regionNumber?: number | undefined; /**
|
|
175
|
+
* #property
|
|
176
|
+
*/
|
|
167
177
|
}): number | undefined;
|
|
168
178
|
} & {
|
|
169
179
|
setFeatures(features: import("@jbrowse/core/util").Feature[]): void;
|
|
170
180
|
showAllRegions(): void;
|
|
171
|
-
zoomOut(): void;
|
|
181
|
+
zoomOut(): void; /**
|
|
182
|
+
* #property
|
|
183
|
+
*/
|
|
172
184
|
zoomIn(): void;
|
|
173
185
|
zoomTo(bpPerPx: number, offset?: number | undefined): number;
|
|
174
186
|
scrollTo(offsetPx: number): number;
|
|
@@ -201,28 +213,33 @@ export default function stateModelFactory(pm: PluginManager): import("mobx-state
|
|
|
201
213
|
readonly textSearchAdapter: any;
|
|
202
214
|
readonly adapterType: import("@jbrowse/core/pluggableElementTypes").AdapterType;
|
|
203
215
|
readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[];
|
|
204
|
-
readonly canConfigure:
|
|
216
|
+
readonly canConfigure: boolean | ({
|
|
217
|
+
[x: string]: any;
|
|
218
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
219
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
220
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>) | undefined;
|
|
205
221
|
} & {
|
|
206
222
|
setMinimized(flag: boolean): void;
|
|
207
|
-
|
|
208
|
-
|
|
223
|
+
showDisplay(displayId: string, initialSnapshot?: {} | undefined): void; /**
|
|
224
|
+
* #property
|
|
225
|
+
*/
|
|
209
226
|
hideDisplay(displayId: string): number;
|
|
210
227
|
replaceDisplay(oldId: string, newId: string, initialSnapshot?: {} | undefined): void;
|
|
211
228
|
} & {
|
|
212
229
|
trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
|
|
213
|
-
type: string;
|
|
230
|
+
type: string;
|
|
231
|
+
label: string; /**
|
|
214
232
|
* #property
|
|
215
233
|
*/
|
|
216
|
-
label: string;
|
|
217
234
|
subMenu: {
|
|
218
235
|
type: string;
|
|
219
|
-
label: string;
|
|
220
|
-
* #property
|
|
221
|
-
*/
|
|
236
|
+
label: string;
|
|
222
237
|
checked: boolean;
|
|
223
238
|
onClick: () => void;
|
|
224
239
|
}[];
|
|
225
|
-
})[];
|
|
240
|
+
})[]; /**
|
|
241
|
+
* #property
|
|
242
|
+
*/
|
|
226
243
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
227
244
|
viewTrackConfigs: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
228
245
|
}, {
|
|
@@ -329,15 +346,15 @@ export default function stateModelFactory(pm: PluginManager): import("mobx-state
|
|
|
329
346
|
readonly width: number;
|
|
330
347
|
readonly assemblyNames: string[];
|
|
331
348
|
readonly displayedRegionsTotalPx: number;
|
|
332
|
-
readonly maxOffset: number;
|
|
333
|
-
|
|
349
|
+
readonly maxOffset: number;
|
|
350
|
+
readonly minOffset: number; /**
|
|
351
|
+
* #stateModel DotplotView
|
|
352
|
+
* #category view
|
|
353
|
+
* extends `BaseViewModel`
|
|
334
354
|
*/
|
|
335
|
-
readonly minOffset: number;
|
|
336
355
|
readonly totalBp: number;
|
|
337
356
|
} & {
|
|
338
|
-
readonly dynamicBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
339
|
-
* #property
|
|
340
|
-
*/
|
|
357
|
+
readonly dynamicBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
341
358
|
readonly staticBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
342
359
|
readonly currBp: number;
|
|
343
360
|
} & {
|
|
@@ -353,14 +370,20 @@ export default function stateModelFactory(pm: PluginManager): import("mobx-state
|
|
|
353
370
|
reversed: boolean;
|
|
354
371
|
};
|
|
355
372
|
bpToPx({ refName, coord, regionNumber, }: {
|
|
356
|
-
refName: string;
|
|
373
|
+
refName: string; /**
|
|
374
|
+
* #property
|
|
375
|
+
*/
|
|
357
376
|
coord: number;
|
|
358
|
-
regionNumber?: number | undefined;
|
|
377
|
+
regionNumber?: number | undefined; /**
|
|
378
|
+
* #property
|
|
379
|
+
*/
|
|
359
380
|
}): number | undefined;
|
|
360
381
|
} & {
|
|
361
382
|
setFeatures(features: import("@jbrowse/core/util").Feature[]): void;
|
|
362
383
|
showAllRegions(): void;
|
|
363
|
-
zoomOut(): void;
|
|
384
|
+
zoomOut(): void; /**
|
|
385
|
+
* #property
|
|
386
|
+
*/
|
|
364
387
|
zoomIn(): void;
|
|
365
388
|
zoomTo(bpPerPx: number, offset?: number | undefined): number;
|
|
366
389
|
scrollTo(offsetPx: number): number;
|
|
@@ -407,15 +430,15 @@ export default function stateModelFactory(pm: PluginManager): import("mobx-state
|
|
|
407
430
|
readonly width: number;
|
|
408
431
|
readonly assemblyNames: string[];
|
|
409
432
|
readonly displayedRegionsTotalPx: number;
|
|
410
|
-
readonly maxOffset: number;
|
|
411
|
-
|
|
433
|
+
readonly maxOffset: number;
|
|
434
|
+
readonly minOffset: number; /**
|
|
435
|
+
* #stateModel DotplotView
|
|
436
|
+
* #category view
|
|
437
|
+
* extends `BaseViewModel`
|
|
412
438
|
*/
|
|
413
|
-
readonly minOffset: number;
|
|
414
439
|
readonly totalBp: number;
|
|
415
440
|
} & {
|
|
416
|
-
readonly dynamicBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
417
|
-
* #property
|
|
418
|
-
*/
|
|
441
|
+
readonly dynamicBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
419
442
|
readonly staticBlocks: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
420
443
|
readonly currBp: number;
|
|
421
444
|
} & {
|
|
@@ -431,14 +454,20 @@ export default function stateModelFactory(pm: PluginManager): import("mobx-state
|
|
|
431
454
|
reversed: boolean;
|
|
432
455
|
};
|
|
433
456
|
bpToPx({ refName, coord, regionNumber, }: {
|
|
434
|
-
refName: string;
|
|
457
|
+
refName: string; /**
|
|
458
|
+
* #property
|
|
459
|
+
*/
|
|
435
460
|
coord: number;
|
|
436
|
-
regionNumber?: number | undefined;
|
|
461
|
+
regionNumber?: number | undefined; /**
|
|
462
|
+
* #property
|
|
463
|
+
*/
|
|
437
464
|
}): number | undefined;
|
|
438
465
|
} & {
|
|
439
466
|
setFeatures(features: import("@jbrowse/core/util").Feature[]): void;
|
|
440
467
|
showAllRegions(): void;
|
|
441
|
-
zoomOut(): void;
|
|
468
|
+
zoomOut(): void; /**
|
|
469
|
+
* #property
|
|
470
|
+
*/
|
|
442
471
|
zoomIn(): void;
|
|
443
472
|
zoomTo(bpPerPx: number, offset?: number | undefined): number;
|
|
444
473
|
scrollTo(offsetPx: number): number;
|
|
@@ -46,6 +46,15 @@ const util_2 = require("./components/util");
|
|
|
46
46
|
// lazies
|
|
47
47
|
const ExportSvgDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/ExportSvgDialog'))));
|
|
48
48
|
const ReturnToImportFormDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@jbrowse/core/ui/ReturnToImportFormDialog'))));
|
|
49
|
+
const len = (a) => (0, util_1.measureText)(a.slice(0, 30));
|
|
50
|
+
const pxWidthForBlocks = (blocks, hide) => {
|
|
51
|
+
return (0, util_1.max)([
|
|
52
|
+
...blocks.filter(b => !hide.has(b.key)).map(b => len(b.refName)),
|
|
53
|
+
...blocks
|
|
54
|
+
.filter(b => !hide.has(b.key))
|
|
55
|
+
.map(b => len(b.end.toLocaleString('en-us'))),
|
|
56
|
+
]);
|
|
57
|
+
};
|
|
49
58
|
/**
|
|
50
59
|
* #stateModel DotplotView
|
|
51
60
|
* #category view
|
|
@@ -498,8 +507,11 @@ function stateModelFactory(pm) {
|
|
|
498
507
|
},
|
|
499
508
|
// if any of our assemblies are temporary assemblies
|
|
500
509
|
beforeDestroy() {
|
|
510
|
+
var _a;
|
|
501
511
|
const session = (0, util_1.getSession)(self);
|
|
502
|
-
|
|
512
|
+
for (const name in self.assemblyNames) {
|
|
513
|
+
(_a = session.removeTemporaryAssembly) === null || _a === void 0 ? void 0 : _a.call(session, name);
|
|
514
|
+
}
|
|
503
515
|
},
|
|
504
516
|
afterAttach() {
|
|
505
517
|
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
|
|
@@ -547,9 +559,8 @@ function stateModelFactory(pm) {
|
|
|
547
559
|
const voffset = vview.offsetPx;
|
|
548
560
|
const vhide = (0, util_2.getBlockLabelKeysToHide)(vblocks, viewHeight, voffset);
|
|
549
561
|
const hhide = (0, util_2.getBlockLabelKeysToHide)(hblocks, viewWidth, hoffset);
|
|
550
|
-
const
|
|
551
|
-
const
|
|
552
|
-
const bx = (0, util_1.max)(vblocks.filter(b => !vhide.has(b.key)).map(b => len(b.refName)));
|
|
562
|
+
const by = pxWidthForBlocks(hblocks, hhide);
|
|
563
|
+
const bx = pxWidthForBlocks(vblocks, vhide);
|
|
553
564
|
// these are set via autorun to avoid dependency cycle
|
|
554
565
|
self.setBorderY(Math.max(by + padding, 50));
|
|
555
566
|
self.setBorderX(Math.max(bx + padding, 50));
|
|
@@ -5,8 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const material_1 = require("@mui/material");
|
|
8
|
+
const util_1 = require("@jbrowse/core/util");
|
|
8
9
|
function SVGBackground({ width, height, }) {
|
|
9
10
|
const theme = (0, material_1.useTheme)();
|
|
10
|
-
return (react_1.default.createElement("rect", { x: 0, y: 0, width: width, height: height, fill: theme.palette.background.default }));
|
|
11
|
+
return (react_1.default.createElement("rect", { x: 0, y: 0, width: width, height: height, fill: (0, util_1.stripAlpha)(theme.palette.background.default) }));
|
|
11
12
|
}
|
|
12
13
|
exports.default = SVGBackground;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
|
2
|
-
declare const
|
|
2
|
+
declare const ServerSideRenderedDotplotContent: ({ model, style, }: {
|
|
3
3
|
model: {
|
|
4
4
|
error?: unknown;
|
|
5
5
|
message?: string;
|
|
@@ -9,4 +9,4 @@ declare const _default: ({ model, style, }: {
|
|
|
9
9
|
};
|
|
10
10
|
style: CSSProperties;
|
|
11
11
|
}) => React.JSX.Element | null;
|
|
12
|
-
export default
|
|
12
|
+
export default ServerSideRenderedDotplotContent;
|
|
@@ -69,7 +69,7 @@ function BlockError({ error }) {
|
|
|
69
69
|
return (react_1.default.createElement("div", { className: classes.blockError },
|
|
70
70
|
react_1.default.createElement(material_1.Typography, null, `${error}`)));
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
const ServerSideRenderedDotplotContent = (0, mobx_react_1.observer)(function ({ model, style, }) {
|
|
73
73
|
if (model.error) {
|
|
74
74
|
return react_1.default.createElement(BlockError, { error: model.error, "data-testid": "reload_button" });
|
|
75
75
|
}
|
|
@@ -84,3 +84,4 @@ exports.default = (0, mobx_react_1.observer)(function ({ model, style, }) {
|
|
|
84
84
|
}
|
|
85
85
|
return null;
|
|
86
86
|
});
|
|
87
|
+
exports.default = ServerSideRenderedDotplotContent;
|
|
@@ -3,21 +3,16 @@ import React from 'react';
|
|
|
3
3
|
* A block whose content is rendered outside of the main thread and hydrated by this
|
|
4
4
|
* component.
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
highResolutionScaling?: number;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
}): React.JSX.Element;
|
|
17
|
-
declare namespace ServerSideSyntenyRendering {
|
|
18
|
-
var propTypes: {
|
|
19
|
-
model: import("prop-types").Validator<any>;
|
|
6
|
+
interface ModelType {
|
|
7
|
+
imageData: string;
|
|
8
|
+
style: Record<string, string>;
|
|
9
|
+
renderProps: {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
highResolutionScaling?: number;
|
|
20
13
|
};
|
|
21
14
|
}
|
|
22
|
-
declare const
|
|
23
|
-
|
|
15
|
+
declare const ServerSideSyntenyRendering: ({ model, }: {
|
|
16
|
+
model: ModelType;
|
|
17
|
+
}) => React.JSX.Element;
|
|
18
|
+
export default ServerSideSyntenyRendering;
|
|
@@ -23,15 +23,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
27
26
|
const react_1 = __importStar(require("react"));
|
|
28
27
|
const mobx_react_1 = require("mobx-react");
|
|
29
28
|
const offscreenCanvasPonyfill_1 = require("@jbrowse/core/util/offscreenCanvasPonyfill");
|
|
30
|
-
|
|
31
|
-
* A block whose content is rendered outside of the main thread and hydrated by this
|
|
32
|
-
* component.
|
|
33
|
-
*/
|
|
34
|
-
function ServerSideSyntenyRendering({ model, }) {
|
|
29
|
+
const ServerSideSyntenyRendering = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
35
30
|
const { imageData, style, renderProps } = model;
|
|
36
31
|
const { width, height, highResolutionScaling = 1 } = renderProps;
|
|
37
32
|
const featureCanvas = (0, react_1.useRef)(null);
|
|
@@ -46,8 +41,5 @@ function ServerSideSyntenyRendering({ model, }) {
|
|
|
46
41
|
setDone(true);
|
|
47
42
|
}, [height, imageData, width]);
|
|
48
43
|
return (react_1.default.createElement("canvas", { "data-testid": `prerendered_canvas${done ? '_done' : ''}`, ref: featureCanvas, width: width * highResolutionScaling, height: height * highResolutionScaling, style: { width, height, ...style } }));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
model: mobx_react_1.PropTypes.observableObject.isRequired,
|
|
52
|
-
};
|
|
53
|
-
exports.default = (0, mobx_react_1.observer)(ServerSideSyntenyRendering);
|
|
44
|
+
});
|
|
45
|
+
exports.default = ServerSideSyntenyRendering;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DotplotDisplayModel } from '../stateModelFactory';
|
|
3
|
-
declare
|
|
3
|
+
declare const DotplotDisplay: (props: {
|
|
4
4
|
model: DotplotDisplayModel;
|
|
5
5
|
children?: React.ReactNode;
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
export default _default;
|
|
6
|
+
}) => React.JSX.Element;
|
|
7
|
+
export default DotplotDisplay;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { observer } from 'mobx-react';
|
|
3
3
|
import { getContainingView } from '@jbrowse/core/util';
|
|
4
|
-
function DotplotDisplay(props) {
|
|
4
|
+
const DotplotDisplay = observer(function DotplotDisplay(props) {
|
|
5
5
|
const { model, children } = props;
|
|
6
6
|
const { offsetX = 0, offsetY = 0 } = model.data || {};
|
|
7
7
|
const view = getContainingView(model);
|
|
@@ -14,5 +14,5 @@ function DotplotDisplay(props) {
|
|
|
14
14
|
left,
|
|
15
15
|
} }),
|
|
16
16
|
children));
|
|
17
|
-
}
|
|
18
|
-
export default
|
|
17
|
+
});
|
|
18
|
+
export default DotplotDisplay;
|
|
@@ -50,7 +50,9 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
50
50
|
}>;
|
|
51
51
|
readonly DisplayBlurb: React.FC<{
|
|
52
52
|
model: {
|
|
53
|
-
id: string;
|
|
53
|
+
id: string; /**
|
|
54
|
+
* #getter
|
|
55
|
+
*/
|
|
54
56
|
type: string;
|
|
55
57
|
rpcDriverName: string | undefined;
|
|
56
58
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -72,9 +74,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
72
74
|
renderProps(): any;
|
|
73
75
|
readonly rendererType: import("@jbrowse/core/pluggableElementTypes").RendererType;
|
|
74
76
|
readonly DisplayMessageComponent: React.FC<any> | undefined;
|
|
75
|
-
trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
76
|
-
* #action
|
|
77
|
-
*/
|
|
77
|
+
trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
78
78
|
readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[];
|
|
79
79
|
regionCannotBeRendered(): null;
|
|
80
80
|
} & {
|
|
@@ -37,9 +37,9 @@ export function stateModelFactory(configSchema) {
|
|
|
37
37
|
})))
|
|
38
38
|
.views(self => ({
|
|
39
39
|
get shouldDisplay() {
|
|
40
|
-
const
|
|
41
|
-
return (
|
|
42
|
-
|
|
40
|
+
const { vview, hview } = getContainingView(self);
|
|
41
|
+
return (vview.bpPerPx === self.data.bpPerPxY &&
|
|
42
|
+
hview.bpPerPx === self.data.bpPerPxX);
|
|
43
43
|
},
|
|
44
44
|
/**
|
|
45
45
|
* #getter
|
|
@@ -43,7 +43,7 @@ export default class DotplotRenderer extends ComparativeRenderer {
|
|
|
43
43
|
return args;
|
|
44
44
|
}
|
|
45
45
|
async drawDotplot(ctx, props) {
|
|
46
|
-
var _a, _b
|
|
46
|
+
var _a, _b;
|
|
47
47
|
const { config, views, height, drawCigar, theme } = props;
|
|
48
48
|
const color = readConfObject(config, 'color');
|
|
49
49
|
const posColor = readConfObject(config, 'posColor');
|
|
@@ -127,7 +127,7 @@ export default class DotplotRenderer extends ComparativeRenderer {
|
|
|
127
127
|
width: vview.width,
|
|
128
128
|
};
|
|
129
129
|
const t = createJBrowseTheme(theme);
|
|
130
|
-
(
|
|
130
|
+
for (const feature of hview.features || []) {
|
|
131
131
|
const strand = feature.get('strand') || 1;
|
|
132
132
|
const start = strand === 1 ? feature.get('start') : feature.get('end');
|
|
133
133
|
const end = strand === 1 ? feature.get('end') : feature.get('start');
|
|
@@ -185,6 +185,8 @@ export default class DotplotRenderer extends ComparativeRenderer {
|
|
|
185
185
|
const cigarOps = parseCigar(cigar);
|
|
186
186
|
ctx.beginPath();
|
|
187
187
|
ctx.moveTo(currX, height - currY);
|
|
188
|
+
let lastDrawnX = currX;
|
|
189
|
+
let lastDrawnY = currX;
|
|
188
190
|
for (let i = 0; i < cigarOps.length; i += 2) {
|
|
189
191
|
const val = +cigarOps[i];
|
|
190
192
|
const op = cigarOps[i + 1];
|
|
@@ -200,7 +202,13 @@ export default class DotplotRenderer extends ComparativeRenderer {
|
|
|
200
202
|
}
|
|
201
203
|
currX = clampWithWarnX(currX, b1, b2, feature);
|
|
202
204
|
currY = clampWithWarnY(currY, e1, e2, feature);
|
|
203
|
-
|
|
205
|
+
// only draw a line segment if it is bigger than 0.5px
|
|
206
|
+
if (Math.abs(currX - lastDrawnX) > 0.5 ||
|
|
207
|
+
Math.abs(currY - lastDrawnY) > 0.5) {
|
|
208
|
+
ctx.lineTo(currX, height - currY);
|
|
209
|
+
lastDrawnX = currX;
|
|
210
|
+
lastDrawnY = currY;
|
|
211
|
+
}
|
|
204
212
|
}
|
|
205
213
|
ctx.stroke();
|
|
206
214
|
}
|
|
@@ -228,7 +236,7 @@ export default class DotplotRenderer extends ComparativeRenderer {
|
|
|
228
236
|
}
|
|
229
237
|
}
|
|
230
238
|
}
|
|
231
|
-
}
|
|
239
|
+
}
|
|
232
240
|
return { warnings };
|
|
233
241
|
}
|
|
234
242
|
async render(renderProps) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DotplotRenderArgsDeserialized } from '../DotplotRenderer';
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
export default _default;
|
|
3
|
+
declare const DotplotRendering: (props: DotplotRenderArgsDeserialized) => React.JSX.Element;
|
|
4
|
+
export default DotplotRendering;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PrerenderedCanvas } from '@jbrowse/core/ui';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
|
-
|
|
4
|
+
const DotplotRendering = observer(function (props) {
|
|
5
5
|
return React.createElement(PrerenderedCanvas, { ...props });
|
|
6
|
-
}
|
|
7
|
-
export default
|
|
6
|
+
});
|
|
7
|
+
export default DotplotRendering;
|
|
@@ -23,15 +23,7 @@ export declare class BaseBlock {
|
|
|
23
23
|
/**
|
|
24
24
|
* a block that should be shown as filled with data
|
|
25
25
|
*/
|
|
26
|
-
constructor(data: any);
|
|
27
|
-
/**
|
|
28
|
-
* rename the reference sequence of this block and return a new one
|
|
29
|
-
*
|
|
30
|
-
* @param refName -
|
|
31
|
-
* @returns either a new block with a renamed reference sequence,
|
|
32
|
-
* or the same block, if the ref name is not actually different
|
|
33
|
-
*/
|
|
34
|
-
renameReference(refName: string): any;
|
|
26
|
+
constructor(data: Record<string, any>);
|
|
35
27
|
toRegion(): {
|
|
36
28
|
refName: string;
|
|
37
29
|
start: number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sum } from '@jbrowse/core/util';
|
|
1
2
|
export class BlockSet {
|
|
2
3
|
constructor(blocks = []) {
|
|
3
4
|
this.blocks = blocks;
|
|
@@ -28,7 +29,7 @@ export class BlockSet {
|
|
|
28
29
|
}
|
|
29
30
|
get totalWidthPx() {
|
|
30
31
|
return this.blocks.length
|
|
31
|
-
? this.blocks.map(blocks => blocks.widthPx)
|
|
32
|
+
? sum(this.blocks.map(blocks => blocks.widthPx))
|
|
32
33
|
: 0;
|
|
33
34
|
}
|
|
34
35
|
get offsetPx() {
|
|
@@ -53,20 +54,6 @@ export class BaseBlock {
|
|
|
53
54
|
this.end = data.end;
|
|
54
55
|
this.key = data.key;
|
|
55
56
|
}
|
|
56
|
-
/**
|
|
57
|
-
* rename the reference sequence of this block and return a new one
|
|
58
|
-
*
|
|
59
|
-
* @param refName -
|
|
60
|
-
* @returns either a new block with a renamed reference sequence,
|
|
61
|
-
* or the same block, if the ref name is not actually different
|
|
62
|
-
*/
|
|
63
|
-
renameReference(refName) {
|
|
64
|
-
if (this.refName && refName !== this.refName) {
|
|
65
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
66
|
-
return new this.constructor({ ...this, refName });
|
|
67
|
-
}
|
|
68
|
-
return this;
|
|
69
|
-
}
|
|
70
57
|
toRegion() {
|
|
71
58
|
return {
|
|
72
59
|
refName: this.refName,
|