@jbrowse/plugin-linear-genome-view 1.4.4 → 1.5.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 (30) hide show
  1. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +16 -9
  2. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +2 -2
  3. package/dist/LinearBareDisplay/model.d.ts +8 -8
  4. package/dist/LinearBasicDisplay/model.d.ts +11 -8
  5. package/dist/LinearGenomeView/components/RefNameAutocomplete.d.ts +0 -10
  6. package/dist/LinearGenomeView/components/ScaleBar.d.ts +22 -2
  7. package/dist/LinearGenomeView/components/util.d.ts +2 -0
  8. package/dist/LinearGenomeView/index.d.ts +13 -2
  9. package/dist/index.d.ts +26 -26
  10. package/dist/plugin-linear-genome-view.cjs.development.js +272 -268
  11. package/dist/plugin-linear-genome-view.cjs.development.js.map +1 -1
  12. package/dist/plugin-linear-genome-view.cjs.production.min.js +1 -1
  13. package/dist/plugin-linear-genome-view.cjs.production.min.js.map +1 -1
  14. package/dist/plugin-linear-genome-view.esm.js +272 -269
  15. package/dist/plugin-linear-genome-view.esm.js.map +1 -1
  16. package/package.json +2 -2
  17. package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +3 -0
  18. package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +3 -7
  19. package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +15 -13
  20. package/src/LinearBasicDisplay/model.ts +25 -3
  21. package/src/LinearGenomeView/components/ExportSvgDialog.tsx +6 -6
  22. package/src/LinearGenomeView/components/Header.tsx +40 -74
  23. package/src/LinearGenomeView/components/ImportForm.tsx +124 -134
  24. package/src/LinearGenomeView/components/LinearGenomeView.test.js +6 -6
  25. package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +20 -25
  26. package/src/LinearGenomeView/components/SequenceDialog.tsx +1 -1
  27. package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +0 -176
  28. package/src/LinearGenomeView/components/util.ts +8 -0
  29. package/src/LinearGenomeView/index.tsx +14 -13
  30. package/src/index.ts +3 -1
@@ -15,13 +15,14 @@ import Typography from '@material-ui/core/Typography';
15
15
  import MenuOpenIcon from '@material-ui/icons/MenuOpen';
16
16
  import { autorun, when, transaction } from 'mobx';
17
17
  import { getParent, types, cast, isAlive, addDisposer, getEnv, resolveIdentifier, getRoot, getSnapshot } from 'mobx-state-tree';
18
- import { useTheme, makeStyles as makeStyles$1, alpha, Portal, TextField, CircularProgress, InputAdornment, Typography as Typography$1, Popper, Tooltip as Tooltip$1, Popover, Dialog, DialogTitle, IconButton as IconButton$1, Divider, DialogContent, DialogContentText, TableContainer, Paper as Paper$1, Table, TableHead, TableRow, TableCell, TableBody, Button as Button$1, DialogActions, Container, Grid, FormControlLabel, Checkbox } from '@material-ui/core';
18
+ import { useTheme, makeStyles as makeStyles$1, alpha, Portal, TextField, Typography as Typography$1, Popper, CircularProgress, InputAdornment, Tooltip as Tooltip$1, Popover, FormGroup, Button as Button$1, Dialog, DialogTitle, IconButton as IconButton$1, Divider, DialogContent, DialogContentText, TableContainer, Paper as Paper$1, Table, TableHead, TableRow, TableCell, TableBody, DialogActions, Container, Grid, FormControlLabel, Checkbox } from '@material-ui/core';
19
19
  import { Menu, ResizeHandle } from '@jbrowse/core/ui';
20
20
  import { observer, PropTypes } from 'mobx-react';
21
21
  import { usePopper } from 'react-popper';
22
22
  import { makeStyles, alpha as alpha$1, useTheme as useTheme$1 } from '@material-ui/core/styles';
23
23
  import { ContentBlock as ContentBlock$1, ElidedBlock as ElidedBlock$1, InterRegionPaddingBlock as InterRegionPaddingBlock$1 } from '@jbrowse/core/util/blockTypes';
24
24
  import { Region, ElementId } from '@jbrowse/core/util/types/mst';
25
+ import { isRetryException } from '@jbrowse/core/util/types';
25
26
  import RefreshIcon from '@material-ui/icons/Refresh';
26
27
  import { ConfigurationReference } from '@jbrowse/core/configuration/configurationSchema';
27
28
  import calculateDynamicBlocks from '@jbrowse/core/util/calculateDynamicBlocks';
@@ -37,7 +38,6 @@ import ZoomIn from '@material-ui/icons/ZoomIn';
37
38
  import clone from 'clone';
38
39
  import { saveAs } from 'file-saver';
39
40
  import { renderToStaticMarkup } from 'react-dom/server';
40
- import FormGroup from '@material-ui/core/FormGroup';
41
41
  import ArrowForwardIcon from '@material-ui/icons/ArrowForward';
42
42
  import ArrowBackIcon from '@material-ui/icons/ArrowBack';
43
43
  import BaseResult, { RefSequenceResult } from '@jbrowse/core/TextSearch/BaseResults';
@@ -282,6 +282,8 @@ function _assertThisInitialized(self) {
282
282
  function _possibleConstructorReturn(self, call) {
283
283
  if (call && (typeof call === "object" || typeof call === "function")) {
284
284
  return call;
285
+ } else if (call !== void 0) {
286
+ throw new TypeError("Derived constructors may only return object or undefined");
285
287
  }
286
288
 
287
289
  return _assertThisInitialized(self);
@@ -545,11 +547,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
545
547
 
546
548
 
547
549
  var IteratorPrototype = {};
548
-
549
- IteratorPrototype[iteratorSymbol] = function () {
550
+ define(IteratorPrototype, iteratorSymbol, function () {
550
551
  return this;
551
- };
552
-
552
+ });
553
553
  var getProto = Object.getPrototypeOf;
554
554
  var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
555
555
 
@@ -560,8 +560,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
560
560
  }
561
561
 
562
562
  var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
563
- GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
564
- GeneratorFunctionPrototype.constructor = GeneratorFunction;
563
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
564
+ define(Gp, "constructor", GeneratorFunctionPrototype);
565
+ define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
565
566
  GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
566
567
  // Iterator interface in terms of a single ._invoke method.
567
568
 
@@ -666,11 +667,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
666
667
  }
667
668
 
668
669
  defineIteratorMethods(AsyncIterator.prototype);
