@jbrowse/plugin-linear-genome-view 2.4.1 → 2.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 (201) hide show
  1. package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -4
  2. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +8 -43
  3. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
  4. package/dist/BaseLinearDisplay/components/TooLargeMessage.d.ts +3 -4
  5. package/dist/BaseLinearDisplay/components/TooLargeMessage.js +9 -9
  6. package/dist/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -1
  7. package/dist/BaseLinearDisplay/components/Tooltip.d.ts +0 -1
  8. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +81 -35
  9. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +105 -143
  10. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
  11. package/dist/BaseLinearDisplay/models/configSchema.d.ts +35 -1
  12. package/dist/BaseLinearDisplay/models/configSchema.js +9 -0
  13. package/dist/BaseLinearDisplay/models/configSchema.js.map +1 -1
  14. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +10 -6
  15. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
  16. package/dist/BaseLinearDisplay/models/util.d.ts +8 -0
  17. package/dist/BaseLinearDisplay/models/util.js +33 -1
  18. package/dist/BaseLinearDisplay/models/util.js.map +1 -1
  19. package/dist/BasicTrack/configSchema.d.ts +73 -1
  20. package/dist/FeatureTrack/configSchema.d.ts +75 -1
  21. package/dist/LinearBareDisplay/configSchema.d.ts +28 -1
  22. package/dist/LinearBareDisplay/index.js +1 -0
  23. package/dist/LinearBareDisplay/index.js.map +1 -1
  24. package/dist/LinearBareDisplay/model.d.ts +66 -23
  25. package/dist/LinearBareDisplay/model.js +2 -2
  26. package/dist/LinearBareDisplay/model.js.map +1 -1
  27. package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +1 -2
  28. package/dist/LinearBasicDisplay/components/SetMaxHeight.js +2 -5
  29. package/dist/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -1
  30. package/dist/LinearBasicDisplay/configSchema.d.ts +28 -1
  31. package/dist/LinearBasicDisplay/configSchema.js +0 -9
  32. package/dist/LinearBasicDisplay/configSchema.js.map +1 -1
  33. package/dist/LinearBasicDisplay/index.js +1 -1
  34. package/dist/LinearBasicDisplay/model.d.ts +76 -36
  35. package/dist/LinearBasicDisplay/model.js.map +1 -1
  36. package/dist/LinearGenomeView/components/CenterLine.d.ts +0 -1
  37. package/dist/LinearGenomeView/components/Cytobands.d.ts +22 -23
  38. package/dist/LinearGenomeView/components/ExportSvgDialog.d.ts +0 -1
  39. package/dist/LinearGenomeView/components/GetSequenceDialog.d.ts +0 -1
  40. package/dist/LinearGenomeView/components/GetSequenceDialog.js +14 -16
  41. package/dist/LinearGenomeView/components/GetSequenceDialog.js.map +1 -1
  42. package/dist/LinearGenomeView/components/Gridlines.d.ts +0 -1
  43. package/dist/LinearGenomeView/components/Header.d.ts +0 -1
  44. package/dist/LinearGenomeView/components/HelpDialog.d.ts +0 -1
  45. package/dist/LinearGenomeView/components/ImportForm.d.ts +0 -1
  46. package/dist/LinearGenomeView/components/ImportForm.js +4 -7
  47. package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
  48. package/dist/LinearGenomeView/components/LinearGenomeView.d.ts +0 -1
  49. package/dist/LinearGenomeView/components/LinearGenomeView.js +0 -4
  50. package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
  51. package/dist/LinearGenomeView/components/MiniControls.d.ts +0 -1
  52. package/dist/LinearGenomeView/components/OverviewScalebar.js +2 -1
  53. package/dist/LinearGenomeView/components/OverviewScalebar.js.map +1 -1
  54. package/dist/LinearGenomeView/components/RefNameAutocomplete.js +53 -52
  55. package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
  56. package/dist/LinearGenomeView/components/RubberbandSpan.d.ts +0 -1
  57. package/dist/LinearGenomeView/components/SearchBox.d.ts +0 -1
  58. package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +5 -3
  59. package/dist/LinearGenomeView/components/SearchResultsDialog.js +6 -82
  60. package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
  61. package/dist/LinearGenomeView/components/SearchResultsTable.d.ts +8 -0
  62. package/dist/LinearGenomeView/components/SearchResultsTable.js +83 -0
  63. package/dist/LinearGenomeView/components/SearchResultsTable.js.map +1 -0
  64. package/dist/LinearGenomeView/components/SequenceSearchDialog.d.ts +0 -1
  65. package/dist/LinearGenomeView/components/TrackContainer.d.ts +0 -1
  66. package/dist/LinearGenomeView/components/TrackContainer.js +8 -2
  67. package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -1
  68. package/dist/LinearGenomeView/components/TracksContainer.js +5 -7
  69. package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -1
  70. package/dist/LinearGenomeView/components/VerticalGuide.d.ts +0 -1
  71. package/dist/LinearGenomeView/components/ZoomControls.d.ts +0 -1
  72. package/dist/LinearGenomeView/components/util.js +1 -1
  73. package/dist/LinearGenomeView/components/util.js.map +1 -1
  74. package/dist/LinearGenomeView/model.d.ts +49 -36
  75. package/dist/LinearGenomeView/model.js +121 -198
  76. package/dist/LinearGenomeView/model.js.map +1 -1
  77. package/dist/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -1
  78. package/dist/LinearGenomeView/svgcomponents/SVGHeader.d.ts +0 -1
  79. package/dist/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +0 -1
  80. package/dist/LinearGenomeView/svgcomponents/SVGRuler.d.ts +0 -1
  81. package/dist/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +0 -1
  82. package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +0 -1
  83. package/dist/LinearGenomeView/svgcomponents/SVGTracks.d.ts +0 -1
  84. package/dist/LinearGenomeView/util.d.ts +29 -0
  85. package/dist/LinearGenomeView/util.js +79 -1
  86. package/dist/LinearGenomeView/util.js.map +1 -1
  87. package/dist/index.d.ts +201 -106
  88. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -4
  89. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +8 -20
  90. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
  91. package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +3 -4
  92. package/esm/BaseLinearDisplay/components/TooLargeMessage.js +9 -9
  93. package/esm/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -1
  94. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -1
  95. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +81 -35
  96. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +105 -143
  97. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
  98. package/esm/BaseLinearDisplay/models/configSchema.d.ts +35 -1
  99. package/esm/BaseLinearDisplay/models/configSchema.js +9 -0
  100. package/esm/BaseLinearDisplay/models/configSchema.js.map +1 -1
  101. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +10 -6
  102. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
  103. package/esm/BaseLinearDisplay/models/util.d.ts +8 -0
  104. package/esm/BaseLinearDisplay/models/util.js +30 -0
  105. package/esm/BaseLinearDisplay/models/util.js.map +1 -1
  106. package/esm/BasicTrack/configSchema.d.ts +73 -1
  107. package/esm/FeatureTrack/configSchema.d.ts +75 -1
  108. package/esm/LinearBareDisplay/configSchema.d.ts +28 -1
  109. package/esm/LinearBareDisplay/index.js +1 -0
  110. package/esm/LinearBareDisplay/index.js.map +1 -1
  111. package/esm/LinearBareDisplay/model.d.ts +66 -23
  112. package/esm/LinearBareDisplay/model.js +1 -1
  113. package/esm/LinearBareDisplay/model.js.map +1 -1
  114. package/esm/LinearBasicDisplay/components/SetMaxHeight.d.ts +1 -2
  115. package/esm/LinearBasicDisplay/components/SetMaxHeight.js +2 -5
  116. package/esm/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -1
  117. package/esm/LinearBasicDisplay/configSchema.d.ts +28 -1
  118. package/esm/LinearBasicDisplay/configSchema.js +0 -9
  119. package/esm/LinearBasicDisplay/configSchema.js.map +1 -1
  120. package/esm/LinearBasicDisplay/index.js +1 -1
  121. package/esm/LinearBasicDisplay/model.d.ts +76 -36
  122. package/esm/LinearBasicDisplay/model.js.map +1 -1
  123. package/esm/LinearGenomeView/components/CenterLine.d.ts +0 -1
  124. package/esm/LinearGenomeView/components/Cytobands.d.ts +22 -23
  125. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +0 -1
  126. package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +0 -1
  127. package/esm/LinearGenomeView/components/GetSequenceDialog.js +15 -17
  128. package/esm/LinearGenomeView/components/GetSequenceDialog.js.map +1 -1
  129. package/esm/LinearGenomeView/components/Gridlines.d.ts +0 -1
  130. package/esm/LinearGenomeView/components/Header.d.ts +0 -1
  131. package/esm/LinearGenomeView/components/HelpDialog.d.ts +0 -1
  132. package/esm/LinearGenomeView/components/ImportForm.d.ts +0 -1
  133. package/esm/LinearGenomeView/components/ImportForm.js +5 -8
  134. package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
  135. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +0 -1
  136. package/esm/LinearGenomeView/components/LinearGenomeView.js +0 -4
  137. package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
  138. package/esm/LinearGenomeView/components/MiniControls.d.ts +0 -1
  139. package/esm/LinearGenomeView/components/OverviewScalebar.js +2 -1
  140. package/esm/LinearGenomeView/components/OverviewScalebar.js.map +1 -1
  141. package/esm/LinearGenomeView/components/RefNameAutocomplete.js +53 -52
  142. package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
  143. package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -1
  144. package/esm/LinearGenomeView/components/SearchBox.d.ts +0 -1
  145. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +5 -3
  146. package/esm/LinearGenomeView/components/SearchResultsDialog.js +7 -83
  147. package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
  148. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +8 -0
  149. package/esm/LinearGenomeView/components/SearchResultsTable.js +77 -0
  150. package/esm/LinearGenomeView/components/SearchResultsTable.js.map +1 -0
  151. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +0 -1
  152. package/esm/LinearGenomeView/components/TrackContainer.d.ts +0 -1
  153. package/esm/LinearGenomeView/components/TrackContainer.js +8 -2
  154. package/esm/LinearGenomeView/components/TrackContainer.js.map +1 -1
  155. package/esm/LinearGenomeView/components/TracksContainer.js +5 -7
  156. package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -1
  157. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +0 -1
  158. package/esm/LinearGenomeView/components/ZoomControls.d.ts +0 -1
  159. package/esm/LinearGenomeView/components/util.js +1 -1
  160. package/esm/LinearGenomeView/components/util.js.map +1 -1
  161. package/esm/LinearGenomeView/model.d.ts +49 -36
  162. package/esm/LinearGenomeView/model.js +122 -199
  163. package/esm/LinearGenomeView/model.js.map +1 -1
  164. package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -1
  165. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +0 -1
  166. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +0 -1
  167. package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +0 -1
  168. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +0 -1
  169. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +0 -1
  170. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +0 -1
  171. package/esm/LinearGenomeView/util.d.ts +29 -0
  172. package/esm/LinearGenomeView/util.js +76 -0
  173. package/esm/LinearGenomeView/util.js.map +1 -1
  174. package/esm/index.d.ts +201 -106
  175. package/package.json +3 -3
  176. package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +8 -28
  177. package/src/BaseLinearDisplay/components/TooLargeMessage.tsx +13 -11
  178. package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +148 -197
  179. package/src/BaseLinearDisplay/models/configSchema.ts +10 -0
  180. package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +19 -13
  181. package/src/BaseLinearDisplay/models/util.ts +43 -0
  182. package/src/LinearBareDisplay/index.ts +1 -0
  183. package/src/LinearBareDisplay/model.ts +1 -1
  184. package/src/LinearBasicDisplay/components/SetMaxHeight.tsx +3 -7
  185. package/src/LinearBasicDisplay/configSchema.ts +0 -10
  186. package/src/LinearBasicDisplay/index.ts +1 -1
  187. package/src/LinearBasicDisplay/model.ts +1 -1
  188. package/src/LinearGenomeView/components/GetSequenceDialog.tsx +15 -25
  189. package/src/LinearGenomeView/components/ImportForm.tsx +4 -14
  190. package/src/LinearGenomeView/components/LinearGenomeView.tsx +0 -14
  191. package/src/LinearGenomeView/components/OverviewScalebar.tsx +2 -1
  192. package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +122 -82
  193. package/src/LinearGenomeView/components/SearchResultsDialog.tsx +17 -112
  194. package/src/LinearGenomeView/components/SearchResultsTable.tsx +121 -0
  195. package/src/LinearGenomeView/components/TrackContainer.tsx +12 -3
  196. package/src/LinearGenomeView/components/TracksContainer.tsx +9 -6
  197. package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.tsx.snap +11 -11
  198. package/src/LinearGenomeView/components/util.ts +2 -1
  199. package/src/LinearGenomeView/index.test.ts +10 -12
  200. package/src/LinearGenomeView/model.ts +163 -236
  201. package/src/LinearGenomeView/util.ts +98 -0
