@jbrowse/plugin-linear-genome-view 2.1.0 → 2.1.2

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 (119) hide show
  1. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +27 -54
  2. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -1
  3. package/dist/BaseLinearDisplay/components/Block.js +17 -28
  4. package/dist/BaseLinearDisplay/components/Block.js.map +1 -1
  5. package/dist/BaseLinearDisplay/components/LinearBlocks.js +19 -21
  6. package/dist/BaseLinearDisplay/components/LinearBlocks.js.map +1 -1
  7. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +27 -48
  8. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
  9. package/dist/BaseLinearDisplay/components/Tooltip.js +29 -58
  10. package/dist/BaseLinearDisplay/components/Tooltip.js.map +1 -1
  11. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +242 -363
  12. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
  13. package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +1 -1
  14. package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -1
  15. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +77 -129
  16. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
  17. package/dist/LinearBareDisplay/configSchema.js +2 -2
  18. package/dist/LinearBareDisplay/configSchema.js.map +1 -1
  19. package/dist/LinearBareDisplay/model.js +13 -19
  20. package/dist/LinearBareDisplay/model.js.map +1 -1
  21. package/dist/LinearBasicDisplay/components/SetMaxHeight.js +14 -31
  22. package/dist/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -1
  23. package/dist/LinearBasicDisplay/configSchema.js +3 -3
  24. package/dist/LinearBasicDisplay/configSchema.js.map +1 -1
  25. package/dist/LinearBasicDisplay/model.js +119 -147
  26. package/dist/LinearBasicDisplay/model.js.map +1 -1
  27. package/dist/LinearGenomeView/components/CenterLine.js +11 -12
  28. package/dist/LinearGenomeView/components/CenterLine.js.map +1 -1
  29. package/dist/LinearGenomeView/components/ExportSvgDialog.js +30 -96
  30. package/dist/LinearGenomeView/components/ExportSvgDialog.js.map +1 -1
  31. package/dist/LinearGenomeView/components/GetSequenceDialog.d.ts +9 -0
  32. package/dist/LinearGenomeView/components/GetSequenceDialog.js +172 -0
  33. package/dist/LinearGenomeView/components/GetSequenceDialog.js.map +1 -0
  34. package/dist/LinearGenomeView/components/Gridlines.js +18 -20
  35. package/dist/LinearGenomeView/components/Gridlines.js.map +1 -1
  36. package/dist/LinearGenomeView/components/Header.js +26 -31
  37. package/dist/LinearGenomeView/components/Header.js.map +1 -1
  38. package/dist/LinearGenomeView/components/HelpDialog.js +10 -11
  39. package/dist/LinearGenomeView/components/HelpDialog.js.map +1 -1
  40. package/dist/LinearGenomeView/components/ImportForm.js +91 -154
  41. package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
  42. package/dist/LinearGenomeView/components/LinearGenomeView.js +20 -21
  43. package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
  44. package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +86 -157
  45. package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -1
  46. package/dist/LinearGenomeView/components/MiniControls.js +16 -32
  47. package/dist/LinearGenomeView/components/MiniControls.js.map +1 -1
  48. package/dist/LinearGenomeView/components/OverviewRubberBand.d.ts +0 -11
  49. package/dist/LinearGenomeView/components/OverviewRubberBand.js +44 -76
  50. package/dist/LinearGenomeView/components/OverviewRubberBand.js.map +1 -1
  51. package/dist/LinearGenomeView/components/OverviewScaleBar.js +94 -117
  52. package/dist/LinearGenomeView/components/OverviewScaleBar.js.map +1 -1
  53. package/dist/LinearGenomeView/components/RefNameAutocomplete.js +90 -172
  54. package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
  55. package/dist/LinearGenomeView/components/RubberBand.js +51 -71
  56. package/dist/LinearGenomeView/components/RubberBand.js.map +1 -1
  57. package/dist/LinearGenomeView/components/Ruler.js +17 -18
  58. package/dist/LinearGenomeView/components/Ruler.js.map +1 -1
  59. package/dist/LinearGenomeView/components/ScaleBar.js +37 -58
  60. package/dist/LinearGenomeView/components/ScaleBar.js.map +1 -1
  61. package/dist/LinearGenomeView/components/SearchBox.js +69 -133
  62. package/dist/LinearGenomeView/components/SearchBox.js.map +1 -1
  63. package/dist/LinearGenomeView/components/SearchResultsDialog.js +32 -33
  64. package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
  65. package/dist/LinearGenomeView/components/{SequenceDialog.d.ts → SequenceSearchDialog.d.ts} +0 -0
  66. package/dist/LinearGenomeView/components/SequenceSearchDialog.js +104 -0
  67. package/dist/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -0
  68. package/dist/LinearGenomeView/components/TrackContainer.js +28 -30
  69. package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -1
  70. package/dist/LinearGenomeView/components/TrackLabel.js +37 -71
  71. package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -1
  72. package/dist/LinearGenomeView/components/TracksContainer.js +32 -49
  73. package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -1
  74. package/dist/LinearGenomeView/components/ZoomControls.js +15 -32
  75. package/dist/LinearGenomeView/components/ZoomControls.js.map +1 -1
  76. package/dist/LinearGenomeView/components/util.js +14 -87
  77. package/dist/LinearGenomeView/components/util.js.map +1 -1
  78. package/dist/LinearGenomeView/index.d.ts +3 -3
  79. package/dist/LinearGenomeView/index.js +380 -430
  80. package/dist/LinearGenomeView/index.js.map +1 -1
  81. package/dist/LinearGenomeView/util.js +17 -36
  82. package/dist/LinearGenomeView/util.js.map +1 -1
  83. package/dist/index.js +75 -146
  84. package/dist/index.js.map +1 -1
  85. package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +9 -0
  86. package/esm/LinearGenomeView/components/{SequenceDialog.js → GetSequenceDialog.js} +4 -7
  87. package/esm/LinearGenomeView/components/GetSequenceDialog.js.map +1 -0
  88. package/esm/LinearGenomeView/components/ImportForm.js +1 -0
  89. package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
  90. package/esm/LinearGenomeView/components/LinearGenomeView.js +2 -2
  91. package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
  92. package/esm/LinearGenomeView/components/OverviewRubberBand.d.ts +0 -11
  93. package/esm/LinearGenomeView/components/OverviewRubberBand.js +4 -12
  94. package/esm/LinearGenomeView/components/OverviewRubberBand.js.map +1 -1
  95. package/esm/LinearGenomeView/components/OverviewScaleBar.js +0 -2
  96. package/esm/LinearGenomeView/components/OverviewScaleBar.js.map +1 -1
  97. package/esm/LinearGenomeView/components/RubberBand.js +0 -1
  98. package/esm/LinearGenomeView/components/RubberBand.js.map +1 -1
  99. package/esm/LinearGenomeView/components/SearchBox.js.map +1 -1
  100. package/esm/LinearGenomeView/components/{SequenceDialog.d.ts → SequenceSearchDialog.d.ts} +0 -0
  101. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +76 -0
  102. package/esm/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -0
  103. package/esm/LinearGenomeView/index.d.ts +3 -3
  104. package/esm/LinearGenomeView/index.js +26 -19
  105. package/esm/LinearGenomeView/index.js.map +1 -1
  106. package/package.json +2 -3
  107. package/src/LinearGenomeView/components/{SequenceDialog.tsx → GetSequenceDialog.tsx} +4 -17
  108. package/src/LinearGenomeView/components/ImportForm.tsx +1 -0
  109. package/src/LinearGenomeView/components/LinearGenomeView.tsx +3 -3
  110. package/src/LinearGenomeView/components/OverviewRubberBand.tsx +5 -15
  111. package/src/LinearGenomeView/components/OverviewScaleBar.tsx +0 -2
  112. package/src/LinearGenomeView/components/RubberBand.tsx +0 -1
  113. package/src/LinearGenomeView/components/SearchBox.tsx +1 -1
  114. package/src/LinearGenomeView/components/SequenceSearchDialog.tsx +165 -0
  115. package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +14 -14
  116. package/src/LinearGenomeView/index.tsx +32 -25
  117. package/dist/LinearGenomeView/components/SequenceDialog.js +0 -242
  118. package/dist/LinearGenomeView/components/SequenceDialog.js.map +0 -1
  119. package/esm/LinearGenomeView/components/SequenceDialog.js.map +0 -1
