@jbrowse/plugin-linear-genome-view 2.13.0 → 2.14.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 (111) hide show
  1. package/dist/BaseLinearDisplay/components/LinearBlocks.js +2 -2
  2. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +3 -1
  3. package/dist/BaseLinearDisplay/components/Tooltip.js +1 -1
  4. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +1 -1
  5. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +8 -5
  6. package/dist/BaseLinearDisplay/models/FeatureDensityMixin.js +2 -3
  7. package/dist/BaseLinearDisplay/models/renderSvg.d.ts +1 -1
  8. package/dist/BaseLinearDisplay/models/renderSvg.js +3 -1
  9. package/dist/BaseLinearDisplay/models/util.d.ts +1 -1
  10. package/dist/BaseLinearDisplay/models/util.js +3 -5
  11. package/dist/LaunchLinearGenomeView/index.js +12 -11
  12. package/dist/LinearBareDisplay/model.d.ts +1 -1
  13. package/dist/LinearBasicDisplay/components/AddFiltersDialog.js +9 -3
  14. package/dist/LinearBasicDisplay/components/SetMaxHeightDialog.js +6 -2
  15. package/dist/LinearBasicDisplay/model.d.ts +2 -4
  16. package/dist/LinearBasicDisplay/model.js +9 -3
  17. package/dist/LinearGenomeView/components/Cytobands.js +6 -23
  18. package/dist/LinearGenomeView/components/ExportSvgDialog.js +16 -6
  19. package/dist/LinearGenomeView/components/GetSequenceDialog.js +13 -16
  20. package/dist/LinearGenomeView/components/Header.js +6 -2
  21. package/dist/LinearGenomeView/components/Highlight.js +24 -25
  22. package/dist/LinearGenomeView/components/ImportForm.js +5 -2
  23. package/dist/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +5 -1
  24. package/dist/LinearGenomeView/components/LinearGenomeView.d.ts +2 -3
  25. package/dist/LinearGenomeView/components/LinearGenomeView.js +5 -3
  26. package/dist/LinearGenomeView/components/MiniControls.js +6 -2
  27. package/dist/LinearGenomeView/components/OverviewHighlight.js +23 -30
  28. package/dist/LinearGenomeView/components/OverviewRubberband.js +1 -1
  29. package/dist/LinearGenomeView/components/OverviewScalebar.js +6 -11
  30. package/dist/LinearGenomeView/components/OverviewScalebarPolygon.js +1 -2
  31. package/dist/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +6 -5
  32. package/dist/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +6 -2
  33. package/dist/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +3 -1
  34. package/dist/LinearGenomeView/components/RefNameAutocomplete/index.js +9 -7
  35. package/dist/LinearGenomeView/components/RubberbandSpan.js +3 -5
  36. package/dist/LinearGenomeView/components/Scalebar.js +2 -1
  37. package/dist/LinearGenomeView/components/SearchResultsDialog.js +3 -1
  38. package/dist/LinearGenomeView/components/SearchResultsTable.js +2 -3
  39. package/dist/LinearGenomeView/components/SequenceSearchDialog.js +15 -5
  40. package/dist/LinearGenomeView/components/TrackContainer.js +2 -2
  41. package/dist/LinearGenomeView/components/TrackLabel.js +15 -5
  42. package/dist/LinearGenomeView/components/TrackLabelDragHandle.js +3 -1
  43. package/dist/LinearGenomeView/components/TracksContainer.js +1 -1
  44. package/dist/LinearGenomeView/components/ZoomControls.js +10 -4
  45. package/dist/LinearGenomeView/components/hooks.d.ts +2 -2
  46. package/dist/LinearGenomeView/components/hooks.js +24 -26
  47. package/dist/LinearGenomeView/components/util.d.ts +2 -2
  48. package/dist/LinearGenomeView/model.d.ts +24 -13
  49. package/dist/LinearGenomeView/model.js +75 -46
  50. package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +0 -1
  51. package/dist/LinearGenomeView/svgcomponents/SVGRuler.js +1 -1
  52. package/dist/LinearGenomeView/util.d.ts +1 -1
  53. package/dist/LinearGenomeView/util.js +4 -9
  54. package/dist/index.d.ts +3 -414
  55. package/dist/searchUtils.js +4 -6
  56. package/esm/BaseLinearDisplay/components/LinearBlocks.js +2 -2
  57. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +3 -1
  58. package/esm/BaseLinearDisplay/components/Tooltip.js +1 -1
  59. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +1 -1
  60. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +8 -5
  61. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +2 -3
  62. package/esm/BaseLinearDisplay/models/renderSvg.d.ts +1 -1
  63. package/esm/BaseLinearDisplay/models/renderSvg.js +3 -1
  64. package/esm/BaseLinearDisplay/models/util.d.ts +1 -1
  65. package/esm/BaseLinearDisplay/models/util.js +3 -5
  66. package/esm/LaunchLinearGenomeView/index.js +13 -12
  67. package/esm/LinearBareDisplay/model.d.ts +1 -1
  68. package/esm/LinearBasicDisplay/components/AddFiltersDialog.js +9 -3
  69. package/esm/LinearBasicDisplay/components/SetMaxHeightDialog.js +6 -2
  70. package/esm/LinearBasicDisplay/model.d.ts +2 -4
  71. package/esm/LinearBasicDisplay/model.js +9 -3
  72. package/esm/LinearGenomeView/components/Cytobands.js +6 -23
  73. package/esm/LinearGenomeView/components/ExportSvgDialog.js +16 -6
  74. package/esm/LinearGenomeView/components/GetSequenceDialog.js +13 -16
  75. package/esm/LinearGenomeView/components/Header.js +6 -2
  76. package/esm/LinearGenomeView/components/Highlight.js +26 -27
  77. package/esm/LinearGenomeView/components/ImportForm.js +5 -2
  78. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +5 -1
  79. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +2 -3
  80. package/esm/LinearGenomeView/components/LinearGenomeView.js +5 -3
  81. package/esm/LinearGenomeView/components/MiniControls.js +6 -2
  82. package/esm/LinearGenomeView/components/OverviewHighlight.js +24 -31
  83. package/esm/LinearGenomeView/components/OverviewRubberband.js +1 -1
  84. package/esm/LinearGenomeView/components/OverviewScalebar.js +6 -11
  85. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +1 -2
  86. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +6 -5
  87. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +6 -2
  88. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +3 -1
  89. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +10 -8
  90. package/esm/LinearGenomeView/components/RubberbandSpan.js +3 -5
  91. package/esm/LinearGenomeView/components/Scalebar.js +2 -1
  92. package/esm/LinearGenomeView/components/SearchResultsDialog.js +3 -1
  93. package/esm/LinearGenomeView/components/SearchResultsTable.js +2 -3
  94. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +15 -5
  95. package/esm/LinearGenomeView/components/TrackContainer.js +2 -2
  96. package/esm/LinearGenomeView/components/TrackLabel.js +15 -5
  97. package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +3 -1
  98. package/esm/LinearGenomeView/components/TracksContainer.js +1 -1
  99. package/esm/LinearGenomeView/components/ZoomControls.js +10 -4
  100. package/esm/LinearGenomeView/components/hooks.d.ts +2 -2
  101. package/esm/LinearGenomeView/components/hooks.js +24 -26
  102. package/esm/LinearGenomeView/components/util.d.ts +2 -2
  103. package/esm/LinearGenomeView/model.d.ts +24 -13
  104. package/esm/LinearGenomeView/model.js +77 -48
  105. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +0 -1
  106. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +1 -1
  107. package/esm/LinearGenomeView/util.d.ts +1 -1
  108. package/esm/LinearGenomeView/util.js +4 -9
  109. package/esm/index.d.ts +3 -414
  110. package/esm/searchUtils.js +4 -6
  111. package/package.json +3 -3