@@ -39,7 +39,7 @@ exports.getRelativeX = getRelativeX;
39
39
  function getCytobands(assembly, refName) {
40
40
  var _a;
41
41
  return (((_a = assembly === null || assembly === void 0 ? void 0 : assembly.cytobands) === null || _a === void 0 ? void 0 : _a.map(f => ({
42
- refName: assembly.getCanonicalRefName(f.get('refName')),
42
+ refName: assembly.getCanonicalRefName(f.get('refName')) || f.get('refName'),
43
43
  start: f.get('start'),
44
44
  end: f.get('end'),
45
45
  type: f.get('type'),
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/LinearGenomeView/components/util.ts"],"names":[],"mappings":";;;;;;AAGA,6CAA8D;AAC9D,uFAA6D;AAEtD,KAAK,UAAU,YAAY,CAAC,EACjC,WAAW,EACX,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,GAQT;;IACC,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA;KACvC;IAED,MAAM,iBAAiB,GAAG,MAAM,CAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,MAAM,CACvD;QACE,WAAW;QACX,UAAU;KACX,EACD,WAAW,EACX,iBAAiB,CAClB,CAAA,CAAA;IAED,MAAM,cAAc,GAAG,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,WAAW,0CACxC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,EACtE,KAAK,CAAC,CAAC,EAAE,EAAE,EACX,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,qBAAU,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAEzC,OAAO,IAAA,aAAM,EACX,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC,EACzD,GAAG,CA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String } from '@jbrowse/core/util';
4
5
  import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
5
6
  import { BlockSet, BaseBlock } from '@jbrowse/core/util/blockTypes';
6
7
  import { Instance } from 'mobx-state-tree';
@@ -95,9 +96,6 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
95
96
  coarseTotalBp: number;
96
97
  leftOffset: BpOffset | undefined;
97
98
  rightOffset: BpOffset | undefined;
98
- searchResults: BaseResult[] | undefined;
99
- searchQuery: string | undefined;
100
- seqDialogDisplayed: boolean;
101
99
  } & {
102
100
  /**
103
101
  * #getter
@@ -136,10 +134,6 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
136
134
  * #getter
137
135
  */
138
136
  readonly hasDisplayedRegions: boolean;
139
- /**
140
- * #getter
141
- */
142
- readonly isSearchDialogDisplayed: boolean;
143
137
  /**
144
138
  * #getter
145
139
  */
@@ -256,17 +250,15 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
256
250
  zoomTo(bpPerPx: number, offset?: number, centerAtOffset?: boolean): number;
257
251
  /**
258
252
  * #action
259
- * sets offsets used in the get sequence dialog
253
+ * sets offsets of rubberband, used in the get sequence dialog can call
254
+ * view.getSelectedRegions(view.leftOffset,view.rightOffset) to compute
255
+ * the selected regions from the offsets
260
256
  */
261
257
  setOffsets(left?: BpOffset, right?: BpOffset): void;
262
258
  /**
263
259
  * #action
264
260
  */
265
- setSearchResults(results?: BaseResult[], query?: string): void;
266
- /**
267
- * #action
268
- */
269
- setGetSequenceDialogOpen(open: boolean): void;
261
+ setSearchResults(searchResults: BaseResult[], searchQuery: string, assemblyName?: string): void;
270
262
  /**
271
263
  * #action
272
264
  */
@@ -315,10 +307,13 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
315
307
  /**
316
308
  * #method
317
309
  * Helper method for the fetchSequence.
318
- * Retrieves the corresponding regions that were selected by the rubberband
310
+ * Retrieves the corresponding regions that were selected by the
311
+ * rubberband
319
312
  *
320
- * @param leftOffset - `object as {start, end, index, offset}`, offset = start of user drag
321
- * @param rightOffset - `object as {start, end, index, offset}`, offset = end of user drag
313
+ * @param leftOffset - `object as {start, end, index, offset}`, offset = start
314
+ * of user drag
315
+ * @param rightOffset - `object as {start, end, index, offset}`,
316
+ * offset = end of user drag
322
317
  * @returns array of Region[]
323
318
  */
324
319
  getSelectedRegions(leftOffset?: BpOffset, rightOffset?: BpOffset): {
@@ -336,7 +331,8 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
336
331
  }[];
337
332
  /**
338
333
  * #action
339
- * schedule something to be run after the next time displayedRegions is set
334
+ * schedule something to be run after the next time displayedRegions is
335
+ * set
340
336
  */
341
337
  afterDisplayedRegionsSet(cb: Function): void;
342
338
  /**
@@ -392,8 +388,8 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
392
388
  readonly anyCytobandsExist: boolean;
393
389
  /**
394
390
  * #getter
395
- * the cytoband is displayed to the right of the chromosome name,
396
- * and that offset is calculated manually with this method
391
+ * the cytoband is displayed to the right of the chromosome name, and
392
+ * that offset is calculated manually with this method
397
393
  */
398
394
  readonly cytobandOffset: number;
399
395
  } & {
@@ -406,19 +402,18 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
406
402
  /**
407
403
  * #getter
408
404
  * static blocks are an important concept jbrowse uses to avoid
409
- * re-rendering when you scroll to the side. when you horizontally
410
- * scroll to the right, old blocks to the left may be removed, and
411
- * new blocks may be instantiated on the right. tracks may use the
412
- * static blocks to render their data for the region represented by
413
- * the block
405
+ * re-rendering when you scroll to the side. when you horizontally scroll to the
406
+ * right, old blocks to the left may be removed, and new blocks may be
407
+ * instantiated on the right. tracks may use the static blocks to render their
408
+ * data for the region represented by the block
414
409
  */
415
410
  readonly staticBlocks: BlockSet;
416
411
  /**
417
412
  * #getter
418
413
  * dynamic blocks represent the exact coordinates of the currently
419
- * visible genome regions on the screen. they are similar to static
420
- * blocks, but statcic blocks can go offscreen while dynamic blocks
421
- * represent exactly what is on screen
414
+ * visible genome regions on the screen. they are similar to static blocks, but
415
+ * static blocks can go offscreen while dynamic blocks represent exactly what
416
+ * is on screen
422
417
  */
423
418
  readonly dynamicBlocks: BlockSet;
424
419
  /**
@@ -446,8 +441,8 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
446
441
  } & {
447
442
  /**
448
443
  * #action
449
- * offset is the base-pair-offset in the displayed region, index is the index of the
450
- * displayed region in the linear genome view
444
+ * offset is the base-pair-offset in the displayed region, index is the
445
+ * index of the displayed region in the linear genome view
451
446
  *
452
447
  * @param start - object as `{start, end, offset, index}`
453
448
  * @param end - object as `{start, end, offset, index}`
@@ -455,18 +450,27 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
455
450
  moveTo(start?: BpOffset, end?: BpOffset): void;
456
451
  /**
457
452
  * #action
458
- * navigate to the given locstring
453
+ * Navigate to the given locstring, will change displayed regions if
454
+ * needed, and wait for assemblies to be initialized
459
455
  *
460
- * @param locString - e.g. "chr1:1-100"
461
- * @param optAssemblyName - (optional) the assembly name to use when navigating to the locstring
456
+ * @param input - e.g. "chr1:1-100", "chr1:1-100 chr2:1-100", "chr 1 100"
457
+ * @param optAssemblyName - (optional) the assembly name to use when
458
+ * navigating to the locstring
459
+ */
460
+ navToLocString(input: string, optAssemblyName?: string): Promise<void>;
461
+ /**
462
+ * #action
463
+ * Similar to `navToLocString`, but accepts parsed location objects
464
+ * instead of strings. Will try to perform `setDisplayedRegions` if
465
+ * changing regions
462
466
  */
463
- navToLocString(locString: string, optAssemblyName?: string): Promise<void>;
467
+ navToLocations(parsedLocStrings: ParsedLocString[], assemblyName?: string): Promise<void>;
464
468
  /**
465
469
  * #action
466
470
  * Navigate to a location based on its refName and optionally start, end,
467
- * and assemblyName. Can handle if there are multiple displayedRegions
468
- * from same refName. Only navigates to a location if it is entirely
469
- * within a displayedRegion. Navigates to the first matching location
471
+ * and assemblyName. Will not try to change displayed regions, use
472
+ * `navToLocations` instead. Only navigates to a location if it is
473
+ * entirely within a displayedRegion. Navigates to the first matching location
470
474
  * encountered.
471
475
  *
472
476
  * Throws an error if navigation was unsuccessful
@@ -476,6 +480,15 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
476
480
  navTo(query: NavLocation): void;
477
481
  /**
478
482
  * #action
483
+ * Navigate to a location based on its refName and optionally start, end,
484
+ * and assemblyName. Will not try to change displayed regions, use
485
+ * navToLocations instead. Only navigates to a location if it is entirely
486
+ * within a displayedRegion. Navigates to the first matching location
487
+ * encountered.
488
+ *
489
+ * Throws an error if navigation was unsuccessful
490
+ *
491
+ * @param locations - proposed location to navigate to
479
492
  */
480
493
  navToMultiple(locations: NavLocation[]): void;
481
494
  } & {
@@ -56,8 +56,11 @@ const SVGLinearGenomeView_1 = require("./svgcomponents/SVGLinearGenomeView");
56
56
  const ExportSvgDialog_1 = __importDefault(require("./components/ExportSvgDialog"));
57
57
  const MiniControls_1 = __importDefault(require("./components/MiniControls"));
58
58
  const Header_1 = __importDefault(require("./components/Header"));
59
+ const util_2 = require("./util");
59
60
  // lazies
60
61
  const SequenceSearchDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/SequenceSearchDialog'))));
62
+ const GetSequenceDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/GetSequenceDialog'))));
63
+ const SearchResultsDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/SearchResultsDialog'))));
61
64
  function calculateVisibleLocStrings(contentBlocks) {
62
65
  if (!contentBlocks.length) {
63
66
  return '';
@@ -137,7 +140,8 @@ function stateModelFactory(pluginManager) {
137
140
  trackSelectorType: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.enumeration(['hierarchical']), 'hierarchical'),
138
141
  /**
139
142
  * #property
140
- * how to display the track labels, can be "overlapping", "offset", or "hidden"
143
+ * how to display the track labels, can be "overlapping", "offset", or
144
+ * "hidden"
141
145
  */
142
146
  trackLabels: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.string, () => (0, util_1.localStorageGetItem)('lgv-trackLabels') || 'overlapping'),
143
147
  /**
@@ -171,9 +175,6 @@ function stateModelFactory(pluginManager) {
171
175
  coarseTotalBp: 0,
172
176
  leftOffset: undefined,
173
177
  rightOffset: undefined,
174
- searchResults: undefined,
175
- searchQuery: undefined,
176
- seqDialogDisplayed: false,
177
178
  }))
178
179
  .views(self => ({
179
180
  /**
@@ -246,12 +247,6 @@ function stateModelFactory(pluginManager) {
246
247
  get hasDisplayedRegions() {
247
248
  return self.displayedRegions.length > 0;
248
249
  },
249
- /**
250
- * #getter
251
- */
252
- get isSearchDialogDisplayed() {
253
- return self.searchResults !== undefined;
254
- },
255
250
  /**
256
251
  * #getter
257
252
  */
@@ -486,7 +481,9 @@ function stateModelFactory(pluginManager) {
486
481
  },
487
482
  /**
488
483
  * #action
489
- * sets offsets used in the get sequence dialog
484
+ * sets offsets of rubberband, used in the get sequence dialog can call
485
+ * view.getSelectedRegions(view.leftOffset,view.rightOffset) to compute
486
+ * the selected regions from the offsets
490
487
  */
491
488
  setOffsets(left, right) {
492
489
  self.leftOffset = left;
@@ -495,15 +492,18 @@ function stateModelFactory(pluginManager) {
495
492
  /**
496
493
  * #action
497
494
  */
498
- setSearchResults(results, query) {
499
- self.searchResults = results;
500
- self.searchQuery = query;
501
- },
502
- /**
503
- * #action
504
- */
505
- setGetSequenceDialogOpen(open) {
506
- self.seqDialogDisplayed = open;
495
+ setSearchResults(searchResults, searchQuery, assemblyName) {
496
+ (0, util_1.getSession)(self).queueDialog(handleClose => [
497
+ SearchResultsDialog,
498
+ {
499
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
500
+ model: self,
501
+ searchResults,
502
+ searchQuery,
503
+ handleClose,
504
+ assemblyName,
505
+ },
506
+ ]);
507
507
  },
508
508
  /**
509
509
  * #action
@@ -650,10 +650,13 @@ function stateModelFactory(pluginManager) {
650
650
  /**
651
651
  * #method
652
652
  * Helper method for the fetchSequence.
653
- * Retrieves the corresponding regions that were selected by the rubberband
653
+ * Retrieves the corresponding regions that were selected by the
654
+ * rubberband
654
655
  *
655
- * @param leftOffset - `object as {start, end, index, offset}`, offset = start of user drag
656
- * @param rightOffset - `object as {start, end, index, offset}`, offset = end of user drag
656
+ * @param leftOffset - `object as {start, end, index, offset}`, offset = start
657
+ * of user drag
658
+ * @param rightOffset - `object as {start, end, index, offset}`,
659
+ * offset = end of user drag
657
660
  * @returns array of Region[]
658
661
  */
659
662
  getSelectedRegions(leftOffset, rightOffset) {
@@ -672,7 +675,8 @@ function stateModelFactory(pluginManager) {
672
675
  },
673
676
  /**
674
677
  * #action
675
- * schedule something to be run after the next time displayedRegions is set
678
+ * schedule something to be run after the next time displayedRegions is
679
+ * set
676
680
  */
677
681
  afterDisplayedRegionsSet(cb) {
678
682
  self.afterDisplayedRegionsSetCallbacks.push(cb);
@@ -824,8 +828,8 @@ function stateModelFactory(pluginManager) {
824
828
  },
825
829
  /**
826
830
  * #getter
827
- * the cytoband is displayed to the right of the chromosome name,
828
- * and that offset is calculated manually with this method
831
+ * the cytoband is displayed to the right of the chromosome name, and
832
+ * that offset is calculated manually with this method
829
833
  */
830
834
  get cytobandOffset() {
831
835
  return this.showCytobands
@@ -981,11 +985,10 @@ function stateModelFactory(pluginManager) {
981
985
  /**
982
986
  * #getter
983
987
  * static blocks are an important concept jbrowse uses to avoid
984
- * re-rendering when you scroll to the side. when you horizontally
985
- * scroll to the right, old blocks to the left may be removed, and
986
- * new blocks may be instantiated on the right. tracks may use the
987
- * static blocks to render their data for the region represented by
988
- * the block
988
+ * re-rendering when you scroll to the side. when you horizontally scroll to the
989
+ * right, old blocks to the left may be removed, and new blocks may be
990
+ * instantiated on the right. tracks may use the static blocks to render their
991
+ * data for the region represented by the block
989
992
  */
990
993
  get staticBlocks() {
991
994
  const ret = (0, calculateStaticBlocks_1.default)(self);
@@ -999,9 +1002,9 @@ function stateModelFactory(pluginManager) {
999
1002
  /**
1000
1003
  * #getter
1001
1004
  * dynamic blocks represent the exact coordinates of the currently
1002
- * visible genome regions on the screen. they are similar to static
1003
- * blocks, but statcic blocks can go offscreen while dynamic blocks
1004
- * represent exactly what is on screen
1005
+ * visible genome regions on the screen. they are similar to static blocks, but
1006
+ * static blocks can go offscreen while dynamic blocks represent exactly what
1007
+ * is on screen
1005
1008
  */
1006
1009
  get dynamicBlocks() {
1007
1010
  return (0, calculateDynamicBlocks_1.default)(self);
@@ -1062,8 +1065,8 @@ function stateModelFactory(pluginManager) {
1062
1065
  .actions(self => ({
1063
1066
  /**
1064
1067
  * #action
1065
- * offset is the base-pair-offset in the displayed region, index is the index of the
1066
- * displayed region in the linear genome view
1068
+ * offset is the base-pair-offset in the displayed region, index is the
1069
+ * index of the displayed region in the linear genome view
1067
1070
  *
1068
1071
  * @param start - object as `{start, end, offset, index}`
1069
1072
  * @param end - object as `{start, end, offset, index}`
@@ -1073,76 +1076,38 @@ function stateModelFactory(pluginManager) {
1073
1076
  },
1074
1077
  /**
1075
1078
  * #action
1076
- * navigate to the given locstring
1079
+ * Navigate to the given locstring, will change displayed regions if
1080
+ * needed, and wait for assemblies to be initialized
1077
1081
  *
1078
- * @param locString - e.g. "chr1:1-100"
1079
- * @param optAssemblyName - (optional) the assembly name to use when navigating to the locstring
1082
+ * @param input - e.g. "chr1:1-100", "chr1:1-100 chr2:1-100", "chr 1 100"
1083
+ * @param optAssemblyName - (optional) the assembly name to use when
1084
+ * navigating to the locstring
1080
1085
  */
1081
- async navToLocString(locString, optAssemblyName) {
1086
+ async navToLocString(input, optAssemblyName) {
1082
1087
  const { assemblyNames } = self;
1083
1088
  const { assemblyManager } = (0, util_1.getSession)(self);
1084
1089
  const { isValidRefName } = assemblyManager;
1085
- await (0, mobx_1.when)(() => self.volatileWidth !== undefined);
1086
1090
  const assemblyName = optAssemblyName || assemblyNames[0];
1087
- let parsedLocStrings;
1088
- const inputs = locString
1089
- .split(/(\s+)/)
1090
- .map(f => f.trim())
1091
- .filter(f => !!f);
1092
1091
  if (assemblyName) {
1092
+ // wait before isValidRefName can be called
1093
1093
  await assemblyManager.waitForAssembly(assemblyName);
1094
1094
  }
1095
- // first try interpreting as a whitespace-separated sequence of
1096
- // multiple locstrings
1097
- try {
1098
- parsedLocStrings = inputs.map(loc => (0, util_1.parseLocString)(loc, ref => isValidRefName(ref, assemblyName)));
1099
- }
1100
- catch (e) {
1101
- // if this fails, try interpreting as a whitespace-separated refname,
1102
- // start, end if start and end are integer inputs
1103
- const [refName, start, end] = inputs;
1104
- if (`${e}`.match(/Unknown reference sequence/) &&
1105
- Number.isInteger(+start) &&
1106
- Number.isInteger(+end)) {
1107
- parsedLocStrings = [
1108
- (0, util_1.parseLocString)(refName + ':' + start + '..' + end, ref => isValidRefName(ref, assemblyName)),
1109
- ];
1110
- }
1111
- else {
1112
- throw e;
1113
- }
1114
- }
1115
- const locations = await Promise.all(parsedLocStrings === null || parsedLocStrings === void 0 ? void 0 : parsedLocStrings.map(async (region) => {
1116
- const asmName = region.assemblyName || assemblyName;
1117
- const asm = await assemblyManager.waitForAssembly(asmName);
1118
- const { refName } = region;
1119
- if (!asm) {
1120
- throw new Error(`assembly ${asmName} not found`);
1121
- }
1122
- const { regions } = asm;
1123
- if (!regions) {
1124
- throw new Error(`regions not loaded yet for ${asmName}`);
1125
- }
1126
- const canonicalRefName = asm.getCanonicalRefName(region.refName);
1127
- if (!canonicalRefName) {
1128
- throw new Error(`Could not find refName ${refName} in ${asm.name}`);
1129
- }
1130
- const parentRegion = regions.find(r => r.refName === canonicalRefName);
1131
- if (!parentRegion) {
1132
- throw new Error(`Could not find refName ${refName} in ${asmName}`);
1133
- }
1134
- return {
1135
- ...region,
1136
- assemblyName: asmName,
1137
- parentRegion,
1138
- };
1139
- }));
1095
+ return this.navToLocations((0, util_2.parseLocStrings)(input, assemblyName, isValidRefName), assemblyName);
1096
+ },
1097
+ /**
1098
+ * #action
1099
+ * Similar to `navToLocString`, but accepts parsed location objects
1100
+ * instead of strings. Will try to perform `setDisplayedRegions` if
1101
+ * changing regions
1102
+ */
1103
+ async navToLocations(parsedLocStrings, assemblyName) {
1104
+ const { assemblyManager } = (0, util_1.getSession)(self);
1105
+ await (0, mobx_1.when)(() => self.volatileWidth !== undefined);
1106
+ const locations = await (0, util_2.generateLocations)(parsedLocStrings, assemblyManager, assemblyName);
1140
1107
  if (locations.length === 1) {
1141
1108
  const loc = locations[0];
1142
- self.setDisplayedRegions([
1143
- { reversed: loc.reversed, ...loc.parentRegion },
1144
- ]);
1145
- const { start, end, parentRegion } = loc;
1109
+ const { reversed, parentRegion, start, end } = loc;
1110
+ self.setDisplayedRegions([{ reversed, ...parentRegion }]);
1146
1111
  this.navTo({
1147
1112
  ...loc,
1148
1113
  start: (0, util_1.clamp)(start !== null && start !== void 0 ? start : 0, 0, parentRegion.end),
@@ -1159,9 +1124,9 @@ function stateModelFactory(pluginManager) {
1159
1124
  /**
1160
1125
  * #action
1161
1126
  * Navigate to a location based on its refName and optionally start, end,
1162
- * and assemblyName. Can handle if there are multiple displayedRegions
1163
- * from same refName. Only navigates to a location if it is entirely
1164
- * within a displayedRegion. Navigates to the first matching location
1127
+ * and assemblyName. Will not try to change displayed regions, use
1128
+ * `navToLocations` instead. Only navigates to a location if it is
1129
+ * entirely within a displayedRegion. Navigates to the first matching location
1165
1130
  * encountered.
1166
1131
  *
1167
1132
  * Throws an error if navigation was unsuccessful
@@ -1173,105 +1138,62 @@ function stateModelFactory(pluginManager) {
1173
1138
  },
1174
1139
  /**
1175
1140
  * #action
1141
+ * Navigate to a location based on its refName and optionally start, end,
1142
+ * and assemblyName. Will not try to change displayed regions, use
1143
+ * navToLocations instead. Only navigates to a location if it is entirely
1144
+ * within a displayedRegion. Navigates to the first matching location
1145
+ * encountered.
1146
+ *
1147
+ * Throws an error if navigation was unsuccessful
1148
+ *
1149
+ * @param locations - proposed location to navigate to
1176
1150
  */
1177
1151
  navToMultiple(locations) {
1178
- const firstLocation = locations[0];
1179
- let { refName } = firstLocation;
1180
- const { start, end, assemblyName = self.assemblyNames[0], } = firstLocation;
1181
- if (start !== undefined && end !== undefined && start > end) {
1182
- throw new Error(`start "${start + 1}" is greater than end "${end}"`);
1152
+ if (locations.some(l => l.start !== undefined && l.end !== undefined && l.start > l.end)) {
1153
+ throw new Error('found start greater than end');
1183
1154
  }
1184
- const session = (0, util_1.getSession)(self);
1185
- const { assemblyManager } = session;
1186
- const assembly = assemblyManager.get(assemblyName);
1187
- if (assembly) {
1188
- const canonicalRefName = assembly.getCanonicalRefName(refName);
1189
- if (canonicalRefName) {
1190
- refName = canonicalRefName;
1191
- }
1155
+ const f1 = locations[0];
1156
+ const f2 = locations[locations.length - 1];
1157
+ const a = self.assemblyNames[0];
1158
+ const { assemblyManager } = (0, util_1.getSession)(self);
1159
+ const assembly1 = assemblyManager.get(f1.assemblyName || a);
1160
+ const assembly2 = assemblyManager.get(f2.assemblyName || a);
1161
+ const ref1 = (assembly1 === null || assembly1 === void 0 ? void 0 : assembly1.getCanonicalRefName(f1.refName)) || f1.refName;
1162
+ const ref2 = (assembly2 === null || assembly2 === void 0 ? void 0 : assembly2.getCanonicalRefName(f2.refName)) || f2.refName;
1163
+ const r1 = self.displayedRegions.find(r => r.refName === ref1);
1164
+ const r2 = (0, util_1.findLast)(self.displayedRegions, r => r.refName === ref2);
1165
+ if (!r1) {
1166
+ throw new Error(`could not find a region with refName "${ref1}"`);
1192
1167
  }
1193
- let s = start;
1194
- let e = end;
1195
- let refNameMatched = false;
1196
- const predicate = (r) => {
1197
- if (refName === r.refName) {
1198
- refNameMatched = true;
1199
- if (s === undefined) {
1200
- s = r.start;
1201
- }
1202
- if (e === undefined) {
1203
- e = r.end;
1204
- }
1205
- if (s >= r.start && s <= r.end && e <= r.end && e >= r.start) {
1206
- return true;
1207
- }
1208
- s = start;
1209
- e = end;
1210
- }
1211
- return false;
1212
- };
1213
- const lastIndex = (0, util_1.findLastIndex)(self.displayedRegions, predicate);
1214
- let index;
1215
- while (index !== lastIndex) {
1216
- try {
1217
- const previousIndex = index;
1218
- index = self.displayedRegions
1219
- .slice(previousIndex === undefined ? 0 : previousIndex + 1)
1220
- .findIndex(predicate);
1221
- if (previousIndex !== undefined) {
1222
- index += previousIndex + 1;
1223
- }
1224
- if (!refNameMatched) {
1225
- throw new Error(`could not find a region with refName "${refName}"`);
1226
- }
1227
- if (s === undefined) {
1228
- throw new Error(`could not find a region with refName "${refName}" that contained an end position ${e}`);
1229
- }
1230
- if (e === undefined) {
1231
- throw new Error(`could not find a region with refName "${refName}" that contained a start position ${s + 1}`);
1232
- }
1233
- if (index === -1) {
1234
- throw new Error(`could not find a region that completely contained "${(0, util_1.assembleLocString)(firstLocation)}"`);
1235
- }
1236
- if (locations.length === 1) {
1237
- const f = self.displayedRegions[index];
1238
- this.moveTo({ index, offset: f.reversed ? f.end - e : s - f.start }, { index, offset: f.reversed ? f.end - s : e - f.start });
1239
- return;
1240
- }
1241
- let idx = 0;
1242
- let start = 0;
1243
- let end = 0;
1244
- for (idx; idx < locations.length; idx++) {
1245
- const location = locations[idx];
1246
- const region = self.displayedRegions[index + idx];
1247
- start = location.start || region.start;
1248
- end = location.end || region.end;
1249
- if (location.refName !== region.refName) {
1250
- throw new Error(`Entered location ${(0, util_1.assembleLocString)(location)} does not match with displayed regions`);
1251
- }
1252
- }
1253
- idx -= 1;
1254
- const startDisplayedRegion = self.displayedRegions[index];
1255
- const endDisplayedRegion = self.displayedRegions[index + idx];
1256
- this.moveTo({
1257
- index,
1258
- offset: startDisplayedRegion.reversed
1259
- ? startDisplayedRegion.end - e
1260
- : s - startDisplayedRegion.start,
1261
- }, {
1262
- index: index + idx,
1263
- offset: endDisplayedRegion.reversed
1264
- ? endDisplayedRegion.end - start
1265
- : end - endDisplayedRegion.start,
1266
- });
1267
- return;
1268
- }
1269
- catch (error) {
1270
- if (index === lastIndex) {
1271
- throw error;
1272
- }
1273
- }
1168
+ if (!r2) {
1169
+ throw new Error(`could not find a region with refName "${ref2}"`);
1170
+ }
1171
+ const s1 = f1.start === undefined ? r1.start : f1.start;
1172
+ const e1 = f1.end === undefined ? r1.end : f1.end;
1173
+ const s2 = f2.start === undefined ? r2.start : f2.start;
1174
+ const e2 = f2.end === undefined ? r2.end : f2.end;
1175
+ const index = self.displayedRegions.findIndex(r => ref1 === r.refName &&
1176
+ s1 >= r.start &&
1177
+ s1 <= r.end &&
1178
+ e1 <= r.end &&
1179
+ e1 >= r.start);
1180
+ const index2 = self.displayedRegions.findIndex(r => ref2 === r.refName &&
1181
+ s2 >= r.start &&
1182
+ s2 <= r.end &&
1183
+ e2 <= r.end &&
1184
+ e2 >= r.start);
1185
+ if (index === -1 || index2 === -1) {
1186
+ throw new Error(`could not find a region that contained "${locations.map(l => (0, util_1.assembleLocString)(l))}"`);
1274
1187
  }
1188
+ const sd = self.displayedRegions[index];
1189
+ const ed = self.displayedRegions[index2];
1190
+ this.moveTo({
1191
+ index,
1192
+ offset: sd.reversed ? sd.end - e1 : s1 - sd.start,
1193
+ }, {
1194
+ index: index2,
1195
+ offset: ed.reversed ? ed.end - s2 : e2 - ed.start,
1196
+ });
1275
1197
  },
1276
1198
  }))
1277
1199
  .views(self => ({
@@ -1283,15 +1205,16 @@ function stateModelFactory(pluginManager) {
1283
1205
  {
1284
1206
  label: 'Zoom to region',
1285
1207
  icon: ZoomIn_1.default,
1286
- onClick: () => {
1287
- const { leftOffset, rightOffset } = self;
1288
- self.moveTo(leftOffset, rightOffset);
1289
- },
1208
+ onClick: () => self.moveTo(self.leftOffset, self.rightOffset),
1290
1209
  },
1291
1210
  {
1292
1211
  label: 'Get sequence',
1293
1212
  icon: MenuOpen_1.default,
1294
- onClick: () => self.setGetSequenceDialogOpen(true),
1213
+ onClick: () => (0, util_1.getSession)(self).queueDialog(handleClose => [
1214
+ GetSequenceDialog,
1215
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1216
+ { model: self, handleClose },
1217
+ ]),
1295
1218
  },
1296
1219
  ];
1297
1220
  },
@@ -1315,7 +1238,7 @@ function stateModelFactory(pluginManager) {
1315
1238
  coord,
1316
1239
  regionNumber,
1317
1240
  });
1318
- if (centerPx) {
1241
+ if (centerPx !== undefined) {
1319
1242
  self.scrollTo(Math.round(centerPx.offsetPx - self.width / 2));
1320
1243
  }
1321
1244
  },