@jbrowse/plugin-linear-genome-view 1.7.10 → 2.0.1

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 (271) hide show
  1. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +119 -139
  2. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -0
  3. package/dist/BaseLinearDisplay/components/Block.js +53 -74
  4. package/dist/BaseLinearDisplay/components/Block.js.map +1 -0
  5. package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +11 -1
  6. package/dist/BaseLinearDisplay/components/LinearBlocks.js +64 -103
  7. package/dist/BaseLinearDisplay/components/LinearBlocks.js.map +1 -0
  8. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +145 -175
  9. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -0
  10. package/dist/BaseLinearDisplay/components/Tooltip.js +109 -116
  11. package/dist/BaseLinearDisplay/components/Tooltip.js.map +1 -0
  12. package/dist/BaseLinearDisplay/index.js +13 -40
  13. package/dist/BaseLinearDisplay/index.js.map +1 -0
  14. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +20 -15
  15. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +605 -684
  16. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -0
  17. package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +15 -22
  18. package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -0
  19. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +7 -8
  20. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +266 -312
  21. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -0
  22. package/dist/LinearBareDisplay/configSchema.js +11 -17
  23. package/dist/LinearBareDisplay/configSchema.js.map +1 -0
  24. package/dist/LinearBareDisplay/index.js +7 -20
  25. package/dist/LinearBareDisplay/index.js.map +1 -0
  26. package/dist/LinearBareDisplay/model.d.ts +16 -14
  27. package/dist/LinearBareDisplay/model.js +36 -42
  28. package/dist/LinearBareDisplay/model.js.map +1 -0
  29. package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +1 -1
  30. package/dist/LinearBasicDisplay/components/SetMaxHeight.js +76 -85
  31. package/dist/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -0
  32. package/dist/LinearBasicDisplay/configSchema.js +15 -23
  33. package/dist/LinearBasicDisplay/configSchema.js.map +1 -0
  34. package/dist/LinearBasicDisplay/index.js +10 -22
  35. package/dist/LinearBasicDisplay/index.js.map +1 -0
  36. package/dist/LinearBasicDisplay/model.d.ts +20 -15
  37. package/dist/LinearBasicDisplay/model.js +180 -159
  38. package/dist/LinearBasicDisplay/model.js.map +1 -0
  39. package/dist/LinearGenomeView/components/CenterLine.d.ts +2 -8
  40. package/dist/LinearGenomeView/components/CenterLine.js +60 -74
  41. package/dist/LinearGenomeView/components/CenterLine.js.map +1 -0
  42. package/dist/LinearGenomeView/components/ExportSvgDialog.js +141 -141
  43. package/dist/LinearGenomeView/components/ExportSvgDialog.js.map +1 -0
  44. package/dist/LinearGenomeView/components/Gridlines.d.ts +8 -0
  45. package/dist/LinearGenomeView/components/Gridlines.js +78 -0
  46. package/dist/LinearGenomeView/components/Gridlines.js.map +1 -0
  47. package/dist/LinearGenomeView/components/Header.js +70 -126
  48. package/dist/LinearGenomeView/components/Header.js.map +1 -0
  49. package/dist/LinearGenomeView/components/HelpDialog.d.ts +0 -1
  50. package/dist/LinearGenomeView/components/HelpDialog.js +62 -44
  51. package/dist/LinearGenomeView/components/HelpDialog.js.map +1 -0
  52. package/dist/LinearGenomeView/components/ImportForm.js +223 -320
  53. package/dist/LinearGenomeView/components/ImportForm.js.map +1 -0
  54. package/dist/LinearGenomeView/components/LinearGenomeView.js +64 -124
  55. package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -0
  56. package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +198 -337
  57. package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -0
  58. package/dist/LinearGenomeView/components/MiniControls.js +64 -78
  59. package/dist/LinearGenomeView/components/MiniControls.js.map +1 -0
  60. package/dist/LinearGenomeView/components/OverviewRubberBand.js +229 -293
  61. package/dist/LinearGenomeView/components/OverviewRubberBand.js.map +1 -0
  62. package/dist/LinearGenomeView/components/OverviewScaleBar.d.ts +24 -8
  63. package/dist/LinearGenomeView/components/OverviewScaleBar.js +277 -365
  64. package/dist/LinearGenomeView/components/OverviewScaleBar.js.map +1 -0
  65. package/dist/LinearGenomeView/components/RefNameAutocomplete.d.ts +1 -1
  66. package/dist/LinearGenomeView/components/RefNameAutocomplete.js +237 -324
  67. package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -0
  68. package/dist/LinearGenomeView/components/RubberBand.js +228 -296
  69. package/dist/LinearGenomeView/components/RubberBand.js.map +1 -0
  70. package/dist/LinearGenomeView/components/Ruler.js +45 -90
  71. package/dist/LinearGenomeView/components/Ruler.js.map +1 -0
  72. package/dist/LinearGenomeView/components/ScaleBar.d.ts +8 -403
  73. package/dist/LinearGenomeView/components/ScaleBar.js +121 -172
  74. package/dist/LinearGenomeView/components/ScaleBar.js.map +1 -0
  75. package/dist/LinearGenomeView/components/SearchBox.js +158 -205
  76. package/dist/LinearGenomeView/components/SearchBox.js.map +1 -0
  77. package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +0 -1
  78. package/dist/LinearGenomeView/components/SearchResultsDialog.js +105 -150
  79. package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -0
  80. package/dist/LinearGenomeView/components/SequenceDialog.js +219 -272
  81. package/dist/LinearGenomeView/components/SequenceDialog.js.map +1 -0
  82. package/dist/LinearGenomeView/components/TrackContainer.js +116 -156
  83. package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -0
  84. package/dist/LinearGenomeView/components/TrackLabel.d.ts +6 -42
  85. package/dist/LinearGenomeView/components/TrackLabel.js +115 -134
  86. package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -0
  87. package/dist/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  88. package/dist/LinearGenomeView/components/TracksContainer.js +172 -199
  89. package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -0
  90. package/dist/LinearGenomeView/components/ZoomControls.js +72 -87
  91. package/dist/LinearGenomeView/components/ZoomControls.js.map +1 -0
  92. package/dist/LinearGenomeView/components/util.d.ts +12 -0
  93. package/dist/LinearGenomeView/components/util.js +95 -13
  94. package/dist/LinearGenomeView/components/util.js.map +1 -0
  95. package/dist/LinearGenomeView/index.d.ts +64 -77
  96. package/dist/LinearGenomeView/index.js +1035 -1412
  97. package/dist/LinearGenomeView/index.js.map +1 -0
  98. package/dist/LinearGenomeView/util.js +76 -83
  99. package/dist/LinearGenomeView/util.js.map +1 -0
  100. package/dist/index.d.ts +101 -51
  101. package/dist/index.js +225 -295
  102. package/dist/index.js.map +1 -0
  103. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +9 -0
  104. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +68 -0
  105. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -0
  106. package/esm/BaseLinearDisplay/components/Block.d.ts +15 -0
  107. package/esm/BaseLinearDisplay/components/Block.js +46 -0
  108. package/esm/BaseLinearDisplay/components/Block.js.map +1 -0
  109. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +22 -0
  110. package/esm/BaseLinearDisplay/components/LinearBlocks.js +62 -0
  111. package/esm/BaseLinearDisplay/components/LinearBlocks.js.map +1 -0
  112. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +4 -0
  113. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +113 -0
  114. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -0
  115. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +8 -0
  116. package/esm/BaseLinearDisplay/components/Tooltip.js +64 -0
  117. package/esm/BaseLinearDisplay/components/Tooltip.js.map +1 -0
  118. package/esm/BaseLinearDisplay/index.d.ts +5 -0
  119. package/esm/BaseLinearDisplay/index.js +4 -0
  120. package/esm/BaseLinearDisplay/index.js.map +1 -0
  121. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +232 -0
  122. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +541 -0
  123. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -0
  124. package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +1 -0
  125. package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +14 -0
  126. package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -0
  127. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +96 -0
  128. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +225 -0
  129. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -0
  130. package/esm/LinearBareDisplay/configSchema.d.ts +2 -0
  131. package/esm/LinearBareDisplay/configSchema.js +9 -0
  132. package/esm/LinearBareDisplay/configSchema.js.map +1 -0
  133. package/esm/LinearBareDisplay/index.d.ts +2 -0
  134. package/esm/LinearBareDisplay/index.js +3 -0
  135. package/esm/LinearBareDisplay/index.js.map +1 -0
  136. package/esm/LinearBareDisplay/model.d.ts +194 -0
  137. package/esm/LinearBareDisplay/model.js +28 -0
  138. package/esm/LinearBareDisplay/model.js.map +1 -0
  139. package/esm/LinearBasicDisplay/components/SetMaxHeight.d.ts +10 -0
  140. package/esm/LinearBasicDisplay/components/SetMaxHeight.js +40 -0
  141. package/esm/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -0
  142. package/esm/LinearBasicDisplay/configSchema.d.ts +2 -0
  143. package/esm/LinearBasicDisplay/configSchema.js +14 -0
  144. package/esm/LinearBasicDisplay/configSchema.js.map +1 -0
  145. package/esm/LinearBasicDisplay/index.d.ts +2 -0
  146. package/esm/LinearBasicDisplay/index.js +3 -0
  147. package/esm/LinearBasicDisplay/index.js.map +1 -0
  148. package/esm/LinearBasicDisplay/model.d.ts +218 -0
  149. package/esm/LinearBasicDisplay/model.js +127 -0
  150. package/esm/LinearBasicDisplay/model.js.map +1 -0
  151. package/esm/LinearGenomeView/components/CenterLine.d.ts +8 -0
  152. package/esm/LinearGenomeView/components/CenterLine.js +40 -0
  153. package/esm/LinearGenomeView/components/CenterLine.js.map +1 -0
  154. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +6 -0
  155. package/esm/LinearGenomeView/components/ExportSvgDialog.js +52 -0
  156. package/esm/LinearGenomeView/components/ExportSvgDialog.js.map +1 -0
  157. package/esm/LinearGenomeView/components/Gridlines.d.ts +8 -0
  158. package/esm/LinearGenomeView/components/Gridlines.js +71 -0
  159. package/esm/LinearGenomeView/components/Gridlines.js.map +1 -0
  160. package/esm/LinearGenomeView/components/Header.d.ts +7 -0
  161. package/esm/LinearGenomeView/components/Header.js +81 -0
  162. package/esm/LinearGenomeView/components/Header.js.map +1 -0
  163. package/esm/LinearGenomeView/components/HelpDialog.d.ts +4 -0
  164. package/esm/LinearGenomeView/components/HelpDialog.js +58 -0
  165. package/esm/LinearGenomeView/components/HelpDialog.js.map +1 -0
  166. package/esm/LinearGenomeView/components/ImportForm.d.ts +7 -0
  167. package/esm/LinearGenomeView/components/ImportForm.js +141 -0
  168. package/esm/LinearGenomeView/components/ImportForm.js.map +1 -0
  169. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +7 -0
  170. package/esm/LinearGenomeView/components/LinearGenomeView.js +67 -0
  171. package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -0
  172. package/esm/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +4 -0
  173. package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +132 -0
  174. package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -0
  175. package/esm/LinearGenomeView/components/MiniControls.d.ts +6 -0
  176. package/esm/LinearGenomeView/components/MiniControls.js +25 -0
  177. package/esm/LinearGenomeView/components/MiniControls.js.map +1 -0
  178. package/esm/LinearGenomeView/components/OverviewRubberBand.d.ts +22 -0
  179. package/esm/LinearGenomeView/components/OverviewRubberBand.js +197 -0
  180. package/esm/LinearGenomeView/components/OverviewRubberBand.js.map +1 -0
  181. package/esm/LinearGenomeView/components/OverviewScaleBar.d.ts +148 -0
  182. package/esm/LinearGenomeView/components/OverviewScaleBar.js +287 -0
  183. package/esm/LinearGenomeView/components/OverviewScaleBar.js.map +1 -0
  184. package/esm/LinearGenomeView/components/RefNameAutocomplete.d.ts +22 -0
  185. package/esm/LinearGenomeView/components/RefNameAutocomplete.js +136 -0
  186. package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -0
  187. package/esm/LinearGenomeView/components/RubberBand.d.ts +9 -0
  188. package/esm/LinearGenomeView/components/RubberBand.js +197 -0
  189. package/esm/LinearGenomeView/components/RubberBand.js.map +1 -0
  190. package/esm/LinearGenomeView/components/Ruler.d.ts +27 -0
  191. package/esm/LinearGenomeView/components/Ruler.js +50 -0
  192. package/esm/LinearGenomeView/components/Ruler.js.map +1 -0
  193. package/esm/LinearGenomeView/components/ScaleBar.d.ts +10 -0
  194. package/esm/LinearGenomeView/components/ScaleBar.js +112 -0
  195. package/esm/LinearGenomeView/components/ScaleBar.js.map +1 -0
  196. package/esm/LinearGenomeView/components/SearchBox.d.ts +8 -0
  197. package/esm/LinearGenomeView/components/SearchBox.js +94 -0
  198. package/esm/LinearGenomeView/components/SearchBox.js.map +1 -0
  199. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +7 -0
  200. package/esm/LinearGenomeView/components/SearchResultsDialog.js +107 -0
  201. package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -0
  202. package/esm/LinearGenomeView/components/SequenceDialog.d.ts +8 -0
  203. package/esm/LinearGenomeView/components/SequenceDialog.js +147 -0
  204. package/esm/LinearGenomeView/components/SequenceDialog.js.map +1 -0
  205. package/esm/LinearGenomeView/components/TrackContainer.d.ts +9 -0
  206. package/esm/LinearGenomeView/components/TrackContainer.js +109 -0
  207. package/esm/LinearGenomeView/components/TrackContainer.js.map +1 -0
  208. package/esm/LinearGenomeView/components/TrackLabel.d.ts +8 -0
  209. package/esm/LinearGenomeView/components/TrackLabel.js +89 -0
  210. package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -0
  211. package/{dist/LinearGenomeView/components/VerticalGuides.d.ts → esm/LinearGenomeView/components/TracksContainer.d.ts} +4 -3
  212. package/esm/LinearGenomeView/components/TracksContainer.js +142 -0
  213. package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -0
  214. package/esm/LinearGenomeView/components/ZoomControls.d.ts +7 -0
  215. package/esm/LinearGenomeView/components/ZoomControls.js +32 -0
  216. package/esm/LinearGenomeView/components/ZoomControls.js.map +1 -0
  217. package/esm/LinearGenomeView/components/util.d.ts +14 -0
  218. package/esm/LinearGenomeView/components/util.js +17 -0
  219. package/esm/LinearGenomeView/components/util.js.map +1 -0
  220. package/esm/LinearGenomeView/index.d.ts +275 -0
  221. package/esm/LinearGenomeView/index.js +978 -0
  222. package/esm/LinearGenomeView/index.js.map +1 -0
  223. package/esm/LinearGenomeView/util.d.ts +14 -0
  224. package/esm/LinearGenomeView/util.js +62 -0
  225. package/esm/LinearGenomeView/util.js.map +1 -0
  226. package/esm/index.d.ts +615 -0
  227. package/esm/index.js +127 -0
  228. package/esm/index.js.map +1 -0
  229. package/package.json +22 -15
  230. package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +4 -3
  231. package/src/BaseLinearDisplay/components/Block.tsx +5 -5
  232. package/src/BaseLinearDisplay/components/LinearBlocks.tsx +4 -4
  233. package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +7 -8
  234. package/src/BaseLinearDisplay/components/Tooltip.tsx +14 -4
  235. package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +6 -4
  236. package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +1 -1
  237. package/src/LinearBasicDisplay/components/SetMaxHeight.tsx +10 -7
  238. package/src/LinearBasicDisplay/model.ts +21 -15
  239. package/src/LinearGenomeView/components/CenterLine.tsx +6 -11
  240. package/src/LinearGenomeView/components/ExportSvgDialog.tsx +5 -5
  241. package/src/LinearGenomeView/components/{VerticalGuides.tsx → Gridlines.tsx} +9 -11
  242. package/src/LinearGenomeView/components/Header.tsx +13 -18
  243. package/src/LinearGenomeView/components/HelpDialog.tsx +5 -5
  244. package/src/LinearGenomeView/components/ImportForm.tsx +24 -37
  245. package/src/LinearGenomeView/components/LinearGenomeView.test.js +16 -6
  246. package/src/LinearGenomeView/components/LinearGenomeView.tsx +4 -3
  247. package/src/LinearGenomeView/components/MiniControls.tsx +29 -40
  248. package/src/LinearGenomeView/components/OverviewRubberBand.tsx +20 -29
  249. package/src/LinearGenomeView/components/OverviewScaleBar.tsx +100 -89
  250. package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +13 -44
  251. package/src/LinearGenomeView/components/RubberBand.tsx +12 -18
  252. package/src/LinearGenomeView/components/Ruler.tsx +5 -11
  253. package/src/LinearGenomeView/components/ScaleBar.tsx +23 -27
  254. package/src/LinearGenomeView/components/SearchBox.tsx +22 -32
  255. package/src/LinearGenomeView/components/SearchResultsDialog.tsx +7 -7
  256. package/src/LinearGenomeView/components/SequenceDialog.tsx +10 -10
  257. package/src/LinearGenomeView/components/TrackContainer.tsx +12 -12
  258. package/src/LinearGenomeView/components/TrackLabel.tsx +21 -31
  259. package/src/LinearGenomeView/components/TracksContainer.tsx +10 -15
  260. package/src/LinearGenomeView/components/ZoomControls.tsx +12 -13
  261. package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +500 -547
  262. package/src/LinearGenomeView/components/util.ts +43 -0
  263. package/src/LinearGenomeView/index.test.ts +14 -36
  264. package/src/LinearGenomeView/index.tsx +390 -564
  265. package/src/index.ts +1 -1
  266. package/dist/LinearBareDisplay/index.test.js +0 -33
  267. package/dist/LinearGenomeView/components/LinearGenomeView.test.js +0 -234
  268. package/dist/LinearGenomeView/components/ScaleBar.test.js +0 -180
  269. package/dist/LinearGenomeView/components/VerticalGuides.js +0 -116
  270. package/dist/LinearGenomeView/index.test.js +0 -1187
  271. package/dist/LinearGenomeView/util.test.js +0 -78
