react-msaview 1.2.7 → 1.2.11
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/components/AboutDlg.d.ts +1 -0
- package/dist/components/AboutDlg.js +41 -27
- package/dist/components/AddTrackDlg.d.ts +1 -0
- package/dist/components/AddTrackDlg.js +17 -26
- package/dist/components/AnnotationDlg.d.ts +1 -0
- package/dist/components/AnnotationDlg.js +49 -47
- package/dist/components/BoxTrack.d.ts +1 -0
- package/dist/components/BoxTrack.js +22 -33
- package/dist/components/DetailsDlg.d.ts +1 -0
- package/dist/components/DetailsDlg.js +5 -14
- package/dist/components/Header.d.ts +1 -0
- package/dist/components/Header.js +38 -39
- package/dist/components/ImportForm.d.ts +1 -0
- package/dist/components/ImportForm.js +73 -73
- package/dist/components/MSACanvas.d.ts +1 -0
- package/dist/components/MSACanvas.js +10 -21
- package/dist/components/MSAView.d.ts +1 -0
- package/dist/components/MSAView.js +25 -17
- package/dist/components/MoreInfoDlg.d.ts +1 -0
- package/dist/components/MoreInfoDlg.js +5 -14
- package/dist/components/ResizeHandles.d.ts +1 -0
- package/dist/components/ResizeHandles.js +7 -6
- package/dist/components/Rubberband.js +46 -48
- package/dist/components/Ruler.d.ts +1 -0
- package/dist/components/Ruler.js +17 -26
- package/dist/components/SettingsDlg.d.ts +1 -0
- package/dist/components/SettingsDlg.js +24 -33
- package/dist/components/TextTrack.d.ts +1 -0
- package/dist/components/TextTrack.js +5 -17
- package/dist/components/Track.d.ts +1 -0
- package/dist/components/Track.js +24 -31
- package/dist/components/TrackInfoDlg.d.ts +1 -0
- package/dist/components/TrackInfoDlg.js +16 -23
- package/dist/components/TracklistDlg.d.ts +1 -0
- package/dist/components/TracklistDlg.js +12 -20
- package/dist/components/TreeCanvas.d.ts +1 -0
- package/dist/components/TreeCanvas.js +96 -84
- package/dist/components/TreeRuler.d.ts +1 -0
- package/dist/components/TreeRuler.js +2 -2
- package/dist/components/package.json +4 -16
- package/dist/model.d.ts +11 -2
- package/dist/model.js +25 -7
- package/package.json +4 -16
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { useState } from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
14
2
|
import { observer } from 'mobx-react';
|
|
15
3
|
import { Button, Checkbox, Dialog, DialogActions, DialogTitle, DialogContent, FormControlLabel, MenuItem, TextField, } from '@material-ui/core';
|
|
16
4
|
import colorSchemes from '../colorSchemes';
|
|
@@ -26,24 +14,27 @@ export default observer(function (_a) {
|
|
|
26
14
|
var rowHeightError = error(rowHeight);
|
|
27
15
|
var colWidthError = error(colWidth);
|
|
28
16
|
var treeWidthError = error(treeWidth);
|
|
29
|
-
return (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
17
|
+
return (React.createElement(Dialog, { onClose: function () { return onClose(); }, open: open },
|
|
18
|
+
React.createElement(DialogTitle, null, "Settings"),
|
|
19
|
+
React.createElement(DialogContent, null,
|
|
20
|
+
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: model.showBranchLen, onChange: function () { return model.toggleBranchLen(); } }), label: "Show branch length" }),
|
|
21
|
+
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: model.bgColor, onChange: function () { return model.toggleBgColor(); } }), label: "Color background" }),
|
|
22
|
+
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: model.drawNodeBubbles, onChange: function () { return model.toggleNodeBubbles(); } }), label: "Draw node bubbles" }),
|
|
23
|
+
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: model.drawTree, onChange: function () { return model.toggleDrawTree(); } }), label: "Draw tree (if available)" }),
|
|
24
|
+
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: model.labelsAlignRight, onChange: function () { return model.toggleLabelsAlignRight(); } }), label: "Labels align right (note: labels may draw over tree, but can adjust tree width or tree area width in UI)" }),
|
|
25
|
+
React.createElement(TextField, { label: "Row height (px)", value: rowHeight, error: rowHeightError, onChange: function (event) { return setRowHeight(event.target.value); } }),
|
|
26
|
+
React.createElement(TextField, { label: "Column width (px)", value: colWidth, error: colWidthError, onChange: function (event) { return setColWidth(event.target.value); } }),
|
|
27
|
+
React.createElement("br", null),
|
|
28
|
+
!noTree ? (React.createElement(TextField, { label: "Tree width (px)", value: treeWidth, error: treeWidthError, onChange: function (event) { return setTreeWidth(event.target.value); } })) : null,
|
|
29
|
+
React.createElement("br", null),
|
|
30
|
+
React.createElement(TextField, { select: true, label: "Color scheme", value: colorSchemeName, onChange: function (event) { return model.setColorSchemeName(event.target.value); } }, Object.keys(colorSchemes).map(function (option) { return (React.createElement(MenuItem, { key: option, value: option }, option)); })),
|
|
31
|
+
React.createElement(DialogActions, null,
|
|
32
|
+
React.createElement(Button, { disabled: rowHeightError || colWidthError || treeWidthError, onClick: function () {
|
|
33
|
+
model.setRowHeight(+rowHeight);
|
|
34
|
+
model.setColWidth(+colWidth);
|
|
35
|
+
if (!noTree) {
|
|
36
|
+
model.setTreeWidth(+treeWidth);
|
|
37
|
+
}
|
|
38
|
+
onClose();
|
|
39
|
+
}, variant: "contained", color: "primary" }, "Submit")))));
|
|
49
40
|
});
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { useRef, useMemo, useEffect } from 'react';
|
|
1
|
+
import React, { useRef, useMemo, useEffect } from 'react';
|
|
14
2
|
import { useTheme } from '@material-ui/core';
|
|
15
3
|
import { observer } from 'mobx-react';
|
|
16
4
|
import { colorContrast } from '../util';
|
|
@@ -64,21 +52,21 @@ var AnnotationBlock = observer(function (_a) {
|
|
|
64
52
|
highResScaleFactor,
|
|
65
53
|
data,
|
|
66
54
|
]);
|
|
67
|
-
return (
|
|
55
|
+
return (React.createElement("canvas", { ref: ref, height: rowHeight * highResScaleFactor, width: blockSize * highResScaleFactor, style: {
|
|
68
56
|
position: 'absolute',
|
|
69
57
|
left: scrollX + offsetX,
|
|
70
58
|
width: blockSize,
|
|
71
59
|
height: rowHeight,
|
|
72
|
-
} }
|
|
60
|
+
} }));
|
|
73
61
|
});
|
|
74
62
|
var AnnotationTrack = observer(function (_a) {
|
|
75
63
|
var track = _a.track, model = _a.model;
|
|
76
64
|
var blocksX = model.blocksX, msaAreaWidth = model.msaAreaWidth, rowHeight = model.rowHeight;
|
|
77
|
-
return (
|
|
65
|
+
return (React.createElement("div", { style: {
|
|
78
66
|
position: 'relative',
|
|
79
67
|
height: rowHeight,
|
|
80
68
|
width: msaAreaWidth,
|
|
81
69
|
overflow: 'hidden',
|
|
82
|
-
} },
|
|
70
|
+
} }, blocksX.map(function (bx) { return (React.createElement(AnnotationBlock, { key: bx, track: track, model: model, offsetX: bx })); })));
|
|
83
71
|
});
|
|
84
72
|
export default AnnotationTrack;
|
package/dist/components/Track.js
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { useState, useRef, useEffect } from 'react';
|
|
1
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
14
2
|
import normalizeWheel from 'normalize-wheel';
|
|
15
3
|
import { observer } from 'mobx-react';
|
|
16
4
|
import { IconButton, Menu, MenuItem, makeStyles } from '@material-ui/core';
|
|
@@ -29,27 +17,30 @@ export var TrackLabel = observer(function (_a) {
|
|
|
29
17
|
var height = track.height, name = track.model.name;
|
|
30
18
|
var classes = useStyles();
|
|
31
19
|
var trackLabelHeight = Math.max(8, rowHeight - 8);
|
|
32
|
-
return (
|
|
20
|
+
return (React.createElement("div", { style: {
|
|
33
21
|
width: width,
|
|
34
22
|
height: height,
|
|
35
23
|
flexShrink: 0,
|
|
36
24
|
textAlign: 'right',
|
|
37
25
|
fontSize: trackLabelHeight,
|
|
38
|
-
} },
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
} },
|
|
27
|
+
name,
|
|
28
|
+
React.createElement(IconButton, { className: classes.button, style: { width: trackLabelHeight, height: trackLabelHeight }, onClick: function (event) {
|
|
29
|
+
setAnchorEl(event.target);
|
|
30
|
+
} },
|
|
31
|
+
React.createElement(ArrowDropDownIcon, null)),
|
|
32
|
+
anchorEl ? (React.createElement(Menu, { anchorEl: anchorEl, transitionDuration: 0, open: true, onClose: function () {
|
|
33
|
+
setAnchorEl(undefined);
|
|
34
|
+
} },
|
|
35
|
+
React.createElement(MenuItem, { dense: true, onClick: function () {
|
|
36
|
+
model.toggleTrack(track.model.id);
|
|
37
|
+
setAnchorEl(undefined);
|
|
38
|
+
} }, "Close"),
|
|
39
|
+
React.createElement(MenuItem, { dense: true, onClick: function () {
|
|
40
|
+
setTrackInfoDlgOpen(true);
|
|
43
41
|
setAnchorEl(undefined);
|
|
44
|
-
} },
|
|
45
|
-
|
|
46
|
-
setAnchorEl(undefined);
|
|
47
|
-
} }, { children: "Close" }), void 0),
|
|
48
|
-
_jsx(MenuItem, __assign({ dense: true, onClick: function () {
|
|
49
|
-
setTrackInfoDlgOpen(true);
|
|
50
|
-
setAnchorEl(undefined);
|
|
51
|
-
} }, { children: "Get info" }), void 0)] }), void 0)) : null,
|
|
52
|
-
trackInfoDlgOpen ? (_jsx(TrackInfoDialog, { model: track.model, onClose: function () { return setTrackInfoDlgOpen(false); } }, void 0)) : null] }), void 0));
|
|
42
|
+
} }, "Get info"))) : null,
|
|
43
|
+
trackInfoDlgOpen ? (React.createElement(TrackInfoDialog, { model: track.model, onClose: function () { return setTrackInfoDlgOpen(false); } })) : null));
|
|
53
44
|
});
|
|
54
45
|
var Track = observer(function (_a) {
|
|
55
46
|
var model = _a.model, track = _a.track;
|
|
@@ -81,8 +72,10 @@ var Track = observer(function (_a) {
|
|
|
81
72
|
curr.removeEventListener('wheel', onWheel);
|
|
82
73
|
};
|
|
83
74
|
}, [model]);
|
|
84
|
-
return (
|
|
85
|
-
|
|
86
|
-
|
|
75
|
+
return (React.createElement("div", { key: track.id, style: { display: 'flex', height: height } },
|
|
76
|
+
React.createElement(TrackLabel, { model: model, track: track }),
|
|
77
|
+
React.createElement("div", { style: { width: resizeHandleWidth, flexShrink: 0 } }),
|
|
78
|
+
React.createElement("div", { ref: ref },
|
|
79
|
+
React.createElement(track.ReactComponent, { model: model, track: track }))));
|
|
87
80
|
});
|
|
88
81
|
export default Track;
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { useState } from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
14
2
|
import copy from 'copy-to-clipboard';
|
|
15
3
|
import { observer } from 'mobx-react';
|
|
16
4
|
import { Button, Dialog, DialogActions, DialogTitle, DialogContent, makeStyles, } from '@material-ui/core';
|
|
@@ -26,15 +14,20 @@ var TrackInfoDialog = observer(function (_a) {
|
|
|
26
14
|
var model = _a.model, onClose = _a.onClose;
|
|
27
15
|
var _b = useState('Copy to clipboard'), label = _b[0], setLabel = _b[1];
|
|
28
16
|
var classes = useStyles();
|
|
29
|
-
return (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
17
|
+
return (React.createElement(Dialog, { open: true, onClose: onClose, fullWidth: true, maxWidth: "lg" },
|
|
18
|
+
React.createElement(DialogTitle, null,
|
|
19
|
+
"Track info - ",
|
|
20
|
+
model.name),
|
|
21
|
+
React.createElement(DialogContent, null,
|
|
22
|
+
React.createElement(Button, { variant: "contained", color: "primary", onClick: function () {
|
|
23
|
+
copy(model.data);
|
|
24
|
+
setLabel('Copied!');
|
|
25
|
+
setTimeout(function () {
|
|
26
|
+
setLabel('Copy to clipboard');
|
|
27
|
+
}, 300);
|
|
28
|
+
} }, label),
|
|
29
|
+
React.createElement("pre", { className: classes.textArea }, model.data)),
|
|
30
|
+
React.createElement(DialogActions, null,
|
|
31
|
+
React.createElement(Button, { variant: "contained", onClick: onClose, color: "secondary" }, "Close"))));
|
|
39
32
|
});
|
|
40
33
|
export default TrackInfoDialog;
|
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import React from 'react';
|
|
13
2
|
import { Dialog, DialogTitle, DialogContent, FormControlLabel, FormGroup, Checkbox, DialogActions, Button, Typography, } from '@material-ui/core';
|
|
14
3
|
import { observer } from 'mobx-react';
|
|
15
4
|
export default observer(function (_a) {
|
|
16
5
|
var model = _a.model, onClose = _a.onClose, open = _a.open;
|
|
17
6
|
var tracks = model.tracks;
|
|
18
|
-
return (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
7
|
+
return (React.createElement(Dialog, { onClose: function () { return onClose(); }, open: open },
|
|
8
|
+
React.createElement(DialogTitle, null, "Add track"),
|
|
9
|
+
React.createElement(DialogContent, null,
|
|
10
|
+
React.createElement(Typography, null, "Open relevant per-alignment tracks e.g. protein domains"),
|
|
11
|
+
React.createElement(FormGroup, null, tracks.map(function (track) {
|
|
12
|
+
return (React.createElement(FormControlLabel, { key: track.model.id, control: React.createElement(Checkbox, { checked: !model.turnedOffTracks.has(track.model.id), onChange: function () {
|
|
13
|
+
model.toggleTrack(track.model.id);
|
|
14
|
+
} }), label: track.model.name }));
|
|
15
|
+
})),
|
|
16
|
+
React.createElement(DialogActions, null,
|
|
17
|
+
React.createElement(Button, { onClick: function () { return onClose(); }, variant: "contained", color: "primary" }, "Close")))));
|
|
26
18
|
});
|
|
@@ -9,8 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import {
|
|
13
|
-
import { useEffect, useRef, useState } from 'react';
|
|
12
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
14
13
|
import { Menu, MenuItem } from '@material-ui/core';
|
|
15
14
|
import normalizeWheel from 'normalize-wheel';
|
|
16
15
|
import { observer } from 'mobx-react';
|
|
@@ -25,56 +24,68 @@ var TreeMenu = observer(function (_a) {
|
|
|
25
24
|
var node = _a.node, onClose = _a.onClose, model = _a.model;
|
|
26
25
|
var structures = model.structures;
|
|
27
26
|
var nodeDetails = node ? model.getRowDetails(node.name) : undefined;
|
|
28
|
-
return (
|
|
27
|
+
return (React.createElement(React.Fragment, null,
|
|
28
|
+
React.createElement(Menu, { anchorReference: "anchorPosition", anchorPosition: {
|
|
29
29
|
top: node.y,
|
|
30
30
|
left: node.x,
|
|
31
|
-
}, transitionDuration: 0, keepMounted: true, open: Boolean(node), onClose: onClose },
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
}, transitionDuration: 0, keepMounted: true, open: Boolean(node), onClose: onClose },
|
|
32
|
+
React.createElement(MenuItem, { dense: true, disabled: true }, node.name),
|
|
33
|
+
React.createElement(MenuItem, { dense: true, onClick: function () {
|
|
34
|
+
model.setDialogComponent(MoreInfoDlg, {
|
|
35
|
+
info: model.getRowDetails(node.name),
|
|
36
|
+
});
|
|
37
|
+
onClose();
|
|
38
|
+
} }, "More info..."), (_b = structures[node.name]) === null || _b === void 0 ? void 0 :
|
|
39
|
+
_b.map(function (entry) {
|
|
40
|
+
return !model.selectedStructures.find(function (n) { return n.id === node.name; }) ? (React.createElement(MenuItem, { key: JSON.stringify(entry), dense: true, onClick: function () {
|
|
41
|
+
model.addStructureToSelection({
|
|
42
|
+
structure: entry,
|
|
43
|
+
id: node.name,
|
|
35
44
|
});
|
|
36
45
|
onClose();
|
|
37
|
-
} },
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
} }, { children: ["Add PDB to selection (", entry.pdb, ")"] }), JSON.stringify(entry))) : (_jsxs(MenuItem, __assign({ dense: true, onClick: function () {
|
|
46
|
-
model.removeStructureFromSelection({
|
|
47
|
-
structure: entry,
|
|
48
|
-
id: node.name,
|
|
49
|
-
});
|
|
50
|
-
onClose();
|
|
51
|
-
} }, { children: ["Remove PDB from selection (", entry.pdb, ")"] }), JSON.stringify(entry)));
|
|
52
|
-
}),
|
|
53
|
-
(_c = nodeDetails.accession) === null || _c === void 0 ? void 0 : _c.map(function (accession) { return (_jsxs(MenuItem, __assign({ dense: true, onClick: function () {
|
|
54
|
-
model.addUniprotTrack({ name: nodeDetails.name, accession: accession });
|
|
46
|
+
} },
|
|
47
|
+
"Add PDB to selection (",
|
|
48
|
+
entry.pdb,
|
|
49
|
+
")")) : (React.createElement(MenuItem, { key: JSON.stringify(entry), dense: true, onClick: function () {
|
|
50
|
+
model.removeStructureFromSelection({
|
|
51
|
+
structure: entry,
|
|
52
|
+
id: node.name,
|
|
53
|
+
});
|
|
55
54
|
onClose();
|
|
56
|
-
} },
|
|
55
|
+
} },
|
|
56
|
+
"Remove PDB from selection (",
|
|
57
|
+
entry.pdb,
|
|
58
|
+
")"));
|
|
59
|
+
}), (_c = nodeDetails.accession) === null || _c === void 0 ? void 0 :
|
|
60
|
+
_c.map(function (accession) { return (React.createElement(MenuItem, { dense: true, key: accession, onClick: function () {
|
|
61
|
+
model.addUniprotTrack({ name: nodeDetails.name, accession: accession });
|
|
62
|
+
onClose();
|
|
63
|
+
} },
|
|
64
|
+
"Open UniProt track (",
|
|
65
|
+
accession,
|
|
66
|
+
")")); }))));
|
|
57
67
|
});
|
|
58
68
|
var TreeBranchMenu = observer(function (_a) {
|
|
59
69
|
var node = _a.node, model = _a.model, onClose = _a.onClose;
|
|
60
|
-
return (
|
|
70
|
+
return (React.createElement(Menu, { anchorReference: "anchorPosition", anchorPosition: {
|
|
61
71
|
left: node.x,
|
|
62
72
|
top: node.y,
|
|
63
|
-
}, transitionDuration: 0, keepMounted: true, open: Boolean(node), onClose: onClose },
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
}, transitionDuration: 0, keepMounted: true, open: Boolean(node), onClose: onClose },
|
|
74
|
+
React.createElement(MenuItem, { dense: true, disabled: true }, node.name),
|
|
75
|
+
React.createElement(MenuItem, { dense: true, onClick: function () {
|
|
76
|
+
model.toggleCollapsed(node.id);
|
|
77
|
+
onClose();
|
|
78
|
+
} }, model.collapsed.includes(node.id)
|
|
79
|
+
? 'Expand this node'
|
|
80
|
+
: 'Collapse this node'),
|
|
81
|
+
React.createElement(MenuItem, { dense: true, onClick: function () {
|
|
82
|
+
model.showOnly === node.id
|
|
83
|
+
? model.setShowOnly(undefined)
|
|
84
|
+
: model.setShowOnly(node.id);
|
|
85
|
+
onClose();
|
|
86
|
+
} }, model.showOnly === node.id
|
|
87
|
+
? 'Disable show only this node'
|
|
88
|
+
: 'Show only this node')));
|
|
78
89
|
});
|
|
79
90
|
var TreeBlock = observer(function (_a) {
|
|
80
91
|
var model = _a.model, offsetY = _a.offsetY;
|
|
@@ -281,46 +292,47 @@ var TreeBlock = observer(function (_a) {
|
|
|
281
292
|
return entry && !entry.branch
|
|
282
293
|
? __assign(__assign({}, entry), { x: event.clientX, y: event.clientY }) : undefined;
|
|
283
294
|
}
|
|
284
|
-
return (
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
295
|
+
return (React.createElement(React.Fragment, null,
|
|
296
|
+
(branchMenu === null || branchMenu === void 0 ? void 0 : branchMenu.id) ? (React.createElement(TreeBranchMenu, { node: branchMenu, model: model, onClose: function () { return setBranchMenu(undefined); } })) : null,
|
|
297
|
+
(toggleNodeMenu === null || toggleNodeMenu === void 0 ? void 0 : toggleNodeMenu.id) ? (React.createElement(TreeMenu, { node: toggleNodeMenu, model: model, onClose: function () { return setToggleNodeMenu(undefined); } })) : null,
|
|
298
|
+
React.createElement("canvas", { width: (treeWidth + padding) * highResScaleFactor, height: blockSize * highResScaleFactor, style: {
|
|
299
|
+
width: treeWidth + padding,
|
|
300
|
+
height: blockSize,
|
|
301
|
+
top: scrollY + offsetY,
|
|
302
|
+
left: 0,
|
|
303
|
+
position: 'absolute',
|
|
304
|
+
}, onMouseMove: function (event) {
|
|
305
|
+
if (!ref.current) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
var ret = hoverNameClickMap(event) || hoverBranchClickMap(event);
|
|
309
|
+
if (ret) {
|
|
310
|
+
ref.current.style.cursor = 'pointer';
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
ref.current.style.cursor = 'default';
|
|
314
|
+
}
|
|
315
|
+
setHoverElt(hoverNameClickMap(event));
|
|
316
|
+
}, onClick: function (event) {
|
|
317
|
+
var x = event.clientX, y = event.clientY;
|
|
318
|
+
var data = hoverBranchClickMap(event);
|
|
319
|
+
if (data === null || data === void 0 ? void 0 : data.id) {
|
|
320
|
+
setBranchMenu(__assign(__assign({}, data), { x: x, y: y }));
|
|
321
|
+
}
|
|
322
|
+
var data2 = hoverNameClickMap(event);
|
|
323
|
+
if (data2 === null || data2 === void 0 ? void 0 : data2.id) {
|
|
324
|
+
setToggleNodeMenu(__assign(__assign({}, data2), { x: x, y: y }));
|
|
325
|
+
}
|
|
326
|
+
}, ref: ref }),
|
|
327
|
+
React.createElement("canvas", { style: {
|
|
328
|
+
width: treeWidth + padding,
|
|
329
|
+
height: blockSize,
|
|
330
|
+
top: scrollY + offsetY,
|
|
331
|
+
left: 0,
|
|
332
|
+
position: 'absolute',
|
|
333
|
+
pointerEvents: 'none',
|
|
334
|
+
zIndex: 100,
|
|
335
|
+
}, width: treeWidth + padding, height: blockSize, ref: mouseoverRef })));
|
|
324
336
|
});
|
|
325
337
|
var TreeCanvas = observer(function (_a) {
|
|
326
338
|
var model = _a.model;
|
|
@@ -409,11 +421,11 @@ var TreeCanvas = observer(function (_a) {
|
|
|
409
421
|
function mouseLeave(event) {
|
|
410
422
|
event.preventDefault();
|
|
411
423
|
}
|
|
412
|
-
return (
|
|
424
|
+
return (React.createElement("div", { ref: ref, onMouseDown: mouseDown, onMouseUp: mouseUp, onMouseLeave: mouseLeave, style: {
|
|
413
425
|
height: height,
|
|
414
426
|
position: 'relative',
|
|
415
427
|
overflow: 'hidden',
|
|
416
428
|
width: treeWidth + padding,
|
|
417
|
-
} },
|
|
429
|
+
} }, blocksY.map(function (block) { return (React.createElement(TreeBlock, { key: block, model: model, offsetY: block })); })));
|
|
418
430
|
});
|
|
419
431
|
export default TreeCanvas;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { observer } from 'mobx-react';
|
|
3
3
|
var TreeRuler = observer(function (_a) {
|
|
4
4
|
var model = _a.model;
|
|
5
5
|
var treeWidth = model.treeWidth;
|
|
6
|
-
return
|
|
6
|
+
return React.createElement("div", { style: { width: treeWidth } });
|
|
7
7
|
});
|
|
8
8
|
export default TreeRuler;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.2.
|
|
2
|
+
"version": "1.2.10",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"build": "yarn tsc",
|
|
19
19
|
"size": "size-limit",
|
|
20
20
|
"analyze": "size-limit --why",
|
|
21
|
+
"preversion": "npm run build",
|
|
21
22
|
"postversion": "git push --follow-tags"
|
|
22
23
|
},
|
|
23
24
|
"peerDependencies": {
|
|
@@ -28,33 +29,20 @@
|
|
|
28
29
|
},
|
|
29
30
|
"name": "react-msaview",
|
|
30
31
|
"author": "Colin",
|
|
31
|
-
"module": "dist/react-msaview.esm.js",
|
|
32
|
-
"size-limit": [
|
|
33
|
-
{
|
|
34
|
-
"path": "dist/react-msaview.cjs.production.min.js",
|
|
35
|
-
"limit": "10 KB"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"path": "dist/react-msaview.esm.js",
|
|
39
|
-
"limit": "10 KB"
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
32
|
"devDependencies": {
|
|
43
|
-
"@size-limit/preset-small-lib": "^4.10.1",
|
|
44
33
|
"@types/color": "^3.0.1",
|
|
45
34
|
"@types/d3": "^6.7.0",
|
|
35
|
+
"@types/lodash": "^4.14.170",
|
|
46
36
|
"@types/react": "^17.0.3",
|
|
47
37
|
"@types/react-dom": "^17.0.2",
|
|
38
|
+
"concurrently": "^6.2.0",
|
|
48
39
|
"eslint-config-react-app": "^6.0.0",
|
|
49
|
-
"husky": "^5.1.3",
|
|
50
40
|
"react": "^17.0.1",
|
|
51
41
|
"react-dom": "^17.0.1",
|
|
52
|
-
"size-limit": "^4.10.1",
|
|
53
42
|
"tslib": "^2.1.0",
|
|
54
43
|
"typescript": "^4.2.3"
|
|
55
44
|
},
|
|
56
45
|
"dependencies": {
|
|
57
|
-
"@gmod/gff": "^1.1.2",
|
|
58
46
|
"clustal-js": "^1.0.3",
|
|
59
47
|
"color": "^3.1.3",
|
|
60
48
|
"copy-to-clipboard": "^3.3.1",
|