@@ -2,12 +2,12 @@ import { lazy } from 'react';
2
2
  import { getConf } from '@jbrowse/core/configuration';
3
3
  import { BaseViewModel } from '@jbrowse/core/pluggableElementTypes/models';
4
4
  import { ElementId } from '@jbrowse/core/util/types/mst';
5
- import { assembleLocString, clamp, findLast, getContainingView, getSession, isViewContainer, isSessionModelWithWidgets, isSessionWithAddTracks, localStorageGetItem, localStorageSetItem, measureText, springAnimate, sum, } from '@jbrowse/core/util';
5
+ import { assembleLocString, clamp, findLast, getSession, isSessionModelWithWidgets, isSessionWithAddTracks, localStorageGetItem, localStorageSetItem, measureText, springAnimate, sum, } from '@jbrowse/core/util';
6
6
  import calculateDynamicBlocks from '@jbrowse/core/util/calculateDynamicBlocks';
7
7
  import calculateStaticBlocks from '@jbrowse/core/util/calculateStaticBlocks';
8
8
  import { getParentRenderProps } from '@jbrowse/core/util/tracks';
9
9
  import { when, transaction, autorun } from 'mobx';
10
- import { addDisposer, cast, getSnapshot, getRoot, resolveIdentifier, types, } from 'mobx-state-tree';
10
+ import { addDisposer, cast, getSnapshot, getRoot, resolveIdentifier, types, getParent, } from 'mobx-state-tree';
11
11
  import Base1DView from '@jbrowse/core/util/Base1DViewModel';