package/esm/index.js ADDED
@@ -0,0 +1,127 @@
1
+ import { lazy } from 'react';
2
+ import { when } from 'mobx';
3
+ import { ConfigurationSchema } from '@jbrowse/core/configuration';
4
+ import { createBaseTrackConfig, createBaseTrackModel, } from '@jbrowse/core/pluggableElementTypes/models';
5
+ import TrackType from '@jbrowse/core/pluggableElementTypes/TrackType';
6
+ import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType';
7
+ import ViewType from '@jbrowse/core/pluggableElementTypes/ViewType';
8
+ import Plugin from '@jbrowse/core/Plugin';
9
+ import { isAbstractMenuManager } from '@jbrowse/core/util';
10
+ import LineStyleIcon from '@mui/icons-material/LineStyle';
11
+ import { BaseLinearDisplay, BaseLinearDisplayComponent, baseLinearDisplayConfigSchema, } from './BaseLinearDisplay';
12
+ import { configSchemaFactory as linearBareDisplayConfigSchemaFactory, stateModelFactory as LinearBareDisplayStateModelFactory, } from './LinearBareDisplay';
13
+ import { stateModelFactory as linearGenomeViewStateModelFactory, renderToSvg, RefNameAutocomplete, SearchBox, } from './LinearGenomeView';
14
+ import { configSchema as linearBasicDisplayConfigSchemaFactory, modelFactory as linearBasicDisplayModelFactory, } from './LinearBasicDisplay';
15
+ export default class LinearGenomeViewPlugin extends Plugin {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.name = 'LinearGenomeViewPlugin';
19
+ this.exports = {
20
+ BaseLinearDisplayComponent,
21
+ BaseLinearDisplay,
22
+ baseLinearDisplayConfigSchema,
23
+ };
24
+ }
25
+ install(pluginManager) {
26
+ pluginManager.addTrackType(() => {
27
+ const configSchema = ConfigurationSchema('FeatureTrack', {}, {
28
+ baseConfiguration: createBaseTrackConfig(pluginManager),
29
+ explicitIdentifier: 'trackId',
30
+ });
31
+ return new TrackType({
32
+ name: 'FeatureTrack',
33
+ configSchema,
34
+ stateModel: createBaseTrackModel(pluginManager, 'FeatureTrack', configSchema),
35
+ });
36
+ });
37
+ pluginManager.addTrackType(() => {
38
+ const configSchema = ConfigurationSchema('BasicTrack', {}, {
39
+ baseConfiguration: createBaseTrackConfig(pluginManager),
40
+ explicitIdentifier: 'trackId',
41
+ });
42
+ return new TrackType({
43
+ name: 'BasicTrack',
44
+ configSchema,
45
+ stateModel: createBaseTrackModel(pluginManager, 'BasicTrack', configSchema),
46
+ });
47
+ });
48
+ pluginManager.addDisplayType(() => {
49
+ const configSchema = linearBareDisplayConfigSchemaFactory(pluginManager);
50
+ return new DisplayType({
51
+ name: 'LinearBareDisplay',
52
+ configSchema,
53
+ stateModel: LinearBareDisplayStateModelFactory(configSchema),
54
+ trackType: 'BasicTrack',
55
+ viewType: 'LinearGenomeView',
56
+ ReactComponent: BaseLinearDisplayComponent,
57
+ });
58
+ });
59
+ pluginManager.addDisplayType(() => {
60
+ const configSchema = linearBasicDisplayConfigSchemaFactory(pluginManager);
61
+ return new DisplayType({
62
+ name: 'LinearBasicDisplay',
63
+ configSchema,
64
+ stateModel: linearBasicDisplayModelFactory(configSchema),
65
+ trackType: 'FeatureTrack',
66
+ viewType: 'LinearGenomeView',
67
+ ReactComponent: BaseLinearDisplayComponent,
68
+ });
69
+ });
70
+ pluginManager.addViewType(() => new ViewType({
71
+ name: 'LinearGenomeView',
72
+ stateModel: linearGenomeViewStateModelFactory(pluginManager),
73
+ ReactComponent: lazy(() => import('./LinearGenomeView/components/LinearGenomeView')),
74
+ }));
75
+ pluginManager.addToExtensionPoint('LaunchView-LinearGenomeView',
76
+ // @ts-ignore
77
+ async ({ session, assembly, loc, tracks = [], }) => {
78
+ try {
79
+ const { assemblyManager } = session;
80
+ const view = session.addView('LinearGenomeView', {});
81
+ await when(() => !!view.volatileWidth);
82
+ if (!assembly) {
83
+ throw new Error('No assembly provided when launching linear genome view');
84
+ }
85
+ const asm = await assemblyManager.waitForAssembly(assembly);
86
+ if (!asm) {
87
+ throw new Error(`Assembly "${assembly}" not found when launching linear genome view`);
88
+ }
89
+ view.navToLocString(loc, assembly);
90
+ const idsNotFound = [];
91
+ tracks.forEach(track => {
92
+ try {
93
+ view.showTrack(track);
94
+ }
95
+ catch (e) {
96
+ if (`${e}`.match('Could not resolve identifier')) {
97
+ idsNotFound.push(track);
98
+ }
99
+ else {
100
+ throw e;
101
+ }
102
+ }
103
+ });
104
+ if (idsNotFound.length) {
105
+ throw new Error(`Could not resolve identifiers: ${idsNotFound.join(',')}`);
106
+ }
107
+ }
108
+ catch (e) {
109
+ session.notify(`${e}`, 'error');
110
+ throw e;
111
+ }
112
+ });
113
+ }
114
+ configure(pluginManager) {
115
+ if (isAbstractMenuManager(pluginManager.rootModel)) {
116
+ pluginManager.rootModel.appendToSubMenu(['Add'], {
117
+ label: 'Linear genome view',
118
+ icon: LineStyleIcon,
119
+ onClick: (session) => {
120
+ session.addView('LinearGenomeView', {});
121
+ },
122
+ });
123
+ }
124
+ }
125
+ }
126
+ export { baseLinearDisplayConfigSchema, linearBareDisplayConfigSchemaFactory, linearBasicDisplayConfigSchemaFactory, linearBasicDisplayModelFactory, renderToSvg, BaseLinearDisplayComponent, BaseLinearDisplay, RefNameAutocomplete, SearchBox, };
127
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EACL,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,4CAA4C,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,EAAE,CAC1D,CAAA;iBACF;aACF;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;gBAC/B,MAAM,CAAC,CAAA;aACR;QACH,CAAC,CACF,CAAA;IACH,CAAC;IAED,SAAS,CAAC,aAA4B;QACpC,IAAI,qBAAqB,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE;YAClD,aAAa,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,EAAE;gBAC/C,KAAK,EAAE,oBAAoB;gBAC3B,IAAI,EAAE,aAAa;gBACnB,OAAO,EAAE,CAAC,OAA6B,EAAE,EAAE;oBACzC,OAAO,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAA;gBACzC,CAAC;aACF,CAAC,CAAA;SACH;IACH,CAAC;CACF;AAED,OAAO,EACL,6BAA6B,EAC7B,oCAAoC,EACpC,qCAAqC,EACrC,8BAA8B,EAC9B,WAAW,EACX,0BAA0B,EAC1B,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,GACV,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-linear-genome-view",
3
- "version": "1.7.10",
3
+ "version": "2.0.1",
4
4
  "description": "JBrowse 2 linear genome view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -16,47 +16,54 @@
