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.
Files changed (43) hide show
  1. package/dist/components/AboutDlg.d.ts +1 -0
  2. package/dist/components/AboutDlg.js +41 -27
  3. package/dist/components/AddTrackDlg.d.ts +1 -0
  4. package/dist/components/AddTrackDlg.js +17 -26
  5. package/dist/components/AnnotationDlg.d.ts +1 -0
  6. package/dist/components/AnnotationDlg.js +49 -47
  7. package/dist/components/BoxTrack.d.ts +1 -0
  8. package/dist/components/BoxTrack.js +22 -33
  9. package/dist/components/DetailsDlg.d.ts +1 -0
  10. package/dist/components/DetailsDlg.js +5 -14
  11. package/dist/components/Header.d.ts +1 -0
  12. package/dist/components/Header.js +38 -39
  13. package/dist/components/ImportForm.d.ts +1 -0
  14. package/dist/components/ImportForm.js +73 -73
  15. package/dist/components/MSACanvas.d.ts +1 -0
  16. package/dist/components/MSACanvas.js +10 -21
  17. package/dist/components/MSAView.d.ts +1 -0
  18. package/dist/components/MSAView.js +25 -17
  19. package/dist/components/MoreInfoDlg.d.ts +1 -0
  20. package/dist/components/MoreInfoDlg.js +5 -14
  21. package/dist/components/ResizeHandles.d.ts +1 -0
  22. package/dist/components/ResizeHandles.js +7 -6
  23. package/dist/components/Rubberband.js +46 -48
  24. package/dist/components/Ruler.d.ts +1 -0
  25. package/dist/components/Ruler.js +17 -26
  26. package/dist/components/SettingsDlg.d.ts +1 -0
  27. package/dist/components/SettingsDlg.js +24 -33
  28. package/dist/components/TextTrack.d.ts +1 -0
  29. package/dist/components/TextTrack.js +5 -17
  30. package/dist/components/Track.d.ts +1 -0
  31. package/dist/components/Track.js +24 -31
  32. package/dist/components/TrackInfoDlg.d.ts +1 -0
  33. package/dist/components/TrackInfoDlg.js +16 -23
  34. package/dist/components/TracklistDlg.d.ts +1 -0
  35. package/dist/components/TracklistDlg.js +12 -20
  36. package/dist/components/TreeCanvas.d.ts +1 -0
  37. package/dist/components/TreeCanvas.js +96 -84
  38. package/dist/components/TreeRuler.d.ts +1 -0
  39. package/dist/components/TreeRuler.js +2 -2
  40. package/dist/components/package.json +4 -16
  41. package/dist/model.d.ts +11 -2
  42. package/dist/model.js +25 -7
  43. package/package.json +4 -16