@@ -1,131 +1,76 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- var __read = (this && this.__read) || function (o, n) {
50
- var m = typeof Symbol === "function" && o[Symbol.iterator];
51
- if (!m) return o;
52
- var i = m.call(o), r, ar = [], e;
53
- try {
54
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
55
- }
56
- catch (error) { e = { error: error }; }
57
- finally {
58
- try {
59
- if (r && !r.done && (m = i["return"])) m.call(i);
60
- }
61
- finally { if (e) throw e.error; }
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
62
7
  }
63
- return ar;
64
- };
65
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
66
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
67
- if (ar || !(i in from)) {
68
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
69
- ar[i] = from[i];
70
- }
71
- }
72
- return to.concat(ar || Array.prototype.slice.call(from));
73
- };
74
- var __values = (this && this.__values) || function(o) {
75
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
76
- if (m) return m.call(o);
77
- if (o && typeof o.length === "number") return {
78
- next: function () {
79
- if (o && i >= o.length) o = void 0;
80
- return { value: o && o[i++], done: !o };
81
- }
82
- };
83
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
84
24
  };
85
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
86
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
87
27
  };
88
28
  Object.defineProperty(exports, "__esModule", { value: true });
89
29
  exports.ReactComponent = exports.SearchBox = exports.RefNameAutocomplete = exports.renderToSvg = exports.stateModelFactory = exports.WIDGET_HEIGHT = exports.SPACING = exports.INTER_REGION_PADDING_WIDTH = exports.RESIZE_HANDLE_HEIGHT = exports.SCALE_BAR_HEIGHT = exports.HEADER_OVERVIEW_HEIGHT = exports.HEADER_BAR_HEIGHT = void 0;
90
- var configuration_1 = require("@jbrowse/core/configuration");
91
- var models_1 = require("@jbrowse/core/pluggableElementTypes/models");
92
- var mst_1 = require("@jbrowse/core/util/types/mst");
93
- var ui_1 = require("@jbrowse/core/ui");
94
- var util_1 = require("@jbrowse/core/util");
95
- var calculateDynamicBlocks_1 = __importDefault(require("@jbrowse/core/util/calculateDynamicBlocks"));
96
- var calculateStaticBlocks_1 = __importDefault(require("@jbrowse/core/util/calculateStaticBlocks"));
97
- var tracks_1 = require("@jbrowse/core/util/tracks");
98
- var mobx_1 = require("mobx");
99
- var mobx_state_tree_1 = require("mobx-state-tree");
100
- var Base1DViewModel_1 = __importDefault(require("@jbrowse/core/util/Base1DViewModel"));
101
- var Base1DUtils_1 = require("@jbrowse/core/util/Base1DUtils");
102
- var file_saver_1 = require("file-saver");
103
- var clone_1 = __importDefault(require("clone"));
30
+ const react_1 = require("react");
31
+ const configuration_1 = require("@jbrowse/core/configuration");
32
+ const models_1 = require("@jbrowse/core/pluggableElementTypes/models");
33
+ const mst_1 = require("@jbrowse/core/util/types/mst");
34
+ const ui_1 = require("@jbrowse/core/ui");
35
+ const util_1 = require("@jbrowse/core/util");
36
+ const calculateDynamicBlocks_1 = __importDefault(require("@jbrowse/core/util/calculateDynamicBlocks"));
37
+ const calculateStaticBlocks_1 = __importDefault(require("@jbrowse/core/util/calculateStaticBlocks"));
38
+ const tracks_1 = require("@jbrowse/core/util/tracks");
39
+ const mobx_1 = require("mobx");
40
+ const mobx_state_tree_1 = require("mobx-state-tree");
41
+ const Base1DViewModel_1 = __importDefault(require("@jbrowse/core/util/Base1DViewModel"));
42
+ const Base1DUtils_1 = require("@jbrowse/core/util/Base1DUtils");
43
+ const file_saver_1 = require("file-saver");
44
+ const clone_1 = __importDefault(require("clone"));
104
45
  // icons
105
- var Icons_1 = require("@jbrowse/core/ui/Icons");
106
- var SyncAlt_1 = __importDefault(require("@mui/icons-material/SyncAlt"));
107
- var Visibility_1 = __importDefault(require("@mui/icons-material/Visibility"));
108
- var Label_1 = __importDefault(require("@mui/icons-material/Label"));
109
- var FolderOpen_1 = __importDefault(require("@mui/icons-material/FolderOpen"));
110
- var PhotoCamera_1 = __importDefault(require("@mui/icons-material/PhotoCamera"));
111
- var ZoomIn_1 = __importDefault(require("@mui/icons-material/ZoomIn"));
112
- var MenuOpen_1 = __importDefault(require("@mui/icons-material/MenuOpen"));
46
+ const Icons_1 = require("@jbrowse/core/ui/Icons");
47
+ const SyncAlt_1 = __importDefault(require("@mui/icons-material/SyncAlt"));
48
+ const Visibility_1 = __importDefault(require("@mui/icons-material/Visibility"));
49
+ const Label_1 = __importDefault(require("@mui/icons-material/Label"));
50
+ const FolderOpen_1 = __importDefault(require("@mui/icons-material/FolderOpen"));
51
+ const PhotoCamera_1 = __importDefault(require("@mui/icons-material/PhotoCamera"));
52
+ const ZoomIn_1 = __importDefault(require("@mui/icons-material/ZoomIn"));
53
+ const MenuOpen_1 = __importDefault(require("@mui/icons-material/MenuOpen"));
113
54
  // locals
114
- var LinearGenomeViewSvg_1 = require("./components/LinearGenomeViewSvg");
55
+ const LinearGenomeViewSvg_1 = require("./components/LinearGenomeViewSvg");
115
56
  Object.defineProperty(exports, "renderToSvg", { enumerable: true, get: function () { return LinearGenomeViewSvg_1.renderToSvg; } });
116
- var RefNameAutocomplete_1 = __importDefault(require("./components/RefNameAutocomplete"));
57
+ const RefNameAutocomplete_1 = __importDefault(require("./components/RefNameAutocomplete"));
117
58
  exports.RefNameAutocomplete = RefNameAutocomplete_1.default;
118
- var SearchBox_1 = __importDefault(require("./components/SearchBox"));
59
+ const SearchBox_1 = __importDefault(require("./components/SearchBox"));
119
60
  exports.SearchBox = SearchBox_1.default;
120
- var ExportSvgDialog_1 = __importDefault(require("./components/ExportSvgDialog"));
61
+ const ExportSvgDialog_1 = __importDefault(require("./components/ExportSvgDialog"));
62
+ const SequenceSearchDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/SequenceSearchDialog'))));
121
63
  function calculateVisibleLocStrings(contentBlocks) {
122
64
  if (!contentBlocks.length) {
123
65
  return '';
124
66
  }
125
- var isSingleAssemblyName = contentBlocks.every(function (block) { return block.assemblyName === contentBlocks[0].assemblyName; });
126
- var locs = contentBlocks.map(function (block) {
127
- return (0, util_1.assembleLocString)(__assign(__assign({}, block), { start: Math.round(block.start), end: Math.round(block.end), assemblyName: isSingleAssemblyName ? undefined : block.assemblyName }));
128
- });
67
+ const isSingleAssemblyName = contentBlocks.every(block => block.assemblyName === contentBlocks[0].assemblyName);
68
+ const locs = contentBlocks.map(block => (0, util_1.assembleLocString)({
69
+ ...block,
70
+ start: Math.round(block.start),
71
+ end: Math.round(block.end),
72
+ assemblyName: isSingleAssemblyName ? undefined : block.assemblyName,
73
+ }));
129
74
  return locs.join(' ');
130
75
  }
131
76
  exports.HEADER_BAR_HEIGHT = 48;
@@ -155,18 +100,18 @@ function stateModelFactory(pluginManager) {
155
100
  hideHeaderOverview: false,
156
101
  hideNoTracksActive: false,
157
102
  trackSelectorType: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.enumeration(['hierarchical']), 'hierarchical'),
158
- trackLabels: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.string, function () { return localStorageGetItem('lgv-trackLabels') || 'overlapping'; }),
159
- showCenterLine: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.boolean, function () {
160
- var setting = localStorageGetItem('lgv-showCenterLine');
103
+ trackLabels: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.string, () => localStorageGetItem('lgv-trackLabels') || 'overlapping'),
104
+ showCenterLine: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.boolean, () => {
105
+ const setting = localStorageGetItem('lgv-showCenterLine');
161
106
  return setting !== undefined && setting !== null ? !!+setting : false;
162
107
  }),
163
- showCytobandsSetting: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.boolean, function () {
164
- var setting = localStorageGetItem('lgv-showCytobands');
108
+ showCytobandsSetting: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.boolean, () => {
109
+ const setting = localStorageGetItem('lgv-showCytobands');
165
110
  return setting !== undefined && setting !== null ? !!+setting : true;
166
111
  }),
167
112
  showGridlines: true,
168
113
  }))