16
16
  },
17
17
  "author": "JBrowse Team",
18
18
  "distMain": "dist/index.js",
19
+ "distModule": "esm/index.js",
19
20
  "srcMain": "src/index.ts",
21
+ "srcModule": "src/index.ts",
20
22
  "main": "dist/index.js",
21
23
  "files": [
22
24
  "dist",
23
- "src"
25
+ "src",
26
+ "esm"
24
27
  ],
25
28
  "scripts": {
26
- "build": "babel src --root-mode upward --out-dir dist --extensions .ts,.js,.tsx,.jsx",
29
+ "prebuild": "npm run clean",
30
+ "build": "npm-run-all build:*",
31
+ "build:esm": "tsc --build tsconfig.build.esm.json",
32
+ "build:es5": "tsc --build tsconfig.build.es5.json",
33
+ "clean": "rimraf dist esm *.tsbuildinfo",
27
34
  "test": "cd ../..; jest plugins/linear-genome-view",
28
35
  "prepublishOnly": "yarn test",
29
36
  "prepack": "yarn build; yarn useDist",
30
37
  "postpack": "yarn useSrc",
31
38
  "useDist": "node ../../scripts/useDist.js",
32
- "useSrc": "node ../../scripts/useSrc.js",
33
- "postbuild": "tsc --build tsconfig.build.json"
39
+ "useSrc": "node ../../scripts/useSrc.js"
34
40
  },
