@jbrowse/plugin-linear-genome-view 2.4.2 → 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 (180) hide show
  1. package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -1
  2. package/dist/BaseLinearDisplay/components/TooLargeMessage.d.ts +3 -4
  3. package/dist/BaseLinearDisplay/components/TooLargeMessage.js +7 -3
  4. package/dist/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -1
  5. package/dist/BaseLinearDisplay/components/Tooltip.d.ts +0 -1
  6. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +75 -14
  7. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +38 -32
  8. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
  9. package/dist/BaseLinearDisplay/models/configSchema.d.ts +35 -1
  10. package/dist/BaseLinearDisplay/models/configSchema.js +9 -0
  11. package/dist/BaseLinearDisplay/models/configSchema.js.map +1 -1
  12. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +10 -6
  13. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
  14. package/dist/BaseLinearDisplay/models/util.d.ts +6 -2
  15. package/dist/BaseLinearDisplay/models/util.js +4 -4
  16. package/dist/BaseLinearDisplay/models/util.js.map +1 -1
  17. package/dist/BasicTrack/configSchema.d.ts +73 -1
  18. package/dist/FeatureTrack/configSchema.d.ts +75 -1
  19. package/dist/LinearBareDisplay/configSchema.d.ts +28 -1
  20. package/dist/LinearBareDisplay/model.d.ts +62 -11
  21. package/dist/LinearBareDisplay/model.js +2 -2
  22. package/dist/LinearBareDisplay/model.js.map +1 -1
  23. package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +0 -1
  24. package/dist/LinearBasicDisplay/configSchema.d.ts +28 -1
  25. package/dist/LinearBasicDisplay/configSchema.js +0 -9
  26. package/dist/LinearBasicDisplay/configSchema.js.map +1 -1
  27. package/dist/LinearBasicDisplay/model.d.ts +71 -10
  28. package/dist/LinearGenomeView/components/CenterLine.d.ts +0 -1
  29. package/dist/LinearGenomeView/components/Cytobands.d.ts +22 -23
  30. package/dist/LinearGenomeView/components/ExportSvgDialog.d.ts +0 -1
  31. package/dist/LinearGenomeView/components/GetSequenceDialog.d.ts +0 -1
  32. package/dist/LinearGenomeView/components/GetSequenceDialog.js +14 -16
  33. package/dist/LinearGenomeView/components/GetSequenceDialog.js.map +1 -1
  34. package/dist/LinearGenomeView/components/Gridlines.d.ts +0 -1
  35. package/dist/LinearGenomeView/components/Header.d.ts +0 -1
  36. package/dist/LinearGenomeView/components/HelpDialog.d.ts +0 -1
  37. package/dist/LinearGenomeView/components/ImportForm.d.ts +0 -1
  38. package/dist/LinearGenomeView/components/ImportForm.js +4 -7
  39. package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
  40. package/dist/LinearGenomeView/components/LinearGenomeView.d.ts +0 -1
  41. package/dist/LinearGenomeView/components/LinearGenomeView.js +0 -4
  42. package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
  43. package/dist/LinearGenomeView/components/MiniControls.d.ts +0 -1
  44. package/dist/LinearGenomeView/components/OverviewScalebar.js +2 -1
  45. package/dist/LinearGenomeView/components/OverviewScalebar.js.map +1 -1
  46. package/dist/LinearGenomeView/components/RefNameAutocomplete.js +43 -36
  47. package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
  48. package/dist/LinearGenomeView/components/RubberbandSpan.d.ts +0 -1
  49. package/dist/LinearGenomeView/components/SearchBox.d.ts +0 -1
  50. package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +5 -3
  51. package/dist/LinearGenomeView/components/SearchResultsDialog.js +6 -82
  52. package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
  53. package/dist/LinearGenomeView/components/SearchResultsTable.d.ts +8 -0
  54. package/dist/LinearGenomeView/components/SearchResultsTable.js +83 -0
  55. package/dist/LinearGenomeView/components/SearchResultsTable.js.map +1 -0
  56. package/dist/LinearGenomeView/components/SequenceSearchDialog.d.ts +0 -1
  57. package/dist/LinearGenomeView/components/TrackContainer.d.ts +0 -1
  58. package/dist/LinearGenomeView/components/TrackContainer.js +8 -2
  59. package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -1
  60. package/dist/LinearGenomeView/components/TracksContainer.js +5 -7
  61. package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -1
  62. package/dist/LinearGenomeView/components/VerticalGuide.d.ts +0 -1
  63. package/dist/LinearGenomeView/components/ZoomControls.d.ts +0 -1
  64. package/dist/LinearGenomeView/components/util.js +1 -1
  65. package/dist/LinearGenomeView/components/util.js.map +1 -1
  66. package/dist/LinearGenomeView/model.d.ts +49 -36
  67. package/dist/LinearGenomeView/model.js +121 -198
  68. package/dist/LinearGenomeView/model.js.map +1 -1
  69. package/dist/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -1
  70. package/dist/LinearGenomeView/svgcomponents/SVGHeader.d.ts +0 -1
  71. package/dist/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +0 -1
  72. package/dist/LinearGenomeView/svgcomponents/SVGRuler.d.ts +0 -1
  73. package/dist/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +0 -1
  74. package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +0 -1
  75. package/dist/LinearGenomeView/svgcomponents/SVGTracks.d.ts +0 -1
  76. package/dist/LinearGenomeView/util.d.ts +29 -0
  77. package/dist/LinearGenomeView/util.js +79 -1
  78. package/dist/LinearGenomeView/util.js.map +1 -1
  79. package/dist/index.d.ts +189 -70
  80. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -1
  81. package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +3 -4
  82. package/esm/BaseLinearDisplay/components/TooLargeMessage.js +7 -3
  83. package/esm/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -1
  84. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -1
  85. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +75 -14
  86. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +40 -34
  87. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
  88. package/esm/BaseLinearDisplay/models/configSchema.d.ts +35 -1
  89. package/esm/BaseLinearDisplay/models/configSchema.js +9 -0
  90. package/esm/BaseLinearDisplay/models/configSchema.js.map +1 -1
  91. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +10 -6
  92. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
  93. package/esm/BaseLinearDisplay/models/util.d.ts +6 -2
  94. package/esm/BaseLinearDisplay/models/util.js +2 -2
  95. package/esm/BaseLinearDisplay/models/util.js.map +1 -1
  96. package/esm/BasicTrack/configSchema.d.ts +73 -1
  97. package/esm/FeatureTrack/configSchema.d.ts +75 -1
  98. package/esm/LinearBareDisplay/configSchema.d.ts +28 -1
  99. package/esm/LinearBareDisplay/model.d.ts +62 -11
  100. package/esm/LinearBareDisplay/model.js +1 -1
  101. package/esm/LinearBareDisplay/model.js.map +1 -1
  102. package/esm/LinearBasicDisplay/components/SetMaxHeight.d.ts +0 -1
  103. package/esm/LinearBasicDisplay/configSchema.d.ts +28 -1
  104. package/esm/LinearBasicDisplay/configSchema.js +0 -9
  105. package/esm/LinearBasicDisplay/configSchema.js.map +1 -1
  106. package/esm/LinearBasicDisplay/model.d.ts +71 -10
  107. package/esm/LinearGenomeView/components/CenterLine.d.ts +0 -1
  108. package/esm/LinearGenomeView/components/Cytobands.d.ts +22 -23
  109. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +0 -1
  110. package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +0 -1
  111. package/esm/LinearGenomeView/components/GetSequenceDialog.js +15 -17
  112. package/esm/LinearGenomeView/components/GetSequenceDialog.js.map +1 -1
  113. package/esm/LinearGenomeView/components/Gridlines.d.ts +0 -1
  114. package/esm/LinearGenomeView/components/Header.d.ts +0 -1
  115. package/esm/LinearGenomeView/components/HelpDialog.d.ts +0 -1
  116. package/esm/LinearGenomeView/components/ImportForm.d.ts +0 -1
  117. package/esm/LinearGenomeView/components/ImportForm.js +5 -8
  118. package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
  119. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +0 -1
  120. package/esm/LinearGenomeView/components/LinearGenomeView.js +0 -4
  121. package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
  122. package/esm/LinearGenomeView/components/MiniControls.d.ts +0 -1
  123. package/esm/LinearGenomeView/components/OverviewScalebar.js +2 -1
  124. package/esm/LinearGenomeView/components/OverviewScalebar.js.map +1 -1
  125. package/esm/LinearGenomeView/components/RefNameAutocomplete.js +43 -36
  126. package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
  127. package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -1
  128. package/esm/LinearGenomeView/components/SearchBox.d.ts +0 -1
  129. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +5 -3
  130. package/esm/LinearGenomeView/components/SearchResultsDialog.js +7 -83
  131. package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
  132. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +8 -0
  133. package/esm/LinearGenomeView/components/SearchResultsTable.js +77 -0
  134. package/esm/LinearGenomeView/components/SearchResultsTable.js.map +1 -0
  135. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +0 -1
  136. package/esm/LinearGenomeView/components/TrackContainer.d.ts +0 -1
  137. package/esm/LinearGenomeView/components/TrackContainer.js +8 -2
  138. package/esm/LinearGenomeView/components/TrackContainer.js.map +1 -1
  139. package/esm/LinearGenomeView/components/TracksContainer.js +5 -7
  140. package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -1
  141. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +0 -1
  142. package/esm/LinearGenomeView/components/ZoomControls.d.ts +0 -1
  143. package/esm/LinearGenomeView/components/util.js +1 -1
  144. package/esm/LinearGenomeView/components/util.js.map +1 -1
  145. package/esm/LinearGenomeView/model.d.ts +49 -36
  146. package/esm/LinearGenomeView/model.js +122 -199
  147. package/esm/LinearGenomeView/model.js.map +1 -1
  148. package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -1
  149. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +0 -1
  150. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +0 -1
  151. package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +0 -1
  152. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +0 -1
  153. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +0 -1
  154. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +0 -1
  155. package/esm/LinearGenomeView/util.d.ts +29 -0
  156. package/esm/LinearGenomeView/util.js +76 -0
  157. package/esm/LinearGenomeView/util.js.map +1 -1
  158. package/esm/index.d.ts +189 -70
  159. package/package.json +3 -3
  160. package/src/BaseLinearDisplay/components/TooLargeMessage.tsx +10 -6
  161. package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +46 -36
  162. package/src/BaseLinearDisplay/models/configSchema.ts +10 -0
  163. package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +19 -13
  164. package/src/BaseLinearDisplay/models/util.ts +10 -4
  165. package/src/LinearBareDisplay/model.ts +1 -1
  166. package/src/LinearBasicDisplay/configSchema.ts +0 -10
  167. package/src/LinearGenomeView/components/GetSequenceDialog.tsx +15 -25
  168. package/src/LinearGenomeView/components/ImportForm.tsx +4 -14
  169. package/src/LinearGenomeView/components/LinearGenomeView.tsx +0 -14
  170. package/src/LinearGenomeView/components/OverviewScalebar.tsx +2 -1
  171. package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +107 -65
  172. package/src/LinearGenomeView/components/SearchResultsDialog.tsx +17 -112
  173. package/src/LinearGenomeView/components/SearchResultsTable.tsx +121 -0
  174. package/src/LinearGenomeView/components/TrackContainer.tsx +12 -3
  175. package/src/LinearGenomeView/components/TracksContainer.tsx +9 -6
  176. package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.tsx.snap +11 -11
  177. package/src/LinearGenomeView/components/util.ts +2 -1
  178. package/src/LinearGenomeView/index.test.ts +10 -12
  179. package/src/LinearGenomeView/model.ts +163 -236
  180. package/src/LinearGenomeView/util.ts +98 -0
