@jbrowse/plugin-linear-genome-view 2.1.4 → 2.1.5

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 (92) hide show
  1. package/dist/BaseLinearDisplay/components/BlockMsg.d.ts +9 -0
  2. package/dist/BaseLinearDisplay/components/BlockMsg.js +22 -0
  3. package/dist/BaseLinearDisplay/components/BlockMsg.js.map +1 -0
  4. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +5 -42
  5. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
  6. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +2 -5
  7. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +3 -20
  8. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
  9. package/dist/BaseLinearDisplay/models/TooLargeMessage.d.ts +11 -0
  10. package/dist/BaseLinearDisplay/models/TooLargeMessage.js +22 -0
  11. package/dist/BaseLinearDisplay/models/TooLargeMessage.js.map +1 -0
  12. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +1 -1
  13. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
  14. package/dist/LinearBareDisplay/model.d.ts +1 -1
  15. package/dist/LinearBasicDisplay/model.d.ts +1 -1
  16. package/dist/LinearGenomeView/components/ExportSvgDialog.d.ts +4 -2
  17. package/dist/LinearGenomeView/components/Header.d.ts +1 -1
  18. package/dist/LinearGenomeView/components/Header.js +2 -2
  19. package/dist/LinearGenomeView/components/Header.js.map +1 -1
  20. package/dist/LinearGenomeView/components/LinearGenomeView.js +9 -10
  21. package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
  22. package/dist/LinearGenomeView/components/MiniControls.d.ts +1 -1
  23. package/dist/LinearGenomeView/components/MiniControls.js +13 -12
  24. package/dist/LinearGenomeView/components/MiniControls.js.map +1 -1
  25. package/dist/LinearGenomeView/components/SequenceSearchDialog.d.ts +4 -2
  26. package/dist/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -1
  27. package/dist/LinearGenomeView/components/TrackLabel.js +4 -5
  28. package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -1
  29. package/dist/LinearGenomeView/components/TracksContainer.d.ts +2 -3
  30. package/dist/LinearGenomeView/components/TracksContainer.js +1 -0
  31. package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -1
  32. package/dist/LinearGenomeView/index.d.ts +8 -3
  33. package/dist/LinearGenomeView/index.js +47 -28
  34. package/dist/LinearGenomeView/index.js.map +1 -1
  35. package/dist/index.d.ts +1246 -3
  36. package/dist/index.js +3 -0
  37. package/dist/index.js.map +1 -1
  38. package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +9 -0
  39. package/esm/BaseLinearDisplay/components/BlockMsg.js +16 -0
  40. package/esm/BaseLinearDisplay/components/BlockMsg.js.map +1 -0
  41. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +6 -43
  42. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
  43. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +2 -5
  44. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +3 -20
  45. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
  46. package/esm/BaseLinearDisplay/models/TooLargeMessage.d.ts +11 -0
  47. package/esm/BaseLinearDisplay/models/TooLargeMessage.js +17 -0
  48. package/esm/BaseLinearDisplay/models/TooLargeMessage.js.map +1 -0
  49. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +1 -1
  50. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
  51. package/esm/LinearBareDisplay/model.d.ts +1 -1
  52. package/esm/LinearBasicDisplay/model.d.ts +1 -1
  53. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +4 -2
  54. package/esm/LinearGenomeView/components/Header.d.ts +1 -1
  55. package/esm/LinearGenomeView/components/Header.js +2 -2
  56. package/esm/LinearGenomeView/components/Header.js.map +1 -1
  57. package/esm/LinearGenomeView/components/LinearGenomeView.js +9 -10
  58. package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
  59. package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
  60. package/esm/LinearGenomeView/components/MiniControls.js +13 -12
  61. package/esm/LinearGenomeView/components/MiniControls.js.map +1 -1
  62. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +4 -2
  63. package/esm/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -1
  64. package/esm/LinearGenomeView/components/TrackLabel.js +4 -5
  65. package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -1
  66. package/esm/LinearGenomeView/components/TracksContainer.d.ts +2 -3
  67. package/esm/LinearGenomeView/components/TracksContainer.js +1 -0
  68. package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -1
  69. package/esm/LinearGenomeView/index.d.ts +8 -3
  70. package/esm/LinearGenomeView/index.js +44 -27
  71. package/esm/LinearGenomeView/index.js.map +1 -1
  72. package/esm/index.d.ts +1246 -3
  73. package/esm/index.js +4 -1
  74. package/esm/index.js.map +1 -1
  75. package/package.json +3 -2
  76. package/src/BaseLinearDisplay/components/BlockMsg.tsx +42 -0
  77. package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +16 -91
  78. package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +3 -31
  79. package/src/BaseLinearDisplay/models/TooLargeMessage.tsx +34 -0
  80. package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +2 -2
  81. package/src/LinearGenomeView/components/ExportSvgDialog.tsx +2 -2
  82. package/src/LinearGenomeView/components/Header.tsx +8 -6
  83. package/src/LinearGenomeView/components/{LinearGenomeView.test.js → LinearGenomeView.test.tsx} +16 -7
  84. package/src/LinearGenomeView/components/LinearGenomeView.tsx +14 -17
  85. package/src/LinearGenomeView/components/MiniControls.tsx +39 -37
  86. package/src/LinearGenomeView/components/SequenceSearchDialog.tsx +1 -4
  87. package/src/LinearGenomeView/components/TrackLabel.tsx +6 -9
  88. package/src/LinearGenomeView/components/TracksContainer.tsx +3 -3
  89. package/src/LinearGenomeView/components/__snapshots__/{LinearGenomeView.test.js.snap → LinearGenomeView.test.tsx.snap} +32 -102
  90. package/src/LinearGenomeView/index.test.ts +2 -2
  91. package/src/LinearGenomeView/index.tsx +53 -28
  92. package/src/index.ts +5 -0
