react-msaview 1.2.8 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/bundle/colorSchemes.d.ts +16 -0
  2. package/bundle/colorSchemes.js +455 -0
  3. package/bundle/components/AboutDlg.d.ts +5 -0
  4. package/bundle/components/AboutDlg.js +47 -0
  5. package/bundle/components/AddTrackDlg.d.ts +8 -0
  6. package/bundle/components/AddTrackDlg.js +26 -0
  7. package/bundle/components/AnnotationDlg.d.ts +11 -0
  8. package/bundle/components/AnnotationDlg.js +77 -0
  9. package/bundle/components/BoxTrack.d.ts +7 -0
  10. package/bundle/components/BoxTrack.js +143 -0
  11. package/bundle/components/DetailsDlg.d.ts +8 -0
  12. package/bundle/components/DetailsDlg.js +12 -0
  13. package/bundle/components/Header.d.ts +6 -0
  14. package/bundle/components/Header.js +63 -0
  15. package/bundle/components/ImportForm.d.ts +6 -0
  16. package/bundle/components/ImportForm.js +89 -0
  17. package/bundle/components/MSACanvas.d.ts +6 -0
  18. package/bundle/components/MSACanvas.js +210 -0
  19. package/bundle/components/MSAView.d.ts +6 -0
  20. package/bundle/components/MSAView.js +88 -0
  21. package/bundle/components/MoreInfoDlg.d.ts +6 -0
  22. package/bundle/components/MoreInfoDlg.js +11 -0
  23. package/bundle/components/ResizeHandles.d.ts +8 -0
  24. package/bundle/components/ResizeHandles.js +110 -0
  25. package/bundle/components/Rubberband.d.ts +7 -0
  26. package/bundle/components/Rubberband.js +196 -0
  27. package/bundle/components/Ruler.d.ts +20 -0
  28. package/bundle/components/Ruler.js +121 -0
  29. package/bundle/components/SettingsDlg.d.ts +8 -0
  30. package/bundle/components/SettingsDlg.js +40 -0
  31. package/bundle/components/TextTrack.d.ts +7 -0
  32. package/bundle/components/TextTrack.js +72 -0
  33. package/bundle/components/Track.d.ts +11 -0
  34. package/bundle/components/Track.js +81 -0
  35. package/bundle/components/TrackInfoDlg.d.ts +6 -0
  36. package/bundle/components/TrackInfoDlg.js +33 -0
  37. package/bundle/components/TracklistDlg.d.ts +8 -0
  38. package/bundle/components/TracklistDlg.js +18 -0
  39. package/bundle/components/TreeCanvas.d.ts +6 -0
  40. package/bundle/components/TreeCanvas.js +431 -0
  41. package/bundle/components/TreeRuler.d.ts +6 -0
  42. package/bundle/components/TreeRuler.js +8 -0
  43. package/bundle/components/data/seq2.d.ts +3 -0
  44. package/bundle/components/data/seq2.js +3 -0
  45. package/bundle/index.d.ts +4 -0
  46. package/bundle/index.js +97264 -0
  47. package/bundle/layout.d.ts +23 -0
  48. package/bundle/layout.js +53 -0
  49. package/bundle/model.d.ts +364 -0
  50. package/bundle/model.js +894 -0
  51. package/bundle/parseNewick.d.ts +64 -0
  52. package/bundle/parseNewick.js +94 -0
  53. package/bundle/parsers/ClustalMSA.d.ts +39 -0
  54. package/bundle/parsers/ClustalMSA.js +77 -0
  55. package/bundle/parsers/FastaMSA.d.ts +26 -0
  56. package/bundle/parsers/FastaMSA.js +78 -0
  57. package/bundle/parsers/StockholmMSA.d.ts +75 -0
  58. package/bundle/parsers/StockholmMSA.js +142 -0
  59. package/bundle/util.d.ts +17 -0
  60. package/bundle/util.js +33 -0
  61. package/dist/components/AboutDlg.d.ts +1 -0
  62. package/dist/components/AboutDlg.js +41 -27
  63. package/dist/components/AddTrackDlg.d.ts +1 -0
  64. package/dist/components/AddTrackDlg.js +17 -26
  65. package/dist/components/AnnotationDlg.d.ts +1 -0
  66. package/dist/components/AnnotationDlg.js +49 -47
  67. package/dist/components/BoxTrack.d.ts +1 -0
  68. package/dist/components/BoxTrack.js +22 -33
  69. package/dist/components/DetailsDlg.d.ts +1 -0
  70. package/dist/components/DetailsDlg.js +5 -14
  71. package/dist/components/Header.d.ts +1 -0
  72. package/dist/components/Header.js +38 -39
  73. package/dist/components/ImportForm.d.ts +1 -0
  74. package/dist/components/ImportForm.js +80 -73
  75. package/dist/components/MSACanvas.d.ts +1 -0
  76. package/dist/components/MSACanvas.js +10 -21
  77. package/dist/components/MSAView.d.ts +1 -0
  78. package/dist/components/MSAView.js +25 -17
  79. package/dist/components/MoreInfoDlg.d.ts +1 -0
  80. package/dist/components/MoreInfoDlg.js +5 -14
  81. package/dist/components/ResizeHandles.d.ts +1 -0
  82. package/dist/components/ResizeHandles.js +7 -6
  83. package/dist/components/Rubberband.js +46 -48
  84. package/dist/components/Ruler.d.ts +1 -0
  85. package/dist/components/Ruler.js +17 -26
  86. package/dist/components/SettingsDlg.d.ts +1 -0
  87. package/dist/components/SettingsDlg.js +24 -33
  88. package/dist/components/TextTrack.d.ts +1 -0
  89. package/dist/components/TextTrack.js +5 -17
  90. package/dist/components/Track.d.ts +1 -0
  91. package/dist/components/Track.js +24 -31
  92. package/dist/components/TrackInfoDlg.d.ts +1 -0
  93. package/dist/components/TrackInfoDlg.js +16 -23
  94. package/dist/components/TracklistDlg.d.ts +1 -0
  95. package/dist/components/TracklistDlg.js +12 -20
  96. package/dist/components/TreeCanvas.d.ts +1 -0
  97. package/dist/components/TreeCanvas.js +96 -84
  98. package/dist/components/TreeRuler.d.ts +1 -0
  99. package/dist/components/TreeRuler.js +2 -2
  100. package/dist/components/package.json +15 -10
  101. package/dist/model.d.ts +79 -6
  102. package/dist/model.js +25 -7
  103. package/package.json +15 -10
