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 { Button, Container, Grid, Typography, Link } from '@material-ui/core';
15
3
  import { observer } from 'mobx-react';
16
4
  import { transaction } from 'mobx';
@@ -18,72 +6,84 @@ import { FileSelector } from '@jbrowse/core/ui';
18
6
  import { smallTree, smallMSA, smallMSAOnly } from './data/seq2';
19
7
  var ListItem = function (_a) {
20
8
  var onClick = _a.onClick, model = _a.model, children = _a.children;
21
- return (_jsx("li", { children: _jsx(Link, __assign({ onClick: function () {
9
+ return (React.createElement("li", null,
10
+ React.createElement(Link, { onClick: function (event) {
22
11
  model.setError(undefined);
12
+ event.preventDefault();
23
13
  onClick();
24
- }, href: "#" }, { children: _jsx(Typography, { children: children }, void 0) }), void 0) }, void 0));
14
+ }, href: "#" },
15
+ React.createElement(Typography, null, children))));
25
16
  };
26
17
  export default observer(function (_a) {
27
18
  var model = _a.model;
28
19
  var _b = useState(), msaFile = _b[0], setMsaFile = _b[1];
29
20
  var _c = useState(), treeFile = _c[0], setTreeFile = _c[1];
30
21
  var error = model.error;
31
- return (_jsxs(Container, { children: [_jsxs("div", __assign({ style: { width: '50%' } }, { children: [error ? (_jsx("div", __assign({ style: { padding: 20 } }, { children: _jsxs(Typography, __assign({ color: "error" }, { children: ["Error: ", "" + error] }), void 0) }), void 0)) : null,
32
- _jsx(Typography, { children: "Open an MSA file (stockholm or clustal format) and/or a tree file (newick format)." }, void 0),
33
- _jsx(Typography, __assign({ color: "error" }, { children: "Note: you can open up just an MSA or just a tree, both are not required. Some MSA files e.g. stockholm format have an embedded tree also and this is fine, and opening a separate tree file is not required." }), void 0)] }), void 0),
34
- _jsxs(Grid, __assign({ container: true, spacing: 10, justifyContent: "center", alignItems: "center" }, { children: [_jsxs(Grid, __assign({ item: true }, { children: [_jsx(Typography, { children: "MSA file or URL" }, void 0),
35
- _jsx(FileSelector, { location: msaFile, setLocation: setMsaFile }, void 0),
36
- _jsx(Typography, { children: "Tree file or URL" }, void 0),
37
- _jsx(FileSelector, { location: treeFile, setLocation: setTreeFile }, void 0)] }), void 0),
38
- _jsx(Grid, __assign({ item: true }, { children: _jsx(Button, __assign({ onClick: function () {
39
- model.setError(undefined);
40
- if (msaFile) {
41
- model.setMSAFilehandle(msaFile);
42
- }
43
- if (treeFile) {
44
- model.setTreeFilehandle(treeFile);
45
- }
46
- }, variant: "contained", color: "primary", disabled: !msaFile && !treeFile }, { children: "Open" }), void 0) }), void 0),
47
- _jsxs(Grid, __assign({ item: true }, { children: [_jsx(Typography, { children: "Examples" }, void 0),
48
- _jsxs("ul", { children: [_jsx(ListItem, __assign({ model: model, onClick: function () {
49
- model.setTreeFilehandle({
50
- uri: 'https://jbrowse.org/genomes/newick_trees/sarscov2phylo.pub.ft.nh',
51
- });
52
- } }, { children: "230k COVID-19 samples (tree only)" }), void 0),
53
- _jsx(ListItem, __assign({ model: model, onClick: function () {
54
- model.setData({ msa: smallMSA, tree: smallTree });
55
- } }, { children: "Small protein MSA+tree" }), void 0),
56
- _jsx(ListItem, __assign({ model: model, onClick: function () {
57
- model.setData({ msa: smallMSAOnly });
58
- } }, { children: "Small MSA only" }), void 0),
59
- _jsx(ListItem, __assign({ model: model, onClick: function () {
60
- model.setMSAFilehandle({
61
- uri: 'https://ihh.github.io/abrowse/build/pfam-cov2.stock',
62
- });
63
- } }, { children: "PFAM SARS-CoV2 multi-stockholm" }), void 0),
64
- _jsx(ListItem, __assign({ model: model, onClick: function () {
65
- model.setMSAFilehandle({
66
- uri: 'https://jbrowse.org/genomes/multiple_sequence_alignments/Lysine.stock',
67
- });
68
- } }, { children: "Lysine stockholm file" }), void 0),
69
- _jsx(ListItem, __assign({ model: model, onClick: function () {
70
- model.setMSAFilehandle({
71
- uri: 'https://jbrowse.org/genomes/multiple_sequence_alignments/PF01601_full.txt',
72
- });
73
- } }, { children: "PF01601 stockholm file (SARS-CoV2 spike protein)" }), void 0),
74
- _jsx(ListItem, __assign({ model: model, onClick: function () {
75
- model.setMSAFilehandle({
76
- uri: 'https://jbrowse.org/genomes/multiple_sequence_alignments/europe_covid.fa',
77
- });
78
- } }, { children: "Europe COVID full genomes (LR883044.1 and 199 other sequences)" }), void 0),
79
- _jsx(ListItem, __assign({ model: model, onClick: function () {
80
- transaction(function () {
81
- model.setMSAFilehandle({
82
- uri: 'https://jbrowse.org/genomes/multiple_sequence_alignments/rhv_test-only.aligned_with_mafft_auto.fa',
83
- });
84
- model.setTreeFilehandle({
85
- uri: 'https://jbrowse.org/genomes/multiple_sequence_alignments/rhv_test-only.aligned_with_mafft_auto.nh',
86
- });
87
- });
88
- } }, { children: "MAFFT+VeryFastTree(17.9k samples)" }), void 0)] }, void 0)] }), void 0)] }), void 0)] }, void 0));
22
+ return (React.createElement(Container, null,
23
+ React.createElement("div", { style: { width: '50%' } },
24
+ error ? (React.createElement("div", { style: { padding: 20 } },
25
+ React.createElement(Typography, { color: "error" },
26
+ "Error: ", "" + error))) : null,
27
+ React.createElement(Typography, null, "Open an MSA file (stockholm or clustal format) and/or a tree file (newick format)."),
28
+ React.createElement(Typography, { color: "error" }, "Note: you can open up just an MSA or just a tree, both are not required. Some MSA files e.g. stockholm format have an embedded tree also and this is fine, and opening a separate tree file is not required.")),
29
+ React.createElement(Grid, { container: true, spacing: 10, justifyContent: "center", alignItems: "center" },
30
+ React.createElement(Grid, { item: true },
31
+ React.createElement(Typography, null, "MSA file or URL"),
32
+ React.createElement(FileSelector, { location: msaFile, setLocation: setMsaFile }),
33
+ React.createElement(Typography, null, "Tree file or URL"),
34
+ React.createElement(FileSelector, { location: treeFile, setLocation: setTreeFile })),
35
+ React.createElement(Grid, { item: true },
36
+ React.createElement(Button, { onClick: function () {
37
+ model.setError(undefined);
38
+ if (msaFile) {
39
+ model.setMSAFilehandle(msaFile);
40
+ }
41
+ if (treeFile) {
42
+ model.setTreeFilehandle(treeFile);
43
+ }
44
+ }, variant: "contained", color: "primary", disabled: !msaFile && !treeFile }, "Open")),
45
+ React.createElement(Grid, { item: true },
46
+ React.createElement(Typography, null, "Examples"),
47
+ React.createElement("ul", null,
48
+ React.createElement(ListItem, { model: model, onClick: function () {
49
+ model.setTreeFilehandle({
50
+ uri: 'https://jbrowse.org/genomes/newick_trees/sarscov2phylo.pub.ft.nh',
51
+ });
52
+ } }, "230k COVID-19 samples (tree only)"),
53
+ React.createElement(ListItem, { model: model, onClick: function () {
54
+ model.setData({ msa: smallMSA, tree: smallTree });
55
+ } }, "Small protein MSA+tree"),
56
+ React.createElement(ListItem, { model: model, onClick: function () {
57
+ model.setData({ msa: smallMSAOnly });
58
+ } }, "Small MSA only"),
59
+ React.createElement(ListItem, { model: model, onClick: function () {
60
+ model.setMSAFilehandle({
61
+ uri: 'https://ihh.github.io/abrowse/build/pfam-cov2.stock',
62
+ });
63
+ } }, "PFAM SARS-CoV2 multi-stockholm"),
64
+ React.createElement(ListItem, { model: model, onClick: function () {
65
+ model.setMSAFilehandle({
66
+ uri: 'https://jbrowse.org/genomes/multiple_sequence_alignments/Lysine.stock',
67
+ });
68
+ } }, "Lysine stockholm file"),
69
+ React.createElement(ListItem, { model: model, onClick: function () {
70
+ model.setMSAFilehandle({
71
+ uri: 'https://jbrowse.org/genomes/multiple_sequence_alignments/PF01601_full.txt',
72
+ });
73
+ } }, "PF01601 stockholm file (SARS-CoV2 spike protein)"),
74
+ React.createElement(ListItem, { model: model, onClick: function () {
75
+ model.setMSAFilehandle({
76
+ uri: 'https://jbrowse.org/genomes/multiple_sequence_alignments/europe_covid.fa',
77
+ });
78
+ } }, "Europe COVID full genomes (LR883044.1 and 199 other sequences)"),
79
+ React.createElement(ListItem, { model: model, onClick: function () {
80
+ transaction(function () {
81
+ model.setMSAFilehandle({
82
+ uri: 'https://jbrowse.org/genomes/multiple_sequence_alignments/rhv_test-only.aligned_with_mafft_auto.fa',
83
+ });
84
+ model.setTreeFilehandle({
85
+ uri: 'https://jbrowse.org/genomes/multiple_sequence_alignments/rhv_test-only.aligned_with_mafft_auto.nh',
86
+ });
87
+ });
88
+ } }, "MAFFT+VeryFastTree(17.9k samples)"))))));
89
89
  });
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { MsaViewModel } from '../model';
2
3
  declare const MSACanvas: ({ model }: {
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 { useEffect, useState, useRef, useMemo } from 'react';
1
+ import React, { useEffect, useState, useRef, useMemo } from 'react';
14
2
  import { Typography, CircularProgress, useTheme } from '@material-ui/core';
15
3
  import { observer } from 'mobx-react';
16
4
  import normalizeWheel from 'normalize-wheel';
@@ -97,7 +85,7 @@ var MSABlock = observer(function (_a) {
97
85
  offsetY,
98
86
  blockSize,
99
87
  ]);
100
- return (_jsx("canvas", { ref: ref, onMouseMove: function (event) {
88
+ return (React.createElement("canvas", { ref: ref, onMouseMove: function (event) {
101
89
  if (!ref.current) {
102
90
  return;
103
91
  }
@@ -111,7 +99,7 @@ var MSABlock = observer(function (_a) {
111
99
  left: scrollX + offsetX,
112
100
  width: blockSize,
113
101
  height: blockSize,
114
- } }, void 0));
102
+ } }));
115
103
  });
116
104
  var MSACanvas = observer(function (_a) {
117
105
  var model = _a.model;
@@ -190,7 +178,7 @@ var MSACanvas = observer(function (_a) {
190
178
  }
191
179
  return cleanup;
192
180
  }, [model, mouseDragging]);
193
- return (_jsx("div", __assign({ ref: ref, onMouseDown: function (event) {
181
+ return (React.createElement("div", { ref: ref, onMouseDown: function (event) {
194
182
  // check if clicking a draggable element or a resize handle
195
183
  var target = event.target;
196
184
  if (target.draggable || target.dataset.resizer) {
@@ -212,10 +200,11 @@ var MSACanvas = observer(function (_a) {
212
200
  height: height,
213
201
  width: msaAreaWidth,
214
202
  overflow: 'hidden',
215
- } }, { children: !MSA && !msaFilehandle ? null : !MSA ? (_jsxs("div", __assign({ style: { position: 'absolute', left: '50%', top: '50%' } }, { children: [_jsx(CircularProgress, {}, void 0),
216
- _jsx(Typography, { children: "Loading..." }, void 0)] }), void 0)) : (blocks2d.map(function (_a) {
217
- var bx = _a[0], by = _a[1];
218
- return (_jsx(MSABlock, { model: model, offsetX: bx, offsetY: by }, bx + "_" + by));
219
- })) }), void 0));
203
+ } }, !MSA && !msaFilehandle ? null : !MSA ? (React.createElement("div", { style: { position: 'absolute', left: '50%', top: '50%' } },
204
+ React.createElement(CircularProgress, null),
205
+ React.createElement(Typography, null, "Loading..."))) : (blocks2d.map(function (_a) {
206
+ var bx = _a[0], by = _a[1];
207
+ return (React.createElement(MSABlock, { key: bx + "_" + by, model: model, offsetX: bx, offsetY: by }));
208
+ }))));
220
209
  });
221
210
  export default MSACanvas;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { MsaViewModel } from '../model';
2
3
  declare const _default: ({ 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 } from "react/jsx-runtime";
13
- import { useRef, useEffect } from 'react';
12
+ import React, { useRef, useEffect } from 'react';
14
13
  import { observer } from 'mobx-react';
15
14
  import { Typography } from '@material-ui/core';
16
15
  import ImportForm from './ImportForm';
@@ -51,7 +50,7 @@ var MouseoverCanvas = observer(function (_a) {
51
50
  treeAreaWidth,
52
51
  width,
53
52
  ]);
54
- return (_jsx("canvas", { ref: ref, width: width, height: height, style: {
53
+ return (React.createElement("canvas", { ref: ref, width: width, height: height, style: {
55
54
  position: 'absolute',
56
55
  top: 0,
57
56
  left: 0,
@@ -59,22 +58,31 @@ var MouseoverCanvas = observer(function (_a) {
59
58
  height: height,
60
59
  zIndex: 1000,
61
60
  pointerEvents: 'none',
62
- } }, void 0));
61
+ } }));
63
62
  });
64
63
  export default observer(function (_a) {
65
64
  var model = _a.model;
66
65
  var done = model.done, initialized = model.initialized, treeAreaWidth = model.treeAreaWidth, height = model.height, resizeHandleWidth = model.resizeHandleWidth, turnedOnTracks = model.turnedOnTracks;
67
- return (_jsxs("div", { children: [!initialized ? (_jsx(ImportForm, { model: model }, void 0)) : !done ? (_jsx(Typography, __assign({ variant: "h4" }, { children: "Loading..." }), void 0)) : (_jsxs("div", { children: [_jsxs("div", __assign({ style: { height: height, overflow: 'hidden' } }, { children: [_jsx(Header, { model: model }, void 0),
68
- _jsx("div", { children: _jsxs("div", __assign({ style: { position: 'relative' } }, { children: [_jsxs("div", __assign({ style: { display: 'flex' } }, { children: [_jsx("div", __assign({ style: { flexShrink: 0, width: treeAreaWidth } }, { children: _jsx(TreeRuler, { model: model }, void 0) }), void 0),
69
- _jsx(Rubberband, { model: model, ControlComponent: _jsx(Ruler, { model: model }, void 0) }, void 0)] }), void 0),
70
- turnedOnTracks === null || turnedOnTracks === void 0 ? void 0 : turnedOnTracks.map(function (track) { return (_jsx(Track, { model: model, track: track }, track.model.id)); }),
71
- _jsxs("div", __assign({ style: { display: 'flex' } }, { children: [_jsx("div", __assign({ style: { flexShrink: 0, width: treeAreaWidth } }, { children: _jsx(TreeCanvas, { model: model }, void 0) }), void 0),
72
- _jsx(VerticalResizeHandle, { model: model }, void 0),
73
- _jsx(MSACanvas, { model: model }, void 0),
74
- _jsx(MouseoverCanvas, { model: model }, void 0)] }), void 0)] }), void 0) }, void 0)] }), void 0),
75
- _jsx(HorizontalResizeHandle, { model: model }, void 0)] }, void 0)),
76
- model.DialogComponent ? (_jsx(model.DialogComponent, __assign({}, (model.DialogProps || {}), { onClose: function () {
77
- model.setDialogComponent(undefined, undefined);
78
- } }), void 0)) : null,
79
- model.annotPos ? (_jsx(AnnotationDialog, { data: model.annotPos, model: model, onClose: function () { return model.clearAnnotPos(); } }, void 0)) : null] }, void 0));
66
+ return (React.createElement("div", null,
67
+ !initialized ? (React.createElement(ImportForm, { model: model })) : !done ? (React.createElement(Typography, { variant: "h4" }, "Loading...")) : (React.createElement("div", null,
68
+ React.createElement("div", { style: { height: height, overflow: 'hidden' } },
69
+ React.createElement(Header, { model: model }),
70
+ React.createElement("div", null,
71
+ React.createElement("div", { style: { position: 'relative' } },
72
+ React.createElement("div", { style: { display: 'flex' } },
73
+ React.createElement("div", { style: { flexShrink: 0, width: treeAreaWidth } },
74
+ React.createElement(TreeRuler, { model: model })),
75
+ React.createElement(Rubberband, { model: model, ControlComponent: React.createElement(Ruler, { model: model }) })), turnedOnTracks === null || turnedOnTracks === void 0 ? void 0 :
76
+ turnedOnTracks.map(function (track) { return (React.createElement(Track, { key: track.model.id, model: model, track: track })); }),
77
+ React.createElement("div", { style: { display: 'flex' } },
78
+ React.createElement("div", { style: { flexShrink: 0, width: treeAreaWidth } },
79
+ React.createElement(TreeCanvas, { model: model })),
80
+ React.createElement(VerticalResizeHandle, { model: model }),
81
+ React.createElement(MSACanvas, { model: model }),
82
+ React.createElement(MouseoverCanvas, { model: model }))))),
83
+ React.createElement(HorizontalResizeHandle, { model: model }))),
84
+ model.DialogComponent ? (React.createElement(model.DialogComponent, __assign({}, (model.DialogProps || {}), { onClose: function () {
85
+ model.setDialogComponent(undefined, undefined);
86
+ } }))) : null,
87
+ model.annotPos ? (React.createElement(AnnotationDialog, { data: model.annotPos, model: model, onClose: function () { return model.clearAnnotPos(); } })) : null));
80
88
  });
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: ({ info, onClose }: {
2
3
  info: any;
3
4
  onClose: () => void;
@@ -1,20 +1,11 @@
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 } from '@material-ui/core';
14
3
  import { observer } from 'mobx-react';
15
4
  import { Attributes } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail';
16
5
  export default observer(function (_a) {
17
6
  var info = _a.info, onClose = _a.onClose;
18
- return (_jsxs(Dialog, __assign({ onClose: function () { return onClose(); }, open: true }, { children: [_jsx(DialogTitle, { children: "Metadata" }, void 0),
19
- _jsx(DialogContent, { children: _jsx(Attributes, { attributes: info }, void 0) }, void 0)] }), void 0));
7
+ return (React.createElement(Dialog, { onClose: function () { return onClose(); }, open: true },
8
+ React.createElement(DialogTitle, null, "Metadata"),
9
+ React.createElement(DialogContent, null,
10
+ React.createElement(Attributes, { attributes: info }))));
20
11
  });
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { MsaViewModel } from '../model';
2
3
  export declare const VerticalResizeHandle: ({ model }: {
3
4
  model: MsaViewModel;
@@ -1,5 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useEffect, useRef, useState } from 'react';
1
+ import React, { useEffect, useRef, useState } from 'react';
3
2
  import { observer } from 'mobx-react';
4
3
  export var VerticalResizeHandle = observer(function (_a) {
5
4
  var model = _a.model;
@@ -46,13 +45,14 @@ export var VerticalResizeHandle = observer(function (_a) {
46
45
  }
47
46
  return function () { };
48
47
  }, [mouseDragging, model]);
49
- return (_jsx("div", { children: _jsx("div", { onMouseDown: function () { return setMouseDragging(true); }, style: {
48
+ return (React.createElement("div", null,
49
+ React.createElement("div", { onMouseDown: function () { return setMouseDragging(true); }, style: {
50
50
  cursor: 'ew-resize',
51
51
  height: '100%',
52
52
  width: resizeHandleWidth,
53
53
  background: "rgba(200,200,200)",
54
54
  position: 'relative',
55
- } }, void 0) }, void 0));
55
+ } })));
56
56
  });
57
57
  export var HorizontalResizeHandle = observer(function (_a) {
58
58
  var model = _a.model;
@@ -99,11 +99,12 @@ export var HorizontalResizeHandle = observer(function (_a) {
99
99
  }
100
100
  return function () { };
101
101
  }, [mouseDragging, model]);
102
- return (_jsx("div", { children: _jsx("div", { onMouseDown: function () { return setMouseDragging(true); }, style: {
102
+ return (React.createElement("div", null,
103
+ React.createElement("div", { onMouseDown: function () { return setMouseDragging(true); }, style: {
103
104
  cursor: 'ns-resize',
104
105
  width: '100%',
105
106
  height: resizeHandleWidth,
106
107
  background: "rgba(200,200,200)",
107
108
  position: 'relative',
108
- } }, void 0) }, void 0));
109
+ } })));
109
110
  });
@@ -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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { useRef, useEffect, useState } from 'react';
1
+ import React, { useRef, useEffect, useState } from 'react';
14
2
  import { observer } from 'mobx-react';
15
3
  // material ui
16
4
  import { Popover, Tooltip, Typography, makeStyles, alpha, } from '@material-ui/core';
@@ -61,18 +49,20 @@ var VerticalGuide = observer(function (_a) {
61
49
  var model = _a.model, coordX = _a.coordX;
62
50
  var treeAreaWidth = model.treeAreaWidth;
63
51
  var classes = useStyles();
64
- return (_jsxs(_Fragment, { children: [_jsx(Tooltip, __assign({ open: true, placement: "top", title: "" + (model.pxToBp(coordX) + 1), arrow: true }, { children: _jsx("div", { style: {
65
- left: coordX + treeAreaWidth,
66
- position: 'absolute',
67
- height: 1,
68
- } }, void 0) }), void 0),
69
- _jsx("div", { className: classes.guide, style: {
52
+ return (React.createElement(React.Fragment, null,
53
+ React.createElement(Tooltip, { open: true, placement: "top", title: "" + (model.pxToBp(coordX) + 1), arrow: true },
54
+ React.createElement("div", { style: {
70
55
  left: coordX + treeAreaWidth,
71
- background: 'red',
72
- } }, void 0)] }, void 0));
56
+ position: 'absolute',
57
+ height: 1,
58
+ } })),
59
+ React.createElement("div", { className: classes.guide, style: {
60
+ left: coordX + treeAreaWidth,
61
+ background: 'red',
62
+ } })));
73
63
  });
74
64
  function Rubberband(_a) {
75
- var model = _a.model, _b = _a.ControlComponent, ControlComponent = _b === void 0 ? _jsx("div", {}, void 0) : _b;
65
+ var model = _a.model, _b = _a.ControlComponent, ControlComponent = _b === void 0 ? React.createElement("div", null) : _b;
76
66
  var treeAreaWidth = model.treeAreaWidth;
77
67
  var _c = useState(), startX = _c[0], setStartX = _c[1];
78
68
  var _d = useState(), currentX = _d[0], setCurrentX = _d[1];
@@ -151,8 +141,9 @@ function Rubberband(_a) {
151
141
  handleClose();
152
142
  }
153
143
  if (startX === undefined) {
154
- return (_jsxs(_Fragment, { children: [guideX !== undefined ? (_jsx(VerticalGuide, { model: model, coordX: guideX }, void 0)) : null,
155
- _jsx("div", __assign({ "data-testid": "rubberband_controls", className: classes.rubberbandControl, role: "presentation", ref: controlsRef, onMouseDown: mouseDown, onMouseOut: mouseOut, onMouseMove: mouseMove }, { children: ControlComponent }), void 0)] }, void 0));
144
+ return (React.createElement(React.Fragment, null,
145
+ guideX !== undefined ? (React.createElement(VerticalGuide, { model: model, coordX: guideX })) : null,
146
+ React.createElement("div", { "data-testid": "rubberband_controls", className: classes.rubberbandControl, role: "presentation", ref: controlsRef, onMouseDown: mouseDown, onMouseOut: mouseOut, onMouseMove: mouseMove }, ControlComponent)));
156
147
  }
157
148
  var right = anchorPosition ? anchorPosition.offsetX : currentX || 0;
158
149
  var left = right < startX ? right : startX;
@@ -170,29 +161,36 @@ function Rubberband(_a) {
170
161
  },
171
162
  },
172
163
  ];
173
- return (_jsxs(_Fragment, { children: [rubberbandRef.current ? (_jsxs(_Fragment, { children: [_jsx(Popover, __assign({ className: classes.popover, classes: {
174
- paper: classes.paper,
175
- }, open: true, anchorEl: rubberbandRef.current, anchorOrigin: {
176
- vertical: 'top',
177
- horizontal: 'left',
178
- }, transformOrigin: {
179
- vertical: 'bottom',
180
- horizontal: 'right',
181
- }, keepMounted: true, disableRestoreFocus: true }, { children: _jsx(Typography, { children: leftBpOffset + 1 }, void 0) }), void 0),
182
- _jsx(Popover, __assign({ className: classes.popover, classes: {
183
- paper: classes.paper,
184
- }, open: true, anchorEl: rubberbandRef.current, anchorOrigin: {
185
- vertical: 'top',
186
- horizontal: 'right',
187
- }, transformOrigin: {
188
- vertical: 'bottom',
189
- horizontal: 'left',
190
- }, keepMounted: true, disableRestoreFocus: true }, { children: _jsx(Typography, { children: rightBpOffset + 1 }, void 0) }), void 0)] }, void 0)) : null,
191
- _jsx("div", __assign({ ref: rubberbandRef, className: classes.rubberband, style: { left: left + treeAreaWidth, width: width } }, { children: _jsxs(Typography, __assign({ variant: "h6", className: classes.rubberbandText }, { children: [numOfBpSelected.toLocaleString('en-US'), " bp"] }), void 0) }), void 0),
192
- _jsx("div", __assign({ "data-testid": "rubberband_controls", className: classes.rubberbandControl, role: "presentation", ref: controlsRef, onMouseDown: mouseDown, onMouseOut: mouseOut, onMouseMove: mouseMove }, { children: ControlComponent }), void 0),
193
- anchorPosition ? (_jsx(Menu, { anchorReference: "anchorPosition", anchorPosition: {
194
- left: anchorPosition.clientX,
195
- top: anchorPosition.clientY,
196
- }, onMenuItemClick: handleMenuItemClick, open: Boolean(anchorPosition), onClose: handleClose, menuItems: menuItems }, void 0)) : null] }, void 0));
164
+ return (React.createElement(React.Fragment, null,
165
+ rubberbandRef.current ? (React.createElement(React.Fragment, null,
166
+ React.createElement(Popover, { className: classes.popover, classes: {
167
+ paper: classes.paper,
168
+ }, open: true, anchorEl: rubberbandRef.current, anchorOrigin: {
169
+ vertical: 'top',
170
+ horizontal: 'left',
171
+ }, transformOrigin: {
172
+ vertical: 'bottom',
173
+ horizontal: 'right',
174
+ }, keepMounted: true, disableRestoreFocus: true },
175
+ React.createElement(Typography, null, leftBpOffset + 1)),
176
+ React.createElement(Popover, { className: classes.popover, classes: {
177
+ paper: classes.paper,
178
+ }, open: true, anchorEl: rubberbandRef.current, anchorOrigin: {
179
+ vertical: 'top',
180
+ horizontal: 'right',
181
+ }, transformOrigin: {
182
+ vertical: 'bottom',
183
+ horizontal: 'left',
184
+ }, keepMounted: true, disableRestoreFocus: true },
185
+ React.createElement(Typography, null, rightBpOffset + 1)))) : null,
186
+ React.createElement("div", { ref: rubberbandRef, className: classes.rubberband, style: { left: left + treeAreaWidth, width: width } },
187
+ React.createElement(Typography, { variant: "h6", className: classes.rubberbandText },
188
+ numOfBpSelected.toLocaleString('en-US'),
189
+ " bp")),
190
+ React.createElement("div", { "data-testid": "rubberband_controls", className: classes.rubberbandControl, role: "presentation", ref: controlsRef, onMouseDown: mouseDown, onMouseOut: mouseOut, onMouseMove: mouseMove }, ControlComponent),
191
+ anchorPosition ? (React.createElement(Menu, { anchorReference: "anchorPosition", anchorPosition: {
192
+ left: anchorPosition.clientX,
193
+ top: anchorPosition.clientY,
194
+ }, onMenuItemClick: handleMenuItemClick, open: Boolean(anchorPosition), onClose: handleClose, menuItems: menuItems })) : null));
197
195
  }
198
196
  export default observer(Rubberband);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { MsaViewModel } from '../model';
2
3
  /**
3
4
  * Given a scale ( bp/px ) and minimum distances (px) between major and minor
@@ -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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { useRef } from 'react';
1
+ import React, { useRef } from 'react';
14
2
  import { makeStyles } from '@material-ui/core';
15
3
  import { observer } from 'mobx-react';
16
4
  /**
@@ -97,34 +85,37 @@ function RulerBlock(_a) {
97
85
  var start = _a.start, end = _a.end, bpPerPx = _a.bpPerPx, reversed = _a.reversed, major = _a.major, minor = _a.minor;
98
86
  var classes = useStyles();
99
87
  var ticks = makeTicks(start, end, bpPerPx, major, minor);
100
- return (_jsxs(_Fragment, { children: [ticks.map(function (tick) {
101
- var x = (reversed ? end - tick.base : tick.base - start) / bpPerPx;
102
- return (_jsx("line", { x1: x, x2: x, y1: 11, y2: tick.type === 'major' ? 11 + 6 : 11 + 4, strokeWidth: 1, stroke: tick.type === 'major' ? '#555' : '#999', className: tick.type === 'major' ? classes.majorTick : classes.minorTick, "data-bp": tick.base }, tick.base));
103
- }),
104
- ticks
105
- .filter(function (tick) { return tick.type === 'major'; })
106
- .map(function (tick) {
107
- var x = (reversed ? end - tick.base : tick.base - start) / bpPerPx;
108
- return (_jsx("text", __assign({ x: x, y: 10, textAnchor: "middle", style: { fontSize: '11px' }, className: classes.majorTickLabel }, { children: mathPower(tick.base + 1) }), "label-" + tick.base));
109
- })] }, void 0));
88
+ return (React.createElement(React.Fragment, null,
89
+ ticks.map(function (tick) {
90
+ var x = (reversed ? end - tick.base : tick.base - start) / bpPerPx;
91
+ return (React.createElement("line", { key: tick.base, x1: x, x2: x, y1: 11, y2: tick.type === 'major' ? 11 + 6 : 11 + 4, strokeWidth: 1, stroke: tick.type === 'major' ? '#555' : '#999', className: tick.type === 'major' ? classes.majorTick : classes.minorTick, "data-bp": tick.base }));
92
+ }),
93
+ ticks
94
+ .filter(function (tick) { return tick.type === 'major'; })
95
+ .map(function (tick) {
96
+ var x = (reversed ? end - tick.base : tick.base - start) / bpPerPx;
97
+ return (React.createElement("text", { x: x, y: 10, key: "label-" + tick.base, textAnchor: "middle", style: { fontSize: '11px' }, className: classes.majorTickLabel }, mathPower(tick.base + 1)));
98
+ })));
110
99
  }
111
100
  var Ruler = observer(function (_a) {
112
101
  var model = _a.model;
113
102
  var MSA = model.MSA, colWidth = model.colWidth, msaAreaWidth = model.msaAreaWidth, resizeHandleWidth = model.resizeHandleWidth, scrollX = model.scrollX, blocksX = model.blocksX, blockSize = model.blockSize;
114
103
  var ref = useRef(null);
115
104
  var offsetX = blocksX[0];
116
- return !MSA ? null : (_jsx("div", __assign({ ref: ref, style: {
105
+ return !MSA ? null : (React.createElement("div", { ref: ref, style: {
117
106
  position: 'relative',
118
107
  width: msaAreaWidth,
119
108
  cursor: 'crosshair',
120
109
  overflow: 'hidden',
121
110
  height: 20,
122
111
  background: '#ccc',
123
- } }, { children: _jsx("svg", __assign({ style: {
112
+ } },
113
+ React.createElement("svg", { style: {
124
114
  width: blocksX.length * blockSize,
125
115
  position: 'absolute',
126
116
  left: scrollX + offsetX + resizeHandleWidth,
127
117
  pointerEvents: 'none',
128
- } }, { children: _jsx(RulerBlock, { start: offsetX / colWidth, end: offsetX / colWidth + (blockSize * blocksX.length) / colWidth, bpPerPx: 1 / colWidth }, offsetX) }), void 0) }), void 0));
118
+ } },
119
+ React.createElement(RulerBlock, { key: offsetX, start: offsetX / colWidth, end: offsetX / colWidth + (blockSize * blocksX.length) / colWidth, bpPerPx: 1 / colWidth }))));
129
120
  });
130
121
  export default Ruler;
@@ -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;