@@ -2,7 +2,7 @@
2
2
  import React from 'react'
3
3
  import { ThemeOptions } from '@mui/material'
4
4
  import { BaseDisplay } from '@jbrowse/core/pluggableElementTypes/models'
5
- import { getConf } from '@jbrowse/core/configuration'
5
+ import { ConfigurationReference, getConf } from '@jbrowse/core/configuration'
6
6
  import { MenuItem } from '@jbrowse/core/ui'
7
7
  import {
8
8
  isAbortException,
@@ -16,7 +16,7 @@ import {
16
16
  Feature,
17
17
  ReactRendering,
18
18
  } from '@jbrowse/core/util'
19
- import { Stats } from '@jbrowse/core/data_adapters/BaseAdapter'
19
+ import { FeatureDensityStats } from '@jbrowse/core/data_adapters/BaseAdapter'
20
20
  import { BaseBlock } from '@jbrowse/core/util/blockTypes'
21
21
  import { Region } from '@jbrowse/core/util/types'
22
22
  import CompositeMap from '@jbrowse/core/util/compositeMap'
@@ -32,7 +32,8 @@ import { LinearGenomeViewModel, ExportSvgOptions } from '../../LinearGenomeView'
32
32
  import { Tooltip } from '../components/BaseLinearDisplay'
33
33
  import TooLargeMessage from '../components/TooLargeMessage'
34
34
  import BlockState, { renderBlockData } from './serverSideRenderedBlock'
35
- import { getId, getDisplayStr, estimateRegionsStatsPre } from './util'
35
+ import { getId, getDisplayStr, getFeatureDensityStatsPre } from './util'
36
+ import configSchema from './configSchema'
36
37
 
37
38
  type LGV = LinearGenomeViewModel
38
39
 
@@ -81,6 +82,10 @@ function stateModelFactory() {
81
82
  * #property
82
83
  */
83
84
  userByteSizeLimit: types.maybe(types.number),
85
+ /**
86
+ * #property
87
+ */
88
+ configuration: ConfigurationReference(configSchema),
84
89
  }),