669
-
670
- AsyncIterator.prototype[asyncIteratorSymbol] = function () {
670
+ define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
671
671
  return this;
672
- };
673
-
672
+ });
674
673
  exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
675
674
  // AsyncIterator objects; they just return a Promise for the value of
676
675
  // the final result produced by the iterator.
@@ -847,13 +846,12 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
847
846
  // object to not be returned from this call. This ensures that doesn't happen.
848
847
  // See https://github.com/facebook/regenerator/issues/274 for more details.
849
848
 
850
- Gp[iteratorSymbol] = function () {
849
+ define(Gp, iteratorSymbol, function () {
851
850
  return this;
852
- };
853
-
854
- Gp.toString = function () {
851
+ });
852
+ define(Gp, "toString", function () {
855
853
  return "[object Generator]";
856
- };
854
+ });
857
855
 
858
856
  function pushTryEntry(locs) {
859
857
  var entry = {
@@ -1165,14 +1163,19 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
1165
1163
  } catch (accidentalStrictMode) {
1166
1164
  // This module should not be running in strict mode, so the above
1167
1165
  // assignment should always work unless something is misconfigured. Just
1168
- // in case runtime.js accidentally runs in strict mode, we can escape
1166
+ // in case runtime.js accidentally runs in strict mode, in modern engines
1167
+ // we can explicitly access globalThis. In older engines we can escape
1169
1168
  // strict mode using a global Function call. This could conceivably fail
1170
1169
  // if a Content Security Policy forbids using Function, but in that case
1171
1170
  // the proper solution is to fix the accidental strict mode problem. If
1172
1171
  // you've misconfigured your bundler to force strict mode and applied a
1173
1172
  // CSP to forbid Function, and you're not willing to fix either of those
1174
1173
  // problems, please detail your unique predicament in a GitHub issue.
1175
- Function("r", "regeneratorRuntime = r")(runtime);
1174
+ if (typeof globalThis === "object") {
1175
+ globalThis.regeneratorRuntime = runtime;
1176
+ } else {
1177
+ Function("r", "regeneratorRuntime = r")(runtime);
1178
+ }
1176
1179
  }
1177
1180
  });
1178
1181
 
@@ -1390,7 +1393,10 @@ var Tooltip = /*#__PURE__*/observer(function (_ref2) {
1390
1393
  bottom: y,
1391
1394
  right: x,
1392
1395
  width: 0,
1393
- height: 0
1396
+ height: 0,
1397
+ x: x,
1398
+ y: y,
1399
+ toJSON: function toJSON() {}
1394
1400
  };
1395
1401
  }
1396
1402
  };
@@ -1776,6 +1782,10 @@ var blockState = /*#__PURE__*/types.model('BlockState', {
1776
1782
  self.error = error;
1777
1783
  self.renderProps = undefined;
1778
1784
  renderInProgress = undefined;
1785
+
1786
+ if (isRetryException(error)) {
1787
+ this.reload();
1788
+ }
1779
1789
  },
1780
1790
  reload: function reload() {
1781
1791
  self.renderInProgress = undefined;
@@ -2411,8 +2421,8 @@ function stateModelFactory(configSchema) {
2411
2421
  function fetchResults(_x, _x2, _x3) {
2412
2422
  return _fetchResults.apply(this, arguments);
2413
2423
  } // the logic of this method is to only apply a filter to RefSequenceResults
2414
- // because they do not have a matchedObject. the trix search results
2415
- // already filter so don't need re-filtering
2424
+ // because they do not have a matchedObject. the trix search results already
2425
+ // filter so don't need re-filtering
2416
2426
 
2417
2427
 
2418
2428
  function _fetchResults() {
@@ -2494,10 +2504,15 @@ function RefNameAutocomplete(_ref) {
2494
2504
  currentSearch = _useState6[0],
2495
2505
  setCurrentSearch = _useState6[1];
2496
2506
 
2497
- var _useState7 = useState([]),
2507
+ var _useState7 = useState(''),
2498
2508
  _useState8 = _slicedToArray(_useState7, 2),
2499
- searchOptions = _useState8[0],
2500
- setSearchOptions = _useState8[1];
2509
+ inputValue = _useState8[0],
2510
+ setInputValue = _useState8[1];
2511
+
2512
+ var _useState9 = useState([]),
2513
+ _useState10 = _slicedToArray(_useState9, 2),
2514
+ searchOptions = _useState10[0],
2515
+ setSearchOptions = _useState10[1];
2501
2516
 
2502
2517
  var debouncedSearch = useDebounce(currentSearch, 300);
2503
2518
  var coarseVisibleLocStrings = model.coarseVisibleLocStrings,
@@ -2542,20 +2557,23 @@ function RefNameAutocomplete(_ref) {
2542
2557
  case 6:
2543
2558
  results = _context.sent;
2544
2559
 
2545
- if (results && results.length >= 0 && active) {
2546
- setSearchOptions(results.map(function (result) {
2547
- return {
2548
- result: result
2549
- };
2550
- }));
2560
+ if (active) {
2561
+ if (results && results.length >= 0) {
2562
+ setSearchOptions(results.map(function (result) {
2563
+ return {
2564
+ result: result
2565
+ };
2566
+ }));
2567
+ }
2568
+
2569
+ setLoaded(true);
2551
2570
  }
2552
2571
 
2553
- setLoaded(true);
2554
- _context.next = 15;
2572
+ _context.next = 14;
2555
2573
  break;
2556
2574
 
2557
- case 11:
2558
- _context.prev = 11;
2575
+ case 10:
2576
+ _context.prev = 10;
2559
2577
  _context.t0 = _context["catch"](0);
2560
2578
  console.error(_context.t0);
2561
2579
 
@@ -2563,12 +2581,12 @@ function RefNameAutocomplete(_ref) {
2563
2581
  session.notify("".concat(_context.t0), 'error');
2564
2582
  }
2565
2583
 
2566
- case 15:
2584
+ case 14:
2567
2585
  case "end":
2568
2586
  return _context.stop();
2569
2587
  }
2570
2588
  }
2571
- }, _callee, null, [[0, 11]]);
2589
+ }, _callee, null, [[0, 10]]);
2572
2590
  }))();
2573
2591
 
