@jbrowse/plugin-linear-genome-view 2.10.1 → 2.10.3
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/BaseLinearDisplay/components/BlockMsg.d.ts +2 -4
- package/dist/BaseLinearDisplay/components/BlockMsg.js +2 -3
- package/dist/BaseLinearDisplay/components/LinearBlocks.js +2 -2
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +10 -2
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +40 -4
- package/dist/BaseLinearDisplay/components/TooLargeMessage.js +5 -4
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +18 -4
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +9 -2
- package/dist/BaseLinearDisplay/models/util.js +4 -2
- package/dist/LaunchLinearGenomeView/index.js +16 -2
- package/dist/LinearBareDisplay/model.d.ts +18 -4
- package/dist/LinearBasicDisplay/model.d.ts +32 -24
- package/dist/LinearBasicDisplay/model.js +2 -2
- package/dist/LinearGenomeView/components/ExportSvgDialog.d.ts +1 -1
- package/dist/LinearGenomeView/components/ExportSvgDialog.js +2 -2
- package/dist/LinearGenomeView/components/Highlight.d.ts +7 -0
- package/dist/LinearGenomeView/components/Highlight.js +122 -0
- package/dist/LinearGenomeView/components/OverviewHighlight.d.ts +9 -0
- package/dist/LinearGenomeView/components/OverviewHighlight.js +53 -0
- package/dist/LinearGenomeView/components/OverviewScalebar.js +3 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +1 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete/index.js +9 -10
- package/dist/LinearGenomeView/components/TracksContainer.js +2 -0
- package/dist/LinearGenomeView/model.d.ts +10 -5
- package/dist/LinearGenomeView/model.js +26 -15
- package/dist/LinearGenomeView/util.d.ts +1 -1
- package/dist/index.d.ts +96 -42
- package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +2 -4
- package/esm/BaseLinearDisplay/components/BlockMsg.js +3 -4
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +2 -2
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +10 -2
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +17 -4
- package/esm/BaseLinearDisplay/components/TooLargeMessage.js +5 -4
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +18 -4
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +9 -2
- package/esm/BaseLinearDisplay/models/util.js +4 -2
- package/esm/LaunchLinearGenomeView/index.js +17 -3
- package/esm/LinearBareDisplay/model.d.ts +18 -4
- package/esm/LinearBasicDisplay/model.d.ts +32 -24
- package/esm/LinearBasicDisplay/model.js +2 -2
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +1 -1
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +1 -1
- package/esm/LinearGenomeView/components/Highlight.d.ts +7 -0
- package/esm/LinearGenomeView/components/Highlight.js +94 -0
- package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +9 -0
- package/esm/LinearGenomeView/components/OverviewHighlight.js +48 -0
- package/esm/LinearGenomeView/components/OverviewScalebar.js +3 -1
- package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +1 -1
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +10 -11
- package/esm/LinearGenomeView/components/TracksContainer.js +2 -0
- package/esm/LinearGenomeView/model.d.ts +10 -5
- package/esm/LinearGenomeView/model.js +26 -15
- package/esm/LinearGenomeView/util.d.ts +1 -1
- package/esm/index.d.ts +96 -42
- package/package.json +2 -2
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AlertColor } from '@mui/material';
|
|
3
|
-
export default function BlockMsg({ message, severity,
|
|
3
|
+
export default function BlockMsg({ message, severity, action, }: {
|
|
4
4
|
message: string;
|
|
5
5
|
severity?: AlertColor;
|
|
6
|
-
|
|
7
|
-
icon?: React.ReactNode;
|
|
8
|
-
action?: () => void;
|
|
6
|
+
action?: React.ReactNode;
|
|
9
7
|
}): React.JSX.Element;
|
|
@@ -12,10 +12,9 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
12
12
|
overflow: 'hidden',
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
|
-
function BlockMsg({ message, severity,
|
|
15
|
+
function BlockMsg({ message, severity, action, }) {
|
|
16
16
|
const { classes } = useStyles();
|
|
17
|
-
|
|
18
|
-
return (react_1.default.createElement(material_1.Alert, { severity: severity, action: button, classes: { message: classes.ellipses } },
|
|
17
|
+
return (react_1.default.createElement(material_1.Alert, { severity: severity, action: action, classes: { message: classes.ellipses } },
|
|
19
18
|
react_1.default.createElement(material_1.Tooltip, { title: message },
|
|
20
19
|
react_1.default.createElement("div", null, message))));
|
|
21
20
|
}
|
|
@@ -38,8 +38,8 @@ const RenderedBlocks = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
|
38
38
|
if (block instanceof blockTypes_1.ContentBlock) {
|
|
39
39
|
const state = blockState.get(block.key);
|
|
40
40
|
return (react_1.default.createElement(Block_1.ContentBlock, { block: block, key: `${model.id}-${block.key}` },
|
|
41
|
-
state
|
|
42
|
-
state
|
|
41
|
+
(state === null || state === void 0 ? void 0 : state.ReactComponent) ? (react_1.default.createElement(state.ReactComponent, { model: state })) : null,
|
|
42
|
+
(state === null || state === void 0 ? void 0 : state.maxHeightReached) ? (react_1.default.createElement("div", { className: classes.heightOverflowed, style: {
|
|
43
43
|
top: state.layout.getTotalHeight() - 16,
|
|
44
44
|
pointerEvents: 'none',
|
|
45
45
|
height: 16,
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
declare const ServerSideRenderedBlockContent: ({ model, }: {
|
|
2
|
-
model:
|
|
3
|
-
|
|
3
|
+
model: {
|
|
4
|
+
error?: unknown;
|
|
5
|
+
reload: () => void;
|
|
6
|
+
message: React.ReactNode;
|
|
7
|
+
filled?: boolean;
|
|
8
|
+
status?: string;
|
|
9
|
+
reactElement?: React.ReactElement;
|
|
10
|
+
};
|
|
11
|
+
}) => React.JSX.Element | undefined;
|
|
4
12
|
export default ServerSideRenderedBlockContent;
|
|
@@ -1,17 +1,44 @@
|
|
|
1
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 (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 =
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const material_1 = require("@mui/material");
|
|
7
31
|
const mui_1 = require("tss-react/mui");
|
|
8
32
|
const mobx_react_1 = require("mobx-react");
|
|
9
33
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
10
34
|
const ui_1 = require("@jbrowse/core/ui");
|
|
35
|
+
const util_1 = require("@jbrowse/core/util");
|
|
11
36
|
// icons
|
|
12
37
|
const Refresh_1 = __importDefault(require("@mui/icons-material/Refresh"));
|
|
38
|
+
const Report_1 = __importDefault(require("@mui/icons-material/Report"));
|
|
13
39
|
// locals
|
|
14
40
|
const BlockMsg_1 = __importDefault(require("./BlockMsg"));
|
|
41
|
+
const ErrorMessageStackTraceDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@jbrowse/core/ui/ErrorMessageStackTraceDialog'))));
|
|
15
42
|
const useStyles = (0, mui_1.makeStyles)()(theme => {
|
|
16
43
|
const bg = theme.palette.action.disabledBackground;
|
|
17
44
|
return {
|
|
@@ -23,11 +50,9 @@ const useStyles = (0, mui_1.makeStyles)()(theme => {
|
|
|
23
50
|
},
|
|
24
51
|
};
|
|
25
52
|
});
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
53
|
const LoadingMessage = (0, mobx_react_1.observer)(({ model }) => {
|
|
28
54
|
const { classes } = useStyles();
|
|
29
55
|
const { status: blockStatus } = model;
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
56
|
const { message: displayStatus } = (0, mobx_state_tree_1.getParent)(model, 2);
|
|
32
57
|
const status = displayStatus || blockStatus;
|
|
33
58
|
return (react_1.default.createElement("div", { className: classes.loading },
|
|
@@ -35,7 +60,18 @@ const LoadingMessage = (0, mobx_react_1.observer)(({ model }) => {
|
|
|
35
60
|
});
|
|
36
61
|
const ServerSideRenderedBlockContent = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
37
62
|
if (model.error) {
|
|
38
|
-
return (react_1.default.createElement(BlockMsg_1.default, { message: `${model.error}`, severity: "error",
|
|
63
|
+
return (react_1.default.createElement(BlockMsg_1.default, { message: `${model.error}`, severity: "error", action: react_1.default.createElement(react_1.default.Fragment, null,
|
|
64
|
+
react_1.default.createElement(material_1.Tooltip, { title: "Reload track" },
|
|
65
|
+
react_1.default.createElement(material_1.IconButton, { "data-testid": "reload_button", onClick: () => model.reload() },
|
|
66
|
+
react_1.default.createElement(Refresh_1.default, null))),
|
|
67
|
+
react_1.default.createElement(material_1.Tooltip, { title: "Show stack trace" },
|
|
68
|
+
react_1.default.createElement(material_1.IconButton, { onClick: () => {
|
|
69
|
+
(0, util_1.getSession)(model).queueDialog(onClose => [
|
|
70
|
+
ErrorMessageStackTraceDialog,
|
|
71
|
+
{ onClose, error: model.error },
|
|
72
|
+
]);
|
|
73
|
+
} },
|
|
74
|
+
react_1.default.createElement(Report_1.default, null)))) }));
|
|
39
75
|
}
|
|
40
76
|
else if (model.message) {
|
|
41
77
|
// the message can be a fully rendered react component, e.g. the region too large message
|
|
@@ -6,12 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
// locals
|
|
8
8
|
const BlockMsg_1 = __importDefault(require("../components/BlockMsg"));
|
|
9
|
+
const material_1 = require("@mui/material");
|
|
9
10
|
function TooLargeMessage({ model, }) {
|
|
10
11
|
const { regionTooLargeReason } = model;
|
|
11
|
-
return (react_1.default.createElement(BlockMsg_1.default, { severity: "warning", action: () => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
return (react_1.default.createElement(BlockMsg_1.default, { severity: "warning", action: react_1.default.createElement(material_1.Button, { onClick: () => {
|
|
13
|
+
model.setFeatureDensityStatsLimit(model.featureDensityStats);
|
|
14
|
+
model.reload();
|
|
15
|
+
} }, "Force load"), message: [
|
|
15
16
|
regionTooLargeReason,
|
|
16
17
|
'Zoom in to see features or force load (may be slow)',
|
|
17
18
|
]
|
|
@@ -58,8 +58,15 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
|
|
|
58
58
|
message: string | undefined;
|
|
59
59
|
maxHeightReached: boolean;
|
|
60
60
|
ReactComponent: ({ model, }: {
|
|
61
|
-
model:
|
|
62
|
-
|
|
61
|
+
model: {
|
|
62
|
+
error?: unknown;
|
|
63
|
+
reload: () => void;
|
|
64
|
+
message: React.ReactNode;
|
|
65
|
+
filled?: boolean | undefined;
|
|
66
|
+
status?: string | undefined;
|
|
67
|
+
reactElement?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
68
|
+
};
|
|
69
|
+
}) => React.JSX.Element | undefined;
|
|
63
70
|
renderProps: any;
|
|
64
71
|
} & {
|
|
65
72
|
doReload(): void;
|
|
@@ -342,8 +349,15 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
|
|
|
342
349
|
message: string | undefined;
|
|
343
350
|
maxHeightReached: boolean;
|
|
344
351
|
ReactComponent: ({ model, }: {
|
|
345
|
-
model:
|
|
346
|
-
|
|
352
|
+
model: {
|
|
353
|
+
error?: unknown;
|
|
354
|
+
reload: () => void;
|
|
355
|
+
message: React.ReactNode;
|
|
356
|
+
filled?: boolean | undefined;
|
|
357
|
+
status?: string | undefined;
|
|
358
|
+
reactElement?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
359
|
+
};
|
|
360
|
+
}) => React.JSX.Element | undefined;
|
|
347
361
|
renderProps: any;
|
|
348
362
|
} & {
|
|
349
363
|
doReload(): void;
|
|
@@ -28,8 +28,15 @@ declare const blockState: import("mobx-state-tree").IModelType<{
|
|
|
28
28
|
message: string | undefined;
|
|
29
29
|
maxHeightReached: boolean;
|
|
30
30
|
ReactComponent: ({ model, }: {
|
|
31
|
-
model:
|
|
32
|
-
|
|
31
|
+
model: {
|
|
32
|
+
error?: unknown;
|
|
33
|
+
reload: () => void;
|
|
34
|
+
message: React.ReactNode;
|
|
35
|
+
filled?: boolean | undefined;
|
|
36
|
+
status?: string | undefined;
|
|
37
|
+
reactElement?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
38
|
+
};
|
|
39
|
+
}) => React.JSX.Element | undefined;
|
|
33
40
|
renderProps: any;
|
|
34
41
|
} & {
|
|
35
42
|
doReload(): void;
|
|
@@ -20,8 +20,10 @@ function getDisplayStr(totalBytes) {
|
|
|
20
20
|
exports.getDisplayStr = getDisplayStr;
|
|
21
21
|
// stabilize clipid under test for snapshot
|
|
22
22
|
function getId(id, index) {
|
|
23
|
-
const
|
|
24
|
-
return
|
|
23
|
+
const notJest = typeof jest === 'undefined';
|
|
24
|
+
return ['clip', notJest ? id : 'jest', index, notJest ? Math.random() : '']
|
|
25
|
+
.filter(f => !!f)
|
|
26
|
+
.join('-');
|
|
25
27
|
}
|
|
26
28
|
exports.getId = getId;
|
|
27
29
|
async function getFeatureDensityStatsPre(self) {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const util_1 = require("@jbrowse/core/util");
|
|
4
|
-
const searchUtils_1 = require("
|
|
4
|
+
const searchUtils_1 = require("../searchUtils");
|
|
5
5
|
exports.default = (pluginManager) => {
|
|
6
6
|
pluginManager.addToExtensionPoint('LaunchView-LinearGenomeView',
|
|
7
7
|
// @ts-expect-error
|
|
8
|
-
async ({ session, assembly, loc, tracks = [], }) => {
|
|
8
|
+
async ({ session, assembly, loc, tracks = [], tracklist, nav, highlight, }) => {
|
|
9
9
|
try {
|
|
10
10
|
const { assemblyManager } = session;
|
|
11
|
+
const { isValidRefName } = assemblyManager;
|
|
11
12
|
const view = session.addView('LinearGenomeView', {});
|
|
12
13
|
await (0, util_1.when)(() => !!view.volatileWidth);
|
|
13
14
|
if (!assembly) {
|
|
@@ -17,6 +18,19 @@ exports.default = (pluginManager) => {
|
|
|
17
18
|
if (!asm) {
|
|
18
19
|
throw new Error(`Assembly "${assembly}" not found when launching linear genome view`);
|
|
19
20
|
}
|
|
21
|
+
if (tracklist) {
|
|
22
|
+
view.activateTrackSelector();
|
|
23
|
+
}
|
|
24
|
+
if (nav !== undefined) {
|
|
25
|
+
view.setHideHeader(!nav);
|
|
26
|
+
}
|
|
27
|
+
if (highlight !== undefined) {
|
|
28
|
+
const location = (0, util_1.parseLocString)(highlight, refName => isValidRefName(refName, assembly));
|
|
29
|
+
if ((location === null || location === void 0 ? void 0 : location.start) !== undefined && (location === null || location === void 0 ? void 0 : location.end) !== undefined) {
|
|
30
|
+
location.assemblyName = assembly;
|
|
31
|
+
view.setHighlight(location);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
20
34
|
await (0, searchUtils_1.handleSelectedRegion)({ input: loc, model: view, assembly: asm });
|
|
21
35
|
const idsNotFound = [];
|
|
22
36
|
tracks.forEach(track => tryTrack(view, track, idsNotFound));
|
|
@@ -42,8 +42,15 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
42
42
|
message: string | undefined;
|
|
43
43
|
maxHeightReached: boolean;
|
|
44
44
|
ReactComponent: ({ model, }: {
|
|
45
|
-
model:
|
|
46
|
-
|
|
45
|
+
model: {
|
|
46
|
+
error?: unknown;
|
|
47
|
+
reload: () => void;
|
|
48
|
+
message: import("react").ReactNode;
|
|
49
|
+
filled?: boolean | undefined;
|
|
50
|
+
status?: string | undefined;
|
|
51
|
+
reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
52
|
+
};
|
|
53
|
+
}) => import("react").JSX.Element | undefined;
|
|
47
54
|
renderProps: any;
|
|
48
55
|
} & {
|
|
49
56
|
doReload(): void;
|
|
@@ -267,8 +274,15 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
267
274
|
message: string | undefined;
|
|
268
275
|
maxHeightReached: boolean;
|
|
269
276
|
ReactComponent: ({ model, }: {
|
|
270
|
-
model:
|
|
271
|
-
|
|
277
|
+
model: {
|
|
278
|
+
error?: unknown;
|
|
279
|
+
reload: () => void;
|
|
280
|
+
message: import("react").ReactNode;
|
|
281
|
+
filled?: boolean | undefined;
|
|
282
|
+
status?: string | undefined;
|
|
283
|
+
reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
284
|
+
};
|
|
285
|
+
}) => import("react").JSX.Element | undefined;
|
|
272
286
|
renderProps: any;
|
|
273
287
|
} & {
|
|
274
288
|
doReload(): void;
|
|
@@ -37,9 +37,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
37
37
|
isLeftEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
38
38
|
isRightEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
39
39
|
}, {
|
|
40
|
-
renderInProgress: AbortController | undefined;
|
|
41
|
-
* #property
|
|
42
|
-
*/
|
|
40
|
+
renderInProgress: AbortController | undefined;
|
|
43
41
|
filled: boolean;
|
|
44
42
|
reactElement: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
45
43
|
features: Map<string, import("@jbrowse/core/util").Feature> | undefined;
|
|
@@ -49,8 +47,17 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
49
47
|
message: string | undefined;
|
|
50
48
|
maxHeightReached: boolean;
|
|
51
49
|
ReactComponent: ({ model, }: {
|
|
52
|
-
model:
|
|
53
|
-
|
|
50
|
+
model: {
|
|
51
|
+
error?: unknown;
|
|
52
|
+
reload: () => void;
|
|
53
|
+
message: import("react").ReactNode;
|
|
54
|
+
filled?: boolean | undefined;
|
|
55
|
+
status?: string | undefined; /**
|
|
56
|
+
* #getter
|
|
57
|
+
*/
|
|
58
|
+
reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
59
|
+
};
|
|
60
|
+
}) => import("react").JSX.Element | undefined;
|
|
54
61
|
renderProps: any;
|
|
55
62
|
} & {
|
|
56
63
|
doReload(): void;
|
|
@@ -159,12 +166,11 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
159
166
|
}, {
|
|
160
167
|
rendererTypeName: string;
|
|
161
168
|
error: unknown;
|
|
162
|
-
message: string | undefined;
|
|
169
|
+
message: string | undefined; /**
|
|
170
|
+
* #action
|
|
171
|
+
*/
|
|
163
172
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
164
173
|
}> | null;
|
|
165
|
-
/**
|
|
166
|
-
* #action
|
|
167
|
-
*/
|
|
168
174
|
readonly adapterConfig: any;
|
|
169
175
|
readonly parentTrack: any;
|
|
170
176
|
renderProps(): any;
|
|
@@ -193,9 +199,6 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
193
199
|
} & {
|
|
194
200
|
readonly currentBytesRequested: number;
|
|
195
201
|
readonly currentFeatureScreenDensity: number;
|
|
196
|
-
/**
|
|
197
|
-
* #getter
|
|
198
|
-
*/
|
|
199
202
|
readonly maxFeatureScreenDensity: any;
|
|
200
203
|
readonly featureDensityStatsReady: boolean;
|
|
201
204
|
readonly maxAllowableBytes: number;
|
|
@@ -205,7 +208,9 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
205
208
|
setCurrStatsBpPerPx(n: number): void;
|
|
206
209
|
setFeatureDensityStatsLimit(stats?: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined): void;
|
|
207
210
|
getFeatureDensityStats(): Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats>;
|
|
208
|
-
setFeatureDensityStatsP(arg: any): void;
|
|
211
|
+
setFeatureDensityStatsP(arg: any): void; /**
|
|
212
|
+
* #method
|
|
213
|
+
*/
|
|
209
214
|
setFeatureDensityStats(featureDensityStats?: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined): void;
|
|
210
215
|
clearFeatureDensityStats(): void;
|
|
211
216
|
} & {
|
|
@@ -275,9 +280,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
275
280
|
readonly rendererConfig: {
|
|
276
281
|
[x: string]: any;
|
|
277
282
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
278
|
-
setSubschema(slotName: string, data: unknown): any;
|
|
279
|
-
* #property
|
|
280
|
-
*/
|
|
283
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
281
284
|
} & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>;
|
|
282
285
|
} & {
|
|
283
286
|
/**
|
|
@@ -304,9 +307,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
304
307
|
config: {
|
|
305
308
|
[x: string]: any;
|
|
306
309
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
307
|
-
setSubschema(slotName: string, data: unknown): any;
|
|
308
|
-
* #property
|
|
309
|
-
*/
|
|
310
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
310
311
|
} & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>;
|
|
311
312
|
};
|
|
312
313
|
/**
|
|
@@ -341,9 +342,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
341
342
|
isLeftEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
342
343
|
isRightEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
343
344
|
}, {
|
|
344
|
-
renderInProgress: AbortController | undefined;
|
|
345
|
-
* #property
|
|
346
|
-
*/
|
|
345
|
+
renderInProgress: AbortController | undefined;
|
|
347
346
|
filled: boolean;
|
|
348
347
|
reactElement: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
349
348
|
features: Map<string, import("@jbrowse/core/util").Feature> | undefined;
|
|
@@ -353,8 +352,17 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
353
352
|
message: string | undefined;
|
|
354
353
|
maxHeightReached: boolean;
|
|
355
354
|
ReactComponent: ({ model, }: {
|
|
356
|
-
model:
|
|
357
|
-
|
|
355
|
+
model: {
|
|
356
|
+
error?: unknown;
|
|
357
|
+
reload: () => void;
|
|
358
|
+
message: import("react").ReactNode;
|
|
359
|
+
filled?: boolean | undefined;
|
|
360
|
+
status?: string | undefined; /**
|
|
361
|
+
* #getter
|
|
362
|
+
*/
|
|
363
|
+
reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
364
|
+
};
|
|
365
|
+
}) => import("react").JSX.Element | undefined;
|
|
358
366
|
renderProps: any;
|
|
359
367
|
} & {
|
|
360
368
|
doReload(): void;
|
|
@@ -34,7 +34,7 @@ const mobx_state_tree_1 = require("mobx-state-tree");
|
|
|
34
34
|
const Visibility_1 = __importDefault(require("@mui/icons-material/Visibility"));
|
|
35
35
|
// locals
|
|
36
36
|
const BaseLinearDisplay_1 = require("../BaseLinearDisplay");
|
|
37
|
-
const
|
|
37
|
+
const SetMaxHeightDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/SetMaxHeight'))));
|
|
38
38
|
/**
|
|
39
39
|
* #stateModel LinearBasicDisplay
|
|
40
40
|
* #category display
|
|
@@ -202,7 +202,7 @@ function stateModelFactory(configSchema) {
|
|
|
202
202
|
label: 'Set max height',
|
|
203
203
|
onClick: () => {
|
|
204
204
|
(0, util_1.getSession)(self).queueDialog(handleClose => [
|
|
205
|
-
|
|
205
|
+
SetMaxHeightDialog,
|
|
206
206
|
{ model: self, handleClose },
|
|
207
207
|
]);
|
|
208
208
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ExportSvgOptions } from '..';
|
|
3
|
-
export default function
|
|
3
|
+
export default function ExportSvgDialog({ model, handleClose, }: {
|
|
4
4
|
model: {
|
|
5
5
|
exportSvg(opts: ExportSvgOptions): Promise<void>;
|
|
6
6
|
};
|
|
@@ -35,7 +35,7 @@ function LoadingMessage() {
|
|
|
35
35
|
function useSvgLocal(key, val) {
|
|
36
36
|
return (0, util_1.useLocalStorage)('svg-' + key, val);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function ExportSvgDialog({ model, handleClose, }) {
|
|
39
39
|
const session = (0, util_1.getSession)(model);
|
|
40
40
|
const offscreenCanvas = typeof OffscreenCanvas !== 'undefined';
|
|
41
41
|
const [rasterizeLayers, setRasterizeLayers] = (0, react_1.useState)(offscreenCanvas);
|
|
@@ -80,4 +80,4 @@ function ExportSvgDlg({ model, handleClose, }) {
|
|
|
80
80
|
}
|
|
81
81
|
} }, "Submit"))));
|
|
82
82
|
}
|
|
83
|
-
exports.default =
|
|
83
|
+
exports.default = ExportSvgDialog;
|
|
@@ -0,0 +1,122 @@
|
|
|
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 (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const mobx_react_1 = require("mobx-react");
|
|
31
|
+
const mui_1 = require("tss-react/mui");
|
|
32
|
+
const colord_1 = require("@jbrowse/core/util/colord");
|
|
33
|
+
const util_1 = require("@jbrowse/core/util");
|
|
34
|
+
const ui_1 = require("@jbrowse/core/ui");
|
|
35
|
+
const material_1 = require("@mui/material");
|
|
36
|
+
// icons
|
|
37
|
+
const Link_1 = __importDefault(require("@mui/icons-material/Link"));
|
|
38
|
+
const Close_1 = __importDefault(require("@mui/icons-material/Close"));
|
|
39
|
+
const Bookmark_1 = __importDefault(require("@mui/icons-material/Bookmark"));
|
|
40
|
+
const useStyles = (0, mui_1.makeStyles)()(theme => {
|
|
41
|
+
var _a, _b, _c, _d, _e, _f;
|
|
42
|
+
return ({
|
|
43
|
+
highlight: {
|
|
44
|
+
height: '100%',
|
|
45
|
+
position: 'absolute',
|
|
46
|
+
background: `${(0, colord_1.colord)((_b = (_a = theme.palette.quaternary) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : 'goldenrod')
|
|
47
|
+
.alpha(0.35)
|
|
48
|
+
.toRgbString()}`,
|
|
49
|
+
borderLeft: `1px solid ${(_d = (_c = theme.palette.quaternary) === null || _c === void 0 ? void 0 : _c.main) !== null && _d !== void 0 ? _d : 'goldenrod'}`,
|
|
50
|
+
borderRight: `1px solid ${(_f = (_e = theme.palette.quaternary) === null || _e === void 0 ? void 0 : _e.main) !== null && _f !== void 0 ? _f : 'goldenrod'}`,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
const Highlight = (0, mobx_react_1.observer)(function Highlight({ model }) {
|
|
55
|
+
var _a, _b;
|
|
56
|
+
const { classes } = useStyles();
|
|
57
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
58
|
+
const anchorEl = (0, react_1.useRef)(null);
|
|
59
|
+
const color = (_b = (_a = (0, material_1.useTheme)().palette.quaternary) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : 'goldenrod';
|
|
60
|
+
const session = (0, util_1.getSession)(model);
|
|
61
|
+
const dismissHighlight = () => {
|
|
62
|
+
model.setHighlight(undefined);
|
|
63
|
+
};
|
|
64
|
+
const menuItems = [
|
|
65
|
+
{
|
|
66
|
+
label: 'Dismiss highlight',
|
|
67
|
+
icon: Close_1.default,
|
|
68
|
+
onClick: () => dismissHighlight(),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: 'Bookmark highlighted region',
|
|
72
|
+
icon: Bookmark_1.default,
|
|
73
|
+
onClick: () => {
|
|
74
|
+
let bookmarkWidget = session.widgets.get('GridBookmark');
|
|
75
|
+
if (!bookmarkWidget) {
|
|
76
|
+
bookmarkWidget = session.addWidget('GridBookmarkWidget', 'GridBookmark');
|
|
77
|
+
}
|
|
78
|
+
// @ts-ignore
|
|
79
|
+
bookmarkWidget.addBookmark(model.highlight);
|
|
80
|
+
dismissHighlight();
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
function handleClose() {
|
|
85
|
+
setOpen(false);
|
|
86
|
+
}
|
|
87
|
+
if (!model.highlight) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
// coords
|
|
91
|
+
const mapCoords = (r) => {
|
|
92
|
+
const s = model.bpToPx({
|
|
93
|
+
refName: r.refName,
|
|
94
|
+
coord: r.start,
|
|
95
|
+
});
|
|
96
|
+
const e = model.bpToPx({
|
|
97
|
+
refName: r.refName,
|
|
98
|
+
coord: r.end,
|
|
99
|
+
});
|
|
100
|
+
return s && e
|
|
101
|
+
? {
|
|
102
|
+
width: Math.max(Math.abs(e.offsetPx - s.offsetPx), 3),
|
|
103
|
+
left: Math.min(s.offsetPx, e.offsetPx) - model.offsetPx,
|
|
104
|
+
}
|
|
105
|
+
: undefined;
|
|
106
|
+
};
|
|
107
|
+
const h = mapCoords(model.highlight);
|
|
108
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, h ? (react_1.default.createElement("div", { className: classes.highlight, style: {
|
|
109
|
+
left: h.left,
|
|
110
|
+
width: h.width,
|
|
111
|
+
} },
|
|
112
|
+
react_1.default.createElement(material_1.Tooltip, { title: 'Highlighted from URL parameter', arrow: true },
|
|
113
|
+
react_1.default.createElement(material_1.IconButton, { ref: anchorEl, onClick: () => setOpen(true) },
|
|
114
|
+
react_1.default.createElement(Link_1.default, { fontSize: "small", sx: {
|
|
115
|
+
color: `${(0, colord_1.colord)(color).darken(0.2).toRgbString()}`,
|
|
116
|
+
} }))),
|
|
117
|
+
react_1.default.createElement(ui_1.Menu, { anchorEl: anchorEl.current, onMenuItemClick: (_event, callback) => {
|
|
118
|
+
callback(session);
|
|
119
|
+
handleClose();
|
|
120
|
+
}, open: open, onClose: handleClose, menuItems: menuItems }))) : null));
|
|
121
|
+
});
|
|
122
|
+
exports.default = Highlight;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
|
|
3
|
+
import { LinearGenomeViewModel } from '../model';
|
|
4
|
+
type LGV = LinearGenomeViewModel;
|
|
5
|
+
declare const OverviewHighlight: ({ model, overview, }: {
|
|
6
|
+
model: LGV;
|
|
7
|
+
overview: Base1DViewModel;
|
|
8
|
+
}) => React.JSX.Element | null;
|
|
9
|
+
export default OverviewHighlight;
|
|
@@ -0,0 +1,53 @@
|
|
|
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 react_1 = __importDefault(require("react"));
|
|
7
|
+
const mobx_react_1 = require("mobx-react");
|
|
8
|
+
const mui_1 = require("tss-react/mui");
|
|
9
|
+
const colord_1 = require("@jbrowse/core/util/colord");
|
|
10
|
+
const useStyles = (0, mui_1.makeStyles)()(theme => {
|
|
11
|
+
var _a, _b, _c, _d, _e, _f;
|
|
12
|
+
return ({
|
|
13
|
+
highlight: {
|
|
14
|
+
height: '100%',
|
|
15
|
+
position: 'absolute',
|
|
16
|
+
background: `${(0, colord_1.colord)((_b = (_a = theme.palette.quaternary) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : 'goldenrod')
|
|
17
|
+
.alpha(0.35)
|
|
18
|
+
.toRgbString()}`,
|
|
19
|
+
borderLeft: `1px solid ${(_d = (_c = theme.palette.quaternary) === null || _c === void 0 ? void 0 : _c.main) !== null && _d !== void 0 ? _d : 'goldenrod'}`,
|
|
20
|
+
borderRight: `1px solid ${(_f = (_e = theme.palette.quaternary) === null || _e === void 0 ? void 0 : _e.main) !== null && _f !== void 0 ? _f : 'goldenrod'}`,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
const OverviewHighlight = (0, mobx_react_1.observer)(function OverviewHighlight({ model, overview, }) {
|
|
25
|
+
const { classes } = useStyles();
|
|
26
|
+
const { cytobandOffset } = model;
|
|
27
|
+
// coords
|
|
28
|
+
const mapCoords = (r) => {
|
|
29
|
+
const s = overview.bpToPx({
|
|
30
|
+
...r,
|
|
31
|
+
coord: r.reversed ? r.end : r.start,
|
|
32
|
+
});
|
|
33
|
+
const e = overview.bpToPx({
|
|
34
|
+
...r,
|
|
35
|
+
coord: r.reversed ? r.start : r.end,
|
|
36
|
+
});
|
|
37
|
+
return s !== undefined && e != undefined
|
|
38
|
+
? {
|
|
39
|
+
width: Math.abs(e - s),
|
|
40
|
+
left: s + cytobandOffset,
|
|
41
|
+
}
|
|
42
|
+
: undefined;
|
|
43
|
+
};
|
|
44
|
+
if (!model.highlight) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
const h = mapCoords(model.highlight);
|
|
48
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, h ? (react_1.default.createElement("div", { className: classes.highlight, style: {
|
|
49
|
+
width: h.width,
|
|
50
|
+
left: h.left,
|
|
51
|
+
} })) : null));
|
|
52
|
+
});
|
|
53
|
+
exports.default = OverviewHighlight;
|