@@ -1,10 +1,10 @@
1
1
  import React, { useEffect, useRef, useState } from 'react'
2
2
  import { makeStyles } from 'tss-react/mui'
3
3
  import { observer } from 'mobx-react'
4
- import { Instance } from 'mobx-state-tree'
5
4
  import normalizeWheel from 'normalize-wheel'
6
5
 
7
- import { LinearGenomeViewStateModel, SCALE_BAR_HEIGHT } from '..'
6
+ // locals
7
+ import { LinearGenomeViewModel, SCALE_BAR_HEIGHT } from '..'
8
8
  import RubberBand from './RubberBand'
9
9
  import ScaleBar from './ScaleBar'
10
10
  import Gridlines from './Gridlines'
@@ -21,7 +21,7 @@ const useStyles = makeStyles()({
21
21
  },
22
22
  })
23
23
 
24
- type LGV = Instance<LinearGenomeViewStateModel>
24
+ type LGV = LinearGenomeViewModel
25
25
  type Timer = ReturnType<typeof setTimeout>
26
26
 
27
27
  function TracksContainer({
@@ -90,7 +90,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
90
90
  class="tss-ig8oez-headerBar"
91
91
  >
92
92
  <button
93
- class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textSecondary MuiButton-sizeMedium MuiButton-textSizeMedium tss-19jxj46-toggleButton css-1d3f8j8-MuiButtonBase-root-MuiButton-root"
93
+ class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textSecondary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-root MuiButton-text MuiButton-textSecondary MuiButton-sizeMedium MuiButton-textSizeMedium tss-19jxj46-toggleButton css-1d3f8j8-MuiButtonBase-root-MuiButton-root"
94
94
  tabindex="0"
95
95
  title="Open track selector"
96
96
  type="button"
@@ -117,7 +117,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
117
117
  class="MuiFormGroup-root MuiFormGroup-row tss-4gub8h-headerForm css-qfz70r-MuiFormGroup-root"
118
118
  >
119
119
  <button
120
- class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium tss-7ktir1-panButton css-1rwt2y5-MuiButtonBase-root-MuiButton-root"
120
+ class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium tss-7ktir1-panButton css-1rwt2y5-MuiButtonBase-root-MuiButton-root"
121
121
  tabindex="0"
122
122
  type="button"
123
123
  >
@@ -137,7 +137,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
137
137
  />
138
138
  </button>
139
139
  <button
140
- class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium tss-7ktir1-panButton css-1rwt2y5-MuiButtonBase-root-MuiButton-root"
140
+ class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium tss-7ktir1-panButton css-1rwt2y5-MuiButtonBase-root-MuiButton-root"
141
141
  tabindex="0"
142
142
  type="button"
143
143
  >
@@ -224,7 +224,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
224
224
  class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline"
225
225
  >
226
226
  <legend
227
- class="css-hdw1oc"
227
+ class="css-ihdtdm"
228
228
  >
229
229
  <span
230
230
  class="notranslate"
@@ -335,11 +335,11 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
335
335
  >
336
336
  <div
337
337
  class="tss-17gfnt3-verticalGuidesContainer"
338
- style="left: -1024px; width: 2148px;"
338
+ style="left: -800px; width: 1700px;"
339
339
  >
340
340
  <div
341
341
  class="tss-a9ifge-boundaryPaddingBlock"
342
- style="width: 1024px;"
342
+ style="width: 800px;"
343
343
  />
344
344
  <div
345
345
  class="tss-1dmfa10-contentBlock"
@@ -376,7 +376,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
376
376
  </div>
377
377
  <div
378
378
  class="tss-a9ifge-boundaryPaddingBlock"
379
- style="width: 1024px;"
379
+ style="width: 800px;"
380
380
  />
381
381
  </div>
382
382
  </div>
@@ -395,11 +395,11 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
395
395
  >
396
396
  <div
397
397
  class="tss-1u2dss8-scaleBar"
398
- style="left: -1025px; width: 2148px; height: 17px; box-sizing: border-box;"
398
+ style="left: -801px; width: 1700px; height: 17px; box-sizing: border-box;"
399
399
  >
400
400
  <div
401
401
  class="tss-a9ifge-boundaryPaddingBlock"
402
- style="background: none; width: 1024px;"
402
+ style="background: none; width: 800px;"
403
403
  />
404
404
  <div
405
405
  class="tss-1dmfa10-contentBlock"
@@ -412,7 +412,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
412
412
  </div>
413
413
  <div
414
414
  class="tss-a9ifge-boundaryPaddingBlock"
415
- style="background: none; width: 1024px;"
415
+ style="background: none; width: 800px;"
416
416
  />
417
417
  </div>
418
418
  </div>
@@ -513,23 +513,19 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
513
513
  <div
514
514
  class="tss-d6gpow-linearBlocks"
515
515
  data-testid="Blockset"
516
- style="left: -1024px;"
516
+ style="left: -800px;"
517
517
  >
518
518
  <div
519
519
  class="tss-a9ifge-boundaryPaddingBlock"
520
- style="background: none; width: 1024px;"
520
+ style="background: none; width: 800px;"
521
521
  />
522
522
  <div
523
523
  class="tss-1dmfa10-contentBlock"
524
524
  style="width: 100px;"
525
- >
526
- <div
527
- style="display: flex;"
528
- />
529
- </div>
525
+ />
530
526
  <div
531
527
  class="tss-a9ifge-boundaryPaddingBlock"
532
- style="background: none; width: 1024px;"
528
+ style="background: none; width: 800px;"
533
529
  />
534
530
  </div>
535
531
  </div>
@@ -655,7 +651,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
655
651
  class="tss-ig8oez-headerBar"
656
652
  >
657
653
  <button
658
- class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textSecondary MuiButton-sizeMedium MuiButton-textSizeMedium tss-19jxj46-toggleButton css-1d3f8j8-MuiButtonBase-root-MuiButton-root"
654
+ class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textSecondary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-root MuiButton-text MuiButton-textSecondary MuiButton-sizeMedium MuiButton-textSizeMedium tss-19jxj46-toggleButton css-1d3f8j8-MuiButtonBase-root-MuiButton-root"
659
655
  tabindex="0"
660
656
  title="Open track selector"
661
657
  type="button"
@@ -682,7 +678,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
682
678
  class="MuiFormGroup-root MuiFormGroup-row tss-4gub8h-headerForm css-qfz70r-MuiFormGroup-root"
683
679
  >
684
680
  <button
685
- class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium tss-7ktir1-panButton css-1rwt2y5-MuiButtonBase-root-MuiButton-root"
681
+ class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium tss-7ktir1-panButton css-1rwt2y5-MuiButtonBase-root-MuiButton-root"
686
682
  tabindex="0"
687
683
  type="button"
688
684
  >
@@ -702,7 +698,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
702
698
  />
703
699
  </button>
704
700
  <button
705
- class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium tss-7ktir1-panButton css-1rwt2y5-MuiButtonBase-root-MuiButton-root"
701
+ class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium tss-7ktir1-panButton css-1rwt2y5-MuiButtonBase-root-MuiButton-root"
706
702
  tabindex="0"
707
703
  type="button"
708
704
  >
@@ -789,7 +785,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
789
785
  class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline"
790
786
  >
791
787
  <legend
792
- class="css-hdw1oc"
788
+ class="css-ihdtdm"
793
789
  >
794
790
  <span
795
791
  class="notranslate"
@@ -902,11 +898,11 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
902
898
  >
903
899
  <div
904
900
  class="tss-17gfnt3-verticalGuidesContainer"
905
- style="left: -1024px; width: 3150px;"
901
+ style="left: -800px; width: 1702px;"
906
902
  >
907
903
  <div
908
904
  class="tss-a9ifge-boundaryPaddingBlock"
909
- style="width: 1024px;"
905
+ style="width: 800px;"
910
906
  />
911
907
  <div
912
908
  class="tss-1dmfa10-contentBlock"
@@ -947,7 +943,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
947
943
  />
948
944
  <div
949
945
  class="tss-1dmfa10-contentBlock"
950
- style="width: 1000px;"
946
+ style="width: 800px;"
951
947
  >
952
948
  <div
953
949
  class="tss-1nnah7t-tick-majorTick"
@@ -1117,51 +1113,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
1117
1113
  class="tss-i794sq-tick-minorTick"
1118
1114
  style="left: 819px;"
1119
1115
  />
1120
- <div
1121
- class="tss-i794sq-tick-minorTick"
1122
- style="left: 839px;"
1123
- />
1124
- <div
1125
- class="tss-i794sq-tick-minorTick"
1126
- style="left: 859px;"
1127
- />
1128
- <div
1129
- class="tss-i794sq-tick-minorTick"
1130
- style="left: 879px;"
1131
- />
1132
- <div
1133
- class="tss-i794sq-tick-minorTick"
1134
- style="left: 899px;"
1135
- />
1136
- <div
1137
- class="tss-i794sq-tick-minorTick"
1138
- style="left: 919px;"
1139
- />
1140
- <div
1141
- class="tss-i794sq-tick-minorTick"
1142
- style="left: 939px;"
1143
- />
1144
- <div
1145
- class="tss-i794sq-tick-minorTick"
1146
- style="left: 959px;"
1147
- />
1148
- <div
1149
- class="tss-i794sq-tick-minorTick"
1150
- style="left: 979px;"
1151
- />
1152
- <div
1153
- class="tss-1nnah7t-tick-majorTick"
1154
- style="left: 999px;"
1155
- />
1156
- <div
1157
- class="tss-i794sq-tick-minorTick"
1158
- style="left: 1019px;"
1159
- />
1160
1116
  </div>
1161
- <div
1162
- class="tss-a9ifge-boundaryPaddingBlock"
1163
- style="width: 1024px;"
1164
- />
1165
1117
  </div>
1166
1118
  </div>
1167
1119
  <div
@@ -1179,11 +1131,11 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
1179
1131
  >
1180
1132
  <div
1181
1133
  class="tss-1u2dss8-scaleBar"
1182
- style="left: -1025px; width: 3150px; height: 17px; box-sizing: border-box;"
1134
+ style="left: -801px; width: 1702px; height: 17px; box-sizing: border-box;"
1183
1135
  >
1184
1136
  <div
1185
1137
  class="tss-a9ifge-boundaryPaddingBlock"
1186
- style="background: none; width: 1024px;"
1138
+ style="background: none; width: 800px;"
1187
1139
  />
1188
1140
  <div
1189
1141
  class="tss-1dmfa10-contentBlock"
@@ -1200,7 +1152,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
1200
1152
  />
1201
1153
  <div
1202
1154
  class="tss-1dmfa10-contentBlock"
1203
- style="width: 1000px;"
1155
+ style="width: 800px;"
1204
1156
  >
1205
1157
  <div
1206
1158
  class="tss-1f3h2yl-tick"
@@ -1252,21 +1204,7 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
1252
1204
  1,800
1253
1205
  </p>
1254
1206
  </div>
1255
- <div
1256
- class="tss-1f3h2yl-tick"
1257
- style="left: 999px;"
1258
- >
1259
- <p
1260
- class="MuiTypography-root MuiTypography-body1 tss-lm3kvf-majorTickLabel css-ahj2mt-MuiTypography-root"
1261
- >
1262
- 2,000
1263
- </p>
1264
- </div>
1265
1207
  </div>
1266
- <div
1267
- class="tss-a9ifge-boundaryPaddingBlock"
1268
- style="background: none; width: 1024px;"
1269
- />
1270
1208
  </div>
1271
1209
  </div>
1272
1210
  <p
@@ -1373,11 +1311,11 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
1373
1311
  <div
1374
1312
  class="tss-d6gpow-linearBlocks"
1375
1313
  data-testid="Blockset"
1376
- style="left: -1024px;"
1314
+ style="left: -800px;"
1377
1315
  >
1378
1316
  <div
1379
1317
  class="tss-a9ifge-boundaryPaddingBlock"
1380
- style="background: none; width: 1024px;"
1318
+ style="background: none; width: 800px;"
1381
1319
  />
1382
1320
  <div
1383
1321
  class="tss-1dmfa10-contentBlock"
@@ -1395,18 +1333,14 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
1395
1333
  />
1396
1334
  <div
1397
1335
  class="tss-1dmfa10-contentBlock"
1398
- style="width: 1000px;"
1336
+ style="width: 800px;"
1399
1337
  >
1400
1338
  <svg
1401
1339
  data-testid="svgfeatures"
1402
1340
  height="100"
1403
- width="1000"
1341
+ width="800"
1404
1342
  />
1405
1343
  </div>
1406
- <div
1407
- class="tss-a9ifge-boundaryPaddingBlock"
1408
- style="background: none; width: 1024px;"
1409
- />
1410
1344
  </div>
1411
1345
  </div>
1412
1346
  </div>
@@ -1509,11 +1443,11 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
1509
1443
  <div
1510
1444
  class="tss-d6gpow-linearBlocks"
1511
1445
  data-testid="Blockset"
1512
- style="left: -1024px;"
1446
+ style="left: -800px;"
1513
1447
  >
1514
1448
  <div
1515
1449
  class="tss-a9ifge-boundaryPaddingBlock"
1516
- style="background: none; width: 1024px;"
1450
+ style="background: none; width: 800px;"
1517
1451
  />
1518
1452
  <div
1519
1453
  class="tss-1dmfa10-contentBlock"
@@ -1531,18 +1465,14 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
1531
1465
  />
1532
1466
  <div
1533
1467
  class="tss-1dmfa10-contentBlock"
1534
- style="width: 1000px;"
1468
+ style="width: 800px;"
1535
1469
  >
1536
1470
  <svg
1537
1471
  data-testid="svgfeatures"
1538
1472
  height="100"
1539
- width="1000"
1473
+ width="800"
1540
1474
  />
1541
1475
  </div>
1542
- <div
1543
- class="tss-a9ifge-boundaryPaddingBlock"
1544
- style="background: none; width: 1024px;"
1545
- />
1546
1476
  </div>
1547
1477
  </div>
1548
1478
  </div>
@@ -636,8 +636,8 @@ test('can perform pxToBp on human genome things with ellided blocks (zoomed out)
636
636
 
637
637
  // chrX after an ellided block, this tests a specific coord but should just be
638
638
  // probably somewhat around here
639
- expect(model.pxToBp(1228).coord).toBe(118604872)
640
- expect(model.pxToBp(1228).refName).toBe('X')
639
+ expect(model.pxToBp(1228).coord).toBe(1075410)
640
+ expect(model.pxToBp(1228).refName).toBe('Y')
641
641
 
642
642
  // chrY_random at the end
643
643
  expect(model.pxToBp(1500).refName).toBe('Y_KI270740v1_random')
@@ -1,4 +1,4 @@
1
- import { lazy } from 'react'
1
+ import React, { lazy } from 'react'
2
2
  import { getConf, AnyConfigurationModel } from '@jbrowse/core/configuration'
3
3
  import { BaseViewModel } from '@jbrowse/core/pluggableElementTypes/models'
4
4
  import { Region } from '@jbrowse/core/util/types'
@@ -15,6 +15,7 @@ import {
15
15
  measureText,
16
16
  parseLocString,
17
17
  springAnimate,
18
+ isSessionWithAddTracks,
18
19
  } from '@jbrowse/core/util'
19
20
  import BaseResult from '@jbrowse/core/TextSearch/BaseResults'
20
21
  import { BlockSet, BaseBlock } from '@jbrowse/core/util/blockTypes'
@@ -53,6 +54,10 @@ import { renderToSvg } from './components/LinearGenomeViewSvg'
53
54
  import RefNameAutocomplete from './components/RefNameAutocomplete'
54
55
  import SearchBox from './components/SearchBox'
55
56
  import ExportSvgDlg from './components/ExportSvgDialog'
57
+ import MiniControls from './components/MiniControls'
58
+ import Header from './components/Header'
59
+ import ZoomControls from './components/ZoomControls'
60
+ import LinearGenomeView from './components/LinearGenomeView'
56
61
 
57
62
  const SequenceSearchDialog = lazy(
58
63
  () => import('./components/SequenceSearchDialog'),
@@ -192,6 +197,16 @@ export function stateModelFactory(pluginManager: PluginManager) {
192
197
  },
193
198
  }))
194
199
  .views(self => ({
200
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
201
+ MiniControlsComponent(): React.FC<any> {
202
+ return MiniControls
203
+ },
204
+
205
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
206
+ HeaderComponent(): React.FC<any> {
207
+ return Header
208
+ },
209
+
195
210
  get assemblyErrors() {
196
211
  const { assemblyManager } = getSession(self)
197
212
  const { assemblyNames } = self
@@ -636,6 +651,22 @@ export function stateModelFactory(pluginManager: PluginManager) {
636
651
  setScaleFactor(factor: number) {
637
652
  self.scaleFactor = factor
638
653
  },
654
+ // this "clears the view" and makes the view return to the import form
655
+ clearView() {
656
+ this.setDisplayedRegions([])
657
+ self.tracks.clear()
658
+ // it is necessary to run these after setting displayed regions empty
659
+ // or else model.offsetPx gets set to Infinity and breaks
660
+ // mobx-state-tree snapshot
661
+ self.scrollTo(0)
662
+ self.zoomTo(10)
663
+ },
664
+ async exportSvg(opts: ExportSvgOptions = {}) {
665
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
666
+ const html = await renderToSvg(self as any, opts)
667
+ const blob = new Blob([html], { type: 'image/svg+xml' })
668
+ saveAs(blob, opts.filename || 'image.svg')
669
+ },
639
670
  }))
640
671
  .actions(self => {
641
672
  let cancelLastAnimation = () => {}
@@ -707,7 +738,7 @@ export function stateModelFactory(pluginManager: PluginManager) {
707
738
  .views(self => ({
708
739
  menuItems(): MenuItem[] {
709
740
  const { canShowCytobands, showCytobands } = self
710
-
741
+ const session = getSession(self)
711
742
  const menuItems: MenuItem[] = [
712
743
  {
713
744
  label: 'Return to import form',
@@ -719,15 +750,19 @@ export function stateModelFactory(pluginManager: PluginManager) {
719
750
  },
720
751
  icon: FolderOpenIcon,
721
752
  },
722
- {
723
- label: 'Sequence search',
724
- onClick: () => {
725
- getSession(self).queueDialog(handleClose => [
726
- SequenceSearchDialog,
727
- { model: self, handleClose },
728
- ])
729
- },
730
- },
753
+ ...(isSessionWithAddTracks(session)
754
+ ? [
755
+ {
756
+ label: 'Sequence search',
757
+ onClick: () => {
758
+ getSession(self).queueDialog(handleClose => [
759
+ SequenceSearchDialog,
760
+ { model: self, handleClose },
761
+ ])
762
+ },
763
+ },
764
+ ]
765
+ : []),
731
766
  {
732
767
  label: 'Export SVG',
733
768
  icon: PhotoCameraIcon,
@@ -880,16 +915,6 @@ export function stateModelFactory(pluginManager: PluginManager) {
880
915
  }
881
916
  })
882
917
  .actions(self => ({
883
- // this "clears the view" and makes the view return to the import form
884
- clearView() {
885
- self.setDisplayedRegions([])
886
- self.tracks.clear()
887
- // it is necessary to run these after setting displayed regions empty
888
- // or else model.offsetPx gets set to Infinity and breaks
889
- // mobx-state-tree snapshot
890
- self.scrollTo(0)
891
- self.zoomTo(10)
892
- },
893
918
  setCoarseDynamicBlocks(blocks: BlockSet) {
894
919
  self.coarseDynamicBlocks = blocks.contentBlocks
895
920
  self.coarseTotalBp = blocks.totalBp
@@ -909,12 +934,6 @@ export function stateModelFactory(pluginManager: PluginManager) {
909
934
  },
910
935
  }))
911
936
  .actions(self => ({
912
- async exportSvg(opts: ExportSvgOptions = {}) {
913
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
914
- const html = await renderToSvg(self as any, opts)
915
- const blob = new Blob([html], { type: 'image/svg+xml' })
916
- saveAs(blob, opts.filename || 'image.svg')
917
- },
918
937
  /**
919
938
  * offset is the base-pair-offset in the displayed region, index is the index of the
920
939
  * displayed region in the linear genome view
@@ -1220,7 +1239,13 @@ export function stateModelFactory(pluginManager: PluginManager) {
1220
1239
  }))
1221
1240
  }
1222
1241
 
1223
- export { renderToSvg, RefNameAutocomplete, SearchBox }
1242
+ export {
1243
+ renderToSvg,
1244
+ RefNameAutocomplete,
1245
+ SearchBox,
1246
+ ZoomControls,
1247
+ LinearGenomeView,
1248
+ }
1224
1249
  export type LinearGenomeViewStateModel = ReturnType<typeof stateModelFactory>
1225
1250
  export type LinearGenomeViewModel = Instance<LinearGenomeViewStateModel>
1226
1251
  export { default as ReactComponent } from './components/LinearGenomeView'
package/src/index.ts CHANGED
@@ -29,6 +29,8 @@ import {
29
29
  renderToSvg,
30
30
  RefNameAutocomplete,
31
31
  SearchBox,
32
+ ZoomControls,
33
+ LinearGenomeView,
32
34
  } from './LinearGenomeView'
33
35
 
34
36
  import {
@@ -45,6 +47,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
45
47
  BaseLinearDisplayComponent,
46
48
  BaseLinearDisplay,
47
49
  baseLinearDisplayConfigSchema,
50
+ SearchBox,
51
+ ZoomControls,
52
+ LinearGenomeView,
48
53
  }
49
54
 
50
55
  install(pluginManager: PluginManager) {