2574
2592
  return function () {
@@ -2578,9 +2596,7 @@ function RefNameAutocomplete(_ref) {
2578
2596
  var inputBoxVal = coarseVisibleLocStrings || value || ''; // heuristic, text width + icon width, minimum 200
2579
2597
 
2580
2598
  var width = Math.min(Math.max(measureText(inputBoxVal, 16) + 25, 200), 550); // notes on implementation:
2581
- // selectOnFocus helps highlight the field when clicked
2582
- // blurOnSelect helps it so that when the user-re-clicks on the textfield,
2583
- // that selectOnFocus re-activates
2599
+ // The selectOnFocus setting helps highlight the field when clicked
2584
2600
 
2585
2601
  return /*#__PURE__*/React.createElement(Autocomplete, {
2586
2602
  id: "refNameAutocomplete-".concat(model.id),
@@ -2592,12 +2608,15 @@ function RefNameAutocomplete(_ref) {
2592
2608
  freeSolo: true,
2593
2609
  includeInputInList: true,
2594
2610
  selectOnFocus: true,
2595
- blurOnSelect: true,
2596
2611
  style: _objectSpread2(_objectSpread2({}, style), {}, {
2597
2612
  width: width
2598
2613
  }),
2599
2614
  value: inputBoxVal,
2600
2615
  loading: !loaded,
2616
+ inputValue: inputValue,
2617
+ onInputChange: function onInputChange(event, newInputValue) {
2618
+ return setInputValue(newInputValue);
2619
+ },
2601
2620
  loadingText: "loading results",
2602
2621
  open: open,
2603
2622
  onOpen: function onOpen() {
@@ -2619,14 +2638,14 @@ function RefNameAutocomplete(_ref) {
2619
2638
 
2620
2639
  if (typeof selectedOption === 'string') {
2621
2640
  // handles string inputs on keyPress enter
2622
- var newResult = new BaseResult({
2641
+ onSelect(new BaseResult({
2623
2642
  label: selectedOption
2624
- });
2625
- onSelect(newResult);
2643
+ }));
2626
2644
  } else {
2627
- var result = selectedOption.result;
2628
- onSelect(result);
2645
+ onSelect(selectedOption.result);
2629
2646
  }
2647
+
2648
+ setInputValue(inputBoxVal);
2630
2649
  },
2631
2650
  options: searchOptions.length === 0 ? options : searchOptions,
2632
2651
  getOptionDisabled: function getOptionDisabled(option) {
@@ -2646,7 +2665,13 @@ function RefNameAutocomplete(_ref) {
2646
2665
  var helperText = TextFieldProps.helperText,
2647
2666
  _TextFieldProps$Input = TextFieldProps.InputProps,
2648
2667
  InputProps = _TextFieldProps$Input === void 0 ? {} : _TextFieldProps$Input;
2649
- return /*#__PURE__*/React.createElement(TextField, Object.assign({}, params, TextFieldProps, {
2668
+ return /*#__PURE__*/React.createElement(TextField, Object.assign({
2669
+ onBlur: function onBlur() {
2670
+ // this is used to restore a refName or the non-user-typed input
2671
+ // to the box on blurring
2672
+ setInputValue(inputBoxVal);
2673
+ }
2674
+ }, params, TextFieldProps, {
2650
2675
  helperText: helperText,
2651
2676
  InputProps: _objectSpread2(_objectSpread2(_objectSpread2({}, params.InputProps), InputProps), {}, {
2652
2677
  endAdornment: /*#__PURE__*/React.createElement(React.Fragment, null, regions.length === 0 ? /*#__PURE__*/React.createElement(CircularProgress, {
@@ -3328,9 +3353,17 @@ function ZoomControls(_ref) {
3328
3353
 
3329
3354
  var ZoomControls$1 = /*#__PURE__*/observer(ZoomControls);
3330
3355
 
3356
+ function dedupe(results) {
3357
+ return results === null || results === void 0 ? void 0 : results.filter(function (elem, index, self) {
3358
+ return index === self.findIndex(function (t) {
3359
+ return t.getId() === elem.getId();
3360
+ });
3361
+ });
3362
+ }
3363
+
3331
3364
  var WIDGET_HEIGHT = 32;
3332
3365
  var SPACING = 7;
3333
- var useStyles$7 = /*#__PURE__*/makeStyles(function (theme) {
3366
+ var useStyles$7 = /*#__PURE__*/makeStyles$1(function (theme) {
3334
3367
  return {
3335
3368
  headerBar: {
3336
3369
  height: HEADER_BAR_HEIGHT,
@@ -3348,7 +3381,7 @@ var useStyles$7 = /*#__PURE__*/makeStyles(function (theme) {
3348
3381
  minWidth: 100
3349
3382
  },
3350
3383
  panButton: {
3351
- background: alpha$1(theme.palette.background.paper, 0.8),
3384
+ background: alpha(theme.palette.background.paper, 0.8),
3352
3385
  height: WIDGET_HEIGHT,
3353
3386
  margin: SPACING
3354
3387
  },
@@ -3370,7 +3403,7 @@ var useStyles$7 = /*#__PURE__*/makeStyles(function (theme) {
3370
3403
  var Controls = /*#__PURE__*/observer(function (_ref) {
3371
3404
  var model = _ref.model;
3372
3405
  var classes = useStyles$7();
3373
- return /*#__PURE__*/React.createElement(Button, {
3406
+ return /*#__PURE__*/React.createElement(Button$1, {
3374
3407
  onClick: model.activateTrackSelector,
3375
3408
  className: classes.toggleButton,
3376
3409
  title: "Open track selector",
@@ -3384,13 +3417,13 @@ var Controls = /*#__PURE__*/observer(function (_ref) {
3384
3417
  function PanControls(_ref2) {
3385
3418
  var model = _ref2.model;
3386
3419
  var classes = useStyles$7();
3387
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
3420
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button$1, {
3388
3421
  variant: "outlined",
3389
3422
  className: classes.panButton,
3390
3423
  onClick: function onClick() {
3391
3424
  return model.slide(-0.9);
3392
3425
  }
3393
- }, /*#__PURE__*/React.createElement(ArrowBackIcon, null)), /*#__PURE__*/React.createElement(Button, {
3426
+ }, /*#__PURE__*/React.createElement(ArrowBackIcon, null)), /*#__PURE__*/React.createElement(Button$1, {
3394
3427
  variant: "outlined",
3395
3428
  className: classes.panButton,
3396
3429
  onClick: function onClick() {
@@ -3403,7 +3436,7 @@ var RegionWidth = /*#__PURE__*/observer(function (_ref3) {
3403
3436
  var model = _ref3.model;
3404
3437
  var classes = useStyles$7();
3405
3438
  var coarseTotalBp = model.coarseTotalBp;
3406
- return /*#__PURE__*/React.createElement(Typography, {
3439
+ return /*#__PURE__*/React.createElement(Typography$1, {
3407
3440
  variant: "body2",
3408
3441
  color: "textSecondary",
3409
3442
  className: classes.bp
@@ -3412,43 +3445,19 @@ var RegionWidth = /*#__PURE__*/observer(function (_ref3) {
3412
3445
  var LinearGenomeViewHeader = /*#__PURE__*/observer(function (_ref4) {
3413
3446
  var model = _ref4.model;
3414
3447
  var classes = useStyles$7();
3415
- var theme = useTheme$1();
3448
+ var theme = useTheme();
3416
3449
  var session = getSession(model);
3417
- var assemblyManager = session.assemblyManager,
3418
- textSearchManager = session.textSearchManager;
3419
- var contentBlocks = model.coarseDynamicBlocks,
3420
- displayedRegions = model.displayedRegions,
3450
+ var textSearchManager = session.textSearchManager,
3451
+ assemblyManager = session.assemblyManager;
3452
+ var assemblyNames = model.assemblyNames,
3421
3453
  rankSearchResults = model.rankSearchResults;
3422
-
3423
- var _ref5 = contentBlocks[0] || {
3424
- refName: ''
3425
- },
3426
- assemblyName = _ref5.assemblyName,
3427
- refName = _ref5.refName;
3428
-
3429
- var assembly = assemblyName ? assemblyManager.get(assemblyName) : undefined;
3430
- var regions = (assembly === null || assembly === void 0 ? void 0 : assembly.regions) || [];
3454
+ var assemblyName = assemblyNames[0];
3455
+ var assembly = assemblyManager.get(assemblyName);
3431
3456
  var searchScope = model.searchScope(assemblyName);
3432
3457
 
3433
3458
  function fetchResults(_x) {
3434
3459
  return _fetchResults.apply(this, arguments);
3435
3460
  }
3436
- /**
3437
- * We first check to see if the identifier/label is an appropriate region,
3438
- * if it is then we set that as our displayed region
3439
- * if the label was not a valid region, then
3440
- * 1) we get the trackId and the location/locStr of the option we chose
3441
- * 2) we then use the label to try and fetch for exact matches through our
3442
- * textSearchManager
3443
- * 3) if we get any hits by requerying the textSearchManager, then we either
3444
- * navigate to the single hit location or pop open the the dialog with all
3445
- * the results from the search
3446
- * 4) if there were no hits from requerying, then we use (1) the chosen options'
3447
- * trackId and locStr to navigate and show that track
3448
- * 5) error handling
3449
- * @param result - result chosen from dropdown
3450
- */
3451
-
3452
3461
 
3453
3462
  function _fetchResults() {
3454
3463
  _fetchResults = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(queryString) {
@@ -3469,11 +3478,7 @@ var LinearGenomeViewHeader = /*#__PURE__*/observer(function (_ref4) {
3469
3478
 
3470
3479
  case 3:
3471
3480
  results = _context.sent;
3472
- return _context.abrupt("return", results === null || results === void 0 ? void 0 : results.filter(function (elem, index, self) {
3473
- return index === self.findIndex(function (t) {
3474
- return t.getId() === elem.getId();
3475
- });
3476
- }));
3481
+ return _context.abrupt("return", dedupe(results));
3477
3482
 
3478
3483
  case 5:
3479
3484
  case "end":
@@ -3485,84 +3490,78 @@ var LinearGenomeViewHeader = /*#__PURE__*/observer(function (_ref4) {
3485
3490
  return _fetchResults.apply(this, arguments);
3486
3491
  }
3487
3492
 
3488
- function setDisplayedRegion(_x2) {
3489
- return _setDisplayedRegion.apply(this, arguments);
3493
+ function handleSelectedRegion(_x2) {
3494
+ return _handleSelectedRegion.apply(this, arguments);
3490
3495
  }
3491
3496
 
3492
- function _setDisplayedRegion() {
3493
- _setDisplayedRegion = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(result) {
3494
- var label, newRegion, location, trackId, results;
3497
+ function _handleSelectedRegion() {
3498
+ _handleSelectedRegion = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(option) {
3499
+ var trackId, location, label, _assembly$refNames, results;
3500
+
3495
3501
  return runtime_1.wrap(function _callee2$(_context2) {
3496
3502
  while (1) {
3497
3503
  switch (_context2.prev = _context2.next) {
3498
3504
  case 0:
3499
- if (!result) {
3500
- _context2.next = 14;
3501
- break;
3502
- }
3505
+ trackId = option.getTrackId();
3506
+ location = option.getLocation();
3507
+ label = option.getLabel();
3508
+ _context2.prev = 3;
3503
3509
 
3504
- label = result.getLabel();
3505
- newRegion = regions.find(function (region) {
3506
- return label === region.refName;
3507
- });
3508
-
3509
- if (!newRegion) {
3510
+ if (!(assembly !== null && assembly !== void 0 && (_assembly$refNames = assembly.refNames) !== null && _assembly$refNames !== void 0 && _assembly$refNames.includes(location))) {
3510
3511
  _context2.next = 8;
3511
3512
  break;
3512
3513
  }
3513
3514
 
3514
- model.setDisplayedRegions([newRegion]); // we use showAllRegions after setDisplayedRegions to make the entire
3515
- // region visible, xref #1703
3516
-
3517
- model.showAllRegions();
3518
- _context2.next = 14;
3515
+ model.navToLocString(location);
3516
+ _context2.next = 19;
3519
3517
  break;
3520
3518
 
3521
3519
  case 8:
3522
- location = result.getLocation();
3523
- trackId = result.getTrackId();
3524
- _context2.next = 12;
3520
+ _context2.next = 10;
3525
3521
  return fetchResults(label);
3526
3522
 
3527
- case 12:
3523
+ case 10:
3528
3524
  results = _context2.sent;
3529
3525
 
3530
- if (results && results.length > 1) {
3531
- model.setSearchResults(results, label.toLowerCase());
3532
- } else {
3533
- if ((results === null || results === void 0 ? void 0 : results.length) === 1) {
3534
- location = results[0].getLocation();
3535
- trackId = results[0].getTrackId();
3536
- }
3526
+ if (!(results && results.length > 1)) {
3527
+ _context2.next = 16;
3528
+ break;
3529
+ }
3537
3530
 
3538
- try {
3539
- label !== '' && model.navToLocString(location);
3540
- } catch (e) {
3541
- if ("".concat(e) === "Error: Unknown reference sequence \"".concat(label, "\"")) {
3542
- model.setSearchResults(results, label.toLowerCase());
3543
- } else {
3544
- console.warn(e);
3545
- session.notify("".concat(e), 'warning');
3546
- }
3547
- }
3531
+ model.setSearchResults(results, label.toLowerCase());
3532
+ return _context2.abrupt("return");
3548
3533
 
3549
- try {
3550
- if (trackId) {
3551
- model.showTrack(trackId);
3552
- }
3553
- } catch (e) {
3554
- console.warn("'".concat(e, "' occurred while attempting to show track: ").concat(trackId));
3555
- }
3534
+ case 16:
3535
+ if ((results === null || results === void 0 ? void 0 : results.length) === 1) {
3536
+ location = results[0].getLocation();
3537
+ trackId = results[0].getTrackId();
3556
3538
  }
3557
3539
 
3558
- case 14:
3540
+ case 17:
3541
+ model.navToLocString(location, assemblyName);
3542
+
3543
+ if (trackId) {
3544
+ model.showTrack(trackId);
3545
+ }
3546
+
3547
+ case 19:
3548
+ _context2.next = 25;
3549
+ break;
3550
+
3551
+ case 21:
3552
+ _context2.prev = 21;
3553
+ _context2.t0 = _context2["catch"](3);
3554
+ console.error(_context2.t0);
3555
+ session.notify("".concat(_context2.t0), 'warning');
3556
+
3557
+ case 25:
3559
3558
  case "end":
3560
3559
  return _context2.stop();
3561
3560
  }
3562
3561
  }
3563
- }, _callee2);
3562
+ }, _callee2, null, [[3, 21]]);
3564
3563
  }));
3565
- return _setDisplayedRegion.apply(this, arguments);
3564
+ return _handleSelectedRegion.apply(this, arguments);
3566
3565
  }
3567
3566
 
3568
3567
  var controls = /*#__PURE__*/React.createElement("div", {
@@ -3577,9 +3576,8 @@ var LinearGenomeViewHeader = /*#__PURE__*/observer(function (_ref4) {
3577
3576
  }, /*#__PURE__*/React.createElement(PanControls, {
3578
3577
  model: model
3579
3578
  }), /*#__PURE__*/React.createElement(RefNameAutocomplete$1, {
3580
- onSelect: setDisplayedRegion,
3579
+ onSelect: handleSelectedRegion,
3581
3580
  assemblyName: assemblyName,
3582
- value: displayedRegions.length > 1 ? '' : refName,
3583
3581
  model: model,
3584
3582
  TextFieldProps: {
3585
3583
  variant: 'outlined',
@@ -3592,7 +3590,7 @@ var LinearGenomeViewHeader = /*#__PURE__*/observer(function (_ref4) {
3592
3590
  style: {
3593
3591
  padding: 0,
3594
3592
  height: WIDGET_HEIGHT,
3595
- background: alpha$1(theme.palette.background.paper, 0.8)
3593
+ background: alpha(theme.palette.background.paper, 0.8)
3596
3594
  }
3597
3595
  }
3598
3596
  }
@@ -4802,7 +4800,7 @@ var ErrorDisplay = /*#__PURE__*/observer(function (_ref) {
4802
4800
  }, "".concat(error));
4803
4801
  });
4804
4802
  var ImportForm = /*#__PURE__*/observer(function (_ref2) {
4805
- var _regions$;
4803
+ var _regions$, _regions$2;
4806
4804
 
4807
4805
  var model = _ref2.model;
4808
4806
  var classes = useStyles$g();
@@ -4833,37 +4831,26 @@ var ImportForm = /*#__PURE__*/observer(function (_ref2) {
4833
4831
 
4834
4832
  var _useState5 = useState(),
4835
4833
  _useState6 = _slicedToArray(_useState5, 2),
4836
- mySelectedRegion = _useState6[0],
4837
- setSelectedRegion = _useState6[1];
4834
+ myOption = _useState6[0],
4835
+ setOption = _useState6[1]; // use this instead of useState initializer because the useState initializer
4836
+ // won't update in response to an observable
4838
4837
 
4839
- var _useState7 = useState(),
4840
- _useState8 = _slicedToArray(_useState7, 2),
4841
- optionTrackId = _useState8[0],
4842
- setOptionTrackId = _useState8[1];
4843
4838
 
4844
- var _useState9 = useState(),
4845
- _useState10 = _slicedToArray(_useState9, 2),
4846
- optionLocation = _useState10[0],
4847
- setOptionLocation = _useState10[1];
4848
-
4849
- var selectedRegion = mySelectedRegion || ((_regions$ = regions[0]) === null || _regions$ === void 0 ? void 0 : _regions$.refName);
4839
+ var option = myOption || new RefSequenceResult({
4840
+ refName: (_regions$ = regions[0]) === null || _regions$ === void 0 ? void 0 : _regions$.refName,
4841
+ label: (_regions$2 = regions[0]) === null || _regions$2 === void 0 ? void 0 : _regions$2.refName
4842
+ });
4843
+ var selectedRegion = option === null || option === void 0 ? void 0 : option.getLocation();
4850
4844
 
4851
4845
  function fetchResults(_x) {
4852
4846
  return _fetchResults.apply(this, arguments);
4853
4847
  }
4854
4848
  /**
4855
- * We first check to see if the identifier/label is an appropriate region,
4856
- * if it is then we set that as our displayed region
4857
- * if the label was not a valid region, then
4858
- * 1) we get the trackId and the location/locStr of the option we chose
4859
- * 2) we then use the label to try and fetch for exact matches through our
4860
- * textSearchManager
4861
- * 3) if we get any hits by requerying the textSearchManager, then we either
4862
- * navigate to single hit's location or pop open the the dialog with all the results
4863
- * 4) if there were no hits from requerying, then we use (1) the chosen options'
4864
- * trackId and locStr to navigate and show that track
4865
- * 5) error handling
4866
- * @param input - selectedRegion/result label
4849
+ * gets a string as input, or use stored option results from previous query,
4850
+ * then re-query and
4851
+ * 1) if it has multiple results: pop a dialog
4852
+ * 2) if it's a single result navigate to it
4853
+ * 3) else assume it's a locstring and navigate to it
4867
4854
  */
4868
4855
 
4869
4856
 
@@ -4886,11 +4873,7 @@ var ImportForm = /*#__PURE__*/observer(function (_ref2) {
4886
4873
 
4887
4874
  case 3:
4888
4875
  results = _context.sent;
4889
- return _context.abrupt("return", results === null || results === void 0 ? void 0 : results.filter(function (elem, index, self) {
4890
- return index === self.findIndex(function (t) {
4891
- return t.getId() === elem.getId();
4892
- });
4893
- }));
4876
+ return _context.abrupt("return", dedupe(results));
4894
4877
 
4895
4878
  case 5:
4896
4879
  case "end":
@@ -4904,76 +4887,83 @@ var ImportForm = /*#__PURE__*/observer(function (_ref2) {
4904
4887
 
4905
4888
  function handleSelectedRegion(_x2) {
4906
4889
  return _handleSelectedRegion.apply(this, arguments);
4907
- }
4890
+ } // implementation notes:
4891
+ // having this wrapped in a form allows intuitive use of enter key to submit
4892
+
4908
4893
 
4909
4894
  function _handleSelectedRegion() {
4910
4895
  _handleSelectedRegion = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(input) {
4911
- var trackId, location, newRegion, results;
4896
+ var trackId, location, _assembly$refNames, results;
4897
+
4912
4898
  return runtime_1.wrap(function _callee2$(_context2) {
4913
4899
  while (1) {
4914
4900
  switch (_context2.prev = _context2.next) {
4915
4901
  case 0:
4916
- trackId = optionTrackId;
4917
- location = optionLocation;
4918
- newRegion = regions.find(function (r) {
4919
- return selectedRegion === r.refName;
4920
- });
4921
-
4922
- if (!newRegion) {
4923
- _context2.next = 8;
4902
+ if (option) {
4903
+ _context2.next = 2;
4924
4904
  break;
4925
4905
  }
4926
4906
 
4927
- model.setDisplayedRegions([newRegion]); // we use showAllRegions after setDisplayedRegions to make the entire
4928
- // region visible, xref #1703
4907
+ return _context2.abrupt("return");
4929
4908
 
4930
- model.showAllRegions();
4931
- _context2.next = 12;
4909
+ case 2:
4910
+ trackId = option.getTrackId();
4911
+ location = input || option.getLocation() || '';
4912
+ _context2.prev = 4;
4913
+
4914
+ if (!(assembly !== null && assembly !== void 0 && (_assembly$refNames = assembly.refNames) !== null && _assembly$refNames !== void 0 && _assembly$refNames.includes(location))) {
4915
+ _context2.next = 9;
4916
+ break;
4917
+ }
4918
+
4919
+ model.navToLocString(location, selectedAsm);
4920
+ _context2.next = 20;
4932
4921
  break;
4933
4922
 
4934
- case 8:
4935
- _context2.next = 10;
4923
+ case 9:
4924
+ _context2.next = 11;
4936
4925
  return fetchResults(input);
4937
4926
 
4938
- case 10:
4927
+ case 11:
4939
4928
  results = _context2.sent;
4940
4929
 
4941
- if (results && results.length > 1) {
4942
- model.setSearchResults(results, input.toLowerCase());
4943
- } else {
4944
- if ((results === null || results === void 0 ? void 0 : results.length) === 1) {
4945
- location = results[0].getLocation();
4946
- trackId = results[0].getTrackId();
4947
- }
4930
+ if (!(results && results.length > 1)) {
4931
+ _context2.next = 17;
4932
+ break;
4933
+ }
4948
4934
 
4949
- try {
4950
- if (location) {
4951
- model.navToLocString(location, selectedAsm);
4952
- }
4953
- } catch (e) {
4954
- if ("".concat(e) === "Error: Unknown reference sequence \"".concat(input, "\"")) {
4955
- model.setSearchResults(results, input.toLocaleLowerCase());
4956
- } else {
4957
- console.warn(e);
4958
- session.notify("".concat(e), 'warning');
4959
- }
4960
- }
4935
+ model.setSearchResults(results, input.toLowerCase());
4936
+ return _context2.abrupt("return");
4961
4937
 
4962
- try {
4963
- if (trackId) {
4964
- model.showTrack(trackId);
4965
- }
4966
- } catch (e) {
4967
- console.warn("'".concat(e, "' occurred while attempting to show track: ").concat(trackId));
4968
- }
4938
+ case 17:
4939
+ if ((results === null || results === void 0 ? void 0 : results.length) === 1) {
4940
+ location = results[0].getLocation();
4941
+ trackId = results[0].getTrackId();
4942
+ }
4943
+
4944
+ case 18:
4945
+ model.navToLocString(location, selectedAsm);
4946
+
4947
+ if (trackId) {
4948
+ model.showTrack(trackId);
4969
4949
  }
4970
4950
 
4971
- case 12:
4951
+ case 20:
4952
+ _context2.next = 26;
4953
+ break;
4954
+
4955
+ case 22:
4956
+ _context2.prev = 22;
4957
+ _context2.t0 = _context2["catch"](4);
4958
+ console.error(_context2.t0);
4959
+ session.notify("".concat(_context2.t0), 'warning');
4960
+
4961
+ case 26:
4972
4962
  case "end":
4973
4963
  return _context2.stop();
4974
4964
  }
4975
4965
  }
4976
- }, _callee2);
4966
+ }, _callee2, null, [[4, 22]]);
4977
4967
  }));
4978
4968
  return _handleSelectedRegion.apply(this, arguments);
4979
4969
  }
@@ -4982,6 +4972,10 @@ var ImportForm = /*#__PURE__*/observer(function (_ref2) {
4982
4972
  error: err
4983
4973
  }) : null, /*#__PURE__*/React.createElement(Container, {
4984
4974
  className: classes.importFormContainer
4975
+ }, /*#__PURE__*/React.createElement("form", {
4976
+ onSubmit: function onSubmit(event) {
4977
+ event.preventDefault();
4978
+ }
4985
4979
  }, /*#__PURE__*/React.createElement(Grid, {
4986
4980
  container: true,
4987
4981
  spacing: 1,
@@ -5005,30 +4999,12 @@ var ImportForm = /*#__PURE__*/observer(function (_ref2) {
5005
4999
  assemblyName: message ? undefined : selectedAsm,
5006
5000
  value: selectedRegion,
5007
5001
  onSelect: function onSelect(option) {
5008
- setSelectedRegion(option.getLabel());
5009
- setOptionTrackId(option.getTrackId() || '');
5010
- setOptionLocation(option.getLocation());
5002
+ setOption(option);
5011
5003
  },
5012
5004
  TextFieldProps: {
5013
5005
  margin: 'normal',
5014
5006
  variant: 'outlined',
5015
- helperText: 'Enter a sequence or location',
5016
- onBlur: function onBlur(event) {
5017
- if (event.target.value !== '') {
5018
- setSelectedRegion(event.target.value);
5019
- } else {
5020
- setSelectedRegion(regions[0].refName);
5021
- }
5022
- },
5023
- onKeyPress: function onKeyPress(event) {
5024
- var elt = event.target; // maybe check regular expression here to see if it's a
5025
- // locstring try defaulting exact matches to first exact
5026
- // match
5027
-
5028
- if (event.key === 'Enter') {
5029
- handleSelectedRegion(elt.value);
5030
- }
5031
- }
5007
+ helperText: 'Enter a sequence or location'
5032
5008
  }
5033
5009
  }) : /*#__PURE__*/React.createElement(CircularProgress, {
5034
5010
  role: "progressbar",
@@ -5037,6 +5013,7 @@ var ImportForm = /*#__PURE__*/observer(function (_ref2) {
5037
5013
  }) : null), /*#__PURE__*/React.createElement(Grid, {
5038
5014
  item: true
5039
5015
  }, /*#__PURE__*/React.createElement(Button$1, {
5016
+ type: "submit",
5040
5017
  disabled: !selectedRegion,
5041
5018
  className: classes.button,
5042
5019
  onClick: function onClick() {
@@ -5057,7 +5034,7 @@ var ImportForm = /*#__PURE__*/observer(function (_ref2) {
5057
5034
  },
5058
5035
  variant: "contained",
5059
5036
  color: "secondary"
5060
- }, "Show all regions in assembly")))), isSearchDialogDisplayed ? /*#__PURE__*/React.createElement(SearchResultsDialog, {
5037
+ }, "Show all regions in assembly"))))), isSearchDialogDisplayed ? /*#__PURE__*/React.createElement(SearchResultsDialog, {
5061
5038
  model: model,
5062
5039
  optAssemblyName: selectedAsm,
5063
5040
  handleClose: function handleClose() {
@@ -5385,20 +5362,17 @@ function mathPower(num) {
5385
5362
  }
5386
5363
 
5387
5364
  var useStyles$i = /*#__PURE__*/makeStyles(function () {
5388
- return (
5389
- /* theme */
5390
- {
5391
- majorTickLabel: {
5392
- fontSize: '11px'
5393
- },
5394
- majorTick: {
5395
- stroke: '#555'
5396
- },
5397
- minorTick: {
5398
- stroke: '#999'
5399
- }
5365
+ return {
5366
+ majorTickLabel: {
5367
+ fontSize: '11px'
5368
+ },
5369
+ majorTick: {
5370
+ stroke: '#555'
5371
+ },
5372
+ minorTick: {
5373
+ stroke: '#999'
5400
5374
  }
5401
- );
5375
+ };
5402
5376
  });
5403
5377
 
5404
5378
  function Ruler(_ref) {
@@ -5817,8 +5791,10 @@ var useStyles$k = /*#__PURE__*/makeStyles(function (theme) {
5817
5791
  function ExportSvgDlg(_ref) {
5818
5792
  var model = _ref.model,
5819
5793
  handleClose = _ref.handleClose;
5794
+ // @ts-ignore
5795
+ var offscreenCanvas = typeof OffscreenCanvas !== 'undefined';
5820
5796
 
5821
- var _useState = useState(typeof OffscreenCanvas !== 'undefined'),
5797
+ var _useState = useState(offscreenCanvas),
5822
5798
  _useState2 = _slicedToArray(_useState, 2),
5823
5799
  rasterizeLayers = _useState2[0],
5824
5800
  setRasterizeLayers = _useState2[1];
@@ -5851,7 +5827,7 @@ function ExportSvgDlg(_ref) {
5851
5827
  }
5852
5828
  }), /*#__PURE__*/React.createElement(Typography$1, {
5853
5829
  display: "inline"
5854
- }, "Creating SVG")) : null, typeof OffscreenCanvas !== 'undefined' ? /*#__PURE__*/React.createElement(FormControlLabel, {
5830
+ }, "Creating SVG")) : null, offscreenCanvas ? /*#__PURE__*/React.createElement(FormControlLabel, {
5855
5831
  control: /*#__PURE__*/React.createElement(Checkbox, {
5856
5832
  checked: rasterizeLayers,
5857
5833
  onChange: function onChange() {
@@ -5887,25 +5863,26 @@ function ExportSvgDlg(_ref) {
5887
5863
 
5888
5864
  case 5:
5889
5865
  handleClose();
5890
- _context.next = 11;
5866
+ _context.next = 12;
5891
5867
  break;
5892
5868
 
5893
5869
  case 8:
5894
5870
  _context.prev = 8;
5895
5871
  _context.t0 = _context["catch"](2);
5872
+ console.error(_context.t0);
5896
5873
  setError(_context.t0);
5897
5874
 
5898
- case 11:
5899
- _context.prev = 11;
5875
+ case 12:
5876
+ _context.prev = 12;
5900
5877
  setLoading(false);
5901
- return _context.finish(11);
5878
+ return _context.finish(12);
5902
5879
 
5903
- case 14:
5880
+ case 15:
5904
5881
  case "end":
5905
5882
  return _context.stop();
5906
5883
  }
5907
5884
  }
5908
- }, _callee, null, [[2, 8, 11, 14]]);
5885
+ }, _callee, null, [[2, 8, 12, 15]]);
5909
5886
  }));
5910
5887
 
5911
5888
  function onClick() {
@@ -7018,8 +6995,7 @@ function stateModelFactory$1(pluginManager) {
7018
6995
  self.zoomTo(self.bpPerPx);
7019
6996
 
7020
6997
  if ( // already zoomed all the way in
7021
- targetBpPerPx < self.bpPerPx && self.bpPerPx === self.minBpPerPx || // already zoomed all the way out
7022
- targetBpPerPx > self.bpPerPx && self.bpPerPx === self.maxBpPerPx) {
6998
+ targetBpPerPx < self.bpPerPx && self.bpPerPx === self.minBpPerPx || targetBpPerPx > self.bpPerPx && self.bpPerPx === self.maxBpPerPx) {
7023
6999
  return;
7024
7000
  }
7025
7001
 
@@ -7049,8 +7025,11 @@ function stateModelFactory$1(pluginManager) {
7049
7025
  var menuItems = [{
7050
7026
  label: 'Return to import form',
7051
7027
  onClick: function onClick() {
7052
- getSession(self).setDialogComponent(ReturnToImportFormDlg, {
7053
- model: self
7028
+ getSession(self).queueDialog(function (doneCallback) {
7029
+ return [ReturnToImportFormDlg, {
7030
+ model: self,
7031
+ handleClose: doneCallback
7032
+ }];
7054
7033
  });
7055
7034
  },
7056
7035
  icon: FolderOpenIcon
@@ -7058,8 +7037,11 @@ function stateModelFactory$1(pluginManager) {
7058
7037
  label: 'Export SVG',
7059
7038
  icon: PhotoCameraIcon,
7060
7039
  onClick: function onClick() {
7061
- getSession(self).setDialogComponent(ExportSvgDlg, {
7062
- model: self
7040
+ getSession(self).queueDialog(function (doneCallback) {
7041
+ return [ExportSvgDlg, {
7042
+ model: self,
7043
+ handleClose: doneCallback
7044
+ }];
7063
7045
  });
7064
7046
  }
7065
7047
  }, {
@@ -7278,6 +7260,7 @@ var stateModelFactory$2 = function stateModelFactory(configSchema) {
7278
7260
  return types.compose('LinearBasicDisplay', BaseLinearDisplay$1, types.model({
7279
7261
  type: types.literal('LinearBasicDisplay'),
7280
7262
  trackShowLabels: types.maybe(types["boolean"]),
7263
+ trackShowDescriptions: types.maybe(types["boolean"]),
7281
7264
  trackDisplayMode: types.maybe(types.string),
7282
7265
  trackMaxHeight: types.maybe(types.number),
7283
7266
  configuration: ConfigurationReference$1(configSchema)
@@ -7292,6 +7275,11 @@ var stateModelFactory$2 = function stateModelFactory(configSchema) {
7292
7275
  return self.trackShowLabels !== undefined ? self.trackShowLabels : showLabels;
7293
7276
  },
7294
7277
 
7278
+ get showDescriptions() {
7279
+ var showDescriptions = getConf(self, ['renderer', 'showLabels']);
7280
+ return self.trackShowDescriptions !== undefined ? self.trackShowDescriptions : showDescriptions;
7281
+ },
7282
+
7295
7283
  get maxHeight() {
7296
7284
  var maxHeight = getConf(self, ['renderer', 'maxHeight']);
7297
7285
  return self.trackMaxHeight !== undefined ? self.trackMaxHeight : maxHeight;
@@ -7306,6 +7294,7 @@ var stateModelFactory$2 = function stateModelFactory(configSchema) {
7306
7294
  var configBlob = getConf(self, ['renderer']) || {};
7307
7295
  return self.rendererType.configSchema.create(_objectSpread2(_objectSpread2({}, configBlob), {}, {
7308
7296
  showLabels: this.showLabels,
7297
+ showDescriptions: this.showDescriptions,
7309
7298
  displayMode: this.displayMode,
7310
7299
  maxHeight: this.maxHeight
7311
7300
  }), getEnv(self));
@@ -7317,6 +7306,9 @@ var stateModelFactory$2 = function stateModelFactory(configSchema) {
7317
7306
  toggleShowLabels: function toggleShowLabels() {
7318
7307
  self.trackShowLabels = !self.showLabels;
7319
7308
  },
7309
+ toggleShowDescriptions: function toggleShowDescriptions() {
7310
+ self.trackShowDescriptions = !self.showDescriptions;
7311
+ },
7320
7312
  setDisplayMode: function setDisplayMode(val) {
7321
7313
  self.trackDisplayMode = val;
7322
7314
  },
@@ -7343,6 +7335,14 @@ var stateModelFactory$2 = function stateModelFactory(configSchema) {
7343
7335
  onClick: function onClick() {
7344
7336
  self.toggleShowLabels();
7345
7337
  }
7338
+ }, {
7339
+ label: 'Show descriptions',
7340
+ icon: VisibilityIcon,
7341
+ type: 'checkbox',
7342
+ checked: self.showDescriptions,
7343
+ onClick: function onClick() {
7344
+ self.toggleShowDescriptions();
7345
+ }
7346
7346
  }, {
7347
7347
  label: 'Display mode',
7348
7348
  icon: VisibilityIcon,
@@ -7357,8 +7357,11 @@ var stateModelFactory$2 = function stateModelFactory(configSchema) {
7357
7357
  }, {
7358
7358
  label: 'Set max height',
7359
7359
  onClick: function onClick() {
7360
- getSession(self).setDialogComponent(SetMaxHeightDlg, {
7361
- model: self
7360
+ getSession(self).queueDialog(function (doneCallback) {
7361
+ return [SetMaxHeightDlg, {
7362
+ model: self,
7363
+ handleClose: doneCallback
7364
+ }];
7362
7365
  });
7363
7366
  }
7364
7367
  }]);
@@ -7469,7 +7472,7 @@ var LinearGenomeViewPlugin = /*#__PURE__*/function (_Plugin) {
7469
7472
  key: "configure",
7470
7473
  value: function configure(pluginManager) {
7471
7474
  if (isAbstractMenuManager(pluginManager.rootModel)) {
7472
- pluginManager.rootModel.appendToSubMenu(['File', 'Add'], {
7475
+ pluginManager.rootModel.appendToSubMenu(['Add'], {
7473
7476
  label: 'Linear genome view',
7474
7477
  icon: LineStyleIcon,
7475
7478
  onClick: function onClick(session) {
@@ -7553,5 +7556,5 @@ var SetMaxHeight$1 = {
7553
7556
  };
7554
7557
 
7555
7558
  export default LinearGenomeViewPlugin;
7556
- export { BaseLinearDisplay$1 as BaseLinearDisplay, BaseLinearDisplay as BaseLinearDisplayComponent, baseLinearDisplayConfigSchema, configSchemaFactory as linearBareDisplayConfigSchemaFactory, configSchemaFactory$1 as linearBasicDisplayConfigSchemaFactory, stateModelFactory$2 as linearBasicDisplayModelFactory, renderToSvg };
7559
+ export { BaseLinearDisplay$1 as BaseLinearDisplay, BaseLinearDisplay as BaseLinearDisplayComponent, RefNameAutocomplete$1 as RefNameAutocomplete, baseLinearDisplayConfigSchema, configSchemaFactory as linearBareDisplayConfigSchemaFactory, configSchemaFactory$1 as linearBasicDisplayConfigSchemaFactory, stateModelFactory$2 as linearBasicDisplayModelFactory, renderToSvg };
7557
7560
  //# sourceMappingURL=plugin-linear-genome-view.esm.js.map