@jbrowse/plugin-dotplot-view 2.6.1
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/LICENSE +201 -0
- package/dist/ComparativeRenderer/index.d.ts +27 -0
- package/dist/ComparativeRenderer/index.js +59 -0
- package/dist/ComparativeRenderer/index.js.map +1 -0
- package/dist/DotplotDisplay/components/DotplotDisplay.d.ts +8 -0
- package/dist/DotplotDisplay/components/DotplotDisplay.js +24 -0
- package/dist/DotplotDisplay/components/DotplotDisplay.js.map +1 -0
- package/dist/DotplotDisplay/index.d.ts +12 -0
- package/dist/DotplotDisplay/index.js +48 -0
- package/dist/DotplotDisplay/index.js.map +1 -0
- package/dist/DotplotDisplay/renderDotplotBlock.d.ts +11 -0
- package/dist/DotplotDisplay/renderDotplotBlock.js +57 -0
- package/dist/DotplotDisplay/renderDotplotBlock.js.map +1 -0
- package/dist/DotplotDisplay/stateModelFactory.d.ts +138 -0
- package/dist/DotplotDisplay/stateModelFactory.js +165 -0
- package/dist/DotplotDisplay/stateModelFactory.js.map +1 -0
- package/dist/DotplotReadVsRef/DotplotReadVsRef.d.ts +3 -0
- package/dist/DotplotReadVsRef/DotplotReadVsRef.js +102 -0
- package/dist/DotplotReadVsRef/DotplotReadVsRef.js.map +1 -0
- package/dist/DotplotReadVsRef/index.d.ts +2 -0
- package/dist/DotplotReadVsRef/index.js +42 -0
- package/dist/DotplotReadVsRef/index.js.map +1 -0
- package/dist/DotplotRenderer/ComparativeRenderRpc.d.ts +27 -0
- package/dist/DotplotRenderer/ComparativeRenderRpc.js +59 -0
- package/dist/DotplotRenderer/ComparativeRenderRpc.js.map +1 -0
- package/dist/DotplotRenderer/DotplotRenderer.d.ts +69 -0
- package/dist/DotplotRenderer/DotplotRenderer.js +274 -0
- package/dist/DotplotRenderer/DotplotRenderer.js.map +1 -0
- package/dist/DotplotRenderer/components/DotplotRendering.d.ts +5 -0
- package/dist/DotplotRenderer/components/DotplotRendering.js +13 -0
- package/dist/DotplotRenderer/components/DotplotRendering.js.map +1 -0
- package/dist/DotplotRenderer/configSchema.d.ts +61 -0
- package/dist/DotplotRenderer/configSchema.js +83 -0
- package/dist/DotplotRenderer/configSchema.js.map +1 -0
- package/dist/DotplotRenderer/index.d.ts +3 -0
- package/dist/DotplotRenderer/index.js +17 -0
- package/dist/DotplotRenderer/index.js.map +1 -0
- package/dist/DotplotView/1dview.d.ts +307 -0
- package/dist/DotplotView/1dview.js +95 -0
- package/dist/DotplotView/1dview.js.map +1 -0
- package/dist/DotplotView/blockTypes.d.ts +61 -0
- package/dist/DotplotView/blockTypes.js +117 -0
- package/dist/DotplotView/blockTypes.js.map +1 -0
- package/dist/DotplotView/components/Axes.d.ts +14 -0
- package/dist/DotplotView/components/Axes.js +127 -0
- package/dist/DotplotView/components/Axes.js.map +1 -0
- package/dist/DotplotView/components/CursorIcon.d.ts +4 -0
- package/dist/DotplotView/components/CursorIcon.js +19 -0
- package/dist/DotplotView/components/CursorIcon.js.map +1 -0
- package/dist/DotplotView/components/DotplotTooltip.d.ts +19 -0
- package/dist/DotplotView/components/DotplotTooltip.js +128 -0
- package/dist/DotplotView/components/DotplotTooltip.js.map +1 -0
- package/dist/DotplotView/components/DotplotView.d.ts +6 -0
- package/dist/DotplotView/components/DotplotView.js +272 -0
- package/dist/DotplotView/components/DotplotView.js.map +1 -0
- package/dist/DotplotView/components/DotplotWarnings.d.ts +6 -0
- package/dist/DotplotView/components/DotplotWarnings.js +40 -0
- package/dist/DotplotView/components/DotplotWarnings.js.map +1 -0
- package/dist/DotplotView/components/ExportSvgDialog.d.ts +8 -0
- package/dist/DotplotView/components/ExportSvgDialog.js +76 -0
- package/dist/DotplotView/components/ExportSvgDialog.js.map +1 -0
- package/dist/DotplotView/components/Grid.d.ts +10 -0
- package/dist/DotplotView/components/Grid.js +60 -0
- package/dist/DotplotView/components/Grid.js.map +1 -0
- package/dist/DotplotView/components/Header.d.ts +10 -0
- package/dist/DotplotView/components/Header.js +168 -0
- package/dist/DotplotView/components/Header.js.map +1 -0
- package/dist/DotplotView/components/ImportCustomTrack.d.ts +11 -0
- package/dist/DotplotView/components/ImportCustomTrack.js +180 -0
- package/dist/DotplotView/components/ImportCustomTrack.js.map +1 -0
- package/dist/DotplotView/components/ImportForm.d.ts +6 -0
- package/dist/DotplotView/components/ImportForm.js +121 -0
- package/dist/DotplotView/components/ImportForm.js.map +1 -0
- package/dist/DotplotView/components/ImportSyntenyTrackSelector.d.ts +9 -0
- package/dist/DotplotView/components/ImportSyntenyTrackSelector.js +69 -0
- package/dist/DotplotView/components/ImportSyntenyTrackSelector.js.map +1 -0
- package/dist/DotplotView/components/PanButtons.d.ts +6 -0
- package/dist/DotplotView/components/PanButtons.js +60 -0
- package/dist/DotplotView/components/PanButtons.js.map +1 -0
- package/dist/DotplotView/components/WarningDialog.d.ts +16 -0
- package/dist/DotplotView/components/WarningDialog.js +41 -0
- package/dist/DotplotView/components/WarningDialog.js.map +1 -0
- package/dist/DotplotView/components/util.d.ts +19 -0
- package/dist/DotplotView/components/util.js +90 -0
- package/dist/DotplotView/components/util.js.map +1 -0
- package/dist/DotplotView/index.d.ts +2 -0
- package/dist/DotplotView/index.js +44 -0
- package/dist/DotplotView/index.js.map +1 -0
- package/dist/DotplotView/model.d.ts +616 -0
- package/dist/DotplotView/model.js +647 -0
- package/dist/DotplotView/model.js.map +1 -0
- package/dist/DotplotView/svgcomponents/SVGBackground.d.ts +5 -0
- package/dist/DotplotView/svgcomponents/SVGBackground.js +13 -0
- package/dist/DotplotView/svgcomponents/SVGBackground.js.map +1 -0
- package/dist/DotplotView/svgcomponents/SVGDotplotView.d.ts +2 -0
- package/dist/DotplotView/svgcomponents/SVGDotplotView.js +47 -0
- package/dist/DotplotView/svgcomponents/SVGDotplotView.js.map +1 -0
- package/dist/LaunchDotplotView.d.ts +2 -0
- package/dist/LaunchDotplotView.js +45 -0
- package/dist/LaunchDotplotView.js.map +1 -0
- package/dist/ServerSideRenderedBlockContent.d.ts +12 -0
- package/dist/ServerSideRenderedBlockContent.js +87 -0
- package/dist/ServerSideRenderedBlockContent.js.map +1 -0
- package/dist/ServerSideSyntenyRendering.d.ts +23 -0
- package/dist/ServerSideSyntenyRendering.js +54 -0
- package/dist/ServerSideSyntenyRendering.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/util.d.ts +9 -0
- package/dist/util.js +9 -0
- package/dist/util.js.map +1 -0
- package/esm/ComparativeRenderer/index.d.ts +27 -0
- package/esm/ComparativeRenderer/index.js +53 -0
- package/esm/ComparativeRenderer/index.js.map +1 -0
- package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +8 -0
- package/esm/DotplotDisplay/components/DotplotDisplay.js +19 -0
- package/esm/DotplotDisplay/components/DotplotDisplay.js.map +1 -0
- package/esm/DotplotDisplay/index.d.ts +12 -0
- package/esm/DotplotDisplay/index.js +41 -0
- package/esm/DotplotDisplay/index.js.map +1 -0
- package/esm/DotplotDisplay/renderDotplotBlock.d.ts +11 -0
- package/esm/DotplotDisplay/renderDotplotBlock.js +49 -0
- package/esm/DotplotDisplay/renderDotplotBlock.js.map +1 -0
- package/esm/DotplotDisplay/stateModelFactory.d.ts +138 -0
- package/esm/DotplotDisplay/stateModelFactory.js +158 -0
- package/esm/DotplotDisplay/stateModelFactory.js.map +1 -0
- package/esm/DotplotReadVsRef/DotplotReadVsRef.d.ts +3 -0
- package/esm/DotplotReadVsRef/DotplotReadVsRef.js +98 -0
- package/esm/DotplotReadVsRef/DotplotReadVsRef.js.map +1 -0
- package/esm/DotplotReadVsRef/index.d.ts +2 -0
- package/esm/DotplotReadVsRef/index.js +36 -0
- package/esm/DotplotReadVsRef/index.js.map +1 -0
- package/esm/DotplotRenderer/ComparativeRenderRpc.d.ts +27 -0
- package/esm/DotplotRenderer/ComparativeRenderRpc.js +53 -0
- package/esm/DotplotRenderer/ComparativeRenderRpc.js.map +1 -0
- package/esm/DotplotRenderer/DotplotRenderer.d.ts +69 -0
- package/esm/DotplotRenderer/DotplotRenderer.js +268 -0
- package/esm/DotplotRenderer/DotplotRenderer.js.map +1 -0
- package/esm/DotplotRenderer/components/DotplotRendering.d.ts +5 -0
- package/esm/DotplotRenderer/components/DotplotRendering.js +8 -0
- package/esm/DotplotRenderer/components/DotplotRendering.js.map +1 -0
- package/esm/DotplotRenderer/configSchema.d.ts +61 -0
- package/esm/DotplotRenderer/configSchema.js +81 -0
- package/esm/DotplotRenderer/configSchema.js.map +1 -0
- package/esm/DotplotRenderer/index.d.ts +3 -0
- package/esm/DotplotRenderer/index.js +12 -0
- package/esm/DotplotRenderer/index.js.map +1 -0
- package/esm/DotplotView/1dview.d.ts +307 -0
- package/esm/DotplotView/1dview.js +87 -0
- package/esm/DotplotView/1dview.js.map +1 -0
- package/esm/DotplotView/blockTypes.d.ts +61 -0
- package/esm/DotplotView/blockTypes.js +109 -0
- package/esm/DotplotView/blockTypes.js.map +1 -0
- package/esm/DotplotView/components/Axes.d.ts +14 -0
- package/esm/DotplotView/components/Axes.js +121 -0
- package/esm/DotplotView/components/Axes.js.map +1 -0
- package/esm/DotplotView/components/CursorIcon.d.ts +4 -0
- package/esm/DotplotView/components/CursorIcon.js +11 -0
- package/esm/DotplotView/components/CursorIcon.js.map +1 -0
- package/esm/DotplotView/components/DotplotTooltip.d.ts +19 -0
- package/esm/DotplotView/components/DotplotTooltip.js +101 -0
- package/esm/DotplotView/components/DotplotTooltip.js.map +1 -0
- package/esm/DotplotView/components/DotplotView.d.ts +6 -0
- package/esm/DotplotView/components/DotplotView.js +244 -0
- package/esm/DotplotView/components/DotplotView.js.map +1 -0
- package/esm/DotplotView/components/DotplotWarnings.d.ts +6 -0
- package/esm/DotplotView/components/DotplotWarnings.js +15 -0
- package/esm/DotplotView/components/DotplotWarnings.js.map +1 -0
- package/esm/DotplotView/components/ExportSvgDialog.d.ts +8 -0
- package/esm/DotplotView/components/ExportSvgDialog.js +50 -0
- package/esm/DotplotView/components/ExportSvgDialog.js.map +1 -0
- package/esm/DotplotView/components/Grid.d.ts +10 -0
- package/esm/DotplotView/components/Grid.js +53 -0
- package/esm/DotplotView/components/Grid.js.map +1 -0
- package/esm/DotplotView/components/Header.d.ts +10 -0
- package/esm/DotplotView/components/Header.js +140 -0
- package/esm/DotplotView/components/Header.js.map +1 -0
- package/esm/DotplotView/components/ImportCustomTrack.d.ts +11 -0
- package/esm/DotplotView/components/ImportCustomTrack.js +152 -0
- package/esm/DotplotView/components/ImportCustomTrack.js.map +1 -0
- package/esm/DotplotView/components/ImportForm.d.ts +6 -0
- package/esm/DotplotView/components/ImportForm.js +93 -0
- package/esm/DotplotView/components/ImportForm.js.map +1 -0
- package/esm/DotplotView/components/ImportSyntenyTrackSelector.d.ts +9 -0
- package/esm/DotplotView/components/ImportSyntenyTrackSelector.js +44 -0
- package/esm/DotplotView/components/ImportSyntenyTrackSelector.js.map +1 -0
- package/esm/DotplotView/components/PanButtons.d.ts +6 -0
- package/esm/DotplotView/components/PanButtons.js +55 -0
- package/esm/DotplotView/components/PanButtons.js.map +1 -0
- package/esm/DotplotView/components/WarningDialog.d.ts +16 -0
- package/esm/DotplotView/components/WarningDialog.js +36 -0
- package/esm/DotplotView/components/WarningDialog.js.map +1 -0
- package/esm/DotplotView/components/util.d.ts +19 -0
- package/esm/DotplotView/components/util.js +83 -0
- package/esm/DotplotView/components/util.js.map +1 -0
- package/esm/DotplotView/index.d.ts +2 -0
- package/esm/DotplotView/index.js +15 -0
- package/esm/DotplotView/index.js.map +1 -0
- package/esm/DotplotView/model.d.ts +616 -0
- package/esm/DotplotView/model.js +616 -0
- package/esm/DotplotView/model.js.map +1 -0
- package/esm/DotplotView/svgcomponents/SVGBackground.d.ts +5 -0
- package/esm/DotplotView/svgcomponents/SVGBackground.js +7 -0
- package/esm/DotplotView/svgcomponents/SVGBackground.js.map +1 -0
- package/esm/DotplotView/svgcomponents/SVGDotplotView.d.ts +2 -0
- package/esm/DotplotView/svgcomponents/SVGDotplotView.js +40 -0
- package/esm/DotplotView/svgcomponents/SVGDotplotView.js.map +1 -0
- package/esm/LaunchDotplotView.d.ts +2 -0
- package/esm/LaunchDotplotView.js +42 -0
- package/esm/LaunchDotplotView.js.map +1 -0
- package/esm/ServerSideRenderedBlockContent.d.ts +12 -0
- package/esm/ServerSideRenderedBlockContent.js +62 -0
- package/esm/ServerSideRenderedBlockContent.js.map +1 -0
- package/esm/ServerSideSyntenyRendering.d.ts +23 -0
- package/esm/ServerSideSyntenyRendering.js +29 -0
- package/esm/ServerSideSyntenyRendering.js.map +1 -0
- package/esm/index.d.ts +7 -0
- package/esm/index.js +38 -0
- package/esm/index.js.map +1 -0
- package/esm/util.d.ts +9 -0
- package/esm/util.js +5 -0
- package/esm/util.js.map +1 -0
- package/package.json +69 -0
- package/src/ComparativeRenderer/index.ts +87 -0
- package/src/DotplotDisplay/components/DotplotDisplay.tsx +34 -0
- package/src/DotplotDisplay/index.ts +48 -0
- package/src/DotplotDisplay/renderDotplotBlock.ts +60 -0
- package/src/DotplotDisplay/stateModelFactory.tsx +196 -0
- package/src/DotplotReadVsRef/DotplotReadVsRef.ts +115 -0
- package/src/DotplotReadVsRef/index.ts +50 -0
- package/src/DotplotRenderer/ComparativeRenderRpc.ts +87 -0
- package/src/DotplotRenderer/DotplotRenderer.ts +328 -0
- package/src/DotplotRenderer/__image_snapshots__/linear-synteny-renderer-test-ts-test-rendering-a-simple-synteny-from-fake-data-1-snap.png +0 -0
- package/src/DotplotRenderer/components/DotplotRendering.tsx +12 -0
- package/src/DotplotRenderer/configSchema.ts +92 -0
- package/src/DotplotRenderer/index.ts +16 -0
- package/src/DotplotView/1dview.ts +98 -0
- package/src/DotplotView/blockTypes.ts +140 -0
- package/src/DotplotView/components/Axes.tsx +246 -0
- package/src/DotplotView/components/CursorIcon.tsx +24 -0
- package/src/DotplotView/components/DotplotTooltip.tsx +163 -0
- package/src/DotplotView/components/DotplotView.tsx +348 -0
- package/src/DotplotView/components/DotplotWarnings.tsx +26 -0
- package/src/DotplotView/components/ExportSvgDialog.tsx +129 -0
- package/src/DotplotView/components/Grid.tsx +112 -0
- package/src/DotplotView/components/Header.tsx +182 -0
- package/src/DotplotView/components/ImportCustomTrack.tsx +262 -0
- package/src/DotplotView/components/ImportForm.tsx +209 -0
- package/src/DotplotView/components/ImportSyntenyTrackSelector.tsx +90 -0
- package/src/DotplotView/components/PanButtons.tsx +93 -0
- package/src/DotplotView/components/WarningDialog.tsx +74 -0
- package/src/DotplotView/components/util.ts +118 -0
- package/src/DotplotView/index.ts +16 -0
- package/src/DotplotView/model.test.ts +17 -0
- package/src/DotplotView/model.ts +719 -0
- package/src/DotplotView/svgcomponents/SVGBackground.tsx +21 -0
- package/src/DotplotView/svgcomponents/SVGDotplotView.tsx +68 -0
- package/src/LaunchDotplotView.ts +63 -0
- package/src/ServerSideRenderedBlockContent.tsx +86 -0
- package/src/ServerSideSyntenyRendering.tsx +54 -0
- package/src/index.ts +41 -0
- package/src/util.ts +14 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.stateModelFactory = void 0;
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
10
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
11
|
+
const tracks_1 = require("@jbrowse/core/util/tracks");
|
|
12
|
+
const util_1 = require("@jbrowse/core/util");
|
|
13
|
+
const models_1 = require("@jbrowse/core/pluggableElementTypes/models");
|
|
14
|
+
// locals
|
|
15
|
+
const ServerSideRenderedBlockContent_1 = __importDefault(require("../ServerSideRenderedBlockContent"));
|
|
16
|
+
const renderDotplotBlock_1 = require("./renderDotplotBlock");
|
|
17
|
+
/**
|
|
18
|
+
* #stateModel DotplotDisplay
|
|
19
|
+
* #category display
|
|
20
|
+
*/
|
|
21
|
+
function stateModelFactory(configSchema) {
|
|
22
|
+
return mobx_state_tree_1.types
|
|
23
|
+
.compose('DotplotDisplay', models_1.BaseDisplay, mobx_state_tree_1.types
|
|
24
|
+
.model({
|
|
25
|
+
/**
|
|
26
|
+
* #property
|
|
27
|
+
*/
|
|
28
|
+
type: mobx_state_tree_1.types.literal('DotplotDisplay'),
|
|
29
|
+
/**
|
|
30
|
+
* #property
|
|
31
|
+
*/
|
|
32
|
+
configuration: (0, configuration_1.ConfigurationReference)(configSchema),
|
|
33
|
+
})
|
|
34
|
+
.volatile(() => ({
|
|
35
|
+
warnings: [],
|
|
36
|
+
renderInProgress: undefined,
|
|
37
|
+
filled: false,
|
|
38
|
+
data: undefined,
|
|
39
|
+
reactElement: undefined,
|
|
40
|
+
message: undefined,
|
|
41
|
+
renderingComponent: undefined,
|
|
42
|
+
ReactComponent2: ServerSideRenderedBlockContent_1.default,
|
|
43
|
+
})))
|
|
44
|
+
.views(self => ({
|
|
45
|
+
get shouldDisplay() {
|
|
46
|
+
const view = (0, util_1.getContainingView)(self);
|
|
47
|
+
return (view.vview.bpPerPx === self.data.bpPerPxY &&
|
|
48
|
+
view.hview.bpPerPx === self.data.bpPerPxX);
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* #getter
|
|
52
|
+
*/
|
|
53
|
+
get rendererTypeName() {
|
|
54
|
+
return (0, configuration_1.getConf)(self, ['renderer', 'type']);
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* #method
|
|
58
|
+
*/
|
|
59
|
+
renderProps() {
|
|
60
|
+
return {
|
|
61
|
+
...(0, tracks_1.getParentRenderProps)(self),
|
|
62
|
+
rpcDriverName: self.rpcDriverName,
|
|
63
|
+
displayModel: self,
|
|
64
|
+
config: self.configuration.renderer,
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
}))
|
|
68
|
+
.views(self => ({
|
|
69
|
+
/**
|
|
70
|
+
* #method
|
|
71
|
+
*/
|
|
72
|
+
async renderSvg(opts) {
|
|
73
|
+
const props = (0, renderDotplotBlock_1.renderBlockData)(self);
|
|
74
|
+
if (!props) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
const { rendererType, rpcManager, renderProps } = props;
|
|
78
|
+
const rendering = await rendererType.renderInClient(rpcManager, {
|
|
79
|
+
...renderProps,
|
|
80
|
+
exportSVG: opts,
|
|
81
|
+
theme: opts.theme || renderProps.theme,
|
|
82
|
+
});
|
|
83
|
+
const { hview, vview } = (0, util_1.getContainingView)(self);
|
|
84
|
+
const offX = -hview.offsetPx + rendering.offsetX;
|
|
85
|
+
const offY = -vview.offsetPx + rendering.offsetY;
|
|
86
|
+
return (react_1.default.createElement("g", { transform: `translate(${offX} ${-offY})` },
|
|
87
|
+
react_1.default.createElement(util_1.ReactRendering, { rendering: rendering })));
|
|
88
|
+
},
|
|
89
|
+
}))
|
|
90
|
+
.actions(self => {
|
|
91
|
+
let renderInProgress;
|
|
92
|
+
return {
|
|
93
|
+
afterAttach() {
|
|
94
|
+
(0, util_1.makeAbortableReaction)(self, () => (0, renderDotplotBlock_1.renderBlockData)(self), blockData => (0, renderDotplotBlock_1.renderBlockEffect)(blockData), {
|
|
95
|
+
name: `${self.type} ${self.id} rendering`,
|
|
96
|
+
delay: 500,
|
|
97
|
+
fireImmediately: true,
|
|
98
|
+
}, this.setLoading, this.setRendered, this.setError);
|
|
99
|
+
},
|
|
100
|
+
/**
|
|
101
|
+
* #action
|
|
102
|
+
*/
|
|
103
|
+
setLoading(abortController) {
|
|
104
|
+
self.filled = false;
|
|
105
|
+
self.message = undefined;
|
|
106
|
+
self.reactElement = undefined;
|
|
107
|
+
self.data = undefined;
|
|
108
|
+
self.error = undefined;
|
|
109
|
+
self.renderingComponent = undefined;
|
|
110
|
+
renderInProgress = abortController;
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
* #action
|
|
114
|
+
*/
|
|
115
|
+
setMessage(messageText) {
|
|
116
|
+
if (renderInProgress && !renderInProgress.signal.aborted) {
|
|
117
|
+
renderInProgress.abort();
|
|
118
|
+
}
|
|
119
|
+
self.filled = false;
|
|
120
|
+
self.message = messageText;
|
|
121
|
+
self.reactElement = undefined;
|
|
122
|
+
self.data = undefined;
|
|
123
|
+
self.error = undefined;
|
|
124
|
+
self.renderingComponent = undefined;
|
|
125
|
+
renderInProgress = undefined;
|
|
126
|
+
},
|
|
127
|
+
/**
|
|
128
|
+
* #action
|
|
129
|
+
*/
|
|
130
|
+
setRendered(args) {
|
|
131
|
+
if (args === undefined) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const { data, reactElement, renderingComponent } = args;
|
|
135
|
+
self.warnings = data.warnings;
|
|
136
|
+
self.filled = true;
|
|
137
|
+
self.message = undefined;
|
|
138
|
+
self.reactElement = reactElement;
|
|
139
|
+
self.data = data;
|
|
140
|
+
self.error = undefined;
|
|
141
|
+
self.renderingComponent = renderingComponent;
|
|
142
|
+
renderInProgress = undefined;
|
|
143
|
+
},
|
|
144
|
+
/**
|
|
145
|
+
* #action
|
|
146
|
+
*/
|
|
147
|
+
setError(error) {
|
|
148
|
+
console.error(error);
|
|
149
|
+
if (renderInProgress && !renderInProgress.signal.aborted) {
|
|
150
|
+
renderInProgress.abort();
|
|
151
|
+
}
|
|
152
|
+
// the rendering failed for some reason
|
|
153
|
+
self.filled = false;
|
|
154
|
+
self.message = undefined;
|
|
155
|
+
self.reactElement = undefined;
|
|
156
|
+
self.data = undefined;
|
|
157
|
+
self.error = error;
|
|
158
|
+
self.renderingComponent = undefined;
|
|
159
|
+
renderInProgress = undefined;
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
exports.stateModelFactory = stateModelFactory;
|
|
165
|
+
//# sourceMappingURL=stateModelFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stateModelFactory.js","sourceRoot":"","sources":["../../src/DotplotDisplay/stateModelFactory.tsx"],"names":[],"mappings":";;;;;;AAAA,uDAAuD;AACvD,kDAAyB;AAEzB,qDAAiD;AACjD,+DAIoC;AACpC,sDAAgE;AAChE,6CAI2B;AAC3B,uEAAwE;AAExE,SAAS;AACT,uGAA8E;AAC9E,6DAAyE;AAGzE;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,YAAwC;IACxE,OAAO,uBAAK;SACT,OAAO,CACN,gBAAgB,EAChB,oBAAW,EACX,uBAAK;SACF,KAAK,CAAC;QACL;;WAEG;QACH,IAAI,EAAE,uBAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC;QACrC;;WAEG;QACH,aAAa,EAAE,IAAA,sCAAsB,EAAC,YAAY,CAAC;KACpD,CAAC;SACD,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;QACf,QAAQ,EAAE,EAA2C;QACrD,gBAAgB,EAAE,SAAwC;QAC1D,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,SAAgB;QACtB,YAAY,EAAE,SAA2C;QACzD,OAAO,EAAE,SAA+B;QACxC,kBAAkB,EAAE,SAAgB;QACpC,eAAe,EACb,wCAA0D;KAC7D,CAAC,CAAC,CACN;SACA,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACd,IAAI,aAAa;YACf,MAAM,IAAI,GAAG,IAAA,wBAAiB,EAAC,IAAI,CAAC,CAAA;YACpC,OAAO,CACL,IAAI,CAAC,KAAK,CAAC,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ;gBACzC,IAAI,CAAC,KAAK,CAAC,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,CAC1C,CAAA;QACH,CAAC;QACD;;WAEG;QACH,IAAI,gBAAgB;YAClB,OAAO,IAAA,uBAAO,EAAC,IAAI,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC,CAA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AI,IAAI,KAAK,SAAS,EAAE;oBACtB,OAAM;iBACP;gBACD,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAA;gBACvD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;gBAC7B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;gBAClB,IAAI,CAAC,OAAO,GAAG,SAAS,CAAA;gBACxB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;gBAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;gBAChB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAA;gBACtB,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAA;gBAC5C,gBAAgB,GAAG,SAAS,CAAA;YAC9B,CAAC;YACD;;eAEG;YACH,QAAQ,CAAC,KAAc;gBACrB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;gBACpB,IAAI,gBAAgB,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,EAAE;oBACxD,gBAAgB,CAAC,KAAK,EAAE,CAAA;iBACzB;gBACD,uCAAuC;gBACvC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;gBACnB,IAAI,CAAC,OAAO,GAAG,SAAS,CAAA;gBACxB,IAAI,CAAC,YAAY,GAAG,SAAS,CAAA;gBAC7B,IAAI,CAAC,IAAI,GAAG,SAAS,CAAA;gBACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;gBAClB,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAA;gBACnC,gBAAgB,GAAG,SAAS,CAAA;YAC9B,CAAC;SACF,CAAA;IACH,CAAC,CAAC,CAAA;AACN,CAAC;AAtKD,8CAsKC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.onClick = void 0;
|
|
4
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
5
|
+
const util_1 = require("@jbrowse/core/util");
|
|
6
|
+
const plugin_alignments_1 = require("@jbrowse/plugin-alignments");
|
|
7
|
+
const { featurizeSA, getClip, getTag, getLength, getLengthSansClipping } = plugin_alignments_1.MismatchParser;
|
|
8
|
+
function onClick(feature, self) {
|
|
9
|
+
const session = (0, util_1.getSession)(self);
|
|
10
|
+
try {
|
|
11
|
+
const cigar = feature.get('CIGAR');
|
|
12
|
+
const clipPos = getClip(cigar, 1);
|
|
13
|
+
const flags = feature.get('flags');
|
|
14
|
+
const strand = feature.get('strand');
|
|
15
|
+
const readName = feature.get('name');
|
|
16
|
+
const readAssembly = `${readName}_assembly_${Date.now()}`;
|
|
17
|
+
const { parentTrack } = self;
|
|
18
|
+
const [trackAssembly] = (0, configuration_1.getConf)(parentTrack, 'assemblyNames');
|
|
19
|
+
const assemblyNames = [trackAssembly, readAssembly];
|
|
20
|
+
const trackId = `track-${Date.now()}`;
|
|
21
|
+
const trackName = `${readName}_vs_${trackAssembly}`;
|
|
22
|
+
const SA = getTag(feature, 'SA') || '';
|
|
23
|
+
const SA2 = featurizeSA(SA, feature.id(), strand, readName, true);
|
|
24
|
+
const feat = feature.toJSON();
|
|
25
|
+
feat.strand = 1;
|
|
26
|
+
feat.mate = {
|
|
27
|
+
refName: readName,
|
|
28
|
+
start: clipPos,
|
|
29
|
+
end: clipPos + getLengthSansClipping(cigar),
|
|
30
|
+
};
|
|
31
|
+
// if secondary alignment or supplementary, calculate length from SA[0]'s
|
|
32
|
+
// CIGAR which is the primary alignments. otherwise it is the primary
|
|
33
|
+
// alignment just use seq.length if primary alignment
|
|
34
|
+
const totalLength = getLength(flags & 2048 ? SA2[0].CIGAR : cigar);
|
|
35
|
+
const features = [feat, ...SA2];
|
|
36
|
+
features.sort((a, b) => a.clipPos - b.clipPos);
|
|
37
|
+
const refLength = features.reduce((a, f) => a + f.end - f.start, 0);
|
|
38
|
+
session.addView('DotplotView', {
|
|
39
|
+
type: 'DotplotView',
|
|
40
|
+
hview: {
|
|
41
|
+
offsetPx: 0,
|
|
42
|
+
bpPerPx: refLength / 800,
|
|
43
|
+
displayedRegions: (0, util_1.gatherOverlaps)(features.map((f, index) => {
|
|
44
|
+
const { start, end, refName } = f;
|
|
45
|
+
return {
|
|
46
|
+
start,
|
|
47
|
+
end,
|
|
48
|
+
refName,
|
|
49
|
+
index,
|
|
50
|
+
assemblyName: trackAssembly,
|
|
51
|
+
};
|
|
52
|
+
})),
|
|
53
|
+
},
|
|
54
|
+
vview: {
|
|
55
|
+
offsetPx: 0,
|
|
56
|
+
bpPerPx: totalLength / 400,
|
|
57
|
+
minimumBlockWidth: 0,
|
|
58
|
+
interRegionPaddingWidth: 0,
|
|
59
|
+
displayedRegions: [
|
|
60
|
+
{
|
|
61
|
+
assemblyName: readAssembly,
|
|
62
|
+
start: 0,
|
|
63
|
+
end: totalLength,
|
|
64
|
+
refName: readName,
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
viewTrackConfigs: [
|
|
69
|
+
{
|
|
70
|
+
type: 'SyntenyTrack',
|
|
71
|
+
assemblyNames,
|
|
72
|
+
adapter: {
|
|
73
|
+
type: 'FromConfigAdapter',
|
|
74
|
+
features,
|
|
75
|
+
},
|
|
76
|
+
trackId,
|
|
77
|
+
name: trackName,
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
assemblyNames,
|
|
81
|
+
tracks: [
|
|
82
|
+
{
|
|
83
|
+
configuration: trackId,
|
|
84
|
+
type: 'SyntenyTrack',
|
|
85
|
+
displays: [
|
|
86
|
+
{
|
|
87
|
+
type: 'DotplotDisplay',
|
|
88
|
+
configuration: `${trackId}-DotplotDisplay`,
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
displayName: `${readName} vs ${trackAssembly}`,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
console.error(e);
|
|
98
|
+
session.notify(`${e}`, 'error');
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.onClick = onClick;
|
|
102
|
+
//# sourceMappingURL=DotplotReadVsRef.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DotplotReadVsRef.js","sourceRoot":"","sources":["../../src/DotplotReadVsRef/DotplotReadVsRef.ts"],"names":[],"mappings":";;;AAAA,+DAAqD;AACrD,6CAAwE;AACxE,kEAGmC;AAKnC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,qBAAqB,EAAE,GACtE,kCAAc,CAAA;AAEhB,SAAgB,OAAO,CAAC,OAAgB,EAAE,IAA8B;IACtE,MAAM,OAAO,GAAG,IAAA,iBAAU,EAAC,IAAI,CAAC,CAAA;IAChC,IAAI;QACF,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAClC,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACjC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAClC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACpC,MAAM,YAAY,GAAG,GAAG,QAAQ,aAAa,IAAI,CAAC,GAAG,EAAE,EAAE,CAAA;QACzD,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAA;QAC5B,MAAM,CAAC,aAAa,CAAC,GAAG,IAAA,uBAAO,EAAC,WAAW,EAAE,eAAe,CAAC,CAAA;QAC7D,MAAM,aAAa,GAAG,CAAC,aAAa,EAAE,YAAY,CAAC,CAAA;QACnD,MAAM,OAAO,GAAG,SAAS,IAAI,CAAC,GAAG,EAAE,EAAE,CAAA;QACrC,MAAM,SAAS,GAAG,GAAG,QAAQ,OA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function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
// icons
|
|
7
|
+
const Add_1 = __importDefault(require("@mui/icons-material/Add"));
|
|
8
|
+
// local
|
|
9
|
+
const DotplotReadVsRef_1 = require("./DotplotReadVsRef");
|
|
10
|
+
function DotplotReadVsRefMenuItem(pluginManager) {
|
|
11
|
+
pluginManager.addToExtensionPoint('Core-extendPluggableElement', (pluggableElement) => {
|
|
12
|
+
if (pluggableElement.name === 'LinearPileupDisplay') {
|
|
13
|
+
const { stateModel } = pluggableElement;
|
|
14
|
+
const newStateModel = stateModel.extend((self) => {
|
|
15
|
+
const superContextMenuItems = self.contextMenuItems;
|
|
16
|
+
return {
|
|
17
|
+
views: {
|
|
18
|
+
contextMenuItems() {
|
|
19
|
+
const feature = self.contextMenuFeature;
|
|
20
|
+
return [
|
|
21
|
+
...superContextMenuItems(),
|
|
22
|
+
...(feature
|
|
23
|
+
? [
|
|
24
|
+
{
|
|
25
|
+
label: 'Dotplot of read vs ref',
|
|
26
|
+
icon: Add_1.default,
|
|
27
|
+
onClick: () => (0, DotplotReadVsRef_1.onClick)(feature, self),
|
|
28
|
+
},
|
|
29
|
+
]
|
|
30
|
+
: []),
|
|
31
|
+
];
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
pluggableElement.stateModel = newStateModel;
|
|
37
|
+
}
|
|
38
|
+
return pluggableElement;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
exports.default = DotplotReadVsRefMenuItem;
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/DotplotReadVsRef/index.ts"],"names":[],"mappings":";;;;;AAOA,QAAQ;AACR,kEAA6C;AAE7C,QAAQ;AACR,yDAA4C;AAE5C,SAAwB,wBAAwB,CAAC,aAA4B;IAC3E,aAAa,CAAC,mBAAmB,CAC/B,6BAA6B,EAC7B,CAAC,gBAAsC,EAAE,EAAE;QACzC,IAAI,gBAAgB,CAAC,IAAI,KAAK,qBAAqB,EAAE;YACnD,MAAM,EAAE,UAAU,EAAE,GAAG,gBAA4B,CAAA;YACnD,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,CACrC,CAAC,IAA8B,EAAE,EAAE;gBACjC,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,CAAA;gBACnD,OAAO;oBACL,KAAK,EAAE;wBACL,gBAAgB;4BACd,MAAM,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAA;4BACvC,OAAO;gCACL,GAAG,qBAAqB,EAAE;gCAC1B,GAAG,CAAC,OAAO;oCACT,CAAC,CAAC;wCACE;4CACE,KAAK,EAAE,wBAAwB;4CAC/B,IAAI,EAAE,aAAO;4CACb,OAAO,EAAE,GAAG,EAAE,CAAC,IAAA,0BAAO,EAAC,OAAO,EAAE,IAAI,CAAC;yCACtC;qCACF;oCACH,CAAC,CAAC,EAAE,CAAC;6BACR,CAAA;wBACH,CAAC;qBACF;iBACF,CAAA;YACH,CAAC,CACF,CAEA;YAAC,gBAA6B,CAAC,UAAU,GAAG,aAAa,CAAA;SAC3D;QACD,OAAO,gBAAgB,CAAA;IACzB,CAAC,CACF,CAAA;AACH,CAAC;AApCD,2CAoCC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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';
|
|
4
|
+
interface RenderArgs extends ComparativeRenderArgs {
|
|
5
|
+
adapterConfig: {};
|
|
6
|
+
rendererType: string;
|
|
7
|
+
}
|
|
8
|
+
interface RenderArgsSerialized extends ComparativeRenderArgsSerialized {
|
|
9
|
+
adapterConfig: {};
|
|
10
|
+
rendererType: string;
|
|
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
|
+
export default class ComparativeRender extends RpcMethodType {
|
|
18
|
+
name: string;
|
|
19
|
+
renameRegionsIfNeeded(args: RenderArgs, rend: ComparativeRenderer): Promise<ComparativeRenderArgs>;
|
|
20
|
+
getRenderer(rendererType: string): ComparativeRenderer;
|
|
21
|
+
serializeArguments(args: RenderArgs, rpcDriver: string): Promise<ComparativeRenderArgs | import("@jbrowse/core/pluggableElementTypes/renderers/ServerSideRendererType").RenderArgsSerialized>;
|
|
22
|
+
execute(args: RenderArgsSerialized & {
|
|
23
|
+
signal?: RemoteAbortSignal;
|
|
24
|
+
}, rpcDriver: string): Promise<RenderResults | import("@jbrowse/core/pluggableElementTypes/renderers/ServerSideRendererType").ResultsSerialized>;
|
|
25
|
+
deserializeReturn(val: RenderResults | ResultsSerialized, args: RenderArgs, rpcDriver: string): Promise<unknown>;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const util_1 = require("@jbrowse/core/util");
|
|
7
|
+
const RpcMethodType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/RpcMethodType"));
|
|
8
|
+
/**
|
|
9
|
+
* call a synteny renderer with the given args
|
|
10
|
+
* param views: a set of views that each contain a set of regions
|
|
11
|
+
* used instead of passing regions directly as in render()
|
|
12
|
+
*/
|
|
13
|
+
class ComparativeRender extends RpcMethodType_1.default {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.name = 'ComparativeRender';
|
|
17
|
+
}
|
|
18
|
+
async renameRegionsIfNeeded(args, rend) {
|
|
19
|
+
return rend.renameRegionsIfNeeded(args);
|
|
20
|
+
}
|
|
21
|
+
getRenderer(rendererType) {
|
|
22
|
+
const pm = this.pluginManager;
|
|
23
|
+
return pm.getRendererType(rendererType);
|
|
24
|
+
}
|
|
25
|
+
async serializeArguments(args, rpcDriver) {
|
|
26
|
+
const { rendererType } = args;
|
|
27
|
+
const renderer = this.getRenderer(rendererType);
|
|
28
|
+
const n = (await super.serializeArguments(args, rpcDriver));
|
|
29
|
+
const result = await this.renameRegionsIfNeeded(n, renderer);
|
|
30
|
+
return rpcDriver === 'MainThreadRpcDriver'
|
|
31
|
+
? result
|
|
32
|
+
: renderer.serializeArgsInClient(result);
|
|
33
|
+
}
|
|
34
|
+
async execute(args, rpcDriver) {
|
|
35
|
+
let deserializedArgs = args;
|
|
36
|
+
if (rpcDriver !== 'MainThreadRpcDriver') {
|
|
37
|
+
deserializedArgs = await this.deserializeArguments(args, rpcDriver);
|
|
38
|
+
}
|
|
39
|
+
const { sessionId, rendererType, signal } = deserializedArgs;
|
|
40
|
+
if (!sessionId) {
|
|
41
|
+
throw new Error('must pass a unique session id');
|
|
42
|
+
}
|
|
43
|
+
(0, util_1.checkAbortSignal)(signal);
|
|
44
|
+
const renderer = this.getRenderer(rendererType);
|
|
45
|
+
return rpcDriver === 'MainThreadRpcDriver'
|
|
46
|
+
? renderer.render(deserializedArgs)
|
|
47
|
+
: renderer.renderInWorker(deserializedArgs);
|
|
48
|
+
}
|
|
49
|
+
async deserializeReturn(val, args, rpcDriver) {
|
|
50
|
+
const ret = (await super.deserializeReturn(val, args, rpcDriver));
|
|
51
|
+
if (rpcDriver === 'MainThreadRpcDriver') {
|
|
52
|
+
return ret;
|
|
53
|
+
}
|
|
54
|
+
const renderer = this.getRenderer(args.rendererType);
|
|
55
|
+
return renderer.deserializeResultsInClient(ret, args);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.default = ComparativeRender;
|
|
59
|
+
//# sourceMappingURL=ComparativeRenderRpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComparativeRenderRpc.js","sourceRoot":"","sources":["../../src/DotplotRenderer/ComparativeRenderRpc.ts"],"names":[],"mappings":";;;;;AAAA,6CAAqD;AACrD,sGAA6E;AAmB7E;;;;GAIG;AACH,MAAqB,iBAAkB,SAAQ,uBAAa;IAA5D;;QACE,SAAI,GAAG,mBAAmB,CAAA;IA4D5B,CAAC;IA1DC,KAAK,CAAC,qBAAqB,CAAC,IAAgB,EAAE,IAAyB;QACrE,OAAO,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;IACzC,CAAC;IAED,WAAW,CAAC,YAAoB;QAC9B,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;QAC7B,OAAO,EAAE,CAAC,eAAe,CAAC,YAAY,CAAwB,CAAA;IAChE,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,IAAgB,EAAE,SAAiB;QAC1D,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAA;QAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAA;QAC/C,MAAM,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,kBAAkB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAe,CAAA;QACzE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAA;QAE5D,OAAO,SAAS,KAAK,qBAAqB;YACxC,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAA;IAC5C,CAAC;IAED,KAAK,CAAC,OAAO,CACX,IAA2D,EAC3D,SAAiB;QAEjB,IAAI,gBAAgB,GAAG,IAAI,CAAA;QAC3B,IAAI,SAAS,KAAK,qBAAqB,EAAE;YACvC,gBAAgB,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;SACpE;QACD,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAAA;QAC5D,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAA;SACjD;QAED,IAAA,uBAAgB,EAAC,MAAM,CAAC,CAAA;QAExB,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAA;QAC/C,OAAO,SAAS,KAAK,qBAAqB;YACxC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC;YACnC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAA;IAC/C,CAAC;IAED,KAAK,CAAC,iBAAiB,CACrB,GAAsC,EACtC,IAAgB,EAChB,SAAiB;QAEjB,MAAM,GAAG,GAAG,CAAC,MAAM,KAAK,CAAC,iBAAiB,CACxC,GAAG,EACH,IAAI,EACJ,SAAS,CACV,CAAsB,CAAA;QACvB,IAAI,SAAS,KAAK,qBAAqB,EAAE;YACvC,OAAO,GAAG,CAAA;SACX;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QACpD,OAAO,QAAQ,CAAC,0BAA0B,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACvD,CAAC;CACF;AA7DD,oCA6DC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import { Region } from '@jbrowse/core/util';
|
|
4
|
+
import ComparativeRenderer, { RenderArgsDeserialized, RenderArgs } from '@jbrowse/core/pluggableElementTypes/renderers/ComparativeServerSideRendererType';
|
|
5
|
+
import { Dotplot1DViewModel } from '../DotplotView/model';
|
|
6
|
+
export interface DotplotRenderArgsDeserialized extends RenderArgsDeserialized {
|
|
7
|
+
height: number;
|
|
8
|
+
width: number;
|
|
9
|
+
highResolutionScaling: number;
|
|
10
|
+
view: {
|
|
11
|
+
hview: Dotplot1DViewModel;
|
|
12
|
+
vview: Dotplot1DViewModel;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
interface DotplotRenderArgs extends RenderArgs {
|
|
16
|
+
adapterConfig: AnyConfigurationModel;
|
|
17
|
+
sessionId: string;
|
|
18
|
+
view: {
|
|
19
|
+
hview: {
|
|
20
|
+
displayedRegions: Region[];
|
|
21
|
+
};
|
|
22
|
+
vview: {
|
|
23
|
+
displayedRegions: Region[];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export default class DotplotRenderer extends ComparativeRenderer {
|
|
28
|
+
supportsSVG: boolean;
|
|
29
|
+
renameRegionsIfNeeded(args: DotplotRenderArgs): Promise<DotplotRenderArgs>;
|
|
30
|
+
drawDotplot(ctx: CanvasRenderingContext2D, props: DotplotRenderArgsDeserialized & {
|
|
31
|
+
views: Dotplot1DViewModel[];
|
|
32
|
+
}): Promise<{
|
|
33
|
+
warnings: {
|
|
34
|
+
message: string;
|
|
35
|
+
effect: string;
|
|
36
|
+
}[];
|
|
37
|
+
}>;
|
|
38
|
+
render(renderProps: DotplotRenderArgsDeserialized): Promise<{
|
|
39
|
+
height: number;
|
|
40
|
+
width: number;
|
|
41
|
+
offsetX: number;
|
|
42
|
+
offsetY: number;
|
|
43
|
+
bpPerPxX: number;
|
|
44
|
+
bpPerPxY: number;
|
|
45
|
+
canvasRecordedData: any;
|
|
46
|
+
reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
47
|
+
html?: string | undefined;
|
|
48
|
+
} | {
|
|
49
|
+
height: number;
|
|
50
|
+
width: number;
|
|
51
|
+
offsetX: number;
|
|
52
|
+
offsetY: number;
|
|
53
|
+
bpPerPxX: number;
|
|
54
|
+
bpPerPxY: number;
|
|
55
|
+
reactElement: import("react").JSX.Element;
|
|
56
|
+
html?: string | undefined;
|
|
57
|
+
} | {
|
|
58
|
+
height: number;
|
|
59
|
+
width: number;
|
|
60
|
+
offsetX: number;
|
|
61
|
+
offsetY: number;
|
|
62
|
+
bpPerPxX: number;
|
|
63
|
+
bpPerPxY: number;
|
|
64
|
+
imageData: any;
|
|
65
|
+
reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
66
|
+
html?: string | undefined;
|
|
67
|
+
}>;
|
|
68
|
+
}
|
|
69
|
+
export {};
|