169
- .volatile(function () { return ({
114
+ .volatile(() => ({
170
115
  volatileWidth: undefined,
171
116
  minimumBlockWidth: 3,
172
117
  draggingTrackId: undefined,
@@ -184,8 +129,8 @@ function stateModelFactory(pluginManager) {
184
129
  searchResults: undefined,
185
130
  searchQuery: undefined,
186
131
  seqDialogDisplayed: false,
187
- }); })
188
- .views(function (self) { return ({
132
+ }))
133
+ .views(self => ({
189
134
  get width() {
190
135
  if (self.volatileWidth === undefined) {
191
136
  throw new Error('width undefined, make sure to check for model.initialized');
@@ -196,22 +141,24 @@ function stateModelFactory(pluginManager) {
196
141
  return exports.INTER_REGION_PADDING_WIDTH;
197
142
  },
198
143
  get assemblyNames() {
199
- return __spreadArray([], __read(new Set(self.displayedRegions.map(function (region) { return region.assemblyName; }))), false);
144
+ return [
145
+ ...new Set(self.displayedRegions.map(region => region.assemblyName)),
146
+ ];
200
147
  },
201
- }); })
202
- .views(function (self) { return ({
148
+ }))
149
+ .views(self => ({
203
150
  get assemblyErrors() {
204
- var assemblyManager = (0, util_1.getSession)(self).assemblyManager;
205
- var assemblyNames = self.assemblyNames;
151
+ const { assemblyManager } = (0, util_1.getSession)(self);
152
+ const { assemblyNames } = self;
206
153
  return assemblyNames
207
- .map(function (a) { var _a; return (_a = assemblyManager.get(a)) === null || _a === void 0 ? void 0 : _a.error; })
208
- .filter(function (f) { return !!f; })
154
+ .map(a => { var _a; return (_a = assemblyManager.get(a)) === null || _a === void 0 ? void 0 : _a.error; })
155
+ .filter(f => !!f)
209
156
  .join(', ');
210
157
  },
211
158
  get assembliesInitialized() {
212
- var assemblyManager = (0, util_1.getSession)(self).assemblyManager;
213
- var assemblyNames = self.assemblyNames;
214
- return assemblyNames.every(function (a) { var _a; return (_a = assemblyManager.get(a)) === null || _a === void 0 ? void 0 : _a.initialized; });
159
+ const { assemblyManager } = (0, util_1.getSession)(self);
160
+ const { assemblyNames } = self;
161
+ return assemblyNames.every(a => { var _a; return (_a = assemblyManager.get(a)) === null || _a === void 0 ? void 0 : _a.initialized; });
215
162
  },
216
163
  get initialized() {
217
164
  return self.volatileWidth !== undefined && this.assembliesInitialized;
@@ -236,8 +183,8 @@ function stateModelFactory(pluginManager) {
236
183
  },
237
184
  get trackHeights() {
238
185
  return self.tracks
239
- .map(function (t) { return t.displays[0].height; })
240
- .reduce(function (a, b) { return a + b; }, 0);
186
+ .map(t => t.displays[0].height)
187
+ .reduce((a, b) => a + b, 0);
241
188
  },
242
189
  get trackHeightsWithResizeHandles() {
243
190
  return this.trackHeights + self.tracks.length * exports.RESIZE_HANDLE_HEIGHT;
@@ -248,7 +195,7 @@ function stateModelFactory(pluginManager) {
248
195
  this.scaleBarHeight);
249
196
  },
250
197
  get totalBp() {
251
- return self.displayedRegions.reduce(function (a, b) { return a + b.end - b.start; }, 0);
198
+ return self.displayedRegions.reduce((a, b) => a + b.end - b.start, 0);
252
199
  },
253
200
  get maxBpPerPx() {
254
201
  return this.totalBp / (self.width * 0.9);
@@ -261,34 +208,38 @@ function stateModelFactory(pluginManager) {
261
208
  },
262
209
  get maxOffset() {
263
210
  // objectively determined to keep the linear genome on the main screen
264
- var leftPadding = 10;
211
+ const leftPadding = 10;
265
212
  return this.displayedRegionsTotalPx - leftPadding;
266
213
  },
267
214
  get minOffset() {
268
215
  // objectively determined to keep the linear genome on the main screen
269
- var rightPadding = 30;
216
+ const rightPadding = 30;
270
217
  return -self.width + rightPadding;
271
218
  },
272
219
  get displayedRegionsTotalPx() {
273
220
  return this.totalBp / self.bpPerPx;
274
221
  },
275
- renderProps: function () {
276
- return __assign(__assign({}, (0, tracks_1.getParentRenderProps)(self)), { bpPerPx: self.bpPerPx, highResolutionScaling: (0, configuration_1.getConf)((0, util_1.getSession)(self), 'highResolutionScaling') });
222
+ renderProps() {
223
+ return {
224
+ ...(0, tracks_1.getParentRenderProps)(self),
225
+ bpPerPx: self.bpPerPx,
226
+ highResolutionScaling: (0, configuration_1.getConf)((0, util_1.getSession)(self), 'highResolutionScaling'),
227
+ };
277
228
  },
278
- searchScope: function (assemblyName) {
229
+ searchScope(assemblyName) {
279
230
  return {
280
- assemblyName: assemblyName,
231
+ assemblyName,
281
232
  includeAggregateIndexes: true,
282
233
  tracks: self.tracks,
283
234
  };
284
235
  },
285
- getTrack: function (id) {
286
- return self.tracks.find(function (t) { return t.configuration.trackId === id; });
236
+ getTrack(id) {
237
+ return self.tracks.find(t => t.configuration.trackId === id);
287
238
  },
288
- rankSearchResults: function (results) {
239
+ rankSearchResults(results) {
289
240
  // order of rank
290
- var openTrackIds = self.tracks.map(function (track) { return track.configuration.trackId; });
291
- results.forEach(function (result) {
241
+ const openTrackIds = self.tracks.map(track => track.configuration.trackId);
242
+ results.forEach(result => {
292
243
  if (openTrackIds.includes(result.trackId)) {
293
244
  result.updateScore(result.getScore() + 1);
294
245
  }
@@ -296,23 +247,18 @@ function stateModelFactory(pluginManager) {
296
247
  return results;
297
248
  },
298
249
  // modifies view menu action onClick to apply to all tracks of same type
299
- rewriteOnClicks: function (trackType, viewMenuActions) {
300
- var _this = this;
301
- viewMenuActions.forEach(function (action) {
250
+ rewriteOnClicks(trackType, viewMenuActions) {
251
+ viewMenuActions.forEach(action => {
302
252
  // go to lowest level menu
303
253
  if ('subMenu' in action) {
304
- _this.rewriteOnClicks(trackType, action.subMenu);
254
+ this.rewriteOnClicks(trackType, action.subMenu);
305
255
  }
306
256
  if ('onClick' in action) {
307
- var holdOnClick_1 = action.onClick;
308
- action.onClick = function () {
309
- var args = [];
310
- for (var _i = 0; _i < arguments.length; _i++) {
311
- args[_i] = arguments[_i];
312
- }
313
- self.tracks.forEach(function (track) {
257
+ const holdOnClick = action.onClick;
258
+ action.onClick = (...args) => {
259
+ self.tracks.forEach(track => {
314
260
  if (track.type === trackType) {
315
- holdOnClick_1.apply(track, __spreadArray([track], __read(args), false));
261
+ holdOnClick.apply(track, [track, ...args]);
316
262
  }
317
263
  });
318
264
  };
@@ -320,141 +266,145 @@ function stateModelFactory(pluginManager) {
320
266
  });
321
267
  },
322
268
  get trackTypeActions() {
323
- var _this = this;
324
- var allActions = new Map();
325
- self.tracks.forEach(function (track) {
326
- var trackInMap = allActions.get(track.type);
269
+ const allActions = new Map();
270
+ self.tracks.forEach(track => {
271
+ const trackInMap = allActions.get(track.type);
327
272
  if (!trackInMap) {
328
- var viewMenuActions = (0, clone_1.default)(track.viewMenuActions);
329
- _this.rewriteOnClicks(track.type, viewMenuActions);
273
+ const viewMenuActions = (0, clone_1.default)(track.viewMenuActions);
274
+ this.rewriteOnClicks(track.type, viewMenuActions);
330
275
  allActions.set(track.type, viewMenuActions);
331
276
  }
332
277
  });
333
278
  return allActions;
334
279
  },
335
- }); })
336
- .actions(function (self) { return ({
337
- setShowCytobands: function (flag) {
280
+ }))
281
+ .actions(self => ({
282
+ setShowCytobands(flag) {
338
283
  self.showCytobandsSetting = flag;
339
- localStorage.setItem('lgv-showCytobands', "".concat(+flag));
284
+ localStorage.setItem('lgv-showCytobands', `${+flag}`);
340
285
  },
341
- setWidth: function (newWidth) {
286
+ setWidth(newWidth) {
342
287
  self.volatileWidth = newWidth;
343
288
  },
344
- setError: function (error) {
289
+ setError(error) {
345
290
  self.volatileError = error;
346
291
  },
347
- toggleHeader: function () {
292
+ toggleHeader() {
348
293
  self.hideHeader = !self.hideHeader;
349
294
  },
350
- toggleHeaderOverview: function () {
295
+ toggleHeaderOverview() {
351
296
  self.hideHeaderOverview = !self.hideHeaderOverview;
352
297
  },
353
- toggleNoTracksActive: function () {
298
+ toggleNoTracksActive() {
354
299
  self.hideNoTracksActive = !self.hideNoTracksActive;
355
300
  },
356
- toggleShowGridlines: function () {
301
+ toggleShowGridlines() {
357
302
  self.showGridlines = !self.showGridlines;
358
303
  },
359
- scrollTo: function (offsetPx) {
360
- var newOffsetPx = (0, util_1.clamp)(offsetPx, self.minOffset, self.maxOffset);
304
+ scrollTo(offsetPx) {
305
+ const newOffsetPx = (0, util_1.clamp)(offsetPx, self.minOffset, self.maxOffset);
361
306
  self.offsetPx = newOffsetPx;
362
307
  return newOffsetPx;
363
308
  },
364
- zoomTo: function (bpPerPx) {
365
- var newBpPerPx = (0, util_1.clamp)(bpPerPx, self.minBpPerPx, self.maxBpPerPx);
309
+ zoomTo(bpPerPx) {
310
+ const newBpPerPx = (0, util_1.clamp)(bpPerPx, self.minBpPerPx, self.maxBpPerPx);
366
311
  if (newBpPerPx === self.bpPerPx) {
367
312
  return newBpPerPx;
368
313
  }
369
- var oldBpPerPx = self.bpPerPx;
314
+ const oldBpPerPx = self.bpPerPx;
370
315
  self.bpPerPx = newBpPerPx;
371
316
  if (Math.abs(oldBpPerPx - newBpPerPx) < 0.000001) {
372
317
  console.warn('zoomTo bpPerPx rounding error');
373
318
  return oldBpPerPx;
374
319
  }
375
320
  // tweak the offset so that the center of the view remains at the same coordinate
376
- var viewWidth = self.width;
321
+ const viewWidth = self.width;
377
322
  this.scrollTo(Math.round(((self.offsetPx + viewWidth / 2) * oldBpPerPx) / newBpPerPx -
378
323
  viewWidth / 2));
379
324
  return newBpPerPx;
380
325
  },
381
- setOffsets: function (left, right) {
326
+ setOffsets(left, right) {
382
327
  // sets offsets used in the get sequence dialog
383
328
  self.leftOffset = left;
384
329
  self.rightOffset = right;
385
330
  },
386
- setSearchResults: function (results, query) {
331
+ setSearchResults(results, query) {
387
332
  self.searchResults = results;
388
333
  self.searchQuery = query;
389
334
  },
390
- setSequenceDialogOpen: function (open) {
335
+ setGetSequenceDialogOpen(open) {
391
336
  self.seqDialogDisplayed = open;
392
337
  },
393
- setNewView: function (bpPerPx, offsetPx) {
338
+ setNewView(bpPerPx, offsetPx) {
394
339
  this.zoomTo(bpPerPx);
395
340
  this.scrollTo(offsetPx);
396
341
  },
397
- horizontallyFlip: function () {
342
+ horizontallyFlip() {
398
343
  self.displayedRegions = (0, mobx_state_tree_1.cast)(self.displayedRegions
399
344
  .slice()
400
345
  .reverse()
401
- .map(function (region) { return (__assign(__assign({}, region), { reversed: !region.reversed })); }));
346
+ .map(region => ({ ...region, reversed: !region.reversed })));
402
347
  this.scrollTo(self.totalBp / self.bpPerPx - self.offsetPx - self.width);
403
348
  },
404
- showTrack: function (trackId, initialSnapshot, displayInitialSnapshot) {
405
- if (initialSnapshot === void 0) { initialSnapshot = {}; }
406
- if (displayInitialSnapshot === void 0) { displayInitialSnapshot = {}; }
407
- var schema = pluginManager.pluggableConfigSchemaType('track');
408
- var conf = (0, mobx_state_tree_1.resolveIdentifier)(schema, (0, mobx_state_tree_1.getRoot)(self), trackId);
349
+ showTrack(trackId, initialSnapshot = {}, displayInitialSnapshot = {}) {
350
+ const schema = pluginManager.pluggableConfigSchemaType('track');
351
+ const conf = (0, mobx_state_tree_1.resolveIdentifier)(schema, (0, mobx_state_tree_1.getRoot)(self), trackId);
409
352
  if (!conf) {
410
- throw new Error("Could not resolve identifier \"".concat(trackId, "\""));
353
+ throw new Error(`Could not resolve identifier "${trackId}"`);
411
354
  }
412
- var trackType = pluginManager.getTrackType(conf === null || conf === void 0 ? void 0 : conf.type);
355
+ const trackType = pluginManager.getTrackType(conf === null || conf === void 0 ? void 0 : conf.type);
413
356
  if (!trackType) {
414
- throw new Error("Unknown track type ".concat(conf.type));
357
+ throw new Error(`Unknown track type ${conf.type}`);
415
358
  }
416
- var viewType = pluginManager.getViewType(self.type);
417
- var supportedDisplays = viewType.displayTypes.map(function (d) { return d.name; });
418
- var displayConf = conf.displays.find(function (d) {
419
- return supportedDisplays.includes(d.type);
420
- });
359
+ const viewType = pluginManager.getViewType(self.type);
360
+ const supportedDisplays = viewType.displayTypes.map(d => d.name);
361
+ const displayConf = conf.displays.find((d) => supportedDisplays.includes(d.type));
421
362
  if (!displayConf) {
422
- throw new Error("Could not find a compatible display for view type ".concat(self.type));
363
+ throw new Error(`Could not find a compatible display for view type ${self.type}`);
423
364
  }
424
- var t = self.tracks.filter(function (t) { return t.configuration === conf; });
365
+ const t = self.tracks.filter(t => t.configuration === conf);
425
366
  if (t.length === 0) {
426
- var track = trackType.stateModel.create(__assign(__assign({}, initialSnapshot), { type: conf.type, configuration: conf, displays: [
427
- __assign({ type: displayConf.type, configuration: displayConf }, displayInitialSnapshot),
428
- ] }));
367
+ const track = trackType.stateModel.create({
368
+ ...initialSnapshot,
369
+ type: conf.type,
370
+ configuration: conf,
371
+ displays: [
372
+ {
373
+ type: displayConf.type,
374
+ configuration: displayConf,
375
+ ...displayInitialSnapshot,
376
+ },
377
+ ],
378
+ });
429
379
  self.tracks.push(track);
430
380
  return track;
431
381
  }
432
382
  return t[0];
433
383
  },
434
- hideTrack: function (trackId) {
435
- var schema = pluginManager.pluggableConfigSchemaType('track');
436
- var conf = (0, mobx_state_tree_1.resolveIdentifier)(schema, (0, mobx_state_tree_1.getRoot)(self), trackId);
437
- var t = self.tracks.filter(function (t) { return t.configuration === conf; });
438
- (0, mobx_1.transaction)(function () { return t.forEach(function (t) { return self.tracks.remove(t); }); });
384
+ hideTrack(trackId) {
385
+ const schema = pluginManager.pluggableConfigSchemaType('track');
386
+ const conf = (0, mobx_state_tree_1.resolveIdentifier)(schema, (0, mobx_state_tree_1.getRoot)(self), trackId);
387
+ const t = self.tracks.filter(t => t.configuration === conf);
388
+ (0, mobx_1.transaction)(() => t.forEach(t => self.tracks.remove(t)));
439
389
  return t.length;
440
390
  },
441
- }); })
442
- .actions(function (self) { return ({
443
- moveTrack: function (movingId, targetId) {
444
- var oldIndex = self.tracks.findIndex(function (track) { return track.id === movingId; });
391
+ }))
392
+ .actions(self => ({
393
+ moveTrack(movingId, targetId) {
394
+ const oldIndex = self.tracks.findIndex(track => track.id === movingId);
445
395
  if (oldIndex === -1) {
446
- throw new Error("Track ID ".concat(movingId, " not found"));
396
+ throw new Error(`Track ID ${movingId} not found`);
447
397
  }
448
- var newIndex = self.tracks.findIndex(function (track) { return track.id === targetId; });
398
+ const newIndex = self.tracks.findIndex(track => track.id === targetId);
449
399
  if (newIndex === -1) {
450
- throw new Error("Track ID ".concat(targetId, " not found"));
400
+ throw new Error(`Track ID ${targetId} not found`);
451
401
  }
452
- var track = (0, mobx_state_tree_1.getSnapshot)(self.tracks[oldIndex]);
402
+ const track = (0, mobx_state_tree_1.getSnapshot)(self.tracks[oldIndex]);
453
403
  self.tracks.splice(oldIndex, 1);
454
404
  self.tracks.splice(newIndex, 0, track);
455
405
  },
456
- closeView: function () {
457
- var parent = (0, util_1.getContainingView)(self);
406
+ closeView() {
407
+ const parent = (0, util_1.getContainingView)(self);
458
408
  if (parent) {
459
409
  // I am embedded in a some other view
460
410
  if ((0, util_1.isViewContainer)(parent)) {
@@ -466,36 +416,36 @@ function stateModelFactory(pluginManager) {
466
416
  (0, util_1.getSession)(self).removeView(self);
467
417
  }
468
418
  },
469
- toggleTrack: function (trackId) {
419
+ toggleTrack(trackId) {
470
420
  // if we have any tracks with that configuration, turn them off
471
- var hiddenCount = self.hideTrack(trackId);
421
+ const hiddenCount = self.hideTrack(trackId);
472
422
  // if none had that configuration, turn one on
473
423
  if (!hiddenCount) {
474
424
  self.showTrack(trackId);
475
425
  }
476
426
  },
477
- setTrackLabels: function (setting) {
427
+ setTrackLabels(setting) {
478
428
  self.trackLabels = setting;
479
429
  localStorage.setItem('lgv-trackLabels', setting);
480
430
  },
481
- toggleCenterLine: function () {
431
+ toggleCenterLine() {
482
432
  self.showCenterLine = !self.showCenterLine;
483
- localStorage.setItem('lgv-showCenterLine', "".concat(+self.showCenterLine));
433
+ localStorage.setItem('lgv-showCenterLine', `${+self.showCenterLine}`);
484
434
  },
485
- setDisplayedRegions: function (regions) {
435
+ setDisplayedRegions(regions) {
486
436
  self.displayedRegions = (0, mobx_state_tree_1.cast)(regions);
487
437
  self.zoomTo(self.bpPerPx);
488
438
  },
489
- activateTrackSelector: function () {
439
+ activateTrackSelector() {
490
440
  if (self.trackSelectorType === 'hierarchical') {
491
- var session = (0, util_1.getSession)(self);
441
+ const session = (0, util_1.getSession)(self);
492
442
  if ((0, util_1.isSessionModelWithWidgets)(session)) {
493
- var selector = session.addWidget('HierarchicalTrackSelectorWidget', 'hierarchicalTrackSelector', { view: self });
443
+ const selector = session.addWidget('HierarchicalTrackSelectorWidget', 'hierarchicalTrackSelector', { view: self });
494
444
  session.showWidget(selector);
495
445
  return selector;
496
446
  }
497
447
  }
498
- throw new Error("invalid track selector type ".concat(self.trackSelectorType));
448
+ throw new Error(`invalid track selector type ${self.trackSelectorType}`);
499
449
  },
500
450
  /**
501
451
  * Helper method for the fetchSequence.
@@ -505,48 +455,56 @@ function stateModelFactory(pluginManager) {
505
455
  * @param rightOffset - `object as {start, end, index, offset}`, offset = end of user drag
506
456
  * @returns array of Region[]
507
457
  */
508
- getSelectedRegions: function (leftOffset, rightOffset) {
509
- var snap = (0, mobx_state_tree_1.getSnapshot)(self);
510
- var simView = Base1DViewModel_1.default.create(__assign(__assign({}, snap), { interRegionPaddingWidth: self.interRegionPaddingWidth }));
458
+ getSelectedRegions(leftOffset, rightOffset) {
459
+ const snap = (0, mobx_state_tree_1.getSnapshot)(self);
460
+ const simView = Base1DViewModel_1.default.create({
461
+ ...snap,
462
+ interRegionPaddingWidth: self.interRegionPaddingWidth,
463
+ });
511
464
  simView.setVolatileWidth(self.width);
512
465
  simView.moveTo(leftOffset, rightOffset);
513
- return simView.dynamicBlocks.contentBlocks.map(function (region) { return (__assign(__assign({}, region), { start: Math.floor(region.start), end: Math.ceil(region.end) })); });
466
+ return simView.dynamicBlocks.contentBlocks.map(region => ({
467
+ ...region,
468
+ start: Math.floor(region.start),
469
+ end: Math.ceil(region.end),
470
+ }));
514
471
  },
515
472
  // schedule something to be run after the next time displayedRegions is set
516
- afterDisplayedRegionsSet: function (cb) {
473
+ afterDisplayedRegionsSet(cb) {
517
474
  self.afterDisplayedRegionsSetCallbacks.push(cb);
518
475
  },
519
- horizontalScroll: function (distance) {
520
- var oldOffsetPx = self.offsetPx;
476
+ horizontalScroll(distance) {
477
+ const oldOffsetPx = self.offsetPx;
521
478
  // newOffsetPx is the actual offset after the scroll is clamped
522
- var newOffsetPx = self.scrollTo(self.offsetPx + distance);
479
+ const newOffsetPx = self.scrollTo(self.offsetPx + distance);
523
480
  return newOffsetPx - oldOffsetPx;
524
481
  },
525
- center: function () {
526
- var centerBp = self.totalBp / 2;
527
- var centerPx = centerBp / self.bpPerPx;
482
+ center() {
483
+ const centerBp = self.totalBp / 2;
484
+ const centerPx = centerBp / self.bpPerPx;
528
485
  self.scrollTo(Math.round(centerPx - self.width / 2));
529
486
  },
530
- showAllRegions: function () {
487
+ showAllRegions() {
531
488
  self.zoomTo(self.maxBpPerPx);
532
489
  this.center();
533
490
  },
534
- showAllRegionsInAssembly: function (assemblyName) {
535
- var _a;
536
- var session = (0, util_1.getSession)(self);
537
- var assemblyManager = session.assemblyManager;
491
+ showAllRegionsInAssembly(assemblyName) {
492
+ const session = (0, util_1.getSession)(self);
493
+ const { assemblyManager } = session;
538
494
  if (!assemblyName) {
539
- var assemblyNames = __spreadArray([], __read(new Set(self.displayedRegions.map(function (region) { return region.assemblyName; }))), false);
495
+ const assemblyNames = [
496
+ ...new Set(self.displayedRegions.map(region => region.assemblyName)),
497
+ ];
540
498
  if (assemblyNames.length > 1) {
541
- session.notify("Can't perform this with multiple assemblies currently");
499
+ session.notify(`Can't perform this with multiple assemblies currently`);
542
500
  return;
543
501
  }
544
502
  ;
545
- _a = __read(assemblyNames, 1), assemblyName = _a[0];
503
+ [assemblyName] = assemblyNames;
546
504
  }
547
- var assembly = assemblyManager.get(assemblyName);
505
+ const assembly = assemblyManager.get(assemblyName);
548
506
  if (assembly) {
549
- var regions = assembly.regions;
507
+ const { regions } = assembly;
550
508
  if (regions) {
551
509
  this.setDisplayedRegions(regions);
552
510
  self.zoomTo(self.maxBpPerPx);
@@ -554,25 +512,25 @@ function stateModelFactory(pluginManager) {
554
512
  }
555
513
  }
556
514
  },
557
- setDraggingTrackId: function (idx) {
515
+ setDraggingTrackId(idx) {
558
516
  self.draggingTrackId = idx;
559
517
  },
560
- setScaleFactor: function (factor) {
518
+ setScaleFactor(factor) {
561
519
  self.scaleFactor = factor;
562
520
  },
563
- }); })
564
- .actions(function (self) {
565
- var cancelLastAnimation = function () { };
521
+ }))
522
+ .actions(self => {
523
+ let cancelLastAnimation = () => { };
566
524
  function slide(viewWidths) {
567
- var _a = __read((0, util_1.springAnimate)(self.offsetPx, self.offsetPx + self.width * viewWidths, self.scrollTo), 2), animate = _a[0], cancelAnimation = _a[1];
525
+ const [animate, cancelAnimation] = (0, util_1.springAnimate)(self.offsetPx, self.offsetPx + self.width * viewWidths, self.scrollTo);
568
526
  cancelLastAnimation();
569
527
  cancelLastAnimation = cancelAnimation;
570
528
  animate();
571
529
  }
572
- return { slide: slide };
530
+ return { slide };
573
531
  })
574
- .actions(function (self) {
575
- var cancelLastAnimation = function () { };
532
+ .actions(self => {
533
+ let cancelLastAnimation = () => { };
576
534
  function zoom(targetBpPerPx) {
577
535
  self.zoomTo(self.bpPerPx);
578
536
  if (
@@ -582,18 +540,18 @@ function stateModelFactory(pluginManager) {
582
540
  (targetBpPerPx > self.bpPerPx && self.bpPerPx === self.maxBpPerPx)) {
583
541
  return;
584
542
  }
585
- var factor = self.bpPerPx / targetBpPerPx;
586
- var _a = __read((0, util_1.springAnimate)(1, factor, self.setScaleFactor, function () {
543
+ const factor = self.bpPerPx / targetBpPerPx;
544
+ const [animate, cancelAnimation] = (0, util_1.springAnimate)(1, factor, self.setScaleFactor, () => {
587
545
  self.zoomTo(targetBpPerPx);
588
546
  self.setScaleFactor(1);
589
- }), 2), animate = _a[0], cancelAnimation = _a[1];
547
+ });
590
548
  cancelLastAnimation();
591
549
  cancelLastAnimation = cancelAnimation;
592
550
  animate();
593
551
  }
594
- return { zoom: zoom };
552
+ return { zoom };
595
553
  })
596
- .views(function (self) { return ({
554
+ .views(self => ({
597
555
  get canShowCytobands() {
598
556
  return self.displayedRegions.length === 1 && this.anyCytobandsExist;
599
557
  },
@@ -601,39 +559,47 @@ function stateModelFactory(pluginManager) {
601
559
  return this.canShowCytobands && self.showCytobandsSetting;
602
560
  },
603
561
  get anyCytobandsExist() {
604
- var assemblyManager = (0, util_1.getSession)(self).assemblyManager;
605
- var assemblyNames = self.assemblyNames;
606
- return assemblyNames.some(function (asm) { var _a, _b; return (_b = (_a = assemblyManager.get(asm)) === null || _a === void 0 ? void 0 : _a.cytobands) === null || _b === void 0 ? void 0 : _b.length; });
562
+ const { assemblyManager } = (0, util_1.getSession)(self);
563
+ const { assemblyNames } = self;
564
+ return assemblyNames.some(asm => { var _a, _b; return (_b = (_a = assemblyManager.get(asm)) === null || _a === void 0 ? void 0 : _a.cytobands) === null || _b === void 0 ? void 0 : _b.length; });
607
565
  },
608
566
  get cytobandOffset() {
609
567
  return this.showCytobands
610
568
  ? (0, util_1.measureText)(self.displayedRegions[0].refName, 12) + 15
611
569
  : 0;
612
570
  },
613
- }); })
614
- .views(function (self) { return ({
615
- menuItems: function () {
616
- var e_1, _a;
617
- var canShowCytobands = self.canShowCytobands, showCytobands = self.showCytobands;
618
- var menuItems = __spreadArray([
571
+ }))
572
+ .views(self => ({
573
+ menuItems() {
574
+ const { canShowCytobands, showCytobands } = self;
575
+ const menuItems = [
619
576
  {
620
577
  label: 'Return to import form',
621
- onClick: function () {
622
- (0, util_1.getSession)(self).queueDialog(function (handleClose) { return [
578
+ onClick: () => {
579
+ (0, util_1.getSession)(self).queueDialog(handleClose => [
623
580
  ui_1.ReturnToImportFormDialog,
624
- { model: self, handleClose: handleClose },
625
- ]; });
581
+ { model: self, handleClose },
582
+ ]);
626
583
  },
627
584
  icon: FolderOpen_1.default,
628
585
  },
586
+ {
587
+ label: 'Sequence search',
588
+ onClick: () => {
589
+ (0, util_1.getSession)(self).queueDialog(handleClose => [
590
+ SequenceSearchDialog,
591
+ { model: self, handleClose },
592
+ ]);
593
+ },
594
+ },
629
595
  {
630
596
  label: 'Export SVG',
631
597
  icon: PhotoCamera_1.default,
632
- onClick: function () {
633
- (0, util_1.getSession)(self).queueDialog(function (handleClose) { return [
598
+ onClick: () => {
599
+ (0, util_1.getSession)(self).queueDialog(handleClose => [
634
600
  ExportSvgDialog_1.default,
635
- { model: self, handleClose: handleClose },
636
- ]; });
601
+ { model: self, handleClose },
602
+ ]);
637
603
  },
638
604
  },
639
605
  {
@@ -682,12 +648,23 @@ function stateModelFactory(pluginManager) {
682
648
  onClick: self.toggleNoTracksActive,
683
649
  },
684
650
  {
685
- label: 'Show gridlines',
651
+ label: 'Show guidelines',
686
652
  icon: Visibility_1.default,
687
653
  type: 'checkbox',
688
654
  checked: self.showGridlines,
689
655
  onClick: self.toggleShowGridlines,
690
656
  },
657
+ ...(canShowCytobands
658
+ ? [
659
+ {
660
+ label: 'Show ideogram',
661
+ icon: Visibility_1.default,
662
+ type: 'checkbox',
663
+ checked: self.showCytobands,
664
+ onClick: () => self.setShowCytobands(!showCytobands),
665
+ },
666
+ ]
667
+ : []),
691
668
  {
692
669
  label: 'Track labels',
693
670
  icon: Label_1.default,
@@ -697,63 +674,42 @@ function stateModelFactory(pluginManager) {
697
674
  icon: Visibility_1.default,
698
675
  type: 'radio',
699
676
  checked: self.trackLabels === 'overlapping',
700
- onClick: function () { return self.setTrackLabels('overlapping'); },
677
+ onClick: () => self.setTrackLabels('overlapping'),
701
678
  },
702
679
  {
703
680
  label: 'Offset',
704
681
  icon: Visibility_1.default,
705
682
  type: 'radio',
706
683
  checked: self.trackLabels === 'offset',
707
- onClick: function () { return self.setTrackLabels('offset'); },
684
+ onClick: () => self.setTrackLabels('offset'),
708
685
  },
709
686
  {
710
687
  label: 'Hidden',
711
688
  icon: Visibility_1.default,
712
689
  type: 'radio',
713
690
  checked: self.trackLabels === 'hidden',
714
- onClick: function () { return self.setTrackLabels('hidden'); },
691
+ onClick: () => self.setTrackLabels('hidden'),
715
692
  },
716
693
  ],
694
+ },
695
+ ];
696
+ // add track's view level menu options
697
+ for (const [key, value] of self.trackTypeActions.entries()) {
698
+ if (value.length) {
699
+ menuItems.push({ type: 'divider' }, { type: 'subHeader', label: key });
700
+ value.forEach(action => menuItems.push(action));
717
701
  }
718
- ], __read((canShowCytobands
719
- ? [
720
- {
721
- label: showCytobands ? 'Hide ideogram' : 'Show ideograms',
722
- onClick: function () {
723
- self.setShowCytobands(!showCytobands);
724
- },
725
- },
726
- ]
727
- : [])), false);
728
- try {
729
- // add track's view level menu options
730
- for (var _b = __values(self.trackTypeActions.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {
731
- var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
732
- if (value.length) {
733
- menuItems.push({ type: 'divider' }, { type: 'subHeader', label: key });
734
- value.forEach(function (action) {
735
- menuItems.push(action);
736
- });
737
- }
738
- }
739
- }
740
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
741
- finally {
742
- try {
743
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
744
- }
745
- finally { if (e_1) throw e_1.error; }
746
702
  }
747
703
  return menuItems;
748
704
  },
749
- }); })
750
- .views(function (self) {
751
- var currentlyCalculatedStaticBlocks;
752
- var stringifiedCurrentlyCalculatedStaticBlocks = '';
705
+ }))
706
+ .views(self => {
707
+ let currentlyCalculatedStaticBlocks;
708
+ let stringifiedCurrentlyCalculatedStaticBlocks = '';
753
709
  return {
754
710
  get staticBlocks() {
755
- var ret = (0, calculateStaticBlocks_1.default)(self);
756
- var sret = JSON.stringify(ret);
711
+ const ret = (0, calculateStaticBlocks_1.default)(self);
712
+ const sret = JSON.stringify(ret);
757
713
  if (stringifiedCurrentlyCalculatedStaticBlocks !== sret) {
758
714
  currentlyCalculatedStaticBlocks = ret;
759
715
  stringifiedCurrentlyCalculatedStaticBlocks = sret;
@@ -764,8 +720,12 @@ function stateModelFactory(pluginManager) {
764
720
  return (0, calculateDynamicBlocks_1.default)(self);
765
721
  },
766
722
  get roundedDynamicBlocks() {
767
- return this.dynamicBlocks.contentBlocks.map(function (block) {
768
- return __assign(__assign({}, block), { start: Math.floor(block.start), end: Math.ceil(block.end) });
723
+ return this.dynamicBlocks.contentBlocks.map(block => {
724
+ return {
725
+ ...block,
726
+ start: Math.floor(block.start),
727
+ end: Math.ceil(block.end),
728
+ };
769
729
  });
770
730
  },
771
731
  get visibleLocStrings() {
@@ -776,9 +736,9 @@ function stateModelFactory(pluginManager) {
776
736
  },
777
737
  };
778
738
  })
779
- .actions(function (self) { return ({
739
+ .actions(self => ({
780
740
  // this "clears the view" and makes the view return to the import form
781
- clearView: function () {
741
+ clearView() {
782
742
  self.setDisplayedRegions([]);
783
743
  self.tracks.clear();
784
744
  // it is necessary to run these after setting displayed regions empty
@@ -787,35 +747,24 @@ function stateModelFactory(pluginManager) {
787
747
  self.scrollTo(0);
788
748
  self.zoomTo(10);
789
749
  },
790
- setCoarseDynamicBlocks: function (blocks) {
750
+ setCoarseDynamicBlocks(blocks) {
791
751
  self.coarseDynamicBlocks = blocks.contentBlocks;
792
752
  self.coarseTotalBp = blocks.totalBp;
793
753
  },
794
- afterAttach: function () {
795
- var _this = this;
796
- (0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(function () {
754
+ afterAttach() {
755
+ (0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
797
756
  if (self.initialized) {
798
- _this.setCoarseDynamicBlocks(self.dynamicBlocks);
757
+ this.setCoarseDynamicBlocks(self.dynamicBlocks);
799
758
  }
800
759
  }, { delay: 150 }));
801
760
  },
802
- }); })
803
- .actions(function (self) { return ({
804
- exportSvg: function (opts) {
805
- if (opts === void 0) { opts = {}; }
806
- return __awaiter(this, void 0, void 0, function () {
807
- var html, blob;
808
- return __generator(this, function (_a) {
809
- switch (_a.label) {
810
- case 0: return [4 /*yield*/, (0, LinearGenomeViewSvg_1.renderToSvg)(self, opts)];
811
- case 1:
812
- html = _a.sent();
813
- blob = new Blob([html], { type: 'image/svg+xml' });
814
- (0, file_saver_1.saveAs)(blob, opts.filename || 'image.svg');
815
- return [2 /*return*/];
816
- }
817
- });
818
- });
761
+ }))
762
+ .actions(self => ({
763
+ async exportSvg(opts = {}) {
764
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
765
+ const html = await (0, LinearGenomeViewSvg_1.renderToSvg)(self, opts);
766
+ const blob = new Blob([html], { type: 'image/svg+xml' });
767
+ (0, file_saver_1.saveAs)(blob, opts.filename || 'image.svg');
819
768
  },
820
769
  /**
821
770
  * offset is the base-pair-offset in the displayed region, index is the index of the
@@ -824,76 +773,80 @@ function stateModelFactory(pluginManager) {
824
773
  * @param start - object as `{start, end, offset, index}`
825
774
  * @param end - object as `{start, end, offset, index}`
826
775
  */
827
- moveTo: function (start, end) {
776
+ moveTo(start, end) {
828
777
  (0, Base1DUtils_1.moveTo)(self, start, end);
829
778
  },
830
- navToLocString: function (locString, optAssemblyName) {
831
- var assemblyNames = self.assemblyNames;
832
- var assemblyManager = (0, util_1.getSession)(self).assemblyManager;
833
- var isValidRefName = assemblyManager.isValidRefName;
834
- var assemblyName = optAssemblyName || assemblyNames[0];
835
- var parsedLocStrings;
836
- var inputs = locString
779
+ navToLocString(locString, optAssemblyName) {
780
+ const { assemblyNames } = self;
781
+ const { assemblyManager } = (0, util_1.getSession)(self);
782
+ const { isValidRefName } = assemblyManager;
783
+ const assemblyName = optAssemblyName || assemblyNames[0];
784
+ let parsedLocStrings;
785
+ const inputs = locString
837
786
  .split(/(\s+)/)
838
- .map(function (f) { return f.trim(); })
839
- .filter(function (f) { return !!f; });
787
+ .map(f => f.trim())
788
+ .filter(f => !!f);
840
789
  // first try interpreting as a whitespace-separated sequence of
841
790
  // multiple locstrings
842
791
  try {
843
- parsedLocStrings = inputs.map(function (l) {
844
- return (0, util_1.parseLocString)(l, function (ref) { return isValidRefName(ref, assemblyName); });
845
- });
792
+ parsedLocStrings = inputs.map(l => (0, util_1.parseLocString)(l, ref => isValidRefName(ref, assemblyName)));
846
793
  }
847
794
  catch (e) {
848
795
  // if this fails, try interpreting as a whitespace-separated refname,
849
796
  // start, end if start and end are integer inputs
850
- var _a = __read(inputs, 3), refName = _a[0], start = _a[1], end = _a[2];
851
- if ("".concat(e).match(/Unknown reference sequence/) &&
797
+ const [refName, start, end] = inputs;
798
+ if (`${e}`.match(/Unknown reference sequence/) &&
852
799
  Number.isInteger(+start) &&
853
800
  Number.isInteger(+end)) {
854
801
  parsedLocStrings = [
855
- (0, util_1.parseLocString)(refName + ':' + start + '..' + end, function (ref) {
856
- return isValidRefName(ref, assemblyName);
857
- }),
802
+ (0, util_1.parseLocString)(refName + ':' + start + '..' + end, ref => isValidRefName(ref, assemblyName)),
858
803
  ];
859
804
  }
860
805
  else {
861
806
  throw e;
862
807
  }
863
808
  }
864
- var locations = parsedLocStrings === null || parsedLocStrings === void 0 ? void 0 : parsedLocStrings.map(function (region) {
865
- var asmName = region.assemblyName || assemblyName;
866
- var asm = assemblyManager.get(asmName);
867
- var refName = region.refName;
809
+ const locations = parsedLocStrings === null || parsedLocStrings === void 0 ? void 0 : parsedLocStrings.map(region => {
810
+ const asmName = region.assemblyName || assemblyName;
811
+ const asm = assemblyManager.get(asmName);
812
+ const { refName } = region;
868
813
  if (!asm) {
869
- throw new Error("assembly ".concat(asmName, " not found"));
814
+ throw new Error(`assembly ${asmName} not found`);
870
815
  }
871
- var regions = asm.regions;
816
+ const { regions } = asm;
872
817
  if (!regions) {
873
- throw new Error("regions not loaded yet for ".concat(asmName));
818
+ throw new Error(`regions not loaded yet for ${asmName}`);
874
819
  }
875
- var canonicalRefName = asm.getCanonicalRefName(region.refName);
820
+ const canonicalRefName = asm.getCanonicalRefName(region.refName);
876
821
  if (!canonicalRefName) {
877
- throw new Error("Could not find refName ".concat(refName, " in ").concat(asm.name));
822
+ throw new Error(`Could not find refName ${refName} in ${asm.name}`);
878
823
  }
879
- var parentRegion = regions.find(function (region) { return region.refName === canonicalRefName; });
824
+ const parentRegion = regions.find(region => region.refName === canonicalRefName);
880
825
  if (!parentRegion) {
881
- throw new Error("Could not find refName ".concat(refName, " in ").concat(asmName));
826
+ throw new Error(`Could not find refName ${refName} in ${asmName}`);
882
827
  }
883
- return __assign(__assign({}, region), { assemblyName: asmName, parentRegion: parentRegion });
828
+ return {
829
+ ...region,
830
+ assemblyName: asmName,
831
+ parentRegion,
832
+ };
884
833
  });
885
834
  if (locations.length === 1) {
886
- var loc = locations[0];
835
+ const loc = locations[0];
887
836
  self.setDisplayedRegions([
888
- __assign({ reversed: loc.reversed }, loc.parentRegion),
837
+ { reversed: loc.reversed, ...loc.parentRegion },
889
838
  ]);
890
- var start = loc.start, end = loc.end, parentRegion = loc.parentRegion;
891
- this.navTo(__assign(__assign({}, loc), { start: (0, util_1.clamp)(start !== null && start !== void 0 ? start : 0, 0, parentRegion.end), end: (0, util_1.clamp)(end !== null && end !== void 0 ? end : parentRegion.end, 0, parentRegion.end) }));
839
+ const { start, end, parentRegion } = loc;
840
+ this.navTo({
841
+ ...loc,
842
+ start: (0, util_1.clamp)(start !== null && start !== void 0 ? start : 0, 0, parentRegion.end),
843
+ end: (0, util_1.clamp)(end !== null && end !== void 0 ? end : parentRegion.end, 0, parentRegion.end),
844
+ });
892
845
  }
893
846
  else {
894
847
  self.setDisplayedRegions(
895
848
  // @ts-ignore
896
- locations.map(function (r) { return (r.start === undefined ? r.parentRegion : r); }));
849
+ locations.map(r => (r.start === undefined ? r.parentRegion : r)));
897
850
  self.showAllRegions();
898
851
  }
899
852
  },
@@ -908,29 +861,29 @@ function stateModelFactory(pluginManager) {
908
861
  *
909
862
  * @param location - a proposed location to navigate to
910
863
  */
911
- navTo: function (query) {
864
+ navTo(query) {
912
865
  this.navToMultiple([query]);
913
866
  },
914
- navToMultiple: function (locations) {
915
- var firstLocation = locations[0];
916
- var refName = firstLocation.refName;
917
- var start = firstLocation.start, end = firstLocation.end, _a = firstLocation.assemblyName, assemblyName = _a === void 0 ? self.assemblyNames[0] : _a;
867
+ navToMultiple(locations) {
868
+ const firstLocation = locations[0];
869
+ let { refName } = firstLocation;
870
+ const { start, end, assemblyName = self.assemblyNames[0], } = firstLocation;
918
871
  if (start !== undefined && end !== undefined && start > end) {
919
- throw new Error("start \"".concat(start + 1, "\" is greater than end \"").concat(end, "\""));
872
+ throw new Error(`start "${start + 1}" is greater than end "${end}"`);
920
873
  }
921
- var session = (0, util_1.getSession)(self);
922
- var assemblyManager = session.assemblyManager;
923
- var assembly = assemblyManager.get(assemblyName);
874
+ const session = (0, util_1.getSession)(self);
875
+ const { assemblyManager } = session;
876
+ const assembly = assemblyManager.get(assemblyName);
924
877
  if (assembly) {
925
- var canonicalRefName = assembly.getCanonicalRefName(refName);
878
+ const canonicalRefName = assembly.getCanonicalRefName(refName);
926
879
  if (canonicalRefName) {
927
880
  refName = canonicalRefName;
928
881
  }
929
882
  }
930
- var s = start;
931
- var e = end;
932
- var refNameMatched = false;
933
- var predicate = function (r) {
883
+ let s = start;
884
+ let e = end;
885
+ let refNameMatched = false;
886
+ const predicate = (r) => {
934
887
  if (refName === r.refName) {
935
888
  refNameMatched = true;
936
889
  if (s === undefined) {
@@ -947,11 +900,11 @@ function stateModelFactory(pluginManager) {
947
900
  }
948
901
  return false;
949
902
  };
950
- var lastIndex = (0, util_1.findLastIndex)(self.displayedRegions, predicate);
951
- var index;
903
+ const lastIndex = (0, util_1.findLastIndex)(self.displayedRegions, predicate);
904
+ let index;
952
905
  while (index !== lastIndex) {
953
906
  try {
954
- var previousIndex = index;
907
+ const previousIndex = index;
955
908
  index = self.displayedRegions
956
909
  .slice(previousIndex === undefined ? 0 : previousIndex + 1)
957
910
  .findIndex(predicate);
@@ -959,39 +912,39 @@ function stateModelFactory(pluginManager) {
959
912
  index += previousIndex + 1;
960
913
  }
961
914
  if (!refNameMatched) {
962
- throw new Error("could not find a region with refName \"".concat(refName, "\""));
915
+ throw new Error(`could not find a region with refName "${refName}"`);
963
916
  }
964
917
  if (s === undefined) {
965
- throw new Error("could not find a region with refName \"".concat(refName, "\" that contained an end position ").concat(e));
918
+ throw new Error(`could not find a region with refName "${refName}" that contained an end position ${e}`);
966
919
  }
967
920
  if (e === undefined) {
968
- throw new Error("could not find a region with refName \"".concat(refName, "\" that contained a start position ").concat(s + 1));
921
+ throw new Error(`could not find a region with refName "${refName}" that contained a start position ${s + 1}`);
969
922
  }
970
923
  if (index === -1) {
971
- throw new Error("could not find a region that completely contained \"".concat((0, util_1.assembleLocString)(firstLocation), "\""));
924
+ throw new Error(`could not find a region that completely contained "${(0, util_1.assembleLocString)(firstLocation)}"`);
972
925
  }
973
926
  if (locations.length === 1) {
974
- var f = self.displayedRegions[index];
975
- this.moveTo({ index: index, offset: f.reversed ? f.end - e : s - f.start }, { index: index, offset: f.reversed ? f.end - s : e - f.start });
927
+ const f = self.displayedRegions[index];
928
+ this.moveTo({ index, offset: f.reversed ? f.end - e : s - f.start }, { index, offset: f.reversed ? f.end - s : e - f.start });
976
929
  return;
977
930
  }
978
- var locationIndex = 0;
979
- var locationStart = 0;
980
- var locationEnd = 0;
931
+ let locationIndex = 0;
932
+ let locationStart = 0;
933
+ let locationEnd = 0;
981
934
  for (locationIndex; locationIndex < locations.length; locationIndex++) {
982
- var location_1 = locations[locationIndex];
983
- var region = self.displayedRegions[index + locationIndex];
984
- locationStart = location_1.start || region.start;
985
- locationEnd = location_1.end || region.end;
986
- if (location_1.refName !== region.refName) {
987
- throw new Error("Entered location ".concat((0, util_1.assembleLocString)(location_1), " does not match with displayed regions"));
935
+ const location = locations[locationIndex];
936
+ const region = self.displayedRegions[index + locationIndex];
937
+ locationStart = location.start || region.start;
938
+ locationEnd = location.end || region.end;
939
+ if (location.refName !== region.refName) {
940
+ throw new Error(`Entered location ${(0, util_1.assembleLocString)(location)} does not match with displayed regions`);
988
941
  }
989
942
  }
990
943
  locationIndex -= 1;
991
- var startDisplayedRegion = self.displayedRegions[index];
992
- var endDisplayedRegion = self.displayedRegions[index + locationIndex];
944
+ const startDisplayedRegion = self.displayedRegions[index];
945
+ const endDisplayedRegion = self.displayedRegions[index + locationIndex];
993
946
  this.moveTo({
994
- index: index,
947
+ index,
995
948
  offset: startDisplayedRegion.reversed
996
949
  ? startDisplayedRegion.end - e
997
950
  : s - startDisplayedRegion.start,
@@ -1010,30 +963,27 @@ function stateModelFactory(pluginManager) {
1010
963
  }
1011
964
  }
1012
965
  },
1013
- }); })
1014
- .views(function (self) { return ({
1015
- rubberBandMenuItems: function () {
966
+ }))
967
+ .views(self => ({
968
+ rubberBandMenuItems() {
1016
969
  return [
1017
970
  {
1018
971
  label: 'Zoom to region',
1019
972
  icon: ZoomIn_1.default,
1020
- onClick: function () {
1021
- var leftOffset = self.leftOffset, rightOffset = self.rightOffset;
973
+ onClick: () => {
974
+ const { leftOffset, rightOffset } = self;
1022
975
  self.moveTo(leftOffset, rightOffset);
1023
976
  },
1024
977
  },
1025
978
  {
1026
979
  label: 'Get sequence',
1027
980
  icon: MenuOpen_1.default,
1028
- onClick: function () {
1029
- self.setSequenceDialogOpen(true);
1030
- },
981
+ onClick: () => self.setGetSequenceDialogOpen(true),
1031
982
  },
1032
983
  ];
1033
984
  },
1034
- bpToPx: function (_a) {
1035
- var refName = _a.refName, coord = _a.coord, regionNumber = _a.regionNumber;
1036
- return (0, Base1DUtils_1.bpToPx)({ refName: refName, coord: coord, regionNumber: regionNumber, self: self });
985
+ bpToPx({ refName, coord, regionNumber, }) {
986
+ return (0, Base1DUtils_1.bpToPx)({ refName, coord, regionNumber, self });
1037
987
  },
1038
988
  /**
1039
989
  * scrolls the view to center on the given bp. if that is not in any
@@ -1042,17 +992,17 @@ function stateModelFactory(pluginManager) {
1042
992
  * @param refName - refName of the displayedRegion you are centering at
1043
993
  * @param regionNumber - index of the displayedRegion
1044
994
  */
1045
- centerAt: function (coord, refName, regionNumber) {
1046
- var centerPx = this.bpToPx({
1047
- refName: refName,
1048
- coord: coord,
1049
- regionNumber: regionNumber,
995
+ centerAt(coord, refName, regionNumber) {
996
+ const centerPx = this.bpToPx({
997
+ refName,
998
+ coord,
999
+ regionNumber,
1050
1000
  });
1051
1001
  if (centerPx) {
1052
1002
  self.scrollTo(Math.round(centerPx.offsetPx - self.width / 2));
1053
1003
  }
1054
1004
  },
1055
- pxToBp: function (px) {
1005
+ pxToBp(px) {
1056
1006
  return (0, Base1DUtils_1.pxToBp)(self, px);
1057
1007
  },
1058
1008
  get centerLineInfo() {
@@ -1060,7 +1010,7 @@ function stateModelFactory(pluginManager) {
1060
1010
  ? this.pxToBp(self.width / 2)
1061
1011
  : undefined;
1062
1012
  },
1063
- }); });
1013
+ }));
1064
1014
  }
1065
1015
  exports.stateModelFactory = stateModelFactory;
1066
1016
  var LinearGenomeView_1 = require("./components/LinearGenomeView");