@jbrowse/plugin-dotplot-view 2.6.2 → 2.7.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 (68) hide show
  1. package/dist/DotplotDisplay/components/DotplotDisplay.d.ts +3 -4
  2. package/dist/DotplotDisplay/components/DotplotDisplay.js +3 -3
  3. package/dist/DotplotDisplay/stateModelFactory.d.ts +4 -4
  4. package/dist/DotplotDisplay/stateModelFactory.js +3 -3
  5. package/dist/DotplotRenderer/DotplotRenderer.js +12 -4
  6. package/dist/DotplotRenderer/components/DotplotRendering.d.ts +2 -3
  7. package/dist/DotplotRenderer/components/DotplotRendering.js +3 -3
  8. package/dist/DotplotView/blockTypes.d.ts +1 -9
  9. package/dist/DotplotView/blockTypes.js +2 -15
  10. package/dist/DotplotView/components/Axes.js +37 -35
  11. package/dist/DotplotView/components/DotplotControls.d.ts +6 -0
  12. package/dist/DotplotView/components/DotplotControls.js +94 -0
  13. package/dist/DotplotView/components/DotplotTooltip.d.ts +0 -1
  14. package/dist/DotplotView/components/DotplotTooltip.js +1 -2
  15. package/dist/DotplotView/components/DotplotWarnings.d.ts +2 -2
  16. package/dist/DotplotView/components/DotplotWarnings.js +2 -1
  17. package/dist/DotplotView/components/Header.d.ts +2 -2
  18. package/dist/DotplotView/components/Header.js +5 -120
  19. package/dist/DotplotView/components/ImportCustomTrack.d.ts +1 -1
  20. package/dist/DotplotView/components/ImportCustomTrack.js +1 -1
  21. package/dist/DotplotView/components/ImportSyntenyTrackSelector.js +4 -1
  22. package/dist/DotplotView/components/PanButtons.d.ts +2 -2
  23. package/dist/DotplotView/components/PanButtons.js +2 -1
  24. package/dist/DotplotView/components/WarningDialog.d.ts +2 -2
  25. package/dist/DotplotView/components/WarningDialog.js +2 -1
  26. package/dist/DotplotView/components/util.js +2 -5
  27. package/dist/DotplotView/model.d.ts +74 -45
  28. package/dist/DotplotView/model.js +15 -4
  29. package/dist/DotplotView/svgcomponents/SVGBackground.js +2 -1
  30. package/dist/ServerSideRenderedBlockContent.d.ts +2 -2
  31. package/dist/ServerSideRenderedBlockContent.js +2 -1
  32. package/dist/ServerSideSyntenyRendering.d.ts +11 -16
  33. package/dist/ServerSideSyntenyRendering.js +3 -11
  34. package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +3 -4
  35. package/esm/DotplotDisplay/components/DotplotDisplay.js +3 -3
  36. package/esm/DotplotDisplay/stateModelFactory.d.ts +4 -4
  37. package/esm/DotplotDisplay/stateModelFactory.js +3 -3
  38. package/esm/DotplotRenderer/DotplotRenderer.js +12 -4
  39. package/esm/DotplotRenderer/components/DotplotRendering.d.ts +2 -3
  40. package/esm/DotplotRenderer/components/DotplotRendering.js +3 -3
  41. package/esm/DotplotView/blockTypes.d.ts +1 -9
  42. package/esm/DotplotView/blockTypes.js +2 -15
  43. package/esm/DotplotView/components/Axes.js +37 -35
  44. package/esm/DotplotView/components/DotplotControls.d.ts +6 -0
  45. package/esm/DotplotView/components/DotplotControls.js +89 -0
  46. package/esm/DotplotView/components/DotplotTooltip.d.ts +0 -1
  47. package/esm/DotplotView/components/DotplotTooltip.js +1 -1
  48. package/esm/DotplotView/components/DotplotView.js +1 -1
  49. package/esm/DotplotView/components/DotplotWarnings.d.ts +2 -2
  50. package/esm/DotplotView/components/DotplotWarnings.js +2 -1
  51. package/esm/DotplotView/components/Header.d.ts +2 -2
  52. package/esm/DotplotView/components/Header.js +5 -97
  53. package/esm/DotplotView/components/ImportCustomTrack.d.ts +1 -1
  54. package/esm/DotplotView/components/ImportCustomTrack.js +1 -1
  55. package/esm/DotplotView/components/ImportSyntenyTrackSelector.js +4 -1
  56. package/esm/DotplotView/components/PanButtons.d.ts +2 -2
  57. package/esm/DotplotView/components/PanButtons.js +2 -1
  58. package/esm/DotplotView/components/WarningDialog.d.ts +2 -2
  59. package/esm/DotplotView/components/WarningDialog.js +2 -1
  60. package/esm/DotplotView/components/util.js +2 -5
  61. package/esm/DotplotView/model.d.ts +74 -45
  62. package/esm/DotplotView/model.js +15 -4
  63. package/esm/DotplotView/svgcomponents/SVGBackground.js +2 -1
  64. package/esm/ServerSideRenderedBlockContent.d.ts +2 -2
  65. package/esm/ServerSideRenderedBlockContent.js +2 -1
  66. package/esm/ServerSideSyntenyRendering.d.ts +11 -16
  67. package/esm/ServerSideSyntenyRendering.js +4 -12
  68. package/package.json +3 -3
