@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
@@ -45,7 +45,7 @@ function useSideScroll(model) {
45
45
  };
46
46
  }
47
47
  return cleanup;
48
- }, [model, mouseDragging, prevX]);
48
+ }, [model, mouseDragging]);
49
49
  function mouseDown(event) {
50
50
  if (event.shiftKey) {
51
51
  return;
@@ -122,7 +122,7 @@ function useRangeSelect(ref, model, shiftOnly) {
122
122
  };
123
123
  }
124
124
  return () => { };
125
- }, [startX, mouseDragging, anchorPosition, model, ref]);
125
+ }, [startX, mouseDragging, model, ref]);
126
126
  (0, react_1.useEffect)(() => {
127
127
  if (!mouseDragging &&
128
128
  currentX !== undefined &&
@@ -178,29 +178,27 @@ function useRangeSelect(ref, model, shiftOnly) {
178
178
  handleMenuItemClick,
179
179
  };
180
180
  }
181
- else {
182
- const right = anchorPosition ? anchorPosition.offsetX : currentX || 0;
183
- const left = right < startX ? right : startX;
184
- const width = Math.abs(right - startX);
185
- const leftBpOffset = model.pxToBp(left);
186
- const rightBpOffset = model.pxToBp(left + width);
187
- const numOfBpSelected = Math.ceil(width * model.bpPerPx);
188
- return {
189
- open,
190
- rubberbandOn: true,
191
- mouseDown,
192
- mouseMove,
193
- mouseOut,
194
- handleClose,
195
- handleMenuItemClick,
196
- leftBpOffset,
197
- rightBpOffset,
198
- anchorPosition,
199
- numOfBpSelected,
200
- width,
201
- left,
202
- };
203
- }
181
+ const right = anchorPosition ? anchorPosition.offsetX : currentX || 0;
182
+ const left = right < startX ? right : startX;
183
+ const width = Math.abs(right - startX);
184
+ const leftBpOffset = model.pxToBp(left);
185
+ const rightBpOffset = model.pxToBp(left + width);
186
+ const numOfBpSelected = Math.ceil(width * model.bpPerPx);
187
+ return {
188
+ open,
189
+ rubberbandOn: true,
190
+ mouseDown,
191
+ mouseMove,
192
+ mouseOut,
193
+ handleClose,
194
+ handleMenuItemClick,
195
+ leftBpOffset,
196
+ rightBpOffset,
197
+ anchorPosition,
198
+ numOfBpSelected,
199
+ width,
200
+ left,
201
+ };
204
202
  }
205
203
  function useWheelScroll(ref, model) {
206
204
  const delta = (0, react_1.useRef)(0);
@@ -211,7 +209,7 @@ function useWheelScroll(ref, model) {
211
209
  // if ctrl is held down, zoom in with y-scroll
212
210
  // else scroll horizontally with x-scroll
213
211
  function onWheel(event) {
214
- if (event.ctrlKey === true) {
212
+ if (event.ctrlKey) {
215
213
  event.preventDefault();
216
214
  delta.current += event.deltaY / 500;
217
215
  model.setScaleFactor(delta.current < 0 ? 1 - delta.current : 1 / (1 + delta.current));
@@ -12,10 +12,10 @@ export declare function fetchResults({ queryString, searchType, searchScope, ran
12
12
  assembly?: Assembly;
13
13
  }): Promise<BaseResult[]>;
14
14
  export declare function splitLast(str: string, split: string): [string, string];
15
- export declare function getRelativeX<T extends {
15
+ export declare function getRelativeX(event: {
16
16
  clientX: number;
17
17
  target: EventTarget | null;
18
- }>(event: T, element: HTMLElement | null): number;
18
+ }, element: HTMLElement | null): number;
19
19
  export declare function getCytobands(assembly: Assembly | undefined, refName: string): {
20
20
  refName: string;
21
21
  start: number;
@@ -33,6 +33,12 @@ export interface ExportSvgOptions {
33
33
  trackLabels?: string;
34
34
  themeName?: string;
35
35
  }
36
+ export interface HighlightType {
37
+ start: number;
38
+ end: number;
39
+ assemblyName: string;
40
+ refName: string;
41
+ }
36
42
  export interface NavLocation {
37
43
  refName: string;
38
44
  start?: number;
@@ -72,8 +78,9 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
72
78
  showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
73
79
  trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
74
80
  showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
75
- highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<Required<ParsedLocString>, Required<ParsedLocString>, Required<ParsedLocString>>>, [undefined]>;
81
+ highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<HighlightType, HighlightType, HighlightType>>, [undefined]>;
76
82
  colorByCDS: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
83
+ showTrackOutlines: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
77
84
  }, {
78
85
  width: number;
79
86
  } & {
@@ -87,7 +94,7 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
87
94
  minimumBlockWidth: number;
88
95
  draggingTrackId: undefined | string;
89
96
  volatileError: unknown;
90
- afterDisplayedRegionsSetCallbacks: Function[];
97
+ afterDisplayedRegionsSetCallbacks: (() => void)[];
91
98
  scaleFactor: number;
92
99
  trackRefs: Record<string, HTMLDivElement>;
93
100
  coarseDynamicBlocks: BaseBlock[];
@@ -95,7 +102,6 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
95
102
  leftOffset: undefined | BpOffset;
96
103
  rightOffset: undefined | BpOffset;
97
104
  } & {
98
- scaleBarDisplayPrefix(): "";
99
105
  /**
100
106
  * #getter
101
107
  * this is the effective value of the track labels setting, incorporating
@@ -115,6 +121,10 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
115
121
  */
116
122
  readonly assemblyNames: string[];
117
123
  } & {
124
+ /**
125
+ * #method
126
+ */
127
+ scaleBarDisplayPrefix(): string | undefined;
118
128
  /**
119
129
  * #method
120
130
  */
@@ -174,7 +184,7 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
174
184
  /**
175
185
  * #getter
176
186
  */
177
- readonly error: {};
187
+ readonly error: unknown;
178
188
  /**
179
189
  * #getter
180
190
  */
@@ -217,6 +227,10 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
217
227
  */
218
228
  readonly trackTypeActions: Map<string, MenuItem[]>;
219
229
  } & {
230
+ /**
231
+ * #action
232
+ */
233
+ setShowTrackOutlines(arg: boolean): void;
220
234
  /**
221
235
  * #action
222
236
  */
@@ -252,15 +266,15 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
252
266
  /**
253
267
  * #action
254
268
  */
255
- addToHighlights(highlight: Required<ParsedLocString>): void;
269
+ addToHighlights(highlight: HighlightType): void;
256
270
  /**
257
271
  * #action
258
272
  */
259
- setHighlight(highlight: Required<ParsedLocString>[] | undefined): void;
273
+ setHighlight(highlight?: HighlightType[]): void;
260
274
  /**
261
275
  * #action
262
276
  */
263
- removeHighlight(highlight: Required<ParsedLocString>): void;
277
+ removeHighlight(highlight: HighlightType): void;
264
278
  /**
265
279
  * #action
266
280
  */
@@ -317,10 +331,6 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
317
331
  * #action
318
332
  */
319
333
  moveTrack(movingId: string, targetId: string): void;
320
- /**
321
- * #action
322
- */
323
- closeView(): void;
324
334
  /**
325
335
  * #action
326
336
  */
@@ -372,7 +382,7 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
372
382
  * schedule something to be run after the next time displayedRegions is
373
383
  * set
374
384
  */
375
- afterDisplayedRegionsSet(cb: Function): void;
385
+ afterDisplayedRegionsSet(cb: () => void): void;
376
386
  /**
377
387
  * #action
378
388
  */
@@ -614,8 +624,9 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
614
624
  showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
615
625
  trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
616
626
  showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
617
- highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<Required<ParsedLocString>, Required<ParsedLocString>, Required<ParsedLocString>>>, [undefined]>;
627
+ highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<HighlightType, HighlightType, HighlightType>>, [undefined]>;
618
628
  colorByCDS: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
629
+ showTrackOutlines: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
619
630
  }>>, import("mobx-state-tree")._NotCustomized>;
620
631
  export type LinearGenomeViewStateModel = ReturnType<typeof stateModelFactory>;
621
632
  export type LinearGenomeViewModel = Instance<LinearGenomeViewStateModel>;
@@ -177,6 +177,11 @@ function stateModelFactory(pluginManager) {
177
177
  * color by CDS
178
178
  */
179
179
  colorByCDS: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.boolean, () => Boolean(JSON.parse((0, util_1.localStorageGetItem)('lgv-colorByCDS') || 'false'))),
180
+ /**
181
+ * #property
182
+ * color by CDS
183
+ */
184
+ showTrackOutlines: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.boolean, () => Boolean(JSON.parse((0, util_1.localStorageGetItem)('lgv-showTrackOutlines') || 'true'))),
180
185
  }))
181
186
  .volatile(() => ({
182
187
  volatileWidth: undefined,
@@ -194,9 +199,6 @@ function stateModelFactory(pluginManager) {
194
199
  rightOffset: undefined,
195
200
  }))
196
201
  .views(self => ({
197
- scaleBarDisplayPrefix() {
198
- return '';
199
- },
200
202
  /**
201
203
  * #getter
202
204
  * this is the effective value of the track labels setting, incorporating
@@ -237,14 +239,20 @@ function stateModelFactory(pluginManager) {
237
239
  /**
238
240
  * #method
239
241
  */
240
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
242
+ scaleBarDisplayPrefix() {
243
+ return (0, mobx_state_tree_1.getParent)(self, 2).type === 'LinearSyntenyView'
244
+ ? self.assemblyNames[0]
245
+ : '';
246
+ },
247
+ /**
248
+ * #method
249
+ */
241
250
  MiniControlsComponent() {
242
251
  return MiniControls_1.default;
243
252
  },
244
253
  /**
245
254
  * #method
246
255
  */
247
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
248
256
  HeaderComponent() {
249
257
  return Header_1.default;
250
258
  },
@@ -253,8 +261,7 @@ function stateModelFactory(pluginManager) {
253
261
  */
254
262
  get assemblyErrors() {
255
263
  const { assemblyManager } = (0, util_1.getSession)(self);
256
- const { assemblyNames } = self;
257
- return assemblyNames
264
+ return self.assemblyNames
258
265
  .map(a => { var _a; return (_a = assemblyManager.get(a)) === null || _a === void 0 ? void 0 : _a.error; })
259
266
  .filter(f => !!f)
260
267
  .join(', ');
@@ -441,6 +448,12 @@ function stateModelFactory(pluginManager) {
441
448
  },
442
449
  }))
443
450
  .actions(self => ({
451
+ /**
452
+ * #action
453
+ */
454
+ setShowTrackOutlines(arg) {
455
+ self.showTrackOutlines = arg;
456
+ },
444
457
  /**
445
458
  * #action
446
459
  */
@@ -493,8 +506,7 @@ function stateModelFactory(pluginManager) {
493
506
  * #action
494
507
  */
495
508
  addToHighlights(highlight) {
496
- var _a;
497
- (_a = self.highlight) === null || _a === void 0 ? void 0 : _a.push(highlight);
509
+ self.highlight.push(highlight);
498
510
  },
499
511
  /**
500
512
  * #action
@@ -622,7 +634,9 @@ function stateModelFactory(pluginManager) {
622
634
  const schema = pluginManager.pluggableConfigSchemaType('track');
623
635
  const conf = (0, mobx_state_tree_1.resolveIdentifier)(schema, (0, mobx_state_tree_1.getRoot)(self), trackId);
624
636
  const t = self.tracks.filter(t => t.configuration === conf);
625
- (0, mobx_1.transaction)(() => t.forEach(t => self.tracks.remove(t)));
637
+ (0, mobx_1.transaction)(() => {
638
+ t.forEach(t => self.tracks.remove(t));
639
+ });
626
640
  return t.length;
627
641
  },
628
642
  }))
@@ -684,22 +698,6 @@ function stateModelFactory(pluginManager) {
684
698
  tracks.splice(newIndex, 0, self.tracks[oldIndex]);
685
699
  self.tracks = (0, mobx_state_tree_1.cast)(tracks);
686
700
  },
687
- /**
688
- * #action
689
- */
690
- closeView() {
691
- const parent = (0, util_1.getContainingView)(self);
692
- if (parent) {
693
- // I am embedded in a some other view
694
- if ((0, util_1.isViewContainer)(parent)) {
695
- parent.removeView(self);
696
- }
697
- }
698
- else {
699
- // I am part of a session
700
- (0, util_1.getSession)(self).removeView(self);
701
- }
702
- },
703
701
  /**
704
702
  * #action
705
703
  */
@@ -932,8 +930,9 @@ function stateModelFactory(pluginManager) {
932
930
  * that offset is calculated manually with this method
933
931
  */
934
932
  get cytobandOffset() {
933
+ var _a;
935
934
  return this.showCytobands
936
- ? (0, util_1.measureText)(self.displayedRegions[0].refName, 12) + 15
935
+ ? (0, util_1.measureText)(((_a = self.displayedRegions[0]) === null || _a === void 0 ? void 0 : _a.refName) || '', 12) + 15
937
936
  : 0;
938
937
  },
939
938
  }))
@@ -995,7 +994,9 @@ function stateModelFactory(pluginManager) {
995
994
  type: 'checkbox',
996
995
  checked: self.colorByCDS,
997
996
  icon: Palette_1.default,
998
- onClick: () => self.setColorByCDS(!self.colorByCDS),
997
+ onClick: () => {
998
+ self.setColorByCDS(!self.colorByCDS);
999
+ },
999
1000
  },
1000
1001
  {
1001
1002
  label: 'Show...',
@@ -1009,32 +1010,50 @@ function stateModelFactory(pluginManager) {
1009
1010
  label: 'Show center line',
1010
1011
  type: 'checkbox',
1011
1012
  checked: self.showCenterLine,
1012
- onClick: () => self.setShowCenterLine(!self.showCenterLine),
1013
+ onClick: () => {
1014
+ self.setShowCenterLine(!self.showCenterLine);
1015
+ },
1013
1016
  },
1014
1017
  {
1015
1018
  label: 'Show header',
1016
1019
  type: 'checkbox',
1017
1020
  checked: !self.hideHeader,
1018
- onClick: () => self.setHideHeader(!self.hideHeader),
1021
+ onClick: () => {
1022
+ self.setHideHeader(!self.hideHeader);
1023
+ },
1024
+ },
1025
+ {
1026
+ label: 'Show track outlines',
1027
+ type: 'checkbox',
1028
+ checked: self.showTrackOutlines,
1029
+ onClick: () => {
1030
+ self.setShowTrackOutlines(!self.showTrackOutlines);
1031
+ },
1019
1032
  },
1020
1033
  {
1021
1034
  label: 'Show header overview',
1022
1035
  type: 'checkbox',
1023
1036
  checked: !self.hideHeaderOverview,
1024
- onClick: () => self.setHideHeaderOverview(!self.hideHeaderOverview),
1037
+ onClick: () => {
1038
+ self.setHideHeaderOverview(!self.hideHeaderOverview);
1039
+ },
1025
1040
  disabled: self.hideHeader,
1026
1041
  },
1027
1042
  {
1028
1043
  label: 'Show no tracks active button',
1029
1044
  type: 'checkbox',
1030
1045
  checked: !self.hideNoTracksActive,
1031
- onClick: () => self.setHideNoTracksActive(!self.hideNoTracksActive),
1046
+ onClick: () => {
1047
+ self.setHideNoTracksActive(!self.hideNoTracksActive);
1048
+ },
1032
1049
  },
1033
1050
  {
1034
1051
  label: 'Show guidelines',
1035
1052
  type: 'checkbox',
1036
1053
  checked: self.showGridlines,
1037
- onClick: () => self.setShowGridlines(!self.showGridlines),
1054
+ onClick: () => {
1055
+ self.setShowGridlines(!self.showGridlines);
1056
+ },
1038
1057
  },
1039
1058
  ...(canShowCytobands
1040
1059
  ? [
@@ -1042,7 +1061,9 @@ function stateModelFactory(pluginManager) {
1042
1061
  label: 'Show ideogram',
1043
1062
  type: 'checkbox',
1044
1063
  checked: self.showCytobands,
1045
- onClick: () => self.setShowCytobands(!showCytobands),
1064
+ onClick: () => {
1065
+ self.setShowCytobands(!showCytobands);
1066
+ },
1046
1067
  },
1047
1068
  ]
1048
1069
  : []),
@@ -1057,21 +1078,27 @@ function stateModelFactory(pluginManager) {
1057
1078
  icon: Visibility_1.default,
1058
1079
  type: 'radio',
1059
1080
  checked: self.trackLabelsSetting === 'overlapping',
1060
- onClick: () => self.setTrackLabels('overlapping'),
1081
+ onClick: () => {
1082
+ self.setTrackLabels('overlapping');
1083
+ },
1061
1084
  },
1062
1085
  {
1063
1086
  label: 'Offset',
1064
1087
  icon: Visibility_1.default,
1065
1088
  type: 'radio',
1066
1089
  checked: self.trackLabelsSetting === 'offset',
1067
- onClick: () => self.setTrackLabels('offset'),
1090
+ onClick: () => {
1091
+ self.setTrackLabels('offset');
1092
+ },
1068
1093
  },
1069
1094
  {
1070
1095
  label: 'Hidden',
1071
1096
  icon: Visibility_1.default,
1072
1097
  type: 'radio',
1073
1098
  checked: self.trackLabelsSetting === 'hidden',
1074
- onClick: () => self.setTrackLabels('hidden'),
1099
+ onClick: () => {
1100
+ self.setTrackLabels('hidden');
1101
+ },
1075
1102
  },
1076
1103
  ],
1077
1104
  },
@@ -1192,13 +1219,11 @@ function stateModelFactory(pluginManager) {
1192
1219
  async navToLocString(input, optAssemblyName) {
1193
1220
  const { assemblyNames } = self;
1194
1221
  const { assemblyManager } = (0, util_1.getSession)(self);
1195
- const { isValidRefName } = assemblyManager;
1196
1222
  const assemblyName = optAssemblyName || assemblyNames[0];
1197
1223
  if (assemblyName) {
1198
- // wait before isValidRefName can be called
1199
1224
  await assemblyManager.waitForAssembly(assemblyName);
1200
1225
  }
1201
- return this.navToLocations((0, util_2.parseLocStrings)(input, assemblyName, isValidRefName), assemblyName);
1226
+ return this.navToLocations((0, util_2.parseLocStrings)(input, assemblyName, (ref, asm) => assemblyManager.isValidRefName(ref, asm)), assemblyName);
1202
1227
  },
1203
1228
  /**
1204
1229
  * #action
@@ -1327,16 +1352,19 @@ function stateModelFactory(pluginManager) {
1327
1352
  {
1328
1353
  label: 'Zoom to region',
1329
1354
  icon: ZoomIn_1.default,
1330
- onClick: () => self.moveTo(self.leftOffset, self.rightOffset),
1355
+ onClick: () => {
1356
+ self.moveTo(self.leftOffset, self.rightOffset);
1357
+ },
1331
1358
  },
1332
1359
  {
1333
1360
  label: 'Get sequence',
1334
1361
  icon: MenuOpen_1.default,
1335
- onClick: () => (0, util_1.getSession)(self).queueDialog(handleClose => [
1336
- GetSequenceDialog,
1337
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1338
- { model: self, handleClose },
1339
- ]),
1362
+ onClick: () => {
1363
+ (0, util_1.getSession)(self).queueDialog(handleClose => [
1364
+ GetSequenceDialog,
1365
+ { model: self, handleClose },
1366
+ ]);
1367
+ },
1340
1368
  },
1341
1369
  ];
1342
1370
  },
@@ -1410,6 +1438,7 @@ function stateModelFactory(pluginManager) {
1410
1438
  },
1411
1439
  }))
1412
1440
  .preProcessSnapshot(snap => {
1441
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1413
1442
  if (!snap) {
1414
1443
  return snap;
1415
1444
  }
@@ -23,7 +23,6 @@ async function renderToSvg(model, opts) {
23
23
  const { textHeight = 18, headerHeight = 40, rulerHeight = 50, fontSize = 13, cytobandHeight = 100, trackLabels = 'offset', themeName = 'default', Wrapper = ({ children }) => children, } = opts;
24
24
  const session = (0, util_1.getSession)(model);
25
25
  const { allThemes } = session;
26
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
26
  const { createRootFn } = (0, mobx_state_tree_1.getRoot)(model);
28
27
  const theme = allThemes === null || allThemes === void 0 ? void 0 : allThemes()[themeName];
29
28
  const { width, tracks, showCytobands } = model;
@@ -17,7 +17,7 @@ function Ruler({ start, end, bpPerPx, reversed = false, major = true, minor = tr
17
17
  return (react_1.default.createElement(react_1.default.Fragment, null,
18
18
  ticks.map(tick => {
19
19
  const x = (reversed ? end - tick.base : tick.base - start) / bpPerPx;
20
- return (react_1.default.createElement("line", { key: 'tick-' + tick.base, x1: x, x2: x, y1: 0, y2: tick.type === 'major' ? 6 : 4, strokeWidth: 1, stroke: c }));
20
+ return (react_1.default.createElement("line", { key: `tick-${tick.base}`, x1: x, x2: x, y1: 0, y2: tick.type === 'major' ? 6 : 4, strokeWidth: 1, stroke: c }));
21
21
  }),
22
22
  !hideText
23
23
  ? 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;
@@ -40,9 +40,6 @@ function makeTicks(start, end, bpPerPx, emitMajor = true, emitMinor = true) {
40
40
  const gridPitch = chooseGridPitch(bpPerPx, 60, 15);
41
41
  let minBase = start;
42
42
  let maxBase = end;
43
- if (minBase === null || maxBase === null) {
44
- return [];
45
- }
46
43
  if (bpPerPx < 0) {
47
44
  ;
48
45
  [minBase, maxBase] = [maxBase, minBase];
@@ -73,7 +70,7 @@ function makeTicks(start, end, bpPerPx, emitMajor = true, emitMinor = true) {
73
70
  *
74
71
  * Used by navToLocations and navToLocString
75
72
  */
76
- async function generateLocations(regions = [], assemblyManager, assemblyName) {
73
+ async function generateLocations(regions, assemblyManager, assemblyName) {
77
74
  return Promise.all(regions.map(async (region) => {
78
75
  const asmName = region.assemblyName || assemblyName;
79
76
  if (!asmName) {
@@ -129,15 +126,13 @@ function parseLocStrings(input, assemblyName, isValidRefName) {
129
126
  // if this fails, try interpreting as a whitespace-separated refname,
130
127
  // start, end if start and end are integer inputs
131
128
  const [refName, start, end] = inputs;
132
- if (`${e}`.match(/Unknown reference sequence/) &&
129
+ if (/Unknown reference sequence/.exec(`${e}`) &&
133
130
  Number.isInteger(+start) &&
134
131
  Number.isInteger(+end)) {
135
132
  return [
136
- (0, util_1.parseLocString)(refName + ':' + start + '..' + end, ref => isValidRefName(ref, assemblyName)),
133
+ (0, util_1.parseLocString)(`${refName}:${start}..${end}`, ref => isValidRefName(ref, assemblyName)),
137
134
  ];
138
135
  }
139
- else {
140
- throw e;
141
- }
136
+ throw e;
142
137
  }
143
138
  }