@jbrowse/plugin-linear-genome-view 1.7.11 → 2.0.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.
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +119 -139
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -0
- package/dist/BaseLinearDisplay/components/Block.js +53 -74
- package/dist/BaseLinearDisplay/components/Block.js.map +1 -0
- package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +11 -1
- package/dist/BaseLinearDisplay/components/LinearBlocks.js +64 -103
- package/dist/BaseLinearDisplay/components/LinearBlocks.js.map +1 -0
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +145 -175
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -0
- package/dist/BaseLinearDisplay/components/Tooltip.js +109 -116
- package/dist/BaseLinearDisplay/components/Tooltip.js.map +1 -0
- package/dist/BaseLinearDisplay/index.js +13 -40
- package/dist/BaseLinearDisplay/index.js.map +1 -0
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +19 -14
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +605 -684
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -0
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +15 -22
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -0
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +7 -8
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +266 -312
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -0
- package/dist/LinearBareDisplay/configSchema.js +11 -17
- package/dist/LinearBareDisplay/configSchema.js.map +1 -0
- package/dist/LinearBareDisplay/index.js +7 -20
- package/dist/LinearBareDisplay/index.js.map +1 -0
- package/dist/LinearBareDisplay/model.d.ts +15 -13
- package/dist/LinearBareDisplay/model.js +36 -42
- package/dist/LinearBareDisplay/model.js.map +1 -0
- package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +1 -1
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js +76 -85
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -0
- package/dist/LinearBasicDisplay/configSchema.js +15 -23
- package/dist/LinearBasicDisplay/configSchema.js.map +1 -0
- package/dist/LinearBasicDisplay/index.js +10 -22
- package/dist/LinearBasicDisplay/index.js.map +1 -0
- package/dist/LinearBasicDisplay/model.d.ts +20 -14
- package/dist/LinearBasicDisplay/model.js +180 -159
- package/dist/LinearBasicDisplay/model.js.map +1 -0
- package/dist/LinearGenomeView/components/CenterLine.d.ts +2 -8
- package/dist/LinearGenomeView/components/CenterLine.js +60 -74
- package/dist/LinearGenomeView/components/CenterLine.js.map +1 -0
- package/dist/LinearGenomeView/components/ExportSvgDialog.js +141 -141
- package/dist/LinearGenomeView/components/ExportSvgDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/Header.d.ts +1 -0
- package/dist/LinearGenomeView/components/Header.js +70 -125
- package/dist/LinearGenomeView/components/Header.js.map +1 -0
- package/dist/LinearGenomeView/components/HelpDialog.d.ts +0 -1
- package/dist/LinearGenomeView/components/HelpDialog.js +62 -44
- package/dist/LinearGenomeView/components/HelpDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/ImportForm.d.ts +1 -0
- package/dist/LinearGenomeView/components/ImportForm.js +222 -289
- package/dist/LinearGenomeView/components/ImportForm.js.map +1 -0
- package/dist/LinearGenomeView/components/LinearGenomeView.js +64 -124
- package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -0
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +198 -337
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -0
- package/dist/LinearGenomeView/components/MiniControls.js +64 -78
- package/dist/LinearGenomeView/components/MiniControls.js.map +1 -0
- package/dist/LinearGenomeView/components/OverviewRubberBand.js +226 -293
- package/dist/LinearGenomeView/components/OverviewRubberBand.js.map +1 -0
- package/dist/LinearGenomeView/components/OverviewScaleBar.d.ts +3 -3
- package/dist/LinearGenomeView/components/OverviewScaleBar.js +275 -370
- package/dist/LinearGenomeView/components/OverviewScaleBar.js.map +1 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete.d.ts +1 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js +237 -324
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -0
- package/dist/LinearGenomeView/components/RubberBand.js +229 -296
- package/dist/LinearGenomeView/components/RubberBand.js.map +1 -0
- package/dist/LinearGenomeView/components/Ruler.js +45 -90
- package/dist/LinearGenomeView/components/Ruler.js.map +1 -0
- package/dist/LinearGenomeView/components/ScaleBar.d.ts +8 -403
- package/dist/LinearGenomeView/components/ScaleBar.js +121 -172
- package/dist/LinearGenomeView/components/ScaleBar.js.map +1 -0
- package/dist/LinearGenomeView/components/SearchBox.js +155 -166
- package/dist/LinearGenomeView/components/SearchBox.js.map +1 -0
- package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +0 -1
- package/dist/LinearGenomeView/components/SearchResultsDialog.js +105 -149
- package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/SequenceDialog.js +219 -272
- package/dist/LinearGenomeView/components/SequenceDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/TrackContainer.js +116 -156
- package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -0
- package/dist/LinearGenomeView/components/TrackLabel.d.ts +6 -42
- package/dist/LinearGenomeView/components/TrackLabel.js +115 -134
- package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -0
- package/dist/LinearGenomeView/components/TracksContainer.d.ts +1 -1
- package/dist/LinearGenomeView/components/TracksContainer.js +172 -199
- package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -0
- package/dist/LinearGenomeView/components/VerticalGuides.d.ts +2 -3
- package/dist/LinearGenomeView/components/VerticalGuides.js +66 -104
- package/dist/LinearGenomeView/components/VerticalGuides.js.map +1 -0
- package/dist/LinearGenomeView/components/ZoomControls.js +72 -87
- package/dist/LinearGenomeView/components/ZoomControls.js.map +1 -0
- package/dist/LinearGenomeView/components/util.js +94 -71
- package/dist/LinearGenomeView/components/util.js.map +1 -0
- package/dist/LinearGenomeView/index.d.ts +3 -3
- package/dist/LinearGenomeView/index.js +1163 -1414
- package/dist/LinearGenomeView/index.js.map +1 -0
- package/dist/LinearGenomeView/util.js +76 -83
- package/dist/LinearGenomeView/util.js.map +1 -0
- package/dist/index.d.ts +98 -48
- package/dist/index.js +225 -295
- package/dist/index.js.map +1 -0
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +9 -0
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +68 -0
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -0
- package/esm/BaseLinearDisplay/components/Block.d.ts +15 -0
- package/esm/BaseLinearDisplay/components/Block.js +46 -0
- package/esm/BaseLinearDisplay/components/Block.js.map +1 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +22 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +62 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.js.map +1 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +4 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +113 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -0
- package/esm/BaseLinearDisplay/components/Tooltip.d.ts +8 -0
- package/esm/BaseLinearDisplay/components/Tooltip.js +64 -0
- package/esm/BaseLinearDisplay/components/Tooltip.js.map +1 -0
- package/esm/BaseLinearDisplay/index.d.ts +5 -0
- package/esm/BaseLinearDisplay/index.js +4 -0
- package/esm/BaseLinearDisplay/index.js.map +1 -0
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +232 -0
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +541 -0
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -0
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +1 -0
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +14 -0
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +96 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +225 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -0
- package/esm/LinearBareDisplay/configSchema.d.ts +2 -0
- package/esm/LinearBareDisplay/configSchema.js +9 -0
- package/esm/LinearBareDisplay/configSchema.js.map +1 -0
- package/esm/LinearBareDisplay/index.d.ts +2 -0
- package/esm/LinearBareDisplay/index.js +3 -0
- package/esm/LinearBareDisplay/index.js.map +1 -0
- package/esm/LinearBareDisplay/model.d.ts +194 -0
- package/esm/LinearBareDisplay/model.js +28 -0
- package/esm/LinearBareDisplay/model.js.map +1 -0
- package/esm/LinearBasicDisplay/components/SetMaxHeight.d.ts +10 -0
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js +40 -0
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -0
- package/esm/LinearBasicDisplay/configSchema.d.ts +2 -0
- package/esm/LinearBasicDisplay/configSchema.js +14 -0
- package/esm/LinearBasicDisplay/configSchema.js.map +1 -0
- package/esm/LinearBasicDisplay/index.d.ts +2 -0
- package/esm/LinearBasicDisplay/index.js +3 -0
- package/esm/LinearBasicDisplay/index.js.map +1 -0
- package/esm/LinearBasicDisplay/model.d.ts +218 -0
- package/esm/LinearBasicDisplay/model.js +127 -0
- package/esm/LinearBasicDisplay/model.js.map +1 -0
- package/esm/LinearGenomeView/components/CenterLine.d.ts +8 -0
- package/esm/LinearGenomeView/components/CenterLine.js +40 -0
- package/esm/LinearGenomeView/components/CenterLine.js.map +1 -0
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +6 -0
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +52 -0
- package/esm/LinearGenomeView/components/ExportSvgDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/Header.d.ts +7 -0
- package/esm/LinearGenomeView/components/Header.js +81 -0
- package/esm/LinearGenomeView/components/Header.js.map +1 -0
- package/esm/LinearGenomeView/components/HelpDialog.d.ts +4 -0
- package/esm/LinearGenomeView/components/HelpDialog.js +58 -0
- package/esm/LinearGenomeView/components/HelpDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/ImportForm.d.ts +7 -0
- package/esm/LinearGenomeView/components/ImportForm.js +141 -0
- package/esm/LinearGenomeView/components/ImportForm.js.map +1 -0
- package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +7 -0
- package/esm/LinearGenomeView/components/LinearGenomeView.js +67 -0
- package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -0
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +4 -0
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +132 -0
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -0
- package/esm/LinearGenomeView/components/MiniControls.d.ts +6 -0
- package/esm/LinearGenomeView/components/MiniControls.js +25 -0
- package/esm/LinearGenomeView/components/MiniControls.js.map +1 -0
- package/esm/LinearGenomeView/components/OverviewRubberBand.d.ts +22 -0
- package/esm/LinearGenomeView/components/OverviewRubberBand.js +194 -0
- package/esm/LinearGenomeView/components/OverviewRubberBand.js.map +1 -0
- package/esm/LinearGenomeView/components/OverviewScaleBar.d.ts +148 -0
- package/esm/LinearGenomeView/components/OverviewScaleBar.js +287 -0
- package/esm/LinearGenomeView/components/OverviewScaleBar.js.map +1 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete.d.ts +22 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js +136 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -0
- package/esm/LinearGenomeView/components/RubberBand.d.ts +9 -0
- package/esm/LinearGenomeView/components/RubberBand.js +198 -0
- package/esm/LinearGenomeView/components/RubberBand.js.map +1 -0
- package/esm/LinearGenomeView/components/Ruler.d.ts +27 -0
- package/esm/LinearGenomeView/components/Ruler.js +50 -0
- package/esm/LinearGenomeView/components/Ruler.js.map +1 -0
- package/esm/LinearGenomeView/components/ScaleBar.d.ts +10 -0
- package/esm/LinearGenomeView/components/ScaleBar.js +112 -0
- package/esm/LinearGenomeView/components/ScaleBar.js.map +1 -0
- package/esm/LinearGenomeView/components/SearchBox.d.ts +8 -0
- package/esm/LinearGenomeView/components/SearchBox.js +94 -0
- package/esm/LinearGenomeView/components/SearchBox.js.map +1 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +7 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +107 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/SequenceDialog.d.ts +8 -0
- package/esm/LinearGenomeView/components/SequenceDialog.js +147 -0
- package/esm/LinearGenomeView/components/SequenceDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +9 -0
- package/esm/LinearGenomeView/components/TrackContainer.js +109 -0
- package/esm/LinearGenomeView/components/TrackContainer.js.map +1 -0
- package/esm/LinearGenomeView/components/TrackLabel.d.ts +8 -0
- package/esm/LinearGenomeView/components/TrackLabel.js +89 -0
- package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -0
- package/esm/LinearGenomeView/components/TracksContainer.d.ts +10 -0
- package/esm/LinearGenomeView/components/TracksContainer.js +142 -0
- package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -0
- package/esm/LinearGenomeView/components/VerticalGuides.d.ts +8 -0
- package/esm/LinearGenomeView/components/VerticalGuides.js +71 -0
- package/esm/LinearGenomeView/components/VerticalGuides.js.map +1 -0
- package/esm/LinearGenomeView/components/ZoomControls.d.ts +7 -0
- package/esm/LinearGenomeView/components/ZoomControls.js +32 -0
- package/esm/LinearGenomeView/components/ZoomControls.js.map +1 -0
- package/esm/LinearGenomeView/components/util.d.ts +14 -0
- package/esm/LinearGenomeView/components/util.js +17 -0
- package/esm/LinearGenomeView/components/util.js.map +1 -0
- package/esm/LinearGenomeView/index.d.ts +288 -0
- package/esm/LinearGenomeView/index.js +1124 -0
- package/esm/LinearGenomeView/index.js.map +1 -0
- package/esm/LinearGenomeView/util.d.ts +14 -0
- package/esm/LinearGenomeView/util.js +62 -0
- package/esm/LinearGenomeView/util.js.map +1 -0
- package/esm/index.d.ts +615 -0
- package/esm/index.js +127 -0
- package/esm/index.js.map +1 -0
- package/package.json +21 -14
- package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +4 -3
- package/src/BaseLinearDisplay/components/Block.tsx +5 -5
- package/src/BaseLinearDisplay/components/LinearBlocks.tsx +4 -4
- package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +7 -8
- package/src/BaseLinearDisplay/components/Tooltip.tsx +14 -4
- package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +6 -4
- package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +1 -1
- package/src/LinearBasicDisplay/components/SetMaxHeight.tsx +10 -7
- package/src/LinearBasicDisplay/model.ts +19 -11
- package/src/LinearGenomeView/components/CenterLine.tsx +6 -11
- package/src/LinearGenomeView/components/ExportSvgDialog.tsx +5 -5
- package/src/LinearGenomeView/components/Header.tsx +10 -15
- package/src/LinearGenomeView/components/HelpDialog.tsx +5 -5
- package/src/LinearGenomeView/components/ImportForm.tsx +6 -12
- package/src/LinearGenomeView/components/LinearGenomeView.test.js +16 -6
- package/src/LinearGenomeView/components/LinearGenomeView.tsx +4 -3
- package/src/LinearGenomeView/components/MiniControls.tsx +29 -40
- package/src/LinearGenomeView/components/OverviewRubberBand.tsx +6 -10
- package/src/LinearGenomeView/components/OverviewScaleBar.tsx +61 -59
- package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +13 -44
- package/src/LinearGenomeView/components/RubberBand.tsx +12 -17
- package/src/LinearGenomeView/components/Ruler.tsx +5 -11
- package/src/LinearGenomeView/components/ScaleBar.tsx +23 -27
- package/src/LinearGenomeView/components/SearchBox.tsx +4 -3
- package/src/LinearGenomeView/components/SearchResultsDialog.tsx +7 -6
- package/src/LinearGenomeView/components/SequenceDialog.tsx +9 -9
- package/src/LinearGenomeView/components/TrackContainer.tsx +12 -12
- package/src/LinearGenomeView/components/TrackLabel.tsx +21 -31
- package/src/LinearGenomeView/components/TracksContainer.tsx +8 -13
- package/src/LinearGenomeView/components/VerticalGuides.tsx +9 -11
- package/src/LinearGenomeView/components/ZoomControls.tsx +12 -13
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +500 -547
- package/src/LinearGenomeView/index.test.ts +1 -0
- package/src/LinearGenomeView/index.tsx +47 -62
- package/src/index.ts +1 -1
- package/dist/LinearBareDisplay/index.test.js +0 -33
- package/dist/LinearGenomeView/components/LinearGenomeView.test.js +0 -234
- package/dist/LinearGenomeView/components/ScaleBar.test.js +0 -180
- package/dist/LinearGenomeView/index.test.js +0 -1187
- package/dist/LinearGenomeView/util.test.js +0 -78
|
@@ -39,13 +39,13 @@ import { saveAs } from 'file-saver'
|
|
|
39
39
|
|
|
40
40
|
// icons
|
|
41
41
|
import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons'
|
|
42
|
-
import SyncAltIcon from '@
|
|
43
|
-
import VisibilityIcon from '@
|
|
44
|
-
import LabelIcon from '@
|
|
45
|
-
import FolderOpenIcon from '@
|
|
46
|
-
import PhotoCameraIcon from '@
|
|
47
|
-
import ZoomInIcon from '@
|
|
48
|
-
import MenuOpenIcon from '@
|
|
42
|
+
import SyncAltIcon from '@mui/icons-material/SyncAlt'
|
|
43
|
+
import VisibilityIcon from '@mui/icons-material/Visibility'
|
|
44
|
+
import LabelIcon from '@mui/icons-material/Label'
|
|
45
|
+
import FolderOpenIcon from '@mui/icons-material/FolderOpen'
|
|
46
|
+
import PhotoCameraIcon from '@mui/icons-material/PhotoCamera'
|
|
47
|
+
import ZoomInIcon from '@mui/icons-material/ZoomIn'
|
|
48
|
+
import MenuOpenIcon from '@mui/icons-material/MenuOpen'
|
|
49
49
|
|
|
50
50
|
// locals
|
|
51
51
|
import { renderToSvg } from './components/LinearGenomeViewSvg'
|
|
@@ -311,8 +311,10 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
311
311
|
if (bp < 0) {
|
|
312
312
|
const region = self.displayedRegions[0]
|
|
313
313
|
const offset = bp
|
|
314
|
+
const snap = getSnapshot(region)
|
|
314
315
|
return {
|
|
315
|
-
|
|
316
|
+
// xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit
|
|
317
|
+
...(snap as Omit<typeof snap, symbol>),
|
|
316
318
|
oob: true,
|
|
317
319
|
coord: region.reversed
|
|
318
320
|
? Math.floor(region.end - offset) + 1
|
|
@@ -330,8 +332,10 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
330
332
|
const len = region.end - region.start
|
|
331
333
|
const offset = bp - bpSoFar
|
|
332
334
|
if (len + bpSoFar > bp && bpSoFar <= bp) {
|
|
335
|
+
const snap = getSnapshot(region)
|
|
333
336
|
return {
|
|
334
|
-
|
|
337
|
+
// xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit
|
|
338
|
+
...(snap as Omit<typeof snap, symbol>),
|
|
335
339
|
oob: false,
|
|
336
340
|
offset,
|
|
337
341
|
coord: region.reversed
|
|
@@ -358,8 +362,10 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
358
362
|
const region = self.displayedRegions[n - 1]
|
|
359
363
|
const len = region.end - region.start
|
|
360
364
|
const offset = bp - bpSoFar + len
|
|
365
|
+
const snap = getSnapshot(region)
|
|
361
366
|
return {
|
|
362
|
-
|
|
367
|
+
// xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit
|
|
368
|
+
...(snap as Omit<typeof snap, symbol>),
|
|
363
369
|
oob: true,
|
|
364
370
|
offset,
|
|
365
371
|
coord: region.reversed
|
|
@@ -529,26 +535,19 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
529
535
|
initialSnapshot = {},
|
|
530
536
|
displayInitialSnapshot = {},
|
|
531
537
|
) {
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
trackConfigSchema,
|
|
536
|
-
getRoot(self),
|
|
537
|
-
trackId,
|
|
538
|
-
)
|
|
539
|
-
if (!configuration) {
|
|
538
|
+
const schema = pluginManager.pluggableConfigSchemaType('track')
|
|
539
|
+
const conf = resolveIdentifier(schema, getRoot(self), trackId)
|
|
540
|
+
if (!conf) {
|
|
540
541
|
throw new Error(`Could not resolve identifier "${trackId}"`)
|
|
541
542
|
}
|
|
542
|
-
const trackType = pluginManager.getTrackType(
|
|
543
|
+
const trackType = pluginManager.getTrackType(conf?.type)
|
|
543
544
|
if (!trackType) {
|
|
544
|
-
throw new Error(`Unknown track type ${
|
|
545
|
+
throw new Error(`Unknown track type ${conf.type}`)
|
|
545
546
|
}
|
|
546
547
|
const viewType = pluginManager.getViewType(self.type)
|
|
547
|
-
const supportedDisplays = viewType.displayTypes.map(
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
const displayConf = configuration.displays.find(
|
|
551
|
-
(d: AnyConfigurationModel) => supportedDisplays.includes(d.type),
|
|
548
|
+
const supportedDisplays = viewType.displayTypes.map(d => d.name)
|
|
549
|
+
const displayConf = conf.displays.find((d: AnyConfigurationModel) =>
|
|
550
|
+
supportedDisplays.includes(d.type),
|
|
552
551
|
)
|
|
553
552
|
if (!displayConf) {
|
|
554
553
|
throw new Error(
|
|
@@ -556,14 +555,12 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
556
555
|
)
|
|
557
556
|
}
|
|
558
557
|
|
|
559
|
-
const
|
|
560
|
-
|
|
561
|
-
)
|
|
562
|
-
if (shownTracks.length === 0) {
|
|
558
|
+
const t = self.tracks.filter(t => t.configuration === conf)
|
|
559
|
+
if (t.length === 0) {
|
|
563
560
|
const track = trackType.stateModel.create({
|
|
564
561
|
...initialSnapshot,
|
|
565
|
-
type:
|
|
566
|
-
configuration,
|
|
562
|
+
type: conf.type,
|
|
563
|
+
configuration: conf,
|
|
567
564
|
displays: [
|
|
568
565
|
{
|
|
569
566
|
type: displayConf.type,
|
|
@@ -575,38 +572,26 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
575
572
|
self.tracks.push(track)
|
|
576
573
|
return track
|
|
577
574
|
}
|
|
578
|
-
return
|
|
575
|
+
return t[0]
|
|
579
576
|
},
|
|
580
577
|
|
|
581
578
|
hideTrack(trackId: string) {
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
const
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
trackId,
|
|
588
|
-
)
|
|
589
|
-
// if we have any tracks with that configuration, turn them off
|
|
590
|
-
const shownTracks = self.tracks.filter(
|
|
591
|
-
t => t.configuration === configuration,
|
|
592
|
-
)
|
|
593
|
-
transaction(() => shownTracks.forEach(t => self.tracks.remove(t)))
|
|
594
|
-
return shownTracks.length
|
|
579
|
+
const schema = pluginManager.pluggableConfigSchemaType('track')
|
|
580
|
+
const conf = resolveIdentifier(schema, getRoot(self), trackId)
|
|
581
|
+
const t = self.tracks.filter(t => t.configuration === conf)
|
|
582
|
+
transaction(() => t.forEach(t => self.tracks.remove(t)))
|
|
583
|
+
return t.length
|
|
595
584
|
},
|
|
596
585
|
}))
|
|
597
586
|
.actions(self => ({
|
|
598
|
-
moveTrack(
|
|
599
|
-
const oldIndex = self.tracks.findIndex(
|
|
600
|
-
track => track.id === movingTrackId,
|
|
601
|
-
)
|
|
587
|
+
moveTrack(movingId: string, targetId: string) {
|
|
588
|
+
const oldIndex = self.tracks.findIndex(track => track.id === movingId)
|
|
602
589
|
if (oldIndex === -1) {
|
|
603
|
-
throw new Error(`Track ID ${
|
|
590
|
+
throw new Error(`Track ID ${movingId} not found`)
|
|
604
591
|
}
|
|
605
|
-
const newIndex = self.tracks.findIndex(
|
|
606
|
-
track => track.id === targetTrackId,
|
|
607
|
-
)
|
|
592
|
+
const newIndex = self.tracks.findIndex(track => track.id === targetId)
|
|
608
593
|
if (newIndex === -1) {
|
|
609
|
-
throw new Error(`Track ID ${
|
|
594
|
+
throw new Error(`Track ID ${targetId} not found`)
|
|
610
595
|
}
|
|
611
596
|
const track = getSnapshot(self.tracks[oldIndex])
|
|
612
597
|
self.tracks.splice(oldIndex, 1)
|
|
@@ -953,21 +938,21 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
953
938
|
leftOffset: BpOffset | undefined,
|
|
954
939
|
rightOffset: BpOffset | undefined,
|
|
955
940
|
) {
|
|
941
|
+
const snap = getSnapshot(self)
|
|
956
942
|
const simView = Base1DView.create({
|
|
957
|
-
|
|
943
|
+
// xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit
|
|
944
|
+
...(snap as Omit<typeof self, symbol>),
|
|
958
945
|
interRegionPaddingWidth: self.interRegionPaddingWidth,
|
|
959
946
|
})
|
|
960
947
|
|
|
961
948
|
simView.setVolatileWidth(self.width)
|
|
962
949
|
simView.zoomToDisplayedRegions(leftOffset, rightOffset)
|
|
963
950
|
|
|
964
|
-
return simView.dynamicBlocks.contentBlocks.map(region => {
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
}
|
|
970
|
-
})
|
|
951
|
+
return simView.dynamicBlocks.contentBlocks.map(region => ({
|
|
952
|
+
...region,
|
|
953
|
+
start: Math.floor(region.start),
|
|
954
|
+
end: Math.ceil(region.end),
|
|
955
|
+
}))
|
|
971
956
|
},
|
|
972
957
|
|
|
973
958
|
// schedule something to be run after the next time displayedRegions is set
|
package/src/index.ts
CHANGED
|
@@ -11,7 +11,7 @@ import ViewType from '@jbrowse/core/pluggableElementTypes/ViewType'
|
|
|
11
11
|
import Plugin from '@jbrowse/core/Plugin'
|
|
12
12
|
import PluginManager from '@jbrowse/core/PluginManager'
|
|
13
13
|
import { AbstractSessionModel, isAbstractMenuManager } from '@jbrowse/core/util'
|
|
14
|
-
import LineStyleIcon from '@
|
|
14
|
+
import LineStyleIcon from '@mui/icons-material/LineStyle'
|
|
15
15
|
import {
|
|
16
16
|
BaseLinearDisplay,
|
|
17
17
|
BaseLinearDisplayComponent,
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _mobxStateTree = require("mobx-state-tree");
|
|
4
|
-
|
|
5
|
-
var _configuration = require("@jbrowse/core/configuration");
|
|
6
|
-
|
|
7
|
-
var _ = require(".");
|
|
8
|
-
|
|
9
|
-
test('config schema renderer type', function () {
|
|
10
|
-
var stubPluginManager = {
|
|
11
|
-
pluggableConfigSchemaType: function pluggableConfigSchemaType(type) {
|
|
12
|
-
var one = (0, _configuration.ConfigurationSchema)("".concat(type, "_TypeOne"), {}, {
|
|
13
|
-
explicitlyTyped: true
|
|
14
|
-
});
|
|
15
|
-
var two = (0, _configuration.ConfigurationSchema)("".concat(type, "_TypeTwo"), {}, {
|
|
16
|
-
explicitlyTyped: true
|
|
17
|
-
});
|
|
18
|
-
var three = (0, _configuration.ConfigurationSchema)("".concat(type, "_TypeThree"), {}, {
|
|
19
|
-
explicitlyTyped: true
|
|
20
|
-
});
|
|
21
|
-
return _mobxStateTree.types.union(one, two, three);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
var configSchema = (0, _.configSchemaFactory)(stubPluginManager);
|
|
25
|
-
var instance = configSchema.create({
|
|
26
|
-
type: 'LinearBareDisplay',
|
|
27
|
-
displayId: 'displayId0',
|
|
28
|
-
renderer: {
|
|
29
|
-
type: 'renderer_TypeTwo'
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
expect(instance.renderer.type).toBe('renderer_TypeTwo');
|
|
33
|
-
});
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
6
|
-
|
|
7
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
|
-
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
|
|
11
|
-
var _react2 = require("@testing-library/react");
|
|
12
|
-
|
|
13
|
-
require("@testing-library/jest-dom/extend-expect");
|
|
14
|
-
|
|
15
|
-
var _rootModel = require("@jbrowse/web/src/rootModel");
|
|
16
|
-
|
|
17
|
-
require("requestidlecallback-polyfill");
|
|
18
|
-
|
|
19
|
-
var _LinearGenomeView = _interopRequireDefault(require("./LinearGenomeView"));
|
|
20
|
-
|
|
21
|
-
jest.mock('@jbrowse/web/src/makeWorkerInstance', function () {
|
|
22
|
-
return function () {};
|
|
23
|
-
});
|
|
24
|
-
var assemblyConf = {
|
|
25
|
-
name: 'volMyt1',
|
|
26
|
-
sequence: {
|
|
27
|
-
trackId: 'sequenceConfigId',
|
|
28
|
-
type: 'ReferenceSequenceTrack',
|
|
29
|
-
adapter: {
|
|
30
|
-
type: 'FromConfigSequenceAdapter',
|
|
31
|
-
features: [{
|
|
32
|
-
refName: 'ctgA',
|
|
33
|
-
uniqueId: 'firstId',
|
|
34
|
-
start: 0,
|
|
35
|
-
end: 10,
|
|
36
|
-
seq: 'cattgttgcg'
|
|
37
|
-
}]
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
describe('<LinearGenomeView />', function () {
|
|
42
|
-
it('renders setup wizard', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
43
|
-
var session, model, _render, findByText;
|
|
44
|
-
|
|
45
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
46
|
-
while (1) {
|
|
47
|
-
switch (_context.prev = _context.next) {
|
|
48
|
-
case 0:
|
|
49
|
-
session = (0, _rootModel.createTestSession)();
|
|
50
|
-
session.addAssemblyConf(assemblyConf);
|
|
51
|
-
session.addView('LinearGenomeView', {
|
|
52
|
-
id: 'lgv'
|
|
53
|
-
});
|
|
54
|
-
model = session.views[0];
|
|
55
|
-
model.setWidth(800);
|
|
56
|
-
_render = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_LinearGenomeView.default, {
|
|
57
|
-
model: model
|
|
58
|
-
})), findByText = _render.findByText;
|
|
59
|
-
expect(model.displayedRegions.length).toEqual(0);
|
|
60
|
-
_context.t0 = _react2.fireEvent;
|
|
61
|
-
_context.next = 10;
|
|
62
|
-
return findByText('Open');
|
|
63
|
-
|
|
64
|
-
case 10:
|
|
65
|
-
_context.t1 = _context.sent;
|
|
66
|
-
|
|
67
|
-
_context.t0.click.call(_context.t0, _context.t1);
|
|
68
|
-
|
|
69
|
-
_context.next = 14;
|
|
70
|
-
return (0, _react2.waitFor)(function () {
|
|
71
|
-
expect(model.displayedRegions.length).toEqual(1);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
case 14:
|
|
75
|
-
case "end":
|
|
76
|
-
return _context.stop();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}, _callee);
|
|
80
|
-
})));
|
|
81
|
-
it('renders one track, one region', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
82
|
-
var session, model, _render2, container, findByText;
|
|
83
|
-
|
|
84
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
85
|
-
while (1) {
|
|
86
|
-
switch (_context2.prev = _context2.next) {
|
|
87
|
-
case 0:
|
|
88
|
-
session = (0, _rootModel.createTestSession)();
|
|
89
|
-
session.addAssemblyConf(assemblyConf);
|
|
90
|
-
session.addTrackConf({
|
|
91
|
-
trackId: 'testConfig',
|
|
92
|
-
assemblyNames: ['volMyt1'],
|
|
93
|
-
name: 'Foo Track',
|
|
94
|
-
type: 'BasicTrack',
|
|
95
|
-
adapter: {
|
|
96
|
-
type: 'FromConfigAdapter',
|
|
97
|
-
features: []
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
session.addView('LinearGenomeView', {
|
|
101
|
-
type: 'LinearGenomeView',
|
|
102
|
-
id: 'lgv',
|
|
103
|
-
offsetPx: 0,
|
|
104
|
-
bpPerPx: 1,
|
|
105
|
-
tracks: [{
|
|
106
|
-
id: 'foo',
|
|
107
|
-
type: 'BasicTrack',
|
|
108
|
-
height: 20,
|
|
109
|
-
configuration: 'testConfig',
|
|
110
|
-
displays: [{
|
|
111
|
-
type: 'LinearBareDisplay',
|
|
112
|
-
configuration: 'testConfig-LinearBareDisplay'
|
|
113
|
-
}]
|
|
114
|
-
}],
|
|
115
|
-
displayedRegions: [{
|
|
116
|
-
assemblyName: 'volMyt1',
|
|
117
|
-
refName: 'ctgA',
|
|
118
|
-
start: 0,
|
|
119
|
-
end: 100
|
|
120
|
-
}]
|
|
121
|
-
});
|
|
122
|
-
model = session.views[0];
|
|
123
|
-
model.setWidth(800);
|
|
124
|
-
_render2 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_LinearGenomeView.default, {
|
|
125
|
-
model: model
|
|
126
|
-
})), container = _render2.container, findByText = _render2.findByText;
|
|
127
|
-
_context2.next = 9;
|
|
128
|
-
return findByText('Foo Track');
|
|
129
|
-
|
|
130
|
-
case 9:
|
|
131
|
-
_context2.next = 11;
|
|
132
|
-
return findByText('100bp');
|
|
133
|
-
|
|
134
|
-
case 11:
|
|
135
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
136
|
-
|
|
137
|
-
case 12:
|
|
138
|
-
case "end":
|
|
139
|
-
return _context2.stop();
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}, _callee2);
|
|
143
|
-
})));
|
|
144
|
-
it('renders two tracks, two regions', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
145
|
-
var session, model, _render3, container, findByText, findAllByTestId;
|
|
146
|
-
|
|
147
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
148
|
-
while (1) {
|
|
149
|
-
switch (_context3.prev = _context3.next) {
|
|
150
|
-
case 0:
|
|
151
|
-
session = (0, _rootModel.createTestSession)();
|
|
152
|
-
session.addAssemblyConf(assemblyConf);
|
|
153
|
-
session.addTrackConf({
|
|
154
|
-
trackId: 'testConfig',
|
|
155
|
-
name: 'Foo Track',
|
|
156
|
-
assemblyNames: ['volMyt1'],
|
|
157
|
-
type: 'BasicTrack',
|
|
158
|
-
adapter: {
|
|
159
|
-
type: 'FromConfigAdapter',
|
|
160
|
-
features: []
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
session.addTrackConf({
|
|
164
|
-
trackId: 'testConfig2',
|
|
165
|
-
name: 'Bar Track',
|
|
166
|
-
assemblyNames: ['volMyt1'],
|
|
167
|
-
type: 'BasicTrack',
|
|
168
|
-
adapter: {
|
|
169
|
-
type: 'FromConfigAdapter',
|
|
170
|
-
features: []
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
session.addView('LinearGenomeView', {
|
|
174
|
-
id: 'lgv',
|
|
175
|
-
offsetPx: 0,
|
|
176
|
-
bpPerPx: 1,
|
|
177
|
-
displayedRegions: [{
|
|
178
|
-
assemblyName: 'volMyt1',
|
|
179
|
-
refName: 'ctgA',
|
|
180
|
-
start: 0,
|
|
181
|
-
end: 100
|
|
182
|
-
}, {
|
|
183
|
-
assemblyName: 'volMyt1',
|
|
184
|
-
refName: 'ctgB',
|
|
185
|
-
start: 1000,
|
|
186
|
-
end: 2000
|
|
187
|
-
}],
|
|
188
|
-
tracks: [{
|
|
189
|
-
id: 'foo',
|
|
190
|
-
type: 'BasicTrack',
|
|
191
|
-
height: 20,
|
|
192
|
-
configuration: 'testConfig',
|
|
193
|
-
displays: [{
|
|
194
|
-
type: 'LinearBareDisplay',
|
|
195
|
-
configuration: 'testConfig-LinearBareDisplay'
|
|
196
|
-
}]
|
|
197
|
-
}, {
|
|
198
|
-
id: 'bar',
|
|
199
|
-
type: 'BasicTrack',
|
|
200
|
-
height: 20,
|
|
201
|
-
configuration: 'testConfig2',
|
|
202
|
-
displays: [{
|
|
203
|
-
type: 'LinearBareDisplay',
|
|
204
|
-
configuration: 'testConfig2-LinearBareDisplay'
|
|
205
|
-
}]
|
|
206
|
-
}]
|
|
207
|
-
});
|
|
208
|
-
model = session.views[0];
|
|
209
|
-
model.setWidth(800);
|
|
210
|
-
_render3 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_LinearGenomeView.default, {
|
|
211
|
-
model: model
|
|
212
|
-
})), container = _render3.container, findByText = _render3.findByText, findAllByTestId = _render3.findAllByTestId;
|
|
213
|
-
_context3.next = 10;
|
|
214
|
-
return findByText('Foo Track');
|
|
215
|
-
|
|
216
|
-
case 10:
|
|
217
|
-
_context3.next = 12;
|
|
218
|
-
return findByText('798bp');
|
|
219
|
-
|
|
220
|
-
case 12:
|
|
221
|
-
_context3.next = 14;
|
|
222
|
-
return findAllByTestId('svgfeatures');
|
|
223
|
-
|
|
224
|
-
case 14:
|
|
225
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
226
|
-
|
|
227
|
-
case 15:
|
|
228
|
-
case "end":
|
|
229
|
-
return _context3.stop();
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}, _callee3);
|
|
233
|
-
})));
|
|
234
|
-
});
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
|
|
7
|
-
var _react2 = require("@testing-library/react");
|
|
8
|
-
|
|
9
|
-
var _rootModel = require("@jbrowse/web/src/rootModel");
|
|
10
|
-
|
|
11
|
-
var _ScaleBar = _interopRequireDefault(require("./ScaleBar"));
|
|
12
|
-
|
|
13
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
14
|
-
jest.mock('@jbrowse/web/src/makeWorkerInstance', function () {
|
|
15
|
-
return function () {};
|
|
16
|
-
});
|
|
17
|
-
describe('ScaleBar genome view component', function () {
|
|
18
|
-
it('renders two regions', function () {
|
|
19
|
-
var session = (0, _rootModel.createTestSession)({
|
|
20
|
-
views: [{
|
|
21
|
-
type: 'LinearGenomeView',
|
|
22
|
-
offsetPx: 0,
|
|
23
|
-
bpPerPx: 1,
|
|
24
|
-
displayedRegions: [{
|
|
25
|
-
assemblyName: 'volvox',
|
|
26
|
-
refName: 'ctgA',
|
|
27
|
-
start: 0,
|
|
28
|
-
end: 100
|
|
29
|
-
}, {
|
|
30
|
-
assemblyName: 'volvox',
|
|
31
|
-
refName: 'ctgB',
|
|
32
|
-
start: 100,
|
|
33
|
-
end: 200
|
|
34
|
-
}],
|
|
35
|
-
tracks: [],
|
|
36
|
-
configuration: {}
|
|
37
|
-
}]
|
|
38
|
-
});
|
|
39
|
-
session.addAssemblyConf({
|
|
40
|
-
name: 'volMyt1',
|
|
41
|
-
sequence: {
|
|
42
|
-
trackId: 'ref0',
|
|
43
|
-
type: 'ReferenceSequenceTrack',
|
|
44
|
-
adapter: {
|
|
45
|
-
type: 'FromConfigSequenceAdapter',
|
|
46
|
-
features: [{
|
|
47
|
-
refName: 'ctgA',
|
|
48
|
-
uniqueId: 'firstId',
|
|
49
|
-
start: 0,
|
|
50
|
-
end: 10,
|
|
51
|
-
seq: 'cattgttgcg'
|
|
52
|
-
}]
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
var model = session.views[0];
|
|
57
|
-
|
|
58
|
-
var _render = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_ScaleBar.default, {
|
|
59
|
-
model: model
|
|
60
|
-
})),
|
|
61
|
-
getByTestId = _render.getByTestId;
|
|
62
|
-
|
|
63
|
-
var ret1 = getByTestId('refLabel-ctgA');
|
|
64
|
-
var ret2 = getByTestId('refLabel-ctgB');
|
|
65
|
-
expect(ret1.style.left).toBe('-1px');
|
|
66
|
-
expect(ret2.style.left).toBe('101px');
|
|
67
|
-
});
|
|
68
|
-
it('renders two regions when scrolled to the left, the label is ctgA to the actual blocks', function () {
|
|
69
|
-
var session = (0, _rootModel.createTestSession)({
|
|
70
|
-
views: [{
|
|
71
|
-
type: 'LinearGenomeView',
|
|
72
|
-
offsetPx: -100,
|
|
73
|
-
bpPerPx: 1,
|
|
74
|
-
displayedRegions: [{
|
|
75
|
-
assemblyName: 'volvox',
|
|
76
|
-
refName: 'ctgA',
|
|
77
|
-
start: 0,
|
|
78
|
-
end: 100
|
|
79
|
-
}, {
|
|
80
|
-
assemblyName: 'volvox',
|
|
81
|
-
refName: 'ctgB',
|
|
82
|
-
start: 0,
|
|
83
|
-
end: 100
|
|
84
|
-
}],
|
|
85
|
-
tracks: [],
|
|
86
|
-
configuration: {}
|
|
87
|
-
}]
|
|
88
|
-
});
|
|
89
|
-
session.addAssemblyConf({
|
|
90
|
-
name: 'volMyt1',
|
|
91
|
-
sequence: {
|
|
92
|
-
trackId: 'ref0',
|
|
93
|
-
type: 'ReferenceSequenceTrack',
|
|
94
|
-
adapter: {
|
|
95
|
-
type: 'FromConfigSequenceAdapter',
|
|
96
|
-
features: [{
|
|
97
|
-
refName: 'ctgA',
|
|
98
|
-
uniqueId: 'firstId',
|
|
99
|
-
start: 0,
|
|
100
|
-
end: 10,
|
|
101
|
-
seq: 'cattgttgcg'
|
|
102
|
-
}]
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
var model = session.views[0];
|
|
107
|
-
|
|
108
|
-
var _render2 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_ScaleBar.default, {
|
|
109
|
-
model: model
|
|
110
|
-
})),
|
|
111
|
-
getByTestId = _render2.getByTestId;
|
|
112
|
-
|
|
113
|
-
var ret1 = getByTestId('refLabel-ctgA');
|
|
114
|
-
var ret2 = getByTestId('refLabel-ctgB');
|
|
115
|
-
expect(ret1.style.left).toBe('99px');
|
|
116
|
-
expect(ret2.style.left).toBe('201px');
|
|
117
|
-
});
|
|
118
|
-
it('renders two regions when scrolled to the left, the label is ctgA to the actual blocks', function () {
|
|
119
|
-
var session = (0, _rootModel.createTestSession)({
|
|
120
|
-
views: [{
|
|
121
|
-
type: 'LinearGenomeView',
|
|
122
|
-
offsetPx: -100,
|
|
123
|
-
bpPerPx: 1,
|
|
124
|
-
displayedRegions: [{
|
|
125
|
-
assemblyName: 'volvox',
|
|
126
|
-
refName: 'ctgA',
|
|
127
|
-
start: 0,
|
|
128
|
-
end: 1000
|
|
129
|
-
}, {
|
|
130
|
-
assemblyName: 'volvox',
|
|
131
|
-
refName: 'ctgB',
|
|
132
|
-
start: 0,
|
|
133
|
-
end: 1
|
|
134
|
-
}, {
|
|
135
|
-
assemblyName: 'volvox',
|
|
136
|
-
refName: 'ctgC',
|
|
137
|
-
start: 0,
|
|
138
|
-
end: 1
|
|
139
|
-
}, {
|
|
140
|
-
assemblyName: 'volvox',
|
|
141
|
-
refName: 'ctgD',
|
|
142
|
-
start: 0,
|
|
143
|
-
end: 1
|
|
144
|
-
}],
|
|
145
|
-
tracks: [],
|
|
146
|
-
configuration: {}
|
|
147
|
-
}]
|
|
148
|
-
});
|
|
149
|
-
session.addAssemblyConf({
|
|
150
|
-
name: 'volMyt1',
|
|
151
|
-
sequence: {
|
|
152
|
-
trackId: 'ref0',
|
|
153
|
-
type: 'ReferenceSequenceTrack',
|
|
154
|
-
adapter: {
|
|
155
|
-
type: 'FromConfigSequenceAdapter',
|
|
156
|
-
features: [{
|
|
157
|
-
refName: 'ctgA',
|
|
158
|
-
uniqueId: 'firstId',
|
|
159
|
-
start: 0,
|
|
160
|
-
end: 10,
|
|
161
|
-
seq: 'cattgttgcg'
|
|
162
|
-
}]
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
var model = session.views[0];
|
|
167
|
-
|
|
168
|
-
var _render3 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_ScaleBar.default, {
|
|
169
|
-
model: model
|
|
170
|
-
})),
|
|
171
|
-
queryByTestId = _render3.queryByTestId;
|
|
172
|
-
|
|
173
|
-
var ret2 = queryByTestId('refLabel-ctgB');
|
|
174
|
-
var ret3 = queryByTestId('refLabel-ctgC');
|
|
175
|
-
var ret4 = queryByTestId('refLabel-ctgD');
|
|
176
|
-
expect(ret2).toBe(null);
|
|
177
|
-
expect(ret3).toBe(null);
|
|
178
|
-
expect(ret4).toBe(null);
|
|
179
|
-
});
|
|
180
|
-
});
|