35
41
  "dependencies": {
36
42
  "@babel/runtime": "^7.17.9",
37
- "@material-ui/icons": "^4.9.1",
43
+ "@mui/icons-material": "^5.0.1",
38
44
  "@popperjs/core": "^2.11.0",
39
45
  "clone": "^2.1.2",
40
46
  "clsx": "^1.0.4",
41
47
  "copy-to-clipboard": "^3.3.1",
42
48
  "file-saver": "^2.0.0",
43
- "material-ui-popup-state": "^1.9.3",
49
+ "material-ui-popup-state": "^3.0.0",
44
50
  "normalize-wheel": "^1.0.1",
45
51
  "react-popper": "^2.0.0"
46
52
  },
47
53
  "peerDependencies": {
48
- "@jbrowse/core": "^1.0.0",
49
- "@material-ui/core": "^4.12.2",
50
- "@material-ui/lab": "^4.0.0-alpha.45",
51
- "mobx": "^5.0.0",
52
- "mobx-react": "^6.0.0",
53
- "mobx-state-tree": "3.14.1",
54
+ "@jbrowse/core": "^2.0.0",
55
+ "@mui/material": "^5.0.0",
56
+ "mobx": "^6.0.0",
57
+ "mobx-react": "^7.0.0",
58
+ "mobx-state-tree": "^5.0.0",
54
59
  "prop-types": "^15.0.0",
55
60
  "react": ">=16.8.0",
56
- "react-dom": ">=16.8.0"
61
+ "react-dom": ">=16.8.0",
62
+ "tss-react": "^3.0.0"
57
63
  },