85
90
  )
86
91
  .volatile(() => ({
@@ -89,8 +94,10 @@ function stateModelFactory() {
89
94
  message: '',
90
95
  featureIdUnderMouse: undefined as undefined | string,
91
96
  contextMenuFeature: undefined as undefined | Feature,
92
- estimatedRegionsStatsP: undefined as undefined | Promise<Stats>,
93
- estimatedRegionsStats: undefined as undefined | Stats,
97
+ featureDensityStatsP: undefined as
98
+ | undefined
99
+ | Promise<FeatureDensityStats>,
100
+ featureDensityStats: undefined as undefined | FeatureDensityStats,
94
101
  }))
95
102
  .views(self => ({
96
103
  get height() {
@@ -215,7 +222,7 @@ function stateModelFactory() {
215
222
  * #getter
216
223
  */
217
224
  get currentBytesRequested() {
218
- return self.estimatedRegionsStats?.bytes || 0
225
+ return self.featureDensityStats?.bytes || 0
219
226
  },
220
227
 
221
228
  /**
@@ -223,7 +230,7 @@ function stateModelFactory() {
223
230
  */
224
231
  get currentFeatureScreenDensity() {
225
232
  const view = getContainingView(self) as LGV
226
- return (self.estimatedRegionsStats?.featureDensity || 0) * view.bpPerPx
233
+ return (self.featureDensityStats?.featureDensity || 0) * view.bpPerPx
227
234
  },
228
235
 
229
236
  /**
@@ -235,8 +242,8 @@ function stateModelFactory() {
235
242
  /**
236
243
  * #getter
237
244
  */
238
- get estimatedStatsReady() {
239
- return !!self.estimatedRegionsStats || !!self.userBpPerPxLimit
245
+ get featureDensityStatsReady() {
246
+ return !!self.featureDensityStats || !!self.userBpPerPxLimit
240
247
  },
241
248
 
242
249
  /**
@@ -245,7 +252,7 @@ function stateModelFactory() {
245
252
  get maxAllowableBytes() {
246
253
  return (
247
254
  self.userByteSizeLimit ||
248
- self.estimatedRegionsStats?.fetchSizeLimit ||
255
+ self.featureDensityStats?.fetchSizeLimit ||
249
256
  (getConf(self, 'fetchSizeLimit') as number)
250
257
  )
251
258
  },
@@ -288,37 +295,37 @@ function stateModelFactory() {
288
295
  /**
289
296
  * #action
290
297
  */
291
- async estimateRegionsStats() {
292
- if (!self.estimatedRegionsStatsP) {
293
- self.estimatedRegionsStatsP = estimateRegionsStatsPre(self).catch(
298
+ async getFeatureDensityStats() {
299
+ if (!self.featureDensityStatsP) {
300
+ self.featureDensityStatsP = getFeatureDensityStatsPre(self).catch(
294
301
  e => {
295
- this.setRegionsStatsP(undefined)
302
+ this.setFeatureDensityStatsP(undefined)
296
303
  throw e
297
304
  },
298
305
  )
299
306
  }
300
- return self.estimatedRegionsStatsP
307
+ return self.featureDensityStatsP
301
308
  },
302
309
 
303
310
  /**
304
311
  * #action
305
312
  */
306
- setRegionsStatsP(arg: any) {
307
- self.estimatedRegionsStatsP = arg
313
+ setFeatureDensityStatsP(arg: any) {
314
+ self.featureDensityStatsP = arg
308
315
  },
309
316
 
310
317
  /**
311
318
  * #action
312
319
  */
313
- setRegionsStats(estimatedRegionsStats?: Stats) {
314
- self.estimatedRegionsStats = estimatedRegionsStats
320
+ setFeatureDensityStats(featureDensityStats?: FeatureDensityStats) {
321
+ self.featureDensityStats = featureDensityStats
315
322
  },
316
323
  /**
317
324
  * #action
318
325
  */
319
- clearRegionsStats() {
320
- self.estimatedRegionsStatsP = undefined
321
- self.estimatedRegionsStats = undefined
326
+ clearFeatureDensityStats() {
327
+ self.featureDensityStatsP = undefined
328
+ self.featureDensityStats = undefined
322
329
  },
323
330
  /**
324
331
  * #action
@@ -347,7 +354,7 @@ function stateModelFactory() {
347
354
  /**
348
355
  * #action
349
356
  */
350
- updateStatsLimit(stats?: Stats) {
357
+ setFeatureDensityStatsLimit(stats?: FeatureDensityStats) {
351
358
  const view = getContainingView(self) as LGV
352
359
  if (stats?.bytes) {
353
360
  self.userByteSizeLimit = stats.bytes
@@ -406,13 +413,12 @@ function stateModelFactory() {
406
413
  * #action
407
414
  */
408
415
  clearFeatureSelection() {
409
- const session = getSession(self)
410
- session.clearSelection()
416
+ getSession(self).clearSelection()
411
417
  },
412
418
  /**
413
419
  * #action
414
420
  */
415
- setFeatureIdUnderMouse(feature: string | undefined) {
421
+ setFeatureIdUnderMouse(feature?: string) {
416
422
  self.featureIdUnderMouse = feature
417
423
  },
418
424
  /**
@@ -434,11 +440,15 @@ function stateModelFactory() {
434
440
  * region is too large if:
435
441
  * - stats are ready
436
442
  * - region is greater than 20kb (don't warn when zoomed in less than that)
437
- * - and bytes is greater than max allowed bytes or density greater than max density
443
+ * - and bytes is greater than max allowed bytes or density greater than max
444
+ * density
438
445
  */
439
446
  get regionTooLarge() {
440
447
  const view = getContainingView(self) as LGV
441
- if (!self.estimatedStatsReady || view.dynamicBlocks.totalBp < 20_000) {
448
+ if (
449
+ !self.featureDensityStatsReady ||
450
+ view.dynamicBlocks.totalBp < 20_000
451
+ ) {
442
452
  return false
443
453
  }
444
454
  return (
@@ -481,10 +491,10 @@ function stateModelFactory() {
481
491
  }
482
492
 
483
493
  try {
484
- const estimatedRegionsStats = await self.estimateRegionsStats()
494
+ const featureDensityStats = await self.getFeatureDensityStats()
485
495
 
486
496
  if (isAlive(self)) {
487
- self.setRegionsStats(estimatedRegionsStats)
497
+ self.setFeatureDensityStats(featureDensityStats)
488
498
  superReload()
489
499
  }
490
500
  } catch (e) {
@@ -498,7 +508,7 @@ function stateModelFactory() {
498
508
  afterAttach() {
499
509
  // this autorun performs stats estimation
500
510
  //
501
- // the chain of events calls estimateRegionsStats against the data
511
+ // the chain of events calls getFeatureDensityStats against the data
502
512
  // adapter which by default uses featureDensity, but can also respond
503
513
  // with a byte size estimate and fetch size limit (data adapter can
504
514
  // define what is too much data)
@@ -519,7 +529,7 @@ function stateModelFactory() {
519
529
 
520
530
  // don't re-estimate featureDensity even if zoom level changes,
521
531
  // jbrowse1-style assume it's sort of representative
522
- if (self.estimatedRegionsStats?.featureDensity !== undefined) {
532
+ if (self.featureDensityStats?.featureDensity !== undefined) {
523
533
  self.setCurrBpPerPx(view.bpPerPx)
524
534
  return
525
535
  }
@@ -529,11 +539,11 @@ function stateModelFactory() {
529
539
  return
530
540
  }
531
541
 
532
- self.clearRegionsStats()
542
+ self.clearFeatureDensityStats()
533
543
  self.setCurrBpPerPx(view.bpPerPx)
534
- const estimatedRegionsStats = await self.estimateRegionsStats()
544
+ const featureDensityStats = await self.getFeatureDensityStats()
535
545
  if (isAlive(self)) {
536
- self.setRegionsStats(estimatedRegionsStats)
546
+ self.setFeatureDensityStats(featureDensityStats)
537
547
  }
538
548
  } catch (e) {
539
549
  if (!isAbortException(e) && isAlive(self)) {
@@ -600,7 +610,7 @@ function stateModelFactory() {
600
610
  return {
601
611
  ...getParentRenderProps(self),
602
612
  notReady:
603
- self.currBpPerPx !== view.bpPerPx || !self.estimatedRegionsStats,
613
+ self.currBpPerPx !== view.bpPerPx || !self.featureDensityStatsReady,
604
614
  rpcDriverName: self.rpcDriverName,
605
615
  displayModel: self,
606
616
  onFeatureClick(_: unknown, featureId?: string) {
@@ -37,6 +37,16 @@ const baseLinearDisplayConfigSchema = ConfigurationSchema(
37
37
  defaultValue: 100,
38
38
  description: 'default height for the track',
39
39
  },
40
+ /**
41
+ * #slot
42
+ */
43
+ mouseover: {
44
+ type: 'string',
45
+ description: 'text to display when the cursor hovers over a feature',
46
+ defaultValue: `jexl:get(feature,'name')`,
47
+
48
+ contextVariable: ['feature'],
49
+ },
40
50
  },
41
51
  {
42
52
  /**
@@ -63,19 +63,25 @@ const blockState = types
63
63
  },
64
64
  afterAttach() {
65
65
  const display = getContainingDisplay(self)
66
- makeAbortableReaction(
67
- self as any,
68
- renderBlockData,
69
- renderBlockEffect, // reaction doesn't expect async here
70
- {
71
- name: `${display.id}/${assembleLocString(self.region)} rendering`,
72
- delay: display.renderDelay,
73
- fireImmediately: true,
74
- },
75
- this.setLoading,
76
- this.setRendered,
77
- this.setError,
78
- )
66
+ setTimeout(() => {
67
+ if (isAlive(self)) {
68
+ makeAbortableReaction(
69
+ self as any,
70
+ renderBlockData,
71
+ renderBlockEffect, // reaction doesn't expect async here
72
+ {
73
+ name: `${display.id}/${assembleLocString(
74
+ self.region,
75
+ )} rendering`,
76
+ delay: display.renderDelay,
77
+ fireImmediately: true,
78
+ },
79
+ this.setLoading,
80
+ this.setRendered,
81
+ this.setError,
82
+ )
83
+ }
84
+ }, display.renderDelay)
79
85
  },
80
86
  setStatus(message: string) {
81
87
  self.status = message
@@ -1,4 +1,5 @@
1
- import { Stats } from '@jbrowse/core/data_adapters/BaseAdapter'
1
+ import { AnyConfigurationModel } from '@jbrowse/core/configuration'
2
+ import { FeatureDensityStats } from '@jbrowse/core/data_adapters/BaseAdapter'
2
3
  import { getContainingView, getSession } from '@jbrowse/core/util'
3
4
  import { getRpcSessionId } from '@jbrowse/core/util/tracks'
4
5
  import { IAnyStateTreeNode, isAlive } from 'mobx-state-tree'
@@ -35,7 +36,12 @@ export function getId(id: string, index: number) {
35
36
  return `clip-${isJest ? id : 'jest'}-${index}`
36
37
  }
37
38
 
38
- export async function estimateRegionsStatsPre(self: IAnyStateTreeNode) {
39
+ export async function getFeatureDensityStatsPre(
40
+ self: IAnyStateTreeNode & {
41
+ adapterConfig?: AnyConfigurationModel
42
+ setMessage: (arg: string) => void
43
+ },
44
+ ) {
39
45
  const view = getContainingView(self) as LinearGenomeViewModel
40
46
  const regions = view.staticBlocks.contentBlocks
41
47
 
@@ -48,7 +54,7 @@ export async function estimateRegionsStatsPre(self: IAnyStateTreeNode) {
48
54
  }
49
55
  const sessionId = getRpcSessionId(self)
50
56
 
51
- return rpcManager.call(sessionId, 'CoreEstimateRegionStats', {
57
+ return rpcManager.call(sessionId, 'CoreGetFeatureDensityStats', {
52
58
  sessionId,
53
59
  regions,
54
60
  adapterConfig,
@@ -57,5 +63,5 @@ export async function estimateRegionsStatsPre(self: IAnyStateTreeNode) {
57
63
  self.setMessage(message)
58
64
  }
59
65
  },
60
- }) as Promise<Stats>
66
+ }) as Promise<FeatureDensityStats>
61
67
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  AnyConfigurationSchemaType,
3
3
  ConfigurationReference,
4
- } from '@jbrowse/core/configuration/configurationSchema'
4
+ } from '@jbrowse/core/configuration'
5
5
  import { getParentRenderProps } from '@jbrowse/core/util/tracks'
6
6
  import { types } from 'mobx-state-tree'
7
7
  import { BaseLinearDisplay } from '../BaseLinearDisplay'
@@ -9,16 +9,6 @@ function configSchemaFactory(pluginManager: PluginManager) {
9
9
  return ConfigurationSchema(
10
10
  'LinearBasicDisplay',
11
11
  {
12
- /**
13
- * #slot
14
- */
15
- mouseover: {
16
- type: 'string',
17
- description: 'what to display in a given mouseover',
18
- defaultValue: `jexl:get(feature,'name')`,
19
-
20
- contextVariable: ['feature'],
21
- },
22
12
  /**
23
13
  * #slot
24
14
  */
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useMemo, useState } from 'react'
1
+ import React, { useEffect, useState } from 'react'
2
2
  import { makeStyles } from 'tss-react/mui'
3
3
  import {
4
4
  Button,
@@ -96,14 +96,6 @@ function SequenceDialog({
96
96
  const { leftOffset, rightOffset } = model
97
97
  const loading = Boolean(sequenceChunks === undefined)
98
98
 
99
- // avoid infinite looping of useEffect
100
- // random note: the current selected region can't be a computed because it
101
- // uses action on base1dview even though it's on the ephemeral base1dview
102
- const regionsSelected = useMemo(
103
- () => model.getSelectedRegions(leftOffset, rightOffset),
104
- [model, leftOffset, rightOffset],
105
- )
106
-
107
99
  useEffect(() => {
108
100
  let active = true
109
101
  const controller = new AbortController()
@@ -111,18 +103,17 @@ function SequenceDialog({
111
103
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
112
104
  ;(async () => {
113
105
  try {
114
- if (regionsSelected.length > 0) {
115
- const chunks = await fetchSequence(
116
- model,
117
- regionsSelected,
118
- controller.signal,
119
- )
120
- if (active) {
121
- setSequenceChunks(chunks)
122
- }
123
- } else {
106
+ // random note: the current selected region can't be a computed because
107
+ // it uses action on base1dview even though it's on the ephemeral
108
+ // base1dview
109
+ const selection = model.getSelectedRegions(leftOffset, rightOffset)
110
+ if (selection.length === 0) {
124
111
  throw new Error('Selected region is out of bounds')
125
112
  }
113
+ const chunks = await fetchSequence(model, selection, controller.signal)
114
+ if (active) {
115
+ setSequenceChunks(chunks)
116
+ }
126
117
  } catch (e) {
127
118
  console.error(e)
128
119
  if (active) {
@@ -135,7 +126,7 @@ function SequenceDialog({
135
126
  controller.abort()
136
127
  active = false
137
128
  }
138
- }, [model, session, regionsSelected])
129
+ }, [model, session, leftOffset, rightOffset])
139
130
 
140
131
  const sequence = sequenceChunks
141
132
  ? formatSeqFasta(
@@ -146,10 +137,10 @@ function SequenceDialog({
146
137
  const chunkRefName = chunk.get('refName')
147
138
  const chunkStart = chunk.get('start') + 1
148
139
  const chunkEnd = chunk.get('end')
149
- const chunkLocstring = `${chunkRefName}:${chunkStart}-${chunkEnd}`
140
+ const loc = `${chunkRefName}:${chunkStart}-${chunkEnd}`
150
141
  if (chunkSeq?.length !== chunkEnd - chunkStart + 1) {
151
142
  throw new Error(
152
- `${chunkLocstring} returned ${chunkSeq.length.toLocaleString()} bases, but should have returned ${(
143
+ `${loc} returned ${chunkSeq.length.toLocaleString()} bases, but should have returned ${(
153
144
  chunkEnd - chunkStart
154
145
  ).toLocaleString()}`,
155
146
  )
@@ -162,8 +153,7 @@ function SequenceDialog({
162
153
  chunkSeq = complement(chunkSeq)
163
154
  }
164
155
  return {
165
- header:
166
- chunkLocstring + (rev ? '-rev' : '') + (comp ? '-comp' : ''),
156
+ header: loc + (rev ? '-rev' : '') + (comp ? '-comp' : ''),
167
157
  seq: chunkSeq,
168
158
  }
169
159
  }),
@@ -178,7 +168,7 @@ function SequenceDialog({
178
168
  open
179
169
  onClose={() => {
180
170
  handleClose()
181
- model.setOffsets(undefined, undefined)
171
+ model.setOffsets()
182
172
  }}
183
173
  title="Reference sequence"
184
174
  >
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect, lazy } from 'react'
1
+ import React, { useState, useEffect } from 'react'
2
2
  import { makeStyles } from 'tss-react/mui'
3
3
  import { observer } from 'mobx-react'
4
4
  import { getSession } from '@jbrowse/core/util'
@@ -20,9 +20,6 @@ import RefNameAutocomplete from './RefNameAutocomplete'
20
20
  import { fetchResults, splitLast } from './util'
21
21
  import { LinearGenomeViewModel } from '..'
22
22
 
23
- // lazies
24
- const SearchResultsDialog = lazy(() => import('./SearchResultsDialog'))
25
-
26
23
  const useStyles = makeStyles()(theme => ({
27
24
  importFormContainer: {
28
25
  padding: theme.spacing(2),
@@ -41,7 +38,7 @@ export default observer(function ({ model }: { model: LGV }) {
41
38
  const { classes } = useStyles()
42
39
  const session = getSession(model)
43
40
  const { assemblyNames, assemblyManager, textSearchManager } = session
44
- const { rankSearchResults, isSearchDialogDisplayed, error } = model
41
+ const { rankSearchResults, error } = model
45
42
  const [selectedAsm, setSelectedAsm] = useState(assemblyNames[0])
46
43
  const [option, setOption] = useState<BaseResult>()
47
44
  const searchScope = model.searchScope(selectedAsm)
@@ -85,7 +82,7 @@ export default observer(function ({ model }: { model: LGV }) {
85
82
  if (option?.getDisplayString() === input && option.hasLocation()) {
86
83
  await navToOption(option)
87
84
  } else if (option?.results?.length) {
88
- model.setSearchResults(option.results, option.getLabel())
85
+ model.setSearchResults(option.results, option.getLabel(), selectedAsm)
89
86
  } else {
90
87
  const [ref, rest] = splitLast(input, ':')
91
88
  const allRefs = assembly?.allRefNamesWithLowerCase || []
@@ -105,7 +102,7 @@ export default observer(function ({ model }: { model: LGV }) {
105
102
  })
106
103
 
107
104
  if (results.length > 1) {
108
- model.setSearchResults(results, input.toLowerCase())
105
+ model.setSearchResults(results, input.toLowerCase(), selectedAsm)
109
106
  } else if (results.length === 1) {
110
107
  await navToOption(results[0])
111
108
  } else {
@@ -215,13 +212,6 @@ export default observer(function ({ model }: { model: LGV }) {
215
212
  </Grid>
216
213
  </form>
217
214
  </Container>
218
- {isSearchDialogDisplayed ? (
219
- <SearchResultsDialog
220
- model={model}
221
- optAssemblyName={selectedAsm}
222
- handleClose={() => model.setSearchResults(undefined, undefined)}
223
- />
224
- ) : null}
225
215
  </div>
226
216
  )
227
217
  })
@@ -10,8 +10,6 @@ import { LinearGenomeViewModel } from '..'
10
10
  import TrackContainer from './TrackContainer'
11
11
  import TracksContainer from './TracksContainer'
12
12
  import ImportForm from './ImportForm'
13
- import GetSequenceDialog from './GetSequenceDialog'
14
- import SearchResultsDialog from './SearchResultsDialog'
15
13
 
16
14
  type LGV = LinearGenomeViewModel
17
15
 
@@ -39,18 +37,6 @@ const LinearGenomeView = observer(({ model }: { model: LGV }) => {
39
37
 
40
38
  return (
41
39
  <div style={{ position: 'relative' }}>
42
- {model.seqDialogDisplayed ? (
43
- <GetSequenceDialog
44
- model={model}
45
- handleClose={() => model.setGetSequenceDialogOpen(false)}
46
- />
47
- ) : null}
48
- {model.isSearchDialogDisplayed ? (
49
- <SearchResultsDialog
50
- model={model}
51
- handleClose={() => model.setSearchResults(undefined, undefined)}
52
- />
53
- ) : null}
54
40
  <HeaderComponent model={model} />
55
41
  <MiniControlsComponent model={model} />
56
42
  <TracksContainer model={model}>
@@ -69,6 +69,7 @@ const useStyles = makeStyles()(theme => ({
69
69
  position: 'relative',
70
70
  },
71
71
  overviewSvg: {
72
+ pointerEvents: 'none',
72
73
  width: '100%',
73
74
  position: 'absolute',
74
75
  },
@@ -170,7 +171,7 @@ const OverviewBox = observer(function ({
170
171
  style={{
171
172
  left: block.offsetPx + 3,
172
173
  color: canDisplayCytobands
173
- ? theme.palette.primary.contrastText
174
+ ? theme.palette.text.primary
174
175
  : refNameColor,
175
176
  }}
176
177
  className={classes.scalebarRefName}