@@ -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,10 +1,11 @@
1
1
  {
2
- "version": "1.2.7",
2
+ "version": "1.2.11",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "files": [
7
- "dist"
7
+ "dist",
8
+ "bundle"
8
9
  ],
9
10
  "engines": {
10
11
  "node": ">=10"
@@ -15,14 +16,12 @@
15
16
  "prestart": "npm run clean",
16
17
  "prebuild": "npm run clean",
17
18
  "start": "yarn tsc --watch",
18
- "build": "yarn tsc",
19
- "size": "size-limit",
20
- "analyze": "size-limit --why",
19
+ "build": "yarn tsc && rollup -c",
21
20
  "preversion": "npm run build",
22
21
  "postversion": "git push --follow-tags"
23
22
  },
24
23
  "peerDependencies": {
25
- "@jbrowse/core": ">=1.3.0",
24
+ "@jbrowse/core": ">=1.5.1",
26
25
  "@material-ui/core": ">=4.12.2",
27
26
  "react": ">=16.8.0",
28
27
  "react-dom": ">=16.8.0"
@@ -30,21 +29,27 @@
30
29
  "name": "react-msaview",
31
30
  "author": "Colin",
32
31
  "devDependencies": {
33
- "@size-limit/preset-small-lib": "^4.10.1",
32
+ "@rollup/plugin-commonjs": "^21.0.1",
33
+ "@rollup/plugin-json": "^4.1.0",
34
+ "@rollup/plugin-node-resolve": "^13.0.6",
35
+ "@rollup/plugin-typescript": "^8.3.0",
34
36
  "@types/color": "^3.0.1",
35
37
  "@types/d3": "^6.7.0",
38
+ "@types/lodash": "^4.14.170",
36
39
  "@types/react": "^17.0.3",
37
40
  "@types/react-dom": "^17.0.2",
41
+ "concurrently": "^6.2.0",
38
42
  "eslint-config-react-app": "^6.0.0",
39
- "husky": "^5.1.3",
40
43
  "react": "^17.0.1",
41
44
  "react-dom": "^17.0.1",
42
- "size-limit": "^4.10.1",
45
+ "rollup": "^2.60.2",
46
+ "rollup-plugin-node-builtins": "^2.1.2",
47
+ "rollup-plugin-node-polyfills": "^0.2.1",
48
+ "rollup-plugin-polyfill-node": "^0.7.0",
43
49
  "tslib": "^2.1.0",
44
50
  "typescript": "^4.2.3"
45
51
  },
46
52
  "dependencies": {
47
- "@gmod/gff": "^1.1.2",
48
53
  "clustal-js": "^1.0.3",
49
54
  "color": "^3.1.3",
50
55
  "copy-to-clipboard": "^3.3.1",