12
12
  import { moveTo, pxToBp, bpToPx } from '@jbrowse/core/util/Base1DUtils';
13
13
  import { saveAs } from 'file-saver';
@@ -147,6 +147,11 @@ export function stateModelFactory(pluginManager) {
147
147
  * color by CDS
148
148
  */
149
149
  colorByCDS: types.optional(types.boolean, () => Boolean(JSON.parse(localStorageGetItem('lgv-colorByCDS') || 'false'))),
150
+ /**
151
+ * #property
152
+ * color by CDS
153
+ */
154
+ showTrackOutlines: types.optional(types.boolean, () => Boolean(JSON.parse(localStorageGetItem('lgv-showTrackOutlines') || 'true'))),
150
155
  }))
151
156
  .volatile(() => ({
152
157
  volatileWidth: undefined,
@@ -164,9 +169,6 @@ export function stateModelFactory(pluginManager) {
164
169
  rightOffset: undefined,
165
170
  }))
166
171
  .views(self => ({
167
- scaleBarDisplayPrefix() {
168
- return '';
169
- },
170
172
  /**
171
173
  * #getter
172
174
  * this is the effective value of the track labels setting, incorporating
@@ -207,14 +209,20 @@ export function stateModelFactory(pluginManager) {
207
209
  /**
208
210
  * #method
209
211
  */
210
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
212
+ scaleBarDisplayPrefix() {
213
+ return getParent(self, 2).type === 'LinearSyntenyView'
214
+ ? self.assemblyNames[0]
215
+ : '';
216
+ },
217
+ /**
218
+ * #method
219
+ */
211
220
  MiniControlsComponent() {
212
221
  return MiniControls;
213
222
  },
214
223
  /**
215
224
  * #method
216
225
  */
217
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
218
226
  HeaderComponent() {
219
227
  return Header;
220
228
  },
@@ -223,8 +231,7 @@ export function stateModelFactory(pluginManager) {
223
231
  */
224
232
  get assemblyErrors() {
225
233
  const { assemblyManager } = getSession(self);
226
- const { assemblyNames } = self;
227
- return assemblyNames
234
+ return self.assemblyNames
228
235
  .map(a => { var _a; return (_a = assemblyManager.get(a)) === null || _a === void 0 ? void 0 : _a.error; })
229
236
  .filter(f => !!f)
230
237
  .join(', ');
@@ -411,6 +418,12 @@ export function stateModelFactory(pluginManager) {
411
418
  },
412
419
  }))
413
420
  .actions(self => ({
421
+ /**
422
+ * #action
423
+ */
424
+ setShowTrackOutlines(arg) {
425
+ self.showTrackOutlines = arg;
426
+ },
414
427
  /**
415
428
  * #action
416
429
  */
@@ -463,8 +476,7 @@ export function stateModelFactory(pluginManager) {
463
476
  * #action
464
477
  */
465
478
  addToHighlights(highlight) {
466
- var _a;
467
- (_a = self.highlight) === null || _a === void 0 ? void 0 : _a.push(highlight);
479
+ self.highlight.push(highlight);
468
480
  },
469
481
  /**
470
482
  * #action
@@ -592,7 +604,9 @@ export function stateModelFactory(pluginManager) {
592
604
  const schema = pluginManager.pluggableConfigSchemaType('track');
593
605
  const conf = resolveIdentifier(schema, getRoot(self), trackId);
594
606
  const t = self.tracks.filter(t => t.configuration === conf);
595
- transaction(() => t.forEach(t => self.tracks.remove(t)));
607
+ transaction(() => {
608
+ t.forEach(t => self.tracks.remove(t));
609
+ });
596
610
  return t.length;
597
611
  },
598
612
  }))
@@ -654,22 +668,6 @@ export function stateModelFactory(pluginManager) {
654
668
  tracks.splice(newIndex, 0, self.tracks[oldIndex]);
655
669
  self.tracks = cast(tracks);
656
670
  },
657
- /**
658
- * #action
659
- */
660
- closeView() {
661
- const parent = getContainingView(self);
662
- if (parent) {
663
- // I am embedded in a some other view
664
- if (isViewContainer(parent)) {
665
- parent.removeView(self);
666
- }
667
- }
668
- else {
669
- // I am part of a session
670
- getSession(self).removeView(self);
671
- }
672
- },
673
671
  /**
674
672
  * #action
675
673
  */
@@ -902,8 +900,9 @@ export function stateModelFactory(pluginManager) {
902
900
  * that offset is calculated manually with this method
903
901
  */
904
902
  get cytobandOffset() {
903
+ var _a;
905
904
  return this.showCytobands
906
- ? measureText(self.displayedRegions[0].refName, 12) + 15
905
+ ? measureText(((_a = self.displayedRegions[0]) === null || _a === void 0 ? void 0 : _a.refName) || '', 12) + 15
907
906
  : 0;
908
907
  },
909
908
  }))
@@ -965,7 +964,9 @@ export function stateModelFactory(pluginManager) {
965
964
  type: 'checkbox',
966
965
  checked: self.colorByCDS,
967
966
  icon: PaletteIcon,
968
- onClick: () => self.setColorByCDS(!self.colorByCDS),
967
+ onClick: () => {
968
+ self.setColorByCDS(!self.colorByCDS);
969
+ },
969
970
  },
970
971
  {
971
972
  label: 'Show...',
@@ -979,32 +980,50 @@ export function stateModelFactory(pluginManager) {
979
980
  label: 'Show center line',
980
981
  type: 'checkbox',
981
982
  checked: self.showCenterLine,
982
- onClick: () => self.setShowCenterLine(!self.showCenterLine),
983
+ onClick: () => {
984
+ self.setShowCenterLine(!self.showCenterLine);
985
+ },
983
986
  },
984
987
  {
985
988
  label: 'Show header',
986
989
  type: 'checkbox',
987
990
  checked: !self.hideHeader,
988
- onClick: () => self.setHideHeader(!self.hideHeader),
991
+ onClick: () => {
992
+ self.setHideHeader(!self.hideHeader);
993
+ },
994
+ },
995
+ {
996
+ label: 'Show track outlines',
997
+ type: 'checkbox',
998
+ checked: self.showTrackOutlines,
999
+ onClick: () => {
1000
+ self.setShowTrackOutlines(!self.showTrackOutlines);
1001
+ },
989
1002
  },
990
1003
  {
991
1004
  label: 'Show header overview',
992
1005
  type: 'checkbox',
993
1006
  checked: !self.hideHeaderOverview,
994
- onClick: () => self.setHideHeaderOverview(!self.hideHeaderOverview),
1007
+ onClick: () => {
1008
+ self.setHideHeaderOverview(!self.hideHeaderOverview);
1009
+ },
995
1010
  disabled: self.hideHeader,
996
1011
  },
997
1012
  {
998
1013
  label: 'Show no tracks active button',
999
1014
  type: 'checkbox',
1000
1015
  checked: !self.hideNoTracksActive,
1001
- onClick: () => self.setHideNoTracksActive(!self.hideNoTracksActive),
1016
+ onClick: () => {
1017
+ self.setHideNoTracksActive(!self.hideNoTracksActive);
1018
+ },
1002
1019
  },
1003
1020
  {
1004
1021
  label: 'Show guidelines',
1005
1022
  type: 'checkbox',
1006
1023
  checked: self.showGridlines,
1007
- onClick: () => self.setShowGridlines(!self.showGridlines),
1024
+ onClick: () => {
1025
+ self.setShowGridlines(!self.showGridlines);
1026
+ },
1008
1027
  },
1009
1028
  ...(canShowCytobands
1010
1029
  ? [
@@ -1012,7 +1031,9 @@ export function stateModelFactory(pluginManager) {
1012
1031
  label: 'Show ideogram',
1013
1032
  type: 'checkbox',
1014
1033
  checked: self.showCytobands,
1015
- onClick: () => self.setShowCytobands(!showCytobands),
1034
+ onClick: () => {
1035
+ self.setShowCytobands(!showCytobands);
1036
+ },
1016
1037
  },
1017
1038
  ]
1018
1039
  : []),
@@ -1027,21 +1048,27 @@ export function stateModelFactory(pluginManager) {
1027
1048
  icon: VisibilityIcon,
1028
1049
  type: 'radio',
1029
1050
  checked: self.trackLabelsSetting === 'overlapping',
1030
- onClick: () => self.setTrackLabels('overlapping'),
1051
+ onClick: () => {
1052
+ self.setTrackLabels('overlapping');
1053
+ },
1031
1054
  },
1032
1055
  {
1033
1056
  label: 'Offset',
1034
1057
  icon: VisibilityIcon,
1035
1058
  type: 'radio',
1036
1059
  checked: self.trackLabelsSetting === 'offset',
1037
- onClick: () => self.setTrackLabels('offset'),
1060
+ onClick: () => {
1061
+ self.setTrackLabels('offset');
1062
+ },
1038
1063
  },
1039
1064
  {
1040
1065
  label: 'Hidden',
1041
1066
  icon: VisibilityIcon,
1042
1067
  type: 'radio',
1043
1068
  checked: self.trackLabelsSetting === 'hidden',
1044
- onClick: () => self.setTrackLabels('hidden'),
1069
+ onClick: () => {
1070
+ self.setTrackLabels('hidden');
1071
+ },
1045
1072
  },
1046
1073
  ],
1047
1074
  },
@@ -1162,13 +1189,11 @@ export function stateModelFactory(pluginManager) {
1162
1189
  async navToLocString(input, optAssemblyName) {
1163
1190
  const { assemblyNames } = self;
1164
1191
  const { assemblyManager } = getSession(self);
1165
- const { isValidRefName } = assemblyManager;
1166
1192
  const assemblyName = optAssemblyName || assemblyNames[0];
1167
1193
  if (assemblyName) {
1168
- // wait before isValidRefName can be called
1169
1194
  await assemblyManager.waitForAssembly(assemblyName);
1170
1195
  }
1171
- return this.navToLocations(parseLocStrings(input, assemblyName, isValidRefName), assemblyName);
1196
+ return this.navToLocations(parseLocStrings(input, assemblyName, (ref, asm) => assemblyManager.isValidRefName(ref, asm)), assemblyName);
1172
1197
  },
1173
1198
  /**
1174
1199
  * #action
@@ -1297,16 +1322,19 @@ export function stateModelFactory(pluginManager) {
1297
1322
  {
1298
1323
  label: 'Zoom to region',
1299
1324
  icon: ZoomInIcon,
1300
- onClick: () => self.moveTo(self.leftOffset, self.rightOffset),
1325
+ onClick: () => {
1326
+ self.moveTo(self.leftOffset, self.rightOffset);
1327
+ },
1301
1328
  },
1302
1329
  {
1303
1330
  label: 'Get sequence',
1304
1331
  icon: MenuOpenIcon,
1305
- onClick: () => getSession(self).queueDialog(handleClose => [
1306
- GetSequenceDialog,
1307
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1308
- { model: self, handleClose },
1309
- ]),
1332
+ onClick: () => {
1333
+ getSession(self).queueDialog(handleClose => [
1334
+ GetSequenceDialog,
1335
+ { model: self, handleClose },
1336
+ ]);
1337
+ },
1310
1338
  },
1311
1339
  ];
1312
1340
  },
@@ -1380,6 +1408,7 @@ export function stateModelFactory(pluginManager) {
1380
1408
  },
1381
1409
  }))
1382
1410
  .preProcessSnapshot(snap => {
1411
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1383
1412
  if (!snap) {
1384
1413
  return snap;
1385
1414
  }
@@ -16,7 +16,6 @@ export async function renderToSvg(model, opts) {
16
16
  const { textHeight = 18, headerHeight = 40, rulerHeight = 50, fontSize = 13, cytobandHeight = 100, trackLabels = 'offset', themeName = 'default', Wrapper = ({ children }) => children, } = opts;
17
17
  const session = getSession(model);
18
18
  const { allThemes } = session;
19
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
19
  const { createRootFn } = getRoot(model);
21
20
  const theme = allThemes === null || allThemes === void 0 ? void 0 : allThemes()[themeName];
22
21
  const { width, tracks, showCytobands } = model;
@@ -11,7 +11,7 @@ function Ruler({ start, end, bpPerPx, reversed = false, major = true, minor = tr
11
11
  return (React.createElement(React.Fragment, null,
12
12
  ticks.map(tick => {
13
13
  const x = (reversed ? end - tick.base : tick.base - start) / bpPerPx;
14
- return (React.createElement("line", { key: 'tick-' + tick.base, x1: x, x2: x, y1: 0, y2: tick.type === 'major' ? 6 : 4, strokeWidth: 1, stroke: c }));
14
+ return (React.createElement("line", { key: `tick-${tick.base}`, x1: x, x2: x, y1: 0, y2: tick.type === 'major' ? 6 : 4, strokeWidth: 1, stroke: c }));
15
15
  }),
16
16
  !hideText
17
17
  ? ticks
@@ -20,7 +20,7 @@ export declare function makeTicks(start: number, end: number, bpPerPx: number, e
20
20
  *
21
21
  * Used by navToLocations and navToLocString
22
22
  */
23
- export declare function generateLocations(regions: ParsedLocString[] | undefined, assemblyManager: AssemblyManager, assemblyName?: string): Promise<{
23
+ export declare function generateLocations(regions: ParsedLocString[], assemblyManager: AssemblyManager, assemblyName?: string): Promise<{
24
24
  assemblyName: string;
25
25
  parentRegion: import("@jbrowse/core/assemblyManager/assembly").BasicRegion;
26
26
  end?: number | undefined;
@@ -34,9 +34,6 @@ export function makeTicks(start, end, bpPerPx, emitMajor = true, emitMinor = tru
34
34
  const gridPitch = chooseGridPitch(bpPerPx, 60, 15);
35
35
  let minBase = start;
36
36
  let maxBase = end;
37
- if (minBase === null || maxBase === null) {
38
- return [];
39
- }
40
37
  if (bpPerPx < 0) {
41
38
  ;
42
39
  [minBase, maxBase] = [maxBase, minBase];
@@ -67,7 +64,7 @@ export function makeTicks(start, end, bpPerPx, emitMajor = true, emitMinor = tru
67
64
  *
68
65
  * Used by navToLocations and navToLocString
69
66
  */
70
- export async function generateLocations(regions = [], assemblyManager, assemblyName) {
67
+ export async function generateLocations(regions, assemblyManager, assemblyName) {
71
68
  return Promise.all(regions.map(async (region) => {
72
69
  const asmName = region.assemblyName || assemblyName;
73
70
  if (!asmName) {
@@ -123,15 +120,13 @@ export function parseLocStrings(input, assemblyName, isValidRefName) {
123
120
  // if this fails, try interpreting as a whitespace-separated refname,
124
121
  // start, end if start and end are integer inputs
125
122
  const [refName, start, end] = inputs;
126
- if (`${e}`.match(/Unknown reference sequence/) &&
123
+ if (/Unknown reference sequence/.exec(`${e}`) &&
127
124
  Number.isInteger(+start) &&
128
125
  Number.isInteger(+end)) {
129
126
  return [
130
- parseLocString(refName + ':' + start + '..' + end, ref => isValidRefName(ref, assemblyName)),
127
+ parseLocString(`${refName}:${start}..${end}`, ref => isValidRefName(ref, assemblyName)),
131
128
  ];
132
129
  }
133
- else {
134
- throw e;
135
- }
130
+ throw e;
136
131
  }
137
132
  }