@@ -38,6 +38,20 @@ export const HorizontalAxisRaw = observer(function ({ model, }) {
38
38
  width,
39
39
  staticBlocks: hview.staticBlocks,
40
40
  };
41
+ const ticks = hticks
42
+ .map(tick => {
43
+ var _a;
44
+ return [
45
+ tick,
46
+ (_a = bpToPx({
47
+ refName: tick.refName,
48
+ coord: tick.base,
49
+ self: hviewSnap,
50
+ })) === null || _a === void 0 ? void 0 : _a.offsetPx,
51
+ ];
52
+ })
53
+ .filter(f => f[1] !== undefined)
54
+ .map(f => [f[0], f[1] - offsetPx]);
41
55
  return (React.createElement(React.Fragment, null,
42
56
  dblocks
43
57
  .filter(region => !hide.has(region.key))
@@ -47,24 +61,12 @@ export const HorizontalAxisRaw = observer(function ({ model, }) {
47
61
  const xoff = Math.floor(x - hview.offsetPx);
48
62
  return (React.createElement("text", { transform: `rotate(${htextRotation},${xoff},${y})`, key: JSON.stringify(region), x: xoff, y: y + 1, fill: theme.palette.text.primary, fontSize: 11, dominantBaseline: "hanging", textAnchor: "end" }, region.refName));
49
63
  }),
50
- hticks.map(tick => {
51
- var _a;
52
- const x = (((_a = bpToPx({
53
- refName: tick.refName,
54
- coord: tick.base,
55
- self: hviewSnap,
56
- })) === null || _a === void 0 ? void 0 : _a.offsetPx) || 0) - offsetPx;
57
- return (React.createElement("line", { key: `line-${JSON.stringify(tick)}`, x1: x, x2: x, y1: 0, y2: tick.type === 'major' ? 6 : 4, strokeWidth: 1, stroke: theme.palette.divider }));
64
+ ticks.map(([tick, x]) => {
65
+ return (React.createElement("line", { key: `line-${JSON.stringify(tick)}`, x1: x, x2: x, y1: 0, y2: tick.type === 'major' ? 6 : 4, strokeWidth: 1, stroke: theme.palette.grey[400] }));
58
66
  }),
59
- hticks
60
- .filter(tick => tick.type === 'major')
61
- .map(tick => {
62
- var _a;
63
- const x = (((_a = bpToPx({
64
- refName: tick.refName,
65
- coord: tick.base,
66
- self: hviewSnap,
67
- })) === null || _a === void 0 ? void 0 : _a.offsetPx) || 0) - offsetPx;
67
+ ticks
68
+ .filter(t => t[0].type === 'major')
69
+ .map(([tick, x]) => {
68
70
  const y = 0;
69
71
  return x > 10 ? (React.createElement("text", { x: x - 7, y: y, transform: `rotate(${htextRotation},${x},${y})`, key: `text-${JSON.stringify(tick)}`, fill: theme.palette.text.primary, fontSize: 11, dominantBaseline: "middle", textAnchor: "end" }, getTickDisplayStr(tick.base + 1, bpPerPx))) : null;
70
72
  }),
@@ -87,6 +89,20 @@ export const VerticalAxisRaw = observer(function ({ model, }) {
87
89
  width,
88
90
  staticBlocks: vview.staticBlocks,
89
91
  };
92
+ const ticks = vticks
93
+ .map(tick => {
94
+ var _a;
95
+ return [
96
+ tick,
97
+ (_a = bpToPx({
98
+ refName: tick.refName,
99
+ coord: tick.base,
100
+ self: vviewSnap,
101
+ })) === null || _a === void 0 ? void 0 : _a.offsetPx,
102
+ ];
103
+ })
104
+ .filter(f => f[1] !== undefined)
105
+ .map(f => [f[0], f[1] - offsetPx]);
90
106
  return (React.createElement(React.Fragment, null,
91
107
  dblocks
92
108
  .filter(region => !hide.has(region.key))
@@ -96,24 +112,10 @@ export const VerticalAxisRaw = observer(function ({ model, }) {
96
112
  const yoff = Math.floor(viewHeight - y + offsetPx);
97
113
  return (React.createElement("text", { transform: `rotate(${vtextRotation},${x},${y})`, key: JSON.stringify(region), x: x, y: yoff, fill: theme.palette.text.primary, fontSize: 11, textAnchor: "end" }, region.refName));
98
114
  }),
99
- vticks.map(tick => {
100
- var _a;
101
- const y = (((_a = bpToPx({
102
- refName: tick.refName,
103
- coord: tick.base,
104
- self: vviewSnap,
105
- })) === null || _a === void 0 ? void 0 : _a.offsetPx) || 0) - offsetPx;
106
- return (React.createElement("line", { key: `line-${JSON.stringify(tick)}`, y1: viewHeight - y, y2: viewHeight - y, x1: borderX, x2: borderX - (tick.type === 'major' ? 6 : 4), strokeWidth: 1, stroke: theme.palette.divider }));
107
- }),
108
- vticks
109
- .filter(tick => tick.type === 'major')
110
- .map(tick => {
111
- var _a;
112
- const y = (((_a = bpToPx({
113
- refName: tick.refName,
114
- coord: tick.base,
115
- self: vviewSnap,
116
- })) === null || _a === void 0 ? void 0 : _a.offsetPx) || 0) - offsetPx;
115
+ ticks.map(([tick, y]) => (React.createElement("line", { key: `line-${JSON.stringify(tick)}`, y1: viewHeight - y, y2: viewHeight - y, x1: borderX, x2: borderX - (tick.type === 'major' ? 6 : 4), strokeWidth: 1, stroke: theme.palette.grey[400] }))),
116
+ ticks
117
+ .filter(t => t[0].type === 'major')
118
+ .map(([tick, y]) => {
117
119
  return y > 10 ? (React.createElement("text", { y: viewHeight - y - 3, x: borderX - 7, key: `text-${JSON.stringify(tick)}`, textAnchor: "end", fill: theme.palette.text.primary, dominantBaseline: "hanging", fontSize: 11 }, getTickDisplayStr(tick.base + 1, bpPerPx))) : null;
118
120
  }),
119
121
  React.createElement("text", { y: (viewHeight - borderY) / 2, x: 12, fill: theme.palette.text.primary, transform: `rotate(-90,12,${(viewHeight - borderY) / 2})`, textAnchor: "middle", fontSize: 11 }, vview.assemblyNames.join(','))));
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { DotplotViewModel } from '../model';
3
+ declare const DotplotControls: ({ model, }: {
4
+ model: DotplotViewModel;
5
+ }) => React.JSX.Element;
6
+ export default DotplotControls;
@@ -0,0 +1,89 @@
1
+ import React from 'react';
2
+ import { IconButton } from '@mui/material';
3
+ import { observer } from 'mobx-react';
4
+ import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
5
+ // icons
6
+ import ZoomOut from '@mui/icons-material/ZoomOut';
7
+ import ZoomIn from '@mui/icons-material/ZoomIn';
8
+ import MoreVert from '@mui/icons-material/MoreVert';
9
+ import { CursorMouse, CursorMove } from './CursorIcon';
10
+ import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons';
11
+ const DotplotControls = observer(function ({ model, }) {
12
+ return (React.createElement("div", null,
13
+ React.createElement(IconButton, { onClick: model.zoomOutButton },
14
+ React.createElement(ZoomOut, null)),
15
+ React.createElement(IconButton, { onClick: model.zoomInButton },
16
+ React.createElement(ZoomIn, null)),
17
+ React.createElement(IconButton, { onClick: () => model.activateTrackSelector(), title: "Open track selector" },
18
+ React.createElement(TrackSelectorIcon, null)),
19
+ React.createElement(CascadingMenuButton, { menuItems: [
20
+ {
21
+ onClick: () => model.squareView(),
22
+ label: 'Square view - same base pairs per pixel',
23
+ },
24
+ {
25
+ onClick: () => model.squareViewProportional(),
26
+ label: 'Rectanglularize view - same total bp',
27
+ },
28
+ {
29
+ onClick: () => model.showAllRegions(),
30
+ label: 'Show all regions',
31
+ },
32
+ {
33
+ onClick: () => model.setDrawCigar(!model.drawCigar),
34
+ type: 'checkbox',
35
+ label: 'Draw CIGAR',
36
+ checked: model.drawCigar,
37
+ },
38
+ {
39
+ onClick: () => model.setShowPanButtons(!model.showPanButtons),
40
+ label: 'Show pan buttons',
41
+ type: 'checkbox',
42
+ checked: model.showPanButtons,
43
+ },
44
+ {
45
+ label: 'Click and drag mode',
46
+ subMenu: [
47
+ {
48
+ onClick: () => model.setCursorMode('move'),
49
+ label: 'Pan by default, select region when ctrl key is held',
50
+ icon: CursorMove,
51
+ type: 'radio',
52
+ checked: model.cursorMode === 'move',
53
+ },
54
+ {
55
+ onClick: () => model.setCursorMode('crosshair'),
56
+ label: 'Select region by default, pan when ctrl key is held',
57
+ icon: CursorMouse,
58
+ type: 'radio',
59
+ checked: model.cursorMode === 'crosshair',
60
+ },
61
+ ],
62
+ },
63
+ {
64
+ label: 'Wheel scroll mode',
65
+ subMenu: [
66
+ {
67
+ onClick: () => model.setWheelMode('pan'),
68
+ label: 'Pans view',
69
+ type: 'radio',
70
+ checked: model.wheelMode === 'pan',
71
+ },
72
+ {
73
+ onClick: () => model.setWheelMode('zoom'),
74
+ label: 'Zooms view',
75
+ type: 'radio',
76
+ checked: model.wheelMode === 'zoom',
77
+ },
78
+ {
79
+ onClick: () => model.setWheelMode('none'),
80
+ label: 'Disable',
81
+ type: 'radio',
82
+ checked: model.wheelMode === 'none',
83
+ },
84
+ ],
85
+ },
86
+ ] },
87
+ React.createElement(MoreVert, null))));
88
+ });
89
+ export default DotplotControls;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { DotplotViewModel } from '../model';
3
- export declare function round(value: number): number;
4
3
  type Coord = [number, number] | undefined;
5
4
  export declare const TooltipWhereMouseovered: ({ model, mouserect, mouserectClient, xdistance, ydistance, }: {
6
5
  model: DotplotViewModel;
@@ -4,7 +4,7 @@ import { makeStyles } from 'tss-react/mui';
4
4
  import { locstr } from './util';
5
5
  import { Portal, alpha } from '@mui/material';
6
6
  import { usePopper } from 'react-popper';
7
- export function round(value) {
7
+ function round(value) {
8
8
  return Math.round(value * 1e5) / 1e5;
9
9
  }
10
10
  const useStyles = makeStyles()(theme => ({
@@ -7,7 +7,7 @@ import normalizeWheel from 'normalize-wheel';
7
7
  import ImportForm from './ImportForm';
8
8
  import Header from './Header';
9
9
  import Grid from './Grid';
10
- import { HorizontalAxis, VerticalAxis } from './Axes';
10
+ import { VerticalAxis, HorizontalAxis } from './Axes';
11
11
  import { TooltipWhereClicked, TooltipWhereMouseovered } from './DotplotTooltip';
12
12
  const blank = { left: 0, top: 0, width: 0, height: 0 };
13
13
  const useStyles = makeStyles()(theme => ({
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { DotplotViewModel } from '../model';
3
- declare const _default: ({ model }: {
3
+ declare const DotplotWarnings: ({ model, }: {
4
4
  model: DotplotViewModel;
5
5
  }) => React.JSX.Element | null;
6
- export default _default;
6
+ export default DotplotWarnings;
@@ -3,7 +3,7 @@ import { Alert, Button } from '@mui/material';
3
3
  import { observer } from 'mobx-react';
4
4
  // lazy components
5
5
  const WarningDialog = lazy(() => import('./WarningDialog'));
6
- export default observer(function ({ model }) {
6
+ const DotplotWarnings = observer(function ({ model, }) {
7
7
  const trackWarnings = model.tracks.filter(t => { var _a; return (_a = t.displays[0].warnings) === null || _a === void 0 ? void 0 : _a.length; });
8
8
  const [shown, setShown] = useState(false);
9
9
  return trackWarnings.length ? (React.createElement(Alert, { severity: "warning" },
@@ -12,3 +12,4 @@ export default observer(function ({ model }) {
12
12
  React.createElement(Button, { onClick: () => setShown(true) }, "More info"),
13
13
  shown ? (React.createElement(WarningDialog, { trackWarnings: trackWarnings, handleClose: () => setShown(false) })) : null)) : null;
14
14
  });
15
+ export default DotplotWarnings;
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import { DotplotViewModel } from '../model';
3
- declare const _default: ({ model, selection, }: {
3
+ declare const DotplotHeader: ({ model, selection, }: {
4
4
  model: DotplotViewModel;
5
5
  selection?: {
6
6
  width: number;
7
7
  height: number;
8
8
  } | undefined;
9
9
  }) => React.JSX.Element;
10
- export default _default;
10
+ export default DotplotHeader;
@@ -1,21 +1,12 @@
1
- import React, { useState } from 'react';
2
- import { IconButton, Typography } from '@mui/material';
1
+ import React from 'react';
2
+ import { Typography } from '@mui/material';
3
3
  import { observer } from 'mobx-react';
4
4
  import { makeStyles } from 'tss-react/mui';
5
5
  import { getBpDisplayStr } from '@jbrowse/core/util';
6
- import { Menu } from '@jbrowse/core/ui';
7
- // icons
8
- import ZoomOut from '@mui/icons-material/ZoomOut';
9
- import ZoomIn from '@mui/icons-material/ZoomIn';
10
- import MoreVert from '@mui/icons-material/MoreVert';
11
- import { CursorMouse, CursorMove } from './CursorIcon';
12
- import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons';
13
6
  import DotplotWarnings from './DotplotWarnings';
14
7
  import PanButtons from './PanButtons';
8
+ import DotplotControls from './DotplotControls';
15
9
  const useStyles = makeStyles()({
16
- iconButton: {
17
- margin: 5,
18
- },
19
10
  bp: {
20
11
  display: 'flex',
21
12
  alignItems: 'center',
@@ -29,91 +20,7 @@ const useStyles = makeStyles()({
29
20
  position: 'relative',
30
21
  },
31
22
  });
32
- const DotplotControls = observer(({ model }) => {
33
- const { classes } = useStyles();
34
- const [menuAnchorEl, setMenuAnchorEl] = useState();
35
- return (React.createElement("div", null,
36
- React.createElement(IconButton, { onClick: model.zoomOutButton, className: classes.iconButton },
37
- React.createElement(ZoomOut, null)),
38
- React.createElement(IconButton, { onClick: model.zoomInButton, className: classes.iconButton },
39
- React.createElement(ZoomIn, null)),
40
- React.createElement(IconButton, { onClick: () => model.activateTrackSelector(), className: classes.iconButton, title: "Open track selector", "data-testid": "circular_track_select" },
41
- React.createElement(TrackSelectorIcon, null)),
42
- React.createElement(IconButton, { onClick: event => setMenuAnchorEl(event.currentTarget), className: classes.iconButton },
43
- React.createElement(MoreVert, null)),
44
- menuAnchorEl ? (React.createElement(Menu, { anchorEl: menuAnchorEl, open: true, onMenuItemClick: (_event, callback) => {
45
- callback();
46
- setMenuAnchorEl(undefined);
47
- }, menuItems: [
48
- {
49
- onClick: () => model.squareView(),
50
- label: 'Square view - same base pairs per pixel',
51
- },
52
- {
53
- onClick: () => model.squareViewProportional(),
54
- label: 'Rectanglularize view - same total bp',
55
- },
56
- {
57
- onClick: () => model.showAllRegions(),
58
- label: 'Show all regions',
59
- },
60
- {
61
- onClick: () => model.setDrawCigar(!model.drawCigar),
62
- type: 'checkbox',
63
- label: 'Draw CIGAR',
64
- checked: model.drawCigar,
65
- },
66
- {
67
- onClick: () => model.setShowPanButtons(!model.showPanButtons),
68
- label: 'Show pan buttons',
69
- type: 'checkbox',
70
- checked: model.showPanButtons,
71
- },
72
- {
73
- label: 'Click and drag mode',
74
- subMenu: [
75
- {
76
- onClick: () => model.setCursorMode('move'),
77
- label: 'Pan by default, select region when ctrl key is held',
78
- icon: CursorMove,
79
- type: 'radio',
80
- checked: model.cursorMode === 'move',
81
- },
82
- {
83
- onClick: () => model.setCursorMode('crosshair'),
84
- label: 'Select region by default, pan when ctrl key is held',
85
- icon: CursorMouse,
86
- type: 'radio',
87
- checked: model.cursorMode === 'crosshair',
88
- },
89
- ],
90
- },
91
- {
92
- label: 'Wheel scroll mode',
93
- subMenu: [
94
- {
95
- onClick: () => model.setWheelMode('pan'),
96
- label: 'Pans view',
97
- type: 'radio',
98
- checked: model.wheelMode === 'pan',
99
- },
100
- {
101
- onClick: () => model.setWheelMode('zoom'),
102
- label: 'Zooms view',
103
- type: 'radio',
104
- checked: model.wheelMode === 'zoom',
105
- },
106
- {
107
- onClick: () => model.setWheelMode('none'),
108
- label: 'Disable',
109
- type: 'radio',
110
- checked: model.wheelMode === 'none',
111
- },
112
- ],
113
- },
114
- ], onClose: () => setMenuAnchorEl(undefined) })) : null));
115
- });
116
- export default observer(function Header({ model, selection, }) {
23
+ const DotplotHeader = observer(function ({ model, selection, }) {
117
24
  const { classes } = useStyles();
118
25
  const { hview, vview, showPanButtons } = model;
119
26
  return (React.createElement("div", { className: classes.headerBar },
@@ -137,3 +44,4 @@ export default observer(function Header({ model, selection, }) {
137
44
  React.createElement(DotplotWarnings, { model: model }),
138
45
  showPanButtons ? React.createElement(PanButtons, { model: model }) : null));
139
46
  });
47
+ export default DotplotHeader;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { SnapshotIn } from 'mobx-state-tree';
3
3
  import { AnyConfigurationModel } from '@jbrowse/core/configuration';
4
4
  type Conf = SnapshotIn<AnyConfigurationModel>;
5
- declare const OpenTrack: ({ sessionTrackData, assembly1, assembly2, setSessionTrackData, }: {
5
+ declare const OpenTrack: ({ assembly1, assembly2, setSessionTrackData, }: {
6
6
  sessionTrackData: Conf;
7
7
  assembly1: string;
8
8
  assembly2: string;
@@ -71,7 +71,7 @@ function getAdapter({ radioOption, assembly1, assembly2, fileLocation, bed1Locat
71
71
  throw new Error('Unknown type');
72
72
  }
73
73
  }
74
- const OpenTrack = observer(({ sessionTrackData, assembly1, assembly2, setSessionTrackData, }) => {
74
+ const OpenTrack = observer(({ assembly1, assembly2, setSessionTrackData, }) => {
75
75
  const [bed2Location, setBed2Location] = useState();
76
76
  const [bed1Location, setBed1Location] = useState();
77
77
  const [fileLocation, setFileLocation] = useState();
@@ -17,7 +17,10 @@ const Selector = observer(({ model, assembly1, assembly2, setShowTrackId, }) =>
17
17
  var _a;
18
18
  const session = getSession(model);
19
19
  const { tracks, sessionTracks } = session;
20
- const allTracks = [...tracks, ...sessionTracks];
20
+ const allTracks = [
21
+ ...tracks,
22
+ ...(sessionTracks || []),
23
+ ];
21
24
  const filteredTracks = allTracks.filter(t => f(t, assembly2, assembly1));
22
25
  const resetTrack = ((_a = filteredTracks[0]) === null || _a === void 0 ? void 0 : _a.trackId) || '';
23
26
  const [value, setValue] = useState(resetTrack);
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { DotplotViewModel } from '../model';
3
- declare const _default: ({ model, }: {
3
+ declare const PanButtons: ({ model, }: {
4
4
  model: DotplotViewModel;
5
5
  }) => React.JSX.Element;
6
- export default _default;
6
+ export default PanButtons;
@@ -24,7 +24,7 @@ const useStyles = makeStyles()({
24
24
  margin: 0,
25
25
  },
26
26
  });
27
- export default observer(function PanButtons({ model, }) {
27
+ const PanButtons = observer(function PanButtons({ model, }) {
28
28
  const { classes } = useStyles();
29
29
  return (React.createElement(Paper, { className: classes.dpad, elevation: 6 },
30
30
  React.createElement("div", null),
@@ -52,3 +52,4 @@ export default observer(function PanButtons({ model, }) {
52
52
  } },
53
53
  React.createElement(ZoomOut, null))));
54
54
  });
55
+ export default PanButtons;
@@ -9,8 +9,8 @@ interface TrackWarning {
9
9
  }[];
10
10
  }[];
11
11
  }
12
- declare const _default: ({ trackWarnings, handleClose, }: {
12
+ declare const WarningDialog: ({ trackWarnings, handleClose, }: {
13
13
  handleClose: () => void;
14
14
  trackWarnings: TrackWarning[];
15
15
  }) => React.JSX.Element;
16
- export default _default;
16
+ export default WarningDialog;
@@ -11,7 +11,7 @@ const useStyles = makeStyles()({
11
11
  minWidth: 600,
12
12
  },
13
13
  });
14
- export default observer(function WarningDialog({ trackWarnings, handleClose, }) {
14
+ const WarningDialog = observer(function WarningDialog({ trackWarnings, handleClose, }) {
15
15
  const { classes } = useStyles();
16
16
  const rows = [];
17
17
  for (let i = 0; i < trackWarnings.length; i++) {
@@ -33,3 +33,4 @@ export default observer(function WarningDialog({ trackWarnings, handleClose, })
33
33
  React.createElement("div", { style: { height: 600, width: '100%', overflow: 'auto' } },
34
34
  React.createElement(DataGrid, { rows: rows, columns: columns, disableRowSelectionOnClick: true, rowHeight: 25, disableColumnMenu: true })))));
35
35
  });
36
+ export default WarningDialog;
@@ -60,9 +60,7 @@ export function makeTicks(regions, bpPerPx, emitMajor = true, emitMinor = true)
60
60
  const ticks = [];
61
61
  const gridPitch = chooseGridPitch(bpPerPx, 60, 15);
62
62
  const iterPitch = gridPitch.minorPitch || gridPitch.majorPitch;
63
- for (let i = 0; i < regions.length; i++) {
64
- const region = regions[i];
65
- const { start, end, refName } = region;
63
+ for (const { start, end, refName } of regions) {
66
64
  let index = 0;
67
65
  const minBase = start;
68
66
  const maxBase = end;
@@ -71,8 +69,7 @@ export function makeTicks(regions, bpPerPx, emitMajor = true, emitMinor = true)
71
69
  ticks.push({ type: 'minor', base: base - 1, index, refName });
72
70
  index += 1;
73
71
  }
74
- else if (emitMajor &&
75
- Math.abs(base - region.start) > gridPitch.minorPitch) {
72
+ else if (emitMajor && Math.abs(base - start) > gridPitch.minorPitch) {
76
73
  ticks.push({ type: 'major', base: base - 1, index, refName });
77
74
  index += 1;
78
75
  }