58
64
  "publishConfig": {
59
65
  "access": "public"
60
66
  },
61
- "gitHead": "02d8c1e88e5603ea5855faed4ccb814e28071b32"
67
+ "module": "esm/index.js",
68
+ "gitHead": "ed935bf5612af3818abdc8ef52d100d5d81d33a2"
62
69
  }
@@ -1,6 +1,7 @@
1
1
  import React, { useState, useRef } from 'react'
2
2
  import { observer } from 'mobx-react'
3
- import { useTheme, makeStyles } from '@material-ui/core'
3
+ import { useTheme } from '@mui/material'
4
+ import { makeStyles } from 'tss-react/mui'
4
5
  import { getConf } from '@jbrowse/core/configuration'
5
6
  import { Menu } from '@jbrowse/core/ui'
6
7
 
@@ -9,7 +10,7 @@ import Tooltip from './Tooltip'
9
10
  import LinearBlocks from './LinearBlocks'
10
11
  import { BaseLinearDisplayModel } from '../models/BaseLinearDisplayModel'
11
12
 
12
- const useStyles = makeStyles({
13
+ const useStyles = makeStyles()({
13
14
  display: {
14
15
  position: 'relative',
15
16
  whiteSpace: 'nowrap',
@@ -22,7 +23,7 @@ const useStyles = makeStyles({
22
23
  type Coord = [number, number]
23
24
  const BaseLinearDisplay = observer(
24
25
  (props: { model: BaseLinearDisplayModel; children?: React.ReactNode }) => {
25
- const classes = useStyles()
26
+ const { classes } = useStyles()
26
27
  const theme = useTheme()
27
28
  const ref = useRef<HTMLDivElement>(null)
28
29
  const [clientRect, setClientRect] = useState<DOMRect>()
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
2
  import { BaseBlock } from '@jbrowse/core/util/blockTypes'
3
- import { makeStyles } from '@material-ui/core/styles'
3
+ import { makeStyles } from 'tss-react/mui'
4
4
  import { observer } from 'mobx-react'
5
5
 
6
- const useStyles = makeStyles(theme => ({
6
+ const useStyles = makeStyles()(theme => ({
7
7
  contentBlock: {
8
8
  position: 'relative',
9
9
  minHeight: '100%',
@@ -30,7 +30,7 @@ const useStyles = makeStyles(theme => ({
30
30
 
31
31
  const ContentBlock = observer(
32
32
  ({ block, children }: { block: BaseBlock; children: React.ReactNode }) => {
33
- const classes = useStyles()
33
+ const { classes } = useStyles()
34
34
  const { widthPx } = block
35
35
  return (
36
36
  <div style={{ width: widthPx }} className={classes.contentBlock}>
@@ -41,7 +41,7 @@ const ContentBlock = observer(
41
41
  )
42
42
 
43
43
  function ElidedBlock({ width }: { width: number }) {
44
- const classes = useStyles()
44
+ const { classes } = useStyles()
45
45
  return <div className={classes.elidedBlock} style={{ width }} />
46
46
  }
47
47
 
@@ -54,7 +54,7 @@ function InterRegionPaddingBlock({
54
54
  width: number
55
55
  style?: React.CSSProperties
56
56
  }) {
57
- const classes = useStyles()
57
+ const { classes } = useStyles()
58
58
  return (
59
59
  <div
60
60
  style={{
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { makeStyles } from '@material-ui/core/styles'
2
+ import { makeStyles } from 'tss-react/mui'
3
3
  import { getContainingView } from '@jbrowse/core/util'
4
4
  import { observer } from 'mobx-react'
5
5
  import {
@@ -16,7 +16,7 @@ import {
16
16
  } from './Block'
17
17
  import { LinearGenomeViewModel } from '../../LinearGenomeView'
18
18
 
19
- const useStyles = makeStyles({
19
+ const useStyles = makeStyles()({
20
20
  linearBlocks: {
21
21
  whiteSpace: 'nowrap',
22
22
  textAlign: 'left',
@@ -39,7 +39,7 @@ const useStyles = makeStyles({
39
39
  })
40
40
  const RenderedBlocks = observer(
41
41
  ({ model }: { model: BaseLinearDisplayModel }) => {
42
- const classes = useStyles()
42
+ const { classes } = useStyles()
43
43
  const { blockDefinitions, blockState } = model
44
44
  return (
45
45
  <>
@@ -95,7 +95,7 @@ const RenderedBlocks = observer(
95
95
  },
96
96
  )
97
97
  function LinearBlocks({ model }: { model: BaseLinearDisplayModel }) {
98
- const classes = useStyles()
98
+ const { classes } = useStyles()
99
99
  const { blockDefinitions } = model
100
100
  const viewModel = getContainingView(model) as LinearGenomeViewModel
101
101
  return (
@@ -1,13 +1,12 @@
1
1
  import React, { useEffect, useState } from 'react'
2
- import Typography from '@material-ui/core/Typography'
3
- import { makeStyles } from '@material-ui/core/styles'
2
+ import { Typography, Button } from '@mui/material'
3
+ import { makeStyles } from 'tss-react/mui'
4
4
  import { observer } from 'mobx-react'
5
5
  import { getParent } from 'mobx-state-tree'
6
6
  import { getParentRenderProps } from '@jbrowse/core/util/tracks'
7
- import Button from '@material-ui/core/Button'
8
- import RefreshIcon from '@material-ui/icons/Refresh'
7
+ import RefreshIcon from '@mui/icons-material/Refresh'
9
8
 
10
- const useStyles = makeStyles(theme => ({
9
+ const useStyles = makeStyles()(theme => ({
11
10
  loading: {
12
11
  paddingLeft: '0.6em',
13
12
  backgroundColor: theme.palette.action.disabledBackground,
@@ -73,7 +72,7 @@ function Repeater({ children }: { children: React.ReactNode }) {
73
72
  const LoadingMessage = observer(({ model }: { model: any }) => {
74
73
  // only show the loading message after 300ms to prevent excessive flickering
75
74
  const [shown, setShown] = useState(false)
76
- const classes = useStyles()
75
+ const { classes } = useStyles()
77
76
  useEffect(() => {
78
77
  let killed = false
79
78
  const timeout = setTimeout(() => {
@@ -108,7 +107,7 @@ function BlockMessage({
108
107
  }: {
109
108
  messageContent: string | React.ReactNode
110
109
  }) {
111
- const classes = useStyles()
110
+ const { classes } = useStyles()
112
111
 
113
112
  return React.isValidElement(messageContent) ? (
114
113
  <div className={classes.blockReactNodeMessage}>{messageContent}</div>
@@ -128,7 +127,7 @@ function BlockError({
128
127
  reload: () => void
129
128
  displayHeight: number
130
129
  }) {
131
- const classes = useStyles()
130
+ const { classes } = useStyles()
132
131
  return (
133
132
  <div className={classes.blockError} style={{ height: displayHeight }}>
134
133
  {reload ? (
@@ -1,7 +1,9 @@
1
1
  import React, { useState, useMemo } from 'react'
2
2
  import { getConf } from '@jbrowse/core/configuration'
3
+ import { SanitizedHTML } from '@jbrowse/core/ui'
3
4
  import { observer } from 'mobx-react'
4
- import { Portal, alpha, makeStyles } from '@material-ui/core'
5
+ import { Portal, alpha } from '@mui/material'
6
+ import { makeStyles } from 'tss-react/mui'
5
7
  import { usePopper } from 'react-popper'
6
8
 
7
9
  // locals
@@ -10,7 +12,7 @@ import { BaseLinearDisplayModel } from '../models/BaseLinearDisplayModel'
10
12
  function round(value: number) {
11
13
  return Math.round(value * 1e5) / 1e5
12
14
  }
13
- const useStyles = makeStyles(theme => ({
15
+ const useStyles = makeStyles()(theme => ({
14
16
  // these styles come from
15
17
  // https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Tooltip/Tooltip.js
16
18
  tooltip: {
@@ -31,7 +33,15 @@ const TooltipContents = React.forwardRef<
31
33
  HTMLDivElement,
32
34
  { message: React.ReactNode | string }
33
35
  >(({ message }: { message: React.ReactNode | string }, ref) => {
34
- return <div ref={ref}>{message}</div>
36
+ return (
37
+ <div ref={ref}>
38
+ {React.isValidElement(message) ? (
39
+ message
40
+ ) : message ? (
41
+ <SanitizedHTML html={String(message)} />
42
+ ) : null}
43
+ </div>
44
+ )
35
45
  })
36
46
 
37
47
  type Coord = [number, number]
@@ -43,7 +53,7 @@ const Tooltip = observer(
43
53
  model: BaseLinearDisplayModel
44
54
  clientMouseCoord: Coord
45
55
  }) => {
46
- const classes = useStyles()
56
+ const { classes } = useStyles()
47
57
  const { featureUnderMouse } = model
48
58
  const [width, setWidth] = useState(0)
49
59
  const [popperElt, setPopperElt] = useState<HTMLDivElement | null>(null)
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  import React from 'react'
3
- import { Button, Typography } from '@material-ui/core'
3
+ import { Button, Typography } from '@mui/material'
4
4
  import { BaseDisplay } from '@jbrowse/core/pluggableElementTypes/models'
5
5
  import { getConf } from '@jbrowse/core/configuration'
6
6
  import { MenuItem } from '@jbrowse/core/ui'
@@ -25,7 +25,7 @@ import {
25
25
  import { autorun } from 'mobx'
26
26
  import { addDisposer, isAlive, types, Instance } from 'mobx-state-tree'
27
27
  // icons
28
- import MenuOpenIcon from '@material-ui/icons/MenuOpen'
28
+ import MenuOpenIcon from '@mui/icons-material/MenuOpen'
29
29
 
30
30
  import { LinearGenomeViewModel, ExportSvgOptions } from '../../LinearGenomeView'
31
31
  import { Tooltip } from '../components/BaseLinearDisplay'
@@ -552,7 +552,7 @@ export const BaseLinearDisplay = types
552
552
  renderProps() {
553
553
  const view = getContainingView(self) as LGV
554
554
  return {
555
- ...getParentRenderProps(self),
555
+ ...(getParentRenderProps(self) as any),
556
556
  notReady:
557
557
  self.currBpPerPx !== view.bpPerPx || !self.estimatedRegionStats,
558
558
  rpcDriverName: self.rpcDriverName,
@@ -679,7 +679,9 @@ export const BaseLinearDisplay = types
679
679
  },
680
680
  }))
681
681
  .postProcessSnapshot(self => {
682
- const { blockState, ...rest } = self
682
+ // xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit
683
+ const r = self as Omit<typeof self, symbol>
684
+ const { blockState, ...rest } = r
683
685
  return rest
684
686
  })
685
687
 
@@ -163,7 +163,7 @@ const blockState = types
163
163
  self.maxHeightReached = false
164
164
  self.ReactComponent = ServerSideRenderedBlockContent
165
165
  self.renderProps = undefined
166
- getParent(self, 2).reload()
166
+ getParent<any>(self, 2).reload()
167
167
  },
168
168
  beforeDestroy() {
169
169
  if (renderInProgress && !renderInProgress.signal.aborted) {
@@ -9,12 +9,12 @@ import {
9
9
  IconButton,
10
10
  Typography,
11
11
  TextField,
12
- makeStyles,
13
- } from '@material-ui/core'
12
+ } from '@mui/material'
13
+ import { makeStyles } from 'tss-react/mui'
14
14
 
15
- import CloseIcon from '@material-ui/icons/Close'
15
+ import CloseIcon from '@mui/icons-material/Close'
16
16
 
17
- const useStyles = makeStyles(theme => ({
17
+ const useStyles = makeStyles()(theme => ({
18
18
  root: {
19
19
  width: 500,
20
20
  },
@@ -29,15 +29,17 @@ const useStyles = makeStyles(theme => ({
29
29
  },
30
30
  }))
31
31
 
32
- function SetMaxHeightDlg(props: {
32
+ function SetMaxHeightDlg({
33
+ model,
34
+ handleClose,
35
+ }: {
33
36
  model: {
34
37
  maxHeight?: number
35
38
  setMaxHeight: Function
36
39
  }
37
40
  handleClose: () => void
38
41
  }) {
39
- const { model, handleClose } = props
40
- const classes = useStyles()
42
+ const { classes } = useStyles()
41
43
  const { maxHeight = '' } = model
42
44
  const [max, setMax] = useState(`${maxHeight}`)
43
45
 
@@ -54,6 +56,7 @@ function SetMaxHeightDlg(props: {
54
56
  aria-label="close"
55
57
  className={classes.closeButton}
56
58
  onClick={handleClose}
59
+ size="large"
57
60
  >
58
61
  <CloseIcon />
59
62
  </IconButton>
@@ -9,7 +9,7 @@ import { MenuItem } from '@jbrowse/core/ui'
9
9
  import { types, getEnv, Instance } from 'mobx-state-tree'
10
10
 
11
11
  // icons
12
- import VisibilityIcon from '@material-ui/icons/Visibility'
12
+ import VisibilityIcon from '@mui/icons-material/Visibility'
13
13
 
14
14
  // locals
15
15
  import { BaseLinearDisplay } from '../BaseLinearDisplay'
@@ -42,7 +42,7 @@ const stateModelFactory = (configSchema: AnyConfigurationSchemaType) =>
42
42
  get showDescriptions() {
43
43
  return (
44
44
  self.trackShowDescriptions ??
45
- getConf(self, ['renderer', 'showLabels'])
45
+ getConf(self, ['renderer', 'showDescriptions'])
46
46
  )
47
47
  },
48
48
 
@@ -51,19 +51,23 @@ const stateModelFactory = (configSchema: AnyConfigurationSchemaType) =>
51
51
  },
52
52
 
53
53
  get displayMode() {
54
- const displayMode = getConf(self, ['renderer', 'displayMode'])
55
- return self.trackDisplayMode ?? displayMode
54
+ return (
55
+ self.trackDisplayMode ?? getConf(self, ['renderer', 'displayMode'])
56
+ )
56
57
  },
58
+ }))
59
+ .views(self => ({
57
60
  get rendererConfig() {
58
61
  const configBlob = getConf(self, ['renderer']) || {}
62
+ const config = configBlob as Omit<typeof configBlob, symbol>
59
63
 
60
64
  return self.rendererType.configSchema.create(
61
65
  {
62
- ...configBlob,
63
- showLabels: this.showLabels,
64
- showDescriptions: this.showDescriptions,
65
- displayMode: this.displayMode,
66
- maxHeight: this.maxHeight,
66
+ ...config,
67
+ showLabels: self.showLabels,
68
+ showDescriptions: self.showDescriptions,
69
+ displayMode: self.displayMode,
70
+ maxHeight: self.maxHeight,
67
71
  },
68
72
  getEnv(self),
69
73
  )
@@ -92,9 +96,13 @@ const stateModelFactory = (configSchema: AnyConfigurationSchemaType) =>
92
96
  return {
93
97
  renderProps() {
94
98
  const config = self.rendererConfig
99
+ const superProps = superRenderProps()
100
+
101
+ const superPropsOmit = superProps as Omit<typeof superProps, symbol>
95
102
 
96
103
  return {
97
- ...superRenderProps(),
104
+ ...superPropsOmit,
105
+
98
106
  config,
99
107
  }
100
108
  },
@@ -116,9 +124,7 @@ const stateModelFactory = (configSchema: AnyConfigurationSchemaType) =>
116
124
  icon: VisibilityIcon,
117
125
  type: 'checkbox',
118
126
  checked: self.showDescriptions,
119
- onClick: () => {
120
- self.toggleShowDescriptions()
121
- },
127
+ onClick: () => self.toggleShowDescriptions(),
122
128
  },
123
129
  {
124
130
  label: 'Display mode',
@@ -138,9 +144,9 @@ const stateModelFactory = (configSchema: AnyConfigurationSchemaType) =>
138
144
  {
139
145
  label: 'Set max height',
140
146
  onClick: () => {
141
- getSession(self).queueDialog(doneCallback => [
147
+ getSession(self).queueDialog(handleClose => [
142
148
  SetMaxHeightDlg,
143
- { model: self, handleClose: doneCallback },
149
+ { model: self, handleClose },
144
150
  ])
145
151
  },
146
152
  },
@@ -1,12 +1,11 @@
1
- import { makeStyles } from '@material-ui/core/styles'
2
- import { observer, PropTypes as MobxPropTypes } from 'mobx-react'
3
1
  import React, { useRef } from 'react'
4
- import { Instance } from 'mobx-state-tree'
5
- import { LinearGenomeViewStateModel } from '..'
2
+ import { makeStyles } from 'tss-react/mui'
3
+ import { observer } from 'mobx-react'
4
+ import { LinearGenomeViewModel } from '..'
6
5
 
7
- type LGV = Instance<LinearGenomeViewStateModel>
6
+ type LGV = LinearGenomeViewModel
8
7
 
9
- const useStyles = makeStyles(() => ({
8
+ const useStyles = makeStyles()(() => ({
10
9
  centerLineContainer: {
11
10
  background: 'transparent',
12
11
  height: '100%',
@@ -28,7 +27,7 @@ const useStyles = makeStyles(() => ({
28
27
  function CenterLine({ model }: { model: LGV }) {
29
28
  const { bpPerPx, centerLineInfo, trackHeights, tracks, width } = model
30
29
  const ref = useRef<HTMLDivElement>(null)
31
- const classes = useStyles()
30
+ const { classes } = useStyles()
32
31
  const startingPosition = width / 2
33
32
 
34
33
  return tracks.length ? (
@@ -63,8 +62,4 @@ function CenterLine({ model }: { model: LGV }) {
63
62
  ) : null
64
63
  }
65
64
 
66
- CenterLine.propTypes = {
67
- model: MobxPropTypes.objectOrObservableObject.isRequired,
68
- }
69
-
70
65
  export default observer(CenterLine)
@@ -1,4 +1,5 @@
1
1
  import React, { useState } from 'react'
2
+ import { makeStyles } from 'tss-react/mui'
2
3
  import {
3
4
  Button,
4
5
  Checkbox,
@@ -11,13 +12,12 @@ import {
11
12
  IconButton,
12
13
  TextField,
13
14
  Typography,
14
- makeStyles,
15
- } from '@material-ui/core'
15
+ } from '@mui/material'
16
16
  import { ErrorMessage } from '@jbrowse/core/ui'
17
- import CloseIcon from '@material-ui/icons/Close'
17
+ import CloseIcon from '@mui/icons-material/Close'
18
18
  import { LinearGenomeViewModel as LGV } from '..'
19
19
 
20
- const useStyles = makeStyles(theme => ({
20
+ const useStyles = makeStyles()(theme => ({
21
21
  closeButton: {
22
22
  position: 'absolute',
23
23
  right: theme.spacing(1),
@@ -48,7 +48,7 @@ export default function ExportSvgDlg({
48
48
  const [loading, setLoading] = useState(false)
49
49
  const [filename, setFilename] = useState('jbrowse.svg')
50
50
  const [error, setError] = useState<unknown>()
51
- const classes = useStyles()
51
+ const { classes } = useStyles()
52
52
  return (
53
53
  <Dialog open onClose={handleClose}>
54
54
  <DialogTitle>