@@ -1,16 +1,4 @@
1
- var __assign = (this && this.__assign) || function () {
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 (_jsxs(Dialog, __assign({ onClose: function () { return onClose(); }, open: open }, { children: [_jsx(DialogTitle, { children: "Settings" }, void 0),
30
- _jsxs(DialogContent, { children: [_jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: model.showBranchLen, onChange: function () { return model.toggleBranchLen(); } }, void 0), label: "Show branch length" }, void 0),
31
- _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: model.bgColor, onChange: function () { return model.toggleBgColor(); } }, void 0), label: "Color background" }, void 0),
32
- _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: model.drawNodeBubbles, onChange: function () { return model.toggleNodeBubbles(); } }, void 0), label: "Draw node bubbles" }, void 0),
33
- _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: model.drawTree, onChange: function () { return model.toggleDrawTree(); } }, void 0), label: "Draw tree (if available)" }, void 0),
34
- _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: model.labelsAlignRight, onChange: function () { return model.toggleLabelsAlignRight(); } }, void 0), label: "Labels align right (note: labels may draw over tree, but can adjust tree width or tree area width in UI)" }, void 0),
35
- _jsx(TextField, { label: "Row height (px)", value: rowHeight, error: rowHeightError, onChange: function (event) { return setRowHeight(event.target.value); } }, void 0),
36
- _jsx(TextField, { label: "Column width (px)", value: colWidth, error: colWidthError, onChange: function (event) { return setColWidth(event.target.value); } }, void 0),
37
- _jsx("br", {}, void 0),
38
- !noTree ? (_jsx(TextField, { label: "Tree width (px)", value: treeWidth, error: treeWidthError, onChange: function (event) { return setTreeWidth(event.target.value); } }, void 0)) : null,
39
- _jsx("br", {}, void 0),
40
- _jsx(TextField, __assign({ select: true, label: "Color scheme", value: colorSchemeName, onChange: function (event) { return model.setColorSchemeName(event.target.value); } }, { children: Object.keys(colorSchemes).map(function (option) { return (_jsx(MenuItem, __assign({ value: option }, { children: option }), option)); }) }), void 0),
41
- _jsx(DialogActions, { children: _jsx(Button, __assign({ disabled: rowHeightError || colWidthError || treeWidthError, onClick: function () {
42
- model.setRowHeight(+rowHeight);
43
- model.setColWidth(+colWidth);
44
- if (!noTree) {
45
- model.setTreeWidth(+treeWidth);
46
- }
47
- onClose();
48
- }, variant: "contained", color: "primary" }, { children: "Submit" }), void 0) }, void 0)] }, void 0)] }), void 0));
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,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { MsaViewModel } from '../model';
2
3
  declare const AnnotationTrack: ({ track, model }: {
3
4
  track: any;
@@ -1,16 +1,4 @@
1
- var __assign = (this && this.__assign) || function () {
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 (_jsx("canvas", { ref: ref, height: rowHeight * highResScaleFactor, width: blockSize * highResScaleFactor, style: {
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
- } }, void 0));
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 (_jsx("div", __assign({ style: {
65
+ return (React.createElement("div", { style: {
78
66
  position: 'relative',
79
67
  height: rowHeight,
80
68
  width: msaAreaWidth,
81
69
  overflow: 'hidden',
82
- } }, { children: blocksX.map(function (bx) { return (_jsx(AnnotationBlock, { track: track, model: model, offsetX: bx }, bx)); }) }), void 0));
70
+ } }, blocksX.map(function (bx) { return (React.createElement(AnnotationBlock, { key: bx, track: track, model: model, offsetX: bx })); })));
83
71
  });
84
72
  export default AnnotationTrack;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { MsaViewModel } from '../model';
2
3
  export declare const TrackLabel: ({ model, track }: {
3
4
  model: MsaViewModel;
@@ -1,16 +1,4 @@
1
- var __assign = (this && this.__assign) || function () {
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 (_jsxs("div", __assign({ style: {
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
- } }, { children: [name,
39
- _jsx(IconButton, __assign({ className: classes.button, style: { width: trackLabelHeight, height: trackLabelHeight }, onClick: function (event) {
40
- setAnchorEl(event.target);
41
- } }, { children: _jsx(ArrowDropDownIcon, {}, void 0) }), void 0),
42
- anchorEl ? (_jsxs(Menu, __assign({ anchorEl: anchorEl, transitionDuration: 0, open: true, onClose: function () {
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
- } }, { children: [_jsx(MenuItem, __assign({ dense: true, onClick: function () {
45
- model.toggleTrack(track.model.id);
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 (_jsxs("div", __assign({ style: { display: 'flex', height: height } }, { children: [_jsx(TrackLabel, { model: model, track: track }, void 0),
85
- _jsx("div", { style: { width: resizeHandleWidth, flexShrink: 0 } }, void 0),
86
- _jsx("div", __assign({ ref: ref }, { children: _jsx(track.ReactComponent, { model: model, track: track }, void 0) }), void 0)] }), track.id));
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,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const TrackInfoDialog: ({ model, onClose }: {
2
3
  model: any;
3
4
  onClose: () => void;
@@ -1,16 +1,4 @@
1
- var __assign = (this && this.__assign) || function () {
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 (_jsxs(Dialog, __assign({ open: true, onClose: onClose, fullWidth: true, maxWidth: "lg" }, { children: [_jsxs(DialogTitle, { children: ["Track info - ", model.name] }, void 0),
30
- _jsxs(DialogContent, { children: [_jsx(Button, __assign({ variant: "contained", color: "primary", onClick: function () {
31
- copy(model.data);
32
- setLabel('Copied!');
33
- setTimeout(function () {
34
- setLabel('Copy to clipboard');
35
- }, 300);
36
- } }, { children: label }), void 0),
37
- _jsx("pre", __assign({ className: classes.textArea }, { children: model.data }), void 0)] }, void 0),
38
- _jsx(DialogActions, { children: _jsx(Button, __assign({ variant: "contained", onClick: onClose, color: "secondary" }, { children: "Close" }), void 0) }, void 0)] }), void 0));
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,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { MsaViewModel } from '../model';
2
3
  declare const _default: ({ model, onClose, open, }: {
3
4
  model: MsaViewModel;
@@ -1,26 +1,18 @@
1
- var __assign = (this && this.__assign) || function () {
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 (_jsxs(Dialog, __assign({ onClose: function () { return onClose(); }, open: open }, { children: [_jsx(DialogTitle, { children: "Add track" }, void 0),
19
- _jsxs(DialogContent, { children: [_jsx(Typography, { children: "Open relevant per-alignment tracks e.g. protein domains" }, void 0),
20
- _jsx(FormGroup, { children: tracks.map(function (track) {
21
- return (_jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: !model.turnedOffTracks.has(track.model.id), onChange: function () {
22
- model.toggleTrack(track.model.id);
23
- } }, void 0), label: track.model.name }, track.model.id));
24
- }) }, void 0),
25
- _jsx(DialogActions, { children: _jsx(Button, __assign({ onClick: function () { return onClose(); }, variant: "contained", color: "primary" }, { children: "Close" }), void 0) }, void 0)] }, void 0)] }), void 0));
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
  });
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { MsaViewModel } from '../model';
2
3
  declare const TreeCanvas: ({ model }: {
3
4
  model: MsaViewModel;
@@ -9,8 +9,7 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
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 (_jsx(_Fragment, { children: _jsxs(Menu, __assign({ anchorReference: "anchorPosition", anchorPosition: {
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 }, { children: [_jsx(MenuItem, __assign({ dense: true, disabled: true }, { children: node.name }), void 0),
32
- _jsx(MenuItem, __assign({ dense: true, onClick: function () {
33
- model.setDialogComponent(MoreInfoDlg, {
34
- info: model.getRowDetails(node.name),
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
- } }, { children: "More info..." }), void 0),
38
- (_b = structures[node.name]) === null || _b === void 0 ? void 0 : _b.map(function (entry) {
39
- return !model.selectedStructures.find(function (n) { return n.id === node.name; }) ? (_jsxs(MenuItem, __assign({ dense: true, onClick: function () {
40
- model.addStructureToSelection({
41
- structure: entry,
42
- id: node.name,
43
- });
44
- onClose();
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
- } }, { children: ["Open UniProt track (", accession, ")"] }), accession)); })] }), void 0) }, void 0));
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 (_jsxs(Menu, __assign({ anchorReference: "anchorPosition", anchorPosition: {
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 }, { children: [_jsx(MenuItem, __assign({ dense: true, disabled: true }, { children: node.name }), void 0),
64
- _jsx(MenuItem, __assign({ dense: true, onClick: function () {
65
- model.toggleCollapsed(node.id);
66
- onClose();
67
- } }, { children: model.collapsed.includes(node.id)
68
- ? 'Expand this node'
69
- : 'Collapse this node' }), void 0),
70
- _jsx(MenuItem, __assign({ dense: true, onClick: function () {
71
- model.showOnly === node.id
72
- ? model.setShowOnly(undefined)
73
- : model.setShowOnly(node.id);
74
- onClose();
75
- } }, { children: model.showOnly === node.id
76
- ? 'Disable show only this node'
77
- : 'Show only this node' }), void 0)] }), void 0));
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 (_jsxs(_Fragment, { children: [(branchMenu === null || branchMenu === void 0 ? void 0 : branchMenu.id) ? (_jsx(TreeBranchMenu, { node: branchMenu, model: model, onClose: function () { return setBranchMenu(undefined); } }, void 0)) : null,
285
- (toggleNodeMenu === null || toggleNodeMenu === void 0 ? void 0 : toggleNodeMenu.id) ? (_jsx(TreeMenu, { node: toggleNodeMenu, model: model, onClose: function () { return setToggleNodeMenu(undefined); } }, void 0)) : null,
286
- _jsx("canvas", { width: (treeWidth + padding) * highResScaleFactor, height: blockSize * highResScaleFactor, style: {
287
- width: treeWidth + padding,
288
- height: blockSize,
289
- top: scrollY + offsetY,
290
- left: 0,
291
- position: 'absolute',
292
- }, onMouseMove: function (event) {
293
- if (!ref.current) {
294
- return;
295
- }
296
- var ret = hoverNameClickMap(event) || hoverBranchClickMap(event);
297
- if (ret) {
298
- ref.current.style.cursor = 'pointer';
299
- }
300
- else {
301
- ref.current.style.cursor = 'default';
302
- }
303
- setHoverElt(hoverNameClickMap(event));
304
- }, onClick: function (event) {
305
- var x = event.clientX, y = event.clientY;
306
- var data = hoverBranchClickMap(event);
307
- if (data === null || data === void 0 ? void 0 : data.id) {
308
- setBranchMenu(__assign(__assign({}, data), { x: x, y: y }));
309
- }
310
- var data2 = hoverNameClickMap(event);
311
- if (data2 === null || data2 === void 0 ? void 0 : data2.id) {
312
- setToggleNodeMenu(__assign(__assign({}, data2), { x: x, y: y }));
313
- }
314
- }, ref: ref }, void 0),
315
- _jsx("canvas", { style: {
316
- width: treeWidth + padding,
317
- height: blockSize,
318
- top: scrollY + offsetY,
319
- left: 0,
320
- position: 'absolute',
321
- pointerEvents: 'none',
322
- zIndex: 100,
323
- }, width: treeWidth + padding, height: blockSize, ref: mouseoverRef }, void 0)] }, void 0));
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 (_jsx("div", __assign({ ref: ref, onMouseDown: mouseDown, onMouseUp: mouseUp, onMouseLeave: mouseLeave, style: {
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
- } }, { children: blocksY.map(function (block) { return (_jsx(TreeBlock, { model: model, offsetY: block }, block)); }) }), void 0));
429
+ } }, blocksY.map(function (block) { return (React.createElement(TreeBlock, { key: block, model: model, offsetY: block })); })));
418
430
  });
419
431
  export default TreeCanvas;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { MsaViewModel } from '../model';
2
3
  declare const TreeRuler: ({ model }: {
3
4
  model: MsaViewModel;
@@ -1,8 +1,8 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
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 _jsx("div", { style: { width: treeWidth } }, void 0);
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.6",
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",