@jbrowse/plugin-dotplot-view 3.6.5 → 4.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.
- package/esm/ComparativeRenderer/index.d.ts +10 -10
- package/esm/ComparativeRenderer/index.js +4 -17
- package/esm/DiagonalizeDotplotRpc.d.ts +30 -0
- package/esm/DiagonalizeDotplotRpc.js +147 -0
- package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +1 -1
- package/esm/DotplotDisplay/index.d.ts +3 -3
- package/esm/DotplotDisplay/index.js +4 -4
- package/esm/DotplotDisplay/renderDotplotBlock.d.ts +2 -1
- package/esm/DotplotDisplay/renderDotplotBlock.js +9 -4
- package/esm/DotplotDisplay/stateModelFactory.d.ts +148 -29
- package/esm/DotplotDisplay/stateModelFactory.js +17 -11
- package/esm/DotplotReadVsRef/DotplotReadVsRef.js +5 -6
- package/esm/DotplotReadVsRef/index.js +1 -1
- package/esm/DotplotRenderer/DotplotRenderer.d.ts +30 -48
- package/esm/DotplotRenderer/DotplotRenderer.js +55 -22
- package/esm/DotplotRenderer/clamp.d.ts +7 -0
- package/esm/DotplotRenderer/clamp.js +58 -0
- package/esm/DotplotRenderer/components/DotplotRendering.d.ts +1 -1
- package/esm/DotplotRenderer/components/DotplotRendering.js +1 -1
- package/esm/DotplotRenderer/configSchema.d.ts +3 -3
- package/esm/DotplotRenderer/configSchema.js +1 -1
- package/esm/DotplotRenderer/drawDotplot.d.ts +7 -6
- package/esm/DotplotRenderer/drawDotplot.js +95 -100
- package/esm/DotplotRenderer/index.js +4 -4
- package/esm/DotplotView/1dview.d.ts +25 -25
- package/esm/DotplotView/1dview.js +16 -4
- package/esm/DotplotView/components/Axes.d.ts +1 -1
- package/esm/DotplotView/components/Axes.js +31 -41
- package/esm/DotplotView/components/ColorBySelector.d.ts +5 -0
- package/esm/DotplotView/components/ColorBySelector.js +73 -0
- package/esm/DotplotView/components/DiagonalizationProgressDialog.d.ts +6 -0
- package/esm/DotplotView/components/DiagonalizationProgressDialog.js +123 -0
- package/esm/DotplotView/components/DotplotControls.d.ts +1 -1
- package/esm/DotplotView/components/DotplotControls.js +53 -15
- package/esm/DotplotView/components/DotplotGrid.d.ts +6 -0
- package/esm/DotplotView/components/{Grid.js → DotplotGrid.js} +19 -20
- package/esm/DotplotView/components/DotplotGridWrapper.d.ts +6 -0
- package/esm/DotplotView/components/DotplotGridWrapper.js +8 -0
- package/esm/DotplotView/components/DotplotTooltipClick.d.ts +2 -2
- package/esm/DotplotView/components/DotplotTooltipClick.js +4 -4
- package/esm/DotplotView/components/DotplotTooltipMouseover.d.ts +1 -1
- package/esm/DotplotView/components/DotplotTooltipMouseover.js +2 -2
- package/esm/DotplotView/components/DotplotTooltips.d.ts +15 -0
- package/esm/DotplotView/components/DotplotTooltips.js +7 -0
- package/esm/DotplotView/components/DotplotView.d.ts +2 -2
- package/esm/DotplotView/components/DotplotView.js +31 -171
- package/esm/DotplotView/components/DotplotWarnings.d.ts +1 -1
- package/esm/DotplotView/components/DotplotWarnings.js +7 -7
- package/esm/DotplotView/components/ExportSvgDialog.d.ts +1 -1
- package/esm/DotplotView/components/Header.d.ts +1 -1
- package/esm/DotplotView/components/Header.js +5 -5
- package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +1 -1
- package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +6 -5
- package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +1 -1
- package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +2 -3
- package/esm/DotplotView/components/ImportForm/TrackSelector.d.ts +10 -1
- package/esm/DotplotView/components/ImportForm/TrackSelector.js +8 -4
- package/esm/DotplotView/components/ImportForm/index.d.ts +1 -1
- package/esm/DotplotView/components/ImportForm/index.js +4 -10
- package/esm/DotplotView/components/ImportForm/selectors/AnchorsFileSelector.d.ts +1 -1
- package/esm/DotplotView/components/ImportForm/selectors/AnchorsFileSelector.js +2 -2
- package/esm/DotplotView/components/ImportForm/selectors/PifGzSelector.d.ts +1 -1
- package/esm/DotplotView/components/ImportForm/selectors/PifGzSelector.js +2 -2
- package/esm/DotplotView/components/ImportForm/selectors/SwapAssemblies.js +3 -3
- package/esm/DotplotView/components/ImportForm/selectors/SyntenyFileSelector.d.ts +1 -1
- package/esm/DotplotView/components/ImportForm/selectors/SyntenyFileSelector.js +3 -3
- package/esm/DotplotView/components/ImportForm/selectors/index.d.ts +3 -3
- package/esm/DotplotView/components/ImportForm/selectors/index.js +3 -3
- package/esm/DotplotView/components/MinLengthSlider.d.ts +5 -0
- package/esm/DotplotView/components/MinLengthSlider.js +39 -0
- package/esm/DotplotView/components/MouseInteractionLayer.d.ts +17 -0
- package/esm/DotplotView/components/MouseInteractionLayer.js +14 -0
- package/esm/DotplotView/components/OpacitySlider.d.ts +5 -0
- package/esm/DotplotView/components/OpacitySlider.js +37 -0
- package/esm/DotplotView/components/PanButtons.d.ts +1 -1
- package/esm/DotplotView/components/PanButtons.js +1 -1
- package/esm/DotplotView/components/SelectionContextMenu.d.ts +13 -0
- package/esm/DotplotView/components/SelectionContextMenu.js +39 -0
- package/esm/DotplotView/components/SliderTooltip.d.ts +2 -0
- package/esm/DotplotView/components/SliderTooltip.js +6 -0
- package/esm/DotplotView/components/WarningDialog.js +1 -1
- package/esm/DotplotView/components/hooks/useCtrlKeyTracking.d.ts +1 -0
- package/esm/DotplotView/components/hooks/useCtrlKeyTracking.js +21 -0
- package/esm/DotplotView/components/hooks/useCursorMode.d.ts +7 -0
- package/esm/DotplotView/components/hooks/useCursorMode.js +16 -0
- package/esm/DotplotView/components/hooks/useMouseCoordinates.d.ts +29 -0
- package/esm/DotplotView/components/hooks/useMouseCoordinates.js +49 -0
- package/esm/DotplotView/components/hooks/useMouseMoveHandler.d.ts +6 -0
- package/esm/DotplotView/components/hooks/useMouseMoveHandler.js +24 -0
- package/esm/DotplotView/components/hooks/useMouseUpHandler.d.ts +3 -0
- package/esm/DotplotView/components/hooks/useMouseUpHandler.js +28 -0
- package/esm/DotplotView/components/hooks/useWheelHandler.d.ts +8 -0
- package/esm/DotplotView/components/hooks/useWheelHandler.js +44 -0
- package/esm/DotplotView/components/util.d.ts +1 -1
- package/esm/DotplotView/components/util.js +18 -8
- package/esm/DotplotView/index.js +2 -2
- package/esm/DotplotView/model.d.ts +213 -90
- package/esm/DotplotView/model.js +147 -93
- package/esm/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
- package/esm/DotplotView/svgcomponents/SVGDotplotView.js +5 -6
- package/esm/DotplotView/types.d.ts +7 -1
- package/esm/LaunchDotplotView.js +6 -36
- package/esm/ServerSideRenderedBlockContent.js +6 -27
- package/esm/ServerSideSyntenyRendering.d.ts +1 -1
- package/esm/ServerSideSyntenyRendering.js +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +9 -10
- package/esm/util.d.ts +1 -1
- package/package.json +28 -35
- package/dist/ComparativeRenderer/index.d.ts +0 -22
- package/dist/ComparativeRenderer/index.js +0 -53
- package/dist/DotplotDisplay/components/DotplotDisplay.d.ts +0 -6
- package/dist/DotplotDisplay/components/DotplotDisplay.js +0 -18
- package/dist/DotplotDisplay/index.d.ts +0 -5
- package/dist/DotplotDisplay/index.js +0 -36
- package/dist/DotplotDisplay/renderDotplotBlock.d.ts +0 -11
- package/dist/DotplotDisplay/renderDotplotBlock.js +0 -49
- package/dist/DotplotDisplay/stateModelFactory.d.ts +0 -102
- package/dist/DotplotDisplay/stateModelFactory.js +0 -119
- package/dist/DotplotReadVsRef/DotplotReadVsRef.d.ts +0 -3
- package/dist/DotplotReadVsRef/DotplotReadVsRef.js +0 -100
- package/dist/DotplotReadVsRef/index.d.ts +0 -2
- package/dist/DotplotReadVsRef/index.js +0 -41
- package/dist/DotplotRenderer/ComparativeRenderRpc.d.ts +0 -22
- package/dist/DotplotRenderer/ComparativeRenderRpc.js +0 -53
- package/dist/DotplotRenderer/DotplotRenderer.d.ts +0 -74
- package/dist/DotplotRenderer/DotplotRenderer.js +0 -102
- package/dist/DotplotRenderer/components/DotplotRendering.d.ts +0 -3
- package/dist/DotplotRenderer/components/DotplotRendering.js +0 -9
- package/dist/DotplotRenderer/configSchema.d.ts +0 -40
- package/dist/DotplotRenderer/configSchema.js +0 -57
- package/dist/DotplotRenderer/drawDotplot.d.ts +0 -21
- package/dist/DotplotRenderer/drawDotplot.js +0 -213
- package/dist/DotplotRenderer/index.d.ts +0 -2
- package/dist/DotplotRenderer/index.js +0 -17
- package/dist/DotplotView/1dview.d.ts +0 -199
- package/dist/DotplotView/1dview.js +0 -63
- package/dist/DotplotView/components/Axes.d.ts +0 -13
- package/dist/DotplotView/components/Axes.js +0 -107
- package/dist/DotplotView/components/CursorIcon.d.ts +0 -3
- package/dist/DotplotView/components/CursorIcon.js +0 -15
- package/dist/DotplotView/components/DotplotControls.d.ts +0 -5
- package/dist/DotplotView/components/DotplotControls.js +0 -115
- package/dist/DotplotView/components/DotplotTooltipClick.d.ts +0 -10
- package/dist/DotplotView/components/DotplotTooltipClick.js +0 -17
- package/dist/DotplotView/components/DotplotTooltipMouseover.d.ts +0 -9
- package/dist/DotplotView/components/DotplotTooltipMouseover.js +0 -16
- package/dist/DotplotView/components/DotplotView.d.ts +0 -5
- package/dist/DotplotView/components/DotplotView.js +0 -275
- package/dist/DotplotView/components/DotplotWarnings.d.ts +0 -5
- package/dist/DotplotView/components/DotplotWarnings.js +0 -53
- package/dist/DotplotView/components/ExportSvgDialog.d.ts +0 -7
- package/dist/DotplotView/components/ExportSvgDialog.js +0 -53
- package/dist/DotplotView/components/Grid.d.ts +0 -9
- package/dist/DotplotView/components/Grid.js +0 -47
- package/dist/DotplotView/components/Header.d.ts +0 -9
- package/dist/DotplotView/components/Header.js +0 -33
- package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +0 -7
- package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +0 -78
- package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +0 -7
- package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +0 -42
- package/dist/DotplotView/components/ImportForm/TrackSelector.d.ts +0 -7
- package/dist/DotplotView/components/ImportForm/TrackSelector.js +0 -23
- package/dist/DotplotView/components/ImportForm/getAdapter.d.ts +0 -117
- package/dist/DotplotView/components/ImportForm/getAdapter.js +0 -68
- package/dist/DotplotView/components/ImportForm/index.d.ts +0 -5
- package/dist/DotplotView/components/ImportForm/index.js +0 -76
- package/dist/DotplotView/components/ImportForm/selectors/AnchorsFileSelector.d.ts +0 -3
- package/dist/DotplotView/components/ImportForm/selectors/AnchorsFileSelector.js +0 -23
- package/dist/DotplotView/components/ImportForm/selectors/PifGzSelector.d.ts +0 -3
- package/dist/DotplotView/components/ImportForm/selectors/PifGzSelector.js +0 -13
- package/dist/DotplotView/components/ImportForm/selectors/SelectorTypes.d.ts +0 -23
- package/dist/DotplotView/components/ImportForm/selectors/SelectorTypes.js +0 -10
- package/dist/DotplotView/components/ImportForm/selectors/SwapAssemblies.d.ts +0 -13
- package/dist/DotplotView/components/ImportForm/selectors/SwapAssemblies.js +0 -32
- package/dist/DotplotView/components/ImportForm/selectors/SyntenyFileSelector.d.ts +0 -3
- package/dist/DotplotView/components/ImportForm/selectors/SyntenyFileSelector.js +0 -24
- package/dist/DotplotView/components/ImportForm/selectors/index.d.ts +0 -3
- package/dist/DotplotView/components/ImportForm/selectors/index.js +0 -12
- package/dist/DotplotView/components/ImportForm/util.d.ts +0 -10
- package/dist/DotplotView/components/ImportForm/util.js +0 -24
- package/dist/DotplotView/components/PanButtons.d.ts +0 -5
- package/dist/DotplotView/components/PanButtons.js +0 -47
- package/dist/DotplotView/components/WarningDialog.d.ts +0 -16
- package/dist/DotplotView/components/WarningDialog.js +0 -39
- package/dist/DotplotView/components/util.d.ts +0 -14
- package/dist/DotplotView/components/util.js +0 -82
- package/dist/DotplotView/index.d.ts +0 -2
- package/dist/DotplotView/index.js +0 -52
- package/dist/DotplotView/model.d.ts +0 -435
- package/dist/DotplotView/model.js +0 -487
- package/dist/DotplotView/svgcomponents/SVGBackground.d.ts +0 -4
- package/dist/DotplotView/svgcomponents/SVGBackground.js +0 -10
- package/dist/DotplotView/svgcomponents/SVGDotplotView.d.ts +0 -2
- package/dist/DotplotView/svgcomponents/SVGDotplotView.js +0 -30
- package/dist/DotplotView/types.d.ts +0 -12
- package/dist/DotplotView/types.js +0 -2
- package/dist/LaunchDotplotView.d.ts +0 -2
- package/dist/LaunchDotplotView.js +0 -43
- package/dist/ServerSideRenderedBlockContent.d.ts +0 -12
- package/dist/ServerSideRenderedBlockContent.js +0 -65
- package/dist/ServerSideSyntenyRendering.d.ts +0 -13
- package/dist/ServerSideSyntenyRendering.js +0 -23
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -40
- package/dist/util.d.ts +0 -9
- package/dist/util.js +0 -7
- package/esm/DotplotRenderer/ComparativeRenderRpc.d.ts +0 -22
- package/esm/DotplotRenderer/ComparativeRenderRpc.js +0 -47
- package/esm/DotplotView/components/Grid.d.ts +0 -9
|
@@ -1,487 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.Dotplot1DView = void 0;
|
|
40
|
-
exports.default = stateModelFactory;
|
|
41
|
-
const react_1 = require("react");
|
|
42
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
43
|
-
const BaseViewModel_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/models/BaseViewModel"));
|
|
44
|
-
const Icons_1 = require("@jbrowse/core/ui/Icons");
|
|
45
|
-
const util_1 = require("@jbrowse/core/util");
|
|
46
|
-
const tracks_1 = require("@jbrowse/core/util/tracks");
|
|
47
|
-
const mst_1 = require("@jbrowse/core/util/types/mst");
|
|
48
|
-
const FolderOpen_1 = __importDefault(require("@mui/icons-material/FolderOpen"));
|
|
49
|
-
const PhotoCamera_1 = __importDefault(require("@mui/icons-material/PhotoCamera"));
|
|
50
|
-
const file_saver_1 = require("file-saver");
|
|
51
|
-
const mobx_1 = require("mobx");
|
|
52
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
53
|
-
const _1dview_1 = require("./1dview");
|
|
54
|
-
const util_2 = require("./components/util");
|
|
55
|
-
const ExportSvgDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/ExportSvgDialog'))));
|
|
56
|
-
const ReturnToImportFormDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@jbrowse/core/ui/ReturnToImportFormDialog'))));
|
|
57
|
-
function stringLenPx(a) {
|
|
58
|
-
return (0, util_1.measureText)(a.slice(0, 30));
|
|
59
|
-
}
|
|
60
|
-
function pxWidthForBlocks(blocks, bpPerPx, hide) {
|
|
61
|
-
return (0, util_1.max)([
|
|
62
|
-
...blocks.filter(b => !hide.has(b.key)).map(b => stringLenPx(b.refName)),
|
|
63
|
-
...blocks
|
|
64
|
-
.filter(b => !hide.has(b.key))
|
|
65
|
-
.map(b => stringLenPx((0, util_1.getTickDisplayStr)(b.end, bpPerPx))),
|
|
66
|
-
]);
|
|
67
|
-
}
|
|
68
|
-
function stateModelFactory(pm) {
|
|
69
|
-
return mobx_state_tree_1.types
|
|
70
|
-
.compose('DotplotView', BaseViewModel_1.default, mobx_state_tree_1.types.model({
|
|
71
|
-
id: mst_1.ElementId,
|
|
72
|
-
type: mobx_state_tree_1.types.literal('DotplotView'),
|
|
73
|
-
height: 600,
|
|
74
|
-
borderSize: 20,
|
|
75
|
-
tickSize: 5,
|
|
76
|
-
vtextRotation: 0,
|
|
77
|
-
htextRotation: -90,
|
|
78
|
-
fontSize: 15,
|
|
79
|
-
trackSelectorType: 'hierarchical',
|
|
80
|
-
assemblyNames: mobx_state_tree_1.types.array(mobx_state_tree_1.types.string),
|
|
81
|
-
drawCigar: true,
|
|
82
|
-
hview: mobx_state_tree_1.types.optional(_1dview_1.DotplotHView, {}),
|
|
83
|
-
vview: mobx_state_tree_1.types.optional(_1dview_1.DotplotVView, {}),
|
|
84
|
-
tracks: mobx_state_tree_1.types.array(pm.pluggableMstType('track', 'stateModel')),
|
|
85
|
-
viewTrackConfigs: mobx_state_tree_1.types.array(pm.pluggableConfigSchemaType('track')),
|
|
86
|
-
}))
|
|
87
|
-
.volatile(() => ({
|
|
88
|
-
volatileWidth: undefined,
|
|
89
|
-
volatileError: undefined,
|
|
90
|
-
cursorMode: (0, util_1.localStorageGetItem)('dotplot-cursorMode') || 'crosshair',
|
|
91
|
-
showPanButtons: (0, util_1.localStorageGetBoolean)('dotplot-showPanbuttons', true),
|
|
92
|
-
wheelMode: (0, util_1.localStorageGetItem)('dotplot-wheelMode') || 'zoom',
|
|
93
|
-
borderX: 100,
|
|
94
|
-
borderY: 100,
|
|
95
|
-
importFormSyntenyTrackSelections: mobx_1.observable.array(),
|
|
96
|
-
}))
|
|
97
|
-
.actions(self => ({
|
|
98
|
-
importFormRemoveRow(idx) {
|
|
99
|
-
self.importFormSyntenyTrackSelections.splice(idx, 1);
|
|
100
|
-
},
|
|
101
|
-
clearImportFormSyntenyTracks() {
|
|
102
|
-
self.importFormSyntenyTrackSelections.clear();
|
|
103
|
-
},
|
|
104
|
-
setImportFormSyntenyTrack(arg, val) {
|
|
105
|
-
self.importFormSyntenyTrackSelections[arg] = val;
|
|
106
|
-
},
|
|
107
|
-
}))
|
|
108
|
-
.views(self => ({
|
|
109
|
-
get width() {
|
|
110
|
-
if (!self.volatileWidth) {
|
|
111
|
-
throw new Error('width not initialized');
|
|
112
|
-
}
|
|
113
|
-
return self.volatileWidth;
|
|
114
|
-
},
|
|
115
|
-
}))
|
|
116
|
-
.views(self => ({
|
|
117
|
-
get assemblyErrors() {
|
|
118
|
-
const { assemblyManager } = (0, util_1.getSession)(self);
|
|
119
|
-
return self.assemblyNames
|
|
120
|
-
.map(a => { var _a; return (_a = assemblyManager.get(a)) === null || _a === void 0 ? void 0 : _a.error; })
|
|
121
|
-
.filter(f => !!f)
|
|
122
|
-
.join(', ');
|
|
123
|
-
},
|
|
124
|
-
get assembliesInitialized() {
|
|
125
|
-
const { assemblyManager } = (0, util_1.getSession)(self);
|
|
126
|
-
return self.assemblyNames.every(n => { var _a, _b; return (_b = (_a = assemblyManager.get(n)) === null || _a === void 0 ? void 0 : _a.initialized) !== null && _b !== void 0 ? _b : true; });
|
|
127
|
-
},
|
|
128
|
-
}))
|
|
129
|
-
.views(self => ({
|
|
130
|
-
get initialized() {
|
|
131
|
-
return (self.volatileWidth !== undefined &&
|
|
132
|
-
self.hview.displayedRegions.length > 0 &&
|
|
133
|
-
self.vview.displayedRegions.length > 0 &&
|
|
134
|
-
self.assembliesInitialized);
|
|
135
|
-
},
|
|
136
|
-
get hticks() {
|
|
137
|
-
const { hview } = self;
|
|
138
|
-
const { dynamicBlocks, staticBlocks, bpPerPx } = hview;
|
|
139
|
-
return dynamicBlocks.contentBlocks.length > 5
|
|
140
|
-
? []
|
|
141
|
-
: (0, util_2.makeTicks)(staticBlocks.contentBlocks, bpPerPx);
|
|
142
|
-
},
|
|
143
|
-
get vticks() {
|
|
144
|
-
const { vview } = self;
|
|
145
|
-
const { dynamicBlocks, staticBlocks, bpPerPx } = vview;
|
|
146
|
-
return dynamicBlocks.contentBlocks.length > 5
|
|
147
|
-
? []
|
|
148
|
-
: (0, util_2.makeTicks)(staticBlocks.contentBlocks, bpPerPx);
|
|
149
|
-
},
|
|
150
|
-
get loading() {
|
|
151
|
-
return self.assemblyNames.length > 0 && !this.initialized;
|
|
152
|
-
},
|
|
153
|
-
get viewWidth() {
|
|
154
|
-
return self.width - self.borderX;
|
|
155
|
-
},
|
|
156
|
-
get viewHeight() {
|
|
157
|
-
return self.height - self.borderY;
|
|
158
|
-
},
|
|
159
|
-
get views() {
|
|
160
|
-
return [self.hview, self.vview];
|
|
161
|
-
},
|
|
162
|
-
renderProps() {
|
|
163
|
-
const session = (0, util_1.getSession)(self);
|
|
164
|
-
return {
|
|
165
|
-
...(0, tracks_1.getParentRenderProps)(self),
|
|
166
|
-
drawCigar: self.drawCigar,
|
|
167
|
-
highResolutionScaling: (0, configuration_1.getConf)(session, 'highResolutionScaling'),
|
|
168
|
-
};
|
|
169
|
-
},
|
|
170
|
-
}))
|
|
171
|
-
.actions(self => ({
|
|
172
|
-
setShowPanButtons(flag) {
|
|
173
|
-
self.showPanButtons = flag;
|
|
174
|
-
},
|
|
175
|
-
setWheelMode(str) {
|
|
176
|
-
self.wheelMode = str;
|
|
177
|
-
},
|
|
178
|
-
setCursorMode(str) {
|
|
179
|
-
self.cursorMode = str;
|
|
180
|
-
},
|
|
181
|
-
setDrawCigar(flag) {
|
|
182
|
-
self.drawCigar = flag;
|
|
183
|
-
},
|
|
184
|
-
clearView() {
|
|
185
|
-
self.hview.setDisplayedRegions([]);
|
|
186
|
-
self.vview.setDisplayedRegions([]);
|
|
187
|
-
self.assemblyNames = (0, mobx_state_tree_1.cast)([]);
|
|
188
|
-
self.tracks.clear();
|
|
189
|
-
},
|
|
190
|
-
setBorderX(n) {
|
|
191
|
-
self.borderX = n;
|
|
192
|
-
},
|
|
193
|
-
setBorderY(n) {
|
|
194
|
-
self.borderY = n;
|
|
195
|
-
},
|
|
196
|
-
setWidth(newWidth) {
|
|
197
|
-
self.volatileWidth = newWidth;
|
|
198
|
-
return self.volatileWidth;
|
|
199
|
-
},
|
|
200
|
-
setHeight(newHeight) {
|
|
201
|
-
self.height = newHeight;
|
|
202
|
-
return self.height;
|
|
203
|
-
},
|
|
204
|
-
setError(e) {
|
|
205
|
-
self.volatileError = e;
|
|
206
|
-
},
|
|
207
|
-
zoomOut() {
|
|
208
|
-
self.hview.zoomOut();
|
|
209
|
-
self.vview.zoomOut();
|
|
210
|
-
},
|
|
211
|
-
zoomIn() {
|
|
212
|
-
self.hview.zoomIn();
|
|
213
|
-
self.vview.zoomIn();
|
|
214
|
-
},
|
|
215
|
-
activateTrackSelector() {
|
|
216
|
-
if (self.trackSelectorType === 'hierarchical') {
|
|
217
|
-
const session = (0, util_1.getSession)(self);
|
|
218
|
-
if ((0, util_1.isSessionModelWithWidgets)(session)) {
|
|
219
|
-
const selector = session.addWidget('HierarchicalTrackSelectorWidget', 'hierarchicalTrackSelector', { view: self });
|
|
220
|
-
session.showWidget(selector);
|
|
221
|
-
return selector;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
throw new Error(`invalid track selector type ${self.trackSelectorType}`);
|
|
225
|
-
},
|
|
226
|
-
showTrack(trackId, initialSnapshot = {}) {
|
|
227
|
-
const schema = pm.pluggableConfigSchemaType('track');
|
|
228
|
-
const conf = (0, mobx_state_tree_1.resolveIdentifier)(schema, (0, mobx_state_tree_1.getRoot)(self), trackId);
|
|
229
|
-
const trackType = pm.getTrackType(conf.type);
|
|
230
|
-
if (!trackType) {
|
|
231
|
-
throw new Error(`unknown track type ${conf.type}`);
|
|
232
|
-
}
|
|
233
|
-
const viewType = pm.getViewType(self.type);
|
|
234
|
-
const displayConf = conf.displays.find((d) => viewType.displayTypes.find(type => type.name === d.type));
|
|
235
|
-
if (!displayConf) {
|
|
236
|
-
throw new Error(`could not find a compatible display for view type ${self.type}`);
|
|
237
|
-
}
|
|
238
|
-
const track = trackType.stateModel.create({
|
|
239
|
-
...initialSnapshot,
|
|
240
|
-
type: conf.type,
|
|
241
|
-
configuration: conf,
|
|
242
|
-
displays: [{ type: displayConf.type, configuration: displayConf }],
|
|
243
|
-
});
|
|
244
|
-
self.tracks.push(track);
|
|
245
|
-
},
|
|
246
|
-
hideTrack(trackId) {
|
|
247
|
-
const schema = pm.pluggableConfigSchemaType('track');
|
|
248
|
-
const conf = (0, mobx_state_tree_1.resolveIdentifier)(schema, (0, mobx_state_tree_1.getRoot)(self), trackId);
|
|
249
|
-
const tracks = self.tracks.filter(t => t.configuration === conf);
|
|
250
|
-
(0, mobx_1.transaction)(() => {
|
|
251
|
-
for (const track of tracks) {
|
|
252
|
-
self.tracks.remove(track);
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
return tracks.length;
|
|
256
|
-
},
|
|
257
|
-
toggleTrack(trackId) {
|
|
258
|
-
const hiddenCount = this.hideTrack(trackId);
|
|
259
|
-
if (!hiddenCount) {
|
|
260
|
-
this.showTrack(trackId);
|
|
261
|
-
return true;
|
|
262
|
-
}
|
|
263
|
-
return false;
|
|
264
|
-
},
|
|
265
|
-
setAssemblyNames(target, query) {
|
|
266
|
-
self.assemblyNames = (0, mobx_state_tree_1.cast)([target, query]);
|
|
267
|
-
},
|
|
268
|
-
setViews(arr) {
|
|
269
|
-
self.hview = (0, mobx_state_tree_1.cast)(arr[0]);
|
|
270
|
-
self.vview = (0, mobx_state_tree_1.cast)(arr[1]);
|
|
271
|
-
},
|
|
272
|
-
getCoords(mousedown, mouseup) {
|
|
273
|
-
const [xmin, xmax] = (0, util_1.minmax)(mouseup[0], mousedown[0]);
|
|
274
|
-
const [ymin, ymax] = (0, util_1.minmax)(mouseup[1], mousedown[1]);
|
|
275
|
-
return Math.abs(xmax - xmin) > 3 && Math.abs(ymax - ymin) > 3
|
|
276
|
-
? [
|
|
277
|
-
self.hview.pxToBp(xmin),
|
|
278
|
-
self.hview.pxToBp(xmax),
|
|
279
|
-
self.vview.pxToBp(self.viewHeight - ymin),
|
|
280
|
-
self.vview.pxToBp(self.viewHeight - ymax),
|
|
281
|
-
]
|
|
282
|
-
: undefined;
|
|
283
|
-
},
|
|
284
|
-
zoomInToMouseCoords(mousedown, mouseup) {
|
|
285
|
-
const result = this.getCoords(mousedown, mouseup);
|
|
286
|
-
if (result) {
|
|
287
|
-
const [x1, x2, y1, y2] = result;
|
|
288
|
-
self.hview.moveTo(x1, x2);
|
|
289
|
-
self.vview.moveTo(y2, y1);
|
|
290
|
-
}
|
|
291
|
-
},
|
|
292
|
-
showAllRegions() {
|
|
293
|
-
self.hview.zoomTo(self.hview.maxBpPerPx);
|
|
294
|
-
self.vview.zoomTo(self.vview.maxBpPerPx);
|
|
295
|
-
self.vview.center();
|
|
296
|
-
self.hview.center();
|
|
297
|
-
},
|
|
298
|
-
onDotplotView(mousedown, mouseup) {
|
|
299
|
-
const result = this.getCoords(mousedown, mouseup);
|
|
300
|
-
if (result) {
|
|
301
|
-
const [x1, x2, y1, y2] = result;
|
|
302
|
-
const session = (0, util_1.getSession)(self);
|
|
303
|
-
const d1 = _1dview_1.Dotplot1DView.create({
|
|
304
|
-
...(0, mobx_state_tree_1.getSnapshot)(self.hview),
|
|
305
|
-
minimumBlockWidth: 0,
|
|
306
|
-
interRegionPaddingWidth: 0,
|
|
307
|
-
});
|
|
308
|
-
const d2 = _1dview_1.Dotplot1DView.create({
|
|
309
|
-
...(0, mobx_state_tree_1.getSnapshot)(self.vview),
|
|
310
|
-
minimumBlockWidth: 0,
|
|
311
|
-
interRegionPaddingWidth: 0,
|
|
312
|
-
});
|
|
313
|
-
d1.setVolatileWidth(self.hview.width);
|
|
314
|
-
d2.setVolatileWidth(self.vview.width);
|
|
315
|
-
d1.moveTo(x1, x2);
|
|
316
|
-
d2.moveTo(y2, y1);
|
|
317
|
-
d1.zoomTo(d1.bpPerPx / (self.width / self.hview.width), 0);
|
|
318
|
-
d2.zoomTo(d2.bpPerPx / (self.width / self.vview.width), 0);
|
|
319
|
-
const tracks = self.tracks
|
|
320
|
-
.map(track => track.configuration.displays.find((display) => display.type === 'LinearSyntenyDisplay'))
|
|
321
|
-
.filter(f => !!f)
|
|
322
|
-
.map(displayConf => {
|
|
323
|
-
const trackConf = (0, mobx_state_tree_1.getParent)(displayConf, 2);
|
|
324
|
-
return {
|
|
325
|
-
type: trackConf.type,
|
|
326
|
-
configuration: trackConf,
|
|
327
|
-
displays: [
|
|
328
|
-
{ type: displayConf.type, configuration: displayConf },
|
|
329
|
-
],
|
|
330
|
-
};
|
|
331
|
-
});
|
|
332
|
-
const { id: _unused1, ...rest1 } = (0, mobx_state_tree_1.getSnapshot)(d1);
|
|
333
|
-
const { id: _unused2, ...rest2 } = (0, mobx_state_tree_1.getSnapshot)(d2);
|
|
334
|
-
const viewSnapshot = {
|
|
335
|
-
type: 'LinearSyntenyView',
|
|
336
|
-
views: [
|
|
337
|
-
{
|
|
338
|
-
type: 'LinearGenomeView',
|
|
339
|
-
tracks: [],
|
|
340
|
-
hideHeader: true,
|
|
341
|
-
...rest1,
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
type: 'LinearGenomeView',
|
|
345
|
-
tracks: [],
|
|
346
|
-
hideHeader: true,
|
|
347
|
-
...rest2,
|
|
348
|
-
},
|
|
349
|
-
],
|
|
350
|
-
tracks,
|
|
351
|
-
};
|
|
352
|
-
session.addView('LinearSyntenyView', viewSnapshot);
|
|
353
|
-
}
|
|
354
|
-
},
|
|
355
|
-
}))
|
|
356
|
-
.actions(self => ({
|
|
357
|
-
async exportSvg(opts = {}) {
|
|
358
|
-
const { renderToSvg } = await Promise.resolve().then(() => __importStar(require('./svgcomponents/SVGDotplotView')));
|
|
359
|
-
const html = await renderToSvg(self, opts);
|
|
360
|
-
const blob = new Blob([html], { type: 'image/svg+xml' });
|
|
361
|
-
(0, file_saver_1.saveAs)(blob, opts.filename || 'image.svg');
|
|
362
|
-
},
|
|
363
|
-
beforeDestroy() {
|
|
364
|
-
var _a;
|
|
365
|
-
const session = (0, util_1.getSession)(self);
|
|
366
|
-
for (const name of self.assemblyNames) {
|
|
367
|
-
(_a = session.removeTemporaryAssembly) === null || _a === void 0 ? void 0 : _a.call(session, name);
|
|
368
|
-
}
|
|
369
|
-
},
|
|
370
|
-
afterAttach() {
|
|
371
|
-
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
|
|
372
|
-
const s = (s) => JSON.stringify(s);
|
|
373
|
-
const { showPanButtons, wheelMode, cursorMode } = self;
|
|
374
|
-
if (typeof localStorage !== 'undefined') {
|
|
375
|
-
localStorage.setItem('dotplot-showPanbuttons', s(showPanButtons));
|
|
376
|
-
localStorage.setItem('dotplot-cursorMode', cursorMode);
|
|
377
|
-
localStorage.setItem('dotplot-wheelMode', wheelMode);
|
|
378
|
-
}
|
|
379
|
-
}));
|
|
380
|
-
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
|
|
381
|
-
const session = (0, util_1.getSession)(self);
|
|
382
|
-
if (self.volatileWidth === undefined ||
|
|
383
|
-
!self.assembliesInitialized) {
|
|
384
|
-
return;
|
|
385
|
-
}
|
|
386
|
-
if (self.hview.displayedRegions.length > 0 &&
|
|
387
|
-
self.vview.displayedRegions.length > 0) {
|
|
388
|
-
return;
|
|
389
|
-
}
|
|
390
|
-
const views = [self.hview, self.vview];
|
|
391
|
-
(0, mobx_1.transaction)(() => {
|
|
392
|
-
for (const [index, name] of self.assemblyNames.entries()) {
|
|
393
|
-
const assembly = session.assemblyManager.get(name);
|
|
394
|
-
const view = views[index];
|
|
395
|
-
view.setDisplayedRegions((assembly === null || assembly === void 0 ? void 0 : assembly.regions) || []);
|
|
396
|
-
}
|
|
397
|
-
self.showAllRegions();
|
|
398
|
-
});
|
|
399
|
-
}, { delay: 1000 }));
|
|
400
|
-
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(function borderSetter() {
|
|
401
|
-
if (self.volatileWidth === undefined) {
|
|
402
|
-
return;
|
|
403
|
-
}
|
|
404
|
-
const { vview, hview, viewHeight, viewWidth } = self;
|
|
405
|
-
const padding = 40;
|
|
406
|
-
const vblocks = vview.dynamicBlocks.contentBlocks;
|
|
407
|
-
const hblocks = hview.dynamicBlocks.contentBlocks;
|
|
408
|
-
const hoffset = hview.offsetPx;
|
|
409
|
-
const voffset = vview.offsetPx;
|
|
410
|
-
const vhide = (0, util_2.getBlockLabelKeysToHide)(vblocks, viewHeight, voffset);
|
|
411
|
-
const hhide = (0, util_2.getBlockLabelKeysToHide)(hblocks, viewWidth, hoffset);
|
|
412
|
-
const by = pxWidthForBlocks(hblocks, vview.bpPerPx, hhide);
|
|
413
|
-
const bx = pxWidthForBlocks(vblocks, hview.bpPerPx, vhide);
|
|
414
|
-
self.setBorderY(Math.max(by + padding, 50));
|
|
415
|
-
self.setBorderX(Math.max(bx + padding, 50));
|
|
416
|
-
}));
|
|
417
|
-
},
|
|
418
|
-
squareView() {
|
|
419
|
-
const { hview, vview } = self;
|
|
420
|
-
const avg = (hview.bpPerPx + vview.bpPerPx) / 2;
|
|
421
|
-
const hpx = hview.pxToBp(hview.width / 2);
|
|
422
|
-
const vpx = vview.pxToBp(vview.width / 2);
|
|
423
|
-
hview.setBpPerPx(avg);
|
|
424
|
-
hview.centerAt(hpx.coord, hpx.refName, hpx.index);
|
|
425
|
-
vview.setBpPerPx(avg);
|
|
426
|
-
vview.centerAt(vpx.coord, vpx.refName, vpx.index);
|
|
427
|
-
},
|
|
428
|
-
squareViewProportional() {
|
|
429
|
-
const { hview, vview } = self;
|
|
430
|
-
const ratio = hview.width / vview.width;
|
|
431
|
-
const avg = (hview.bpPerPx + vview.bpPerPx) / 2;
|
|
432
|
-
const hpx = hview.pxToBp(hview.width / 2);
|
|
433
|
-
const vpx = vview.pxToBp(vview.width / 2);
|
|
434
|
-
hview.setBpPerPx(avg / ratio);
|
|
435
|
-
hview.centerAt(hpx.coord, hpx.refName, hpx.index);
|
|
436
|
-
vview.setBpPerPx(avg);
|
|
437
|
-
vview.centerAt(vpx.coord, vpx.refName, vpx.index);
|
|
438
|
-
},
|
|
439
|
-
}))
|
|
440
|
-
.views(self => ({
|
|
441
|
-
menuItems() {
|
|
442
|
-
const session = (0, util_1.getSession)(self);
|
|
443
|
-
return [
|
|
444
|
-
{
|
|
445
|
-
label: 'Return to import form',
|
|
446
|
-
icon: FolderOpen_1.default,
|
|
447
|
-
onClick: () => {
|
|
448
|
-
(0, util_1.getSession)(self).queueDialog(handleClose => [
|
|
449
|
-
ReturnToImportFormDialog,
|
|
450
|
-
{
|
|
451
|
-
model: self,
|
|
452
|
-
handleClose,
|
|
453
|
-
},
|
|
454
|
-
]);
|
|
455
|
-
},
|
|
456
|
-
},
|
|
457
|
-
{
|
|
458
|
-
label: 'Export SVG',
|
|
459
|
-
icon: PhotoCamera_1.default,
|
|
460
|
-
onClick: () => {
|
|
461
|
-
(0, util_1.getSession)(self).queueDialog(handleClose => [
|
|
462
|
-
ExportSvgDialog,
|
|
463
|
-
{
|
|
464
|
-
model: self,
|
|
465
|
-
handleClose,
|
|
466
|
-
},
|
|
467
|
-
]);
|
|
468
|
-
},
|
|
469
|
-
},
|
|
470
|
-
...((0, util_1.isSessionModelWithWidgets)(session)
|
|
471
|
-
? [
|
|
472
|
-
{
|
|
473
|
-
label: 'Open track selector',
|
|
474
|
-
onClick: self.activateTrackSelector,
|
|
475
|
-
icon: Icons_1.TrackSelector,
|
|
476
|
-
},
|
|
477
|
-
]
|
|
478
|
-
: []),
|
|
479
|
-
];
|
|
480
|
-
},
|
|
481
|
-
get error() {
|
|
482
|
-
return self.volatileError || self.assemblyErrors;
|
|
483
|
-
},
|
|
484
|
-
}));
|
|
485
|
-
}
|
|
486
|
-
var _1dview_2 = require("./1dview");
|
|
487
|
-
Object.defineProperty(exports, "Dotplot1DView", { enumerable: true, get: function () { return _1dview_2.Dotplot1DView; } });
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = SVGBackground;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const util_1 = require("@jbrowse/core/util");
|
|
6
|
-
const material_1 = require("@mui/material");
|
|
7
|
-
function SVGBackground({ width, height, }) {
|
|
8
|
-
const theme = (0, material_1.useTheme)();
|
|
9
|
-
return ((0, jsx_runtime_1.jsx)("rect", { x: 0, y: 0, width: width, height: height, fill: (0, util_1.stripAlpha)(theme.palette.background.default) }));
|
|
10
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
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.renderToSvg = renderToSvg;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const ui_1 = require("@jbrowse/core/ui");
|
|
9
|
-
const util_1 = require("@jbrowse/core/util");
|
|
10
|
-
const material_1 = require("@mui/material");
|
|
11
|
-
const mobx_1 = require("mobx");
|
|
12
|
-
const SVGBackground_1 = __importDefault(require("./SVGBackground"));
|
|
13
|
-
const Axes_1 = require("../components/Axes");
|
|
14
|
-
const Grid_1 = require("../components/Grid");
|
|
15
|
-
async function renderToSvg(model, opts) {
|
|
16
|
-
var _a;
|
|
17
|
-
await (0, mobx_1.when)(() => model.initialized);
|
|
18
|
-
const { themeName = 'default', Wrapper = ({ children }) => children } = opts;
|
|
19
|
-
const session = (0, util_1.getSession)(model);
|
|
20
|
-
const theme = (_a = session.allThemes) === null || _a === void 0 ? void 0 : _a.call(session)[themeName];
|
|
21
|
-
const { width, borderX, viewWidth, viewHeight, tracks, height } = model;
|
|
22
|
-
const shift = 50;
|
|
23
|
-
const displayResults = await Promise.all(tracks.map(async (track) => {
|
|
24
|
-
const display = track.displays[0];
|
|
25
|
-
await (0, mobx_1.when)(() => (display.ready !== undefined ? display.ready : true));
|
|
26
|
-
return { track, result: await display.renderSvg({ ...opts, theme }) };
|
|
27
|
-
}));
|
|
28
|
-
const w = width + shift * 2;
|
|
29
|
-
return (0, util_1.renderToStaticMarkup)((0, jsx_runtime_1.jsx)(material_1.ThemeProvider, { theme: (0, ui_1.createJBrowseTheme)(theme), children: (0, jsx_runtime_1.jsx)(Wrapper, { children: (0, jsx_runtime_1.jsxs)("svg", { width: width, height: height, xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: [0, 0, w, height].toString(), children: [(0, jsx_runtime_1.jsx)(SVGBackground_1.default, { width: w, height: height }), (0, jsx_runtime_1.jsx)(Axes_1.VerticalAxisRaw, { model: model }), (0, jsx_runtime_1.jsxs)("g", { transform: `translate(${borderX} 0)`, children: [(0, jsx_runtime_1.jsx)(Grid_1.GridRaw, { model: model }), (0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: "clip-ruler", children: (0, jsx_runtime_1.jsx)("rect", { x: 0, y: 0, width: viewWidth, height: viewHeight }) }) }), (0, jsx_runtime_1.jsx)("g", { clipPath: "url(#clip-ruler)", children: displayResults.map(({ result }, i) => ((0, jsx_runtime_1.jsx)("g", { children: result }, i))) })] }), (0, jsx_runtime_1.jsx)("g", { transform: `translate(${borderX} ${viewHeight})`, children: (0, jsx_runtime_1.jsx)(Axes_1.HorizontalAxisRaw, { model: model }) })] }) }) }));
|
|
30
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
2
|
-
import type { SnapshotIn } from 'mobx-state-tree';
|
|
3
|
-
export type Conf = SnapshotIn<AnyConfigurationModel>;
|
|
4
|
-
export type ImportFormSyntenyTrack = {
|
|
5
|
-
type: 'preConfigured';
|
|
6
|
-
value: string;
|
|
7
|
-
} | {
|
|
8
|
-
type: 'userOpened';
|
|
9
|
-
value: Conf;
|
|
10
|
-
} | {
|
|
11
|
-
type: 'none';
|
|
12
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = LaunchDotplotView;
|
|
4
|
-
const mobx_1 = require("mobx");
|
|
5
|
-
function LaunchDotplotView(pluginManager) {
|
|
6
|
-
pluginManager.addToExtensionPoint('LaunchView-DotplotView', async ({ session, views, tracks = [], }) => {
|
|
7
|
-
try {
|
|
8
|
-
const model = session.addView('DotplotView', {});
|
|
9
|
-
const assemblyNames = views.map(view => view.assembly);
|
|
10
|
-
(0, mobx_1.transaction)(() => {
|
|
11
|
-
model.setViews([
|
|
12
|
-
{ bpPerPx: 0.1, offsetPx: 0 },
|
|
13
|
-
{ bpPerPx: 0.1, offsetPx: 0 },
|
|
14
|
-
]);
|
|
15
|
-
model.setAssemblyNames(assemblyNames[0], assemblyNames[1]);
|
|
16
|
-
});
|
|
17
|
-
const idsNotFound = [];
|
|
18
|
-
for (const track of tracks) {
|
|
19
|
-
tryTrack(model, track, idsNotFound);
|
|
20
|
-
}
|
|
21
|
-
if (idsNotFound.length) {
|
|
22
|
-
throw new Error(`Could not resolve identifiers: ${idsNotFound.join(',')}`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
catch (e) {
|
|
26
|
-
session.notifyError(`${e}`, e);
|
|
27
|
-
throw e;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
function tryTrack(model, trackId, idsNotFound) {
|
|
32
|
-
try {
|
|
33
|
-
model.showTrack(trackId);
|
|
34
|
-
}
|
|
35
|
-
catch (e) {
|
|
36
|
-
if (/Could not resolve identifier/.exec(`${e}`)) {
|
|
37
|
-
idsNotFound.push(trackId);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
throw e;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from 'react';
|
|
2
|
-
declare const ServerSideRenderedDotplotContent: ({ model, style, }: {
|
|
3
|
-
model: {
|
|
4
|
-
error?: unknown;
|
|
5
|
-
message?: string;
|
|
6
|
-
filled?: boolean;
|
|
7
|
-
shouldDisplay?: boolean;
|
|
8
|
-
reactElement?: React.ReactElement;
|
|
9
|
-
};
|
|
10
|
-
style: CSSProperties;
|
|
11
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
-
export default ServerSideRenderedDotplotContent;
|