@jbrowse/plugin-linear-genome-view 2.2.2 → 2.3.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 (126) hide show
  1. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +2 -1
  2. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +4 -2
  3. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -1
  4. package/dist/BaseLinearDisplay/components/Block.d.ts +1 -1
  5. package/dist/BaseLinearDisplay/components/Block.js +1 -1
  6. package/dist/BaseLinearDisplay/components/Block.js.map +1 -1
  7. package/dist/BaseLinearDisplay/components/BlockMsg.js +3 -2
  8. package/dist/BaseLinearDisplay/components/BlockMsg.js.map +1 -1
  9. package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -1
  10. package/dist/BaseLinearDisplay/components/LinearBlocks.js +2 -2
  11. package/dist/BaseLinearDisplay/components/LinearBlocks.js.map +1 -1
  12. package/dist/BaseLinearDisplay/{models → components}/TooLargeMessage.d.ts +0 -0
  13. package/dist/BaseLinearDisplay/{models → components}/TooLargeMessage.js +0 -0
  14. package/dist/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -0
  15. package/dist/BaseLinearDisplay/index.d.ts +2 -2
  16. package/dist/BaseLinearDisplay/index.js +4 -3
  17. package/dist/BaseLinearDisplay/index.js.map +1 -1
  18. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +6 -14
  19. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +3 -5
  20. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
  21. package/dist/BaseLinearDisplay/models/configSchema.d.ts +2 -0
  22. package/dist/BaseLinearDisplay/models/{baseLinearDisplayConfigSchema.js → configSchema.js} +5 -5
  23. package/dist/BaseLinearDisplay/models/configSchema.js.map +1 -0
  24. package/dist/BaseLinearDisplay/models/util.d.ts +18 -0
  25. package/dist/BaseLinearDisplay/models/util.js +18 -0
  26. package/dist/BaseLinearDisplay/models/util.js.map +1 -0
  27. package/dist/FeatureTrack/index.d.ts +1 -1
  28. package/dist/FeatureTrack/index.js +5 -4
  29. package/dist/FeatureTrack/index.js.map +1 -1
  30. package/dist/LinearBareDisplay/index.js +2 -1
  31. package/dist/LinearBareDisplay/index.js.map +1 -1
  32. package/dist/LinearBareDisplay/model.d.ts +1 -1
  33. package/dist/LinearBasicDisplay/index.js +1 -0
  34. package/dist/LinearBasicDisplay/index.js.map +1 -1
  35. package/dist/LinearBasicDisplay/model.d.ts +1 -4
  36. package/dist/LinearGenomeView/components/ImportForm.js +5 -1
  37. package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
  38. package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +1 -2
  39. package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -1
  40. package/dist/LinearGenomeView/components/Ruler.d.ts +2 -18
  41. package/dist/LinearGenomeView/components/Ruler.js +9 -25
  42. package/dist/LinearGenomeView/components/Ruler.js.map +1 -1
  43. package/dist/LinearGenomeView/components/SearchBox.js +4 -0
  44. package/dist/LinearGenomeView/components/SearchBox.js.map +1 -1
  45. package/dist/LinearGenomeView/index.js +1 -0
  46. package/dist/LinearGenomeView/index.js.map +1 -1
  47. package/dist/index.d.ts +5 -5
  48. package/dist/index.js +3 -1
  49. package/dist/index.js.map +1 -1
  50. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +2 -1
  51. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +3 -2
  52. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -1
  53. package/esm/BaseLinearDisplay/components/Block.d.ts +1 -1
  54. package/esm/BaseLinearDisplay/components/Block.js +1 -1
  55. package/esm/BaseLinearDisplay/components/Block.js.map +1 -1
  56. package/esm/BaseLinearDisplay/components/BlockMsg.js +3 -2
  57. package/esm/BaseLinearDisplay/components/BlockMsg.js.map +1 -1
  58. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -1
  59. package/esm/BaseLinearDisplay/components/LinearBlocks.js +2 -2
  60. package/esm/BaseLinearDisplay/components/LinearBlocks.js.map +1 -1
  61. package/esm/BaseLinearDisplay/{models → components}/TooLargeMessage.d.ts +0 -0
  62. package/esm/BaseLinearDisplay/{models → components}/TooLargeMessage.js +0 -0
  63. package/esm/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -0
  64. package/esm/BaseLinearDisplay/index.d.ts +2 -2
  65. package/esm/BaseLinearDisplay/index.js +2 -2
  66. package/esm/BaseLinearDisplay/index.js.map +1 -1
  67. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +6 -14
  68. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +3 -5
  69. package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
  70. package/esm/BaseLinearDisplay/models/configSchema.d.ts +2 -0
  71. package/esm/BaseLinearDisplay/models/{baseLinearDisplayConfigSchema.js → configSchema.js} +5 -4
  72. package/esm/BaseLinearDisplay/models/configSchema.js.map +1 -0
  73. package/esm/BaseLinearDisplay/models/util.d.ts +18 -0
  74. package/esm/BaseLinearDisplay/models/util.js +14 -0
  75. package/esm/BaseLinearDisplay/models/util.js.map +1 -0
  76. package/esm/FeatureTrack/index.d.ts +1 -1
  77. package/esm/FeatureTrack/index.js +5 -4
  78. package/esm/FeatureTrack/index.js.map +1 -1
  79. package/esm/LinearBareDisplay/index.js +2 -1
  80. package/esm/LinearBareDisplay/index.js.map +1 -1
  81. package/esm/LinearBareDisplay/model.d.ts +1 -1
  82. package/esm/LinearBasicDisplay/index.js +1 -0
  83. package/esm/LinearBasicDisplay/index.js.map +1 -1
  84. package/esm/LinearBasicDisplay/model.d.ts +1 -4
  85. package/esm/LinearGenomeView/components/ImportForm.js +5 -1
  86. package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
  87. package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +1 -2
  88. package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -1
  89. package/esm/LinearGenomeView/components/Ruler.d.ts +2 -18
  90. package/esm/LinearGenomeView/components/Ruler.js +6 -22
  91. package/esm/LinearGenomeView/components/Ruler.js.map +1 -1
  92. package/esm/LinearGenomeView/components/SearchBox.js +4 -0
  93. package/esm/LinearGenomeView/components/SearchBox.js.map +1 -1
  94. package/esm/LinearGenomeView/index.js +1 -0
  95. package/esm/LinearGenomeView/index.js.map +1 -1
  96. package/esm/index.d.ts +5 -5
  97. package/esm/index.js +3 -2
  98. package/esm/index.js.map +1 -1
  99. package/package.json +4 -5
  100. package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +86 -84
  101. package/src/BaseLinearDisplay/components/Block.tsx +15 -11
  102. package/src/BaseLinearDisplay/components/BlockMsg.tsx +9 -9
  103. package/src/BaseLinearDisplay/components/LinearBlocks.tsx +62 -58
  104. package/src/BaseLinearDisplay/{models → components}/TooLargeMessage.tsx +0 -0
  105. package/src/BaseLinearDisplay/index.ts +2 -1
  106. package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +4 -3
  107. package/src/BaseLinearDisplay/models/{baseLinearDisplayConfigSchema.ts → configSchema.ts} +5 -3
  108. package/src/BaseLinearDisplay/models/util.ts +24 -0
  109. package/src/FeatureTrack/index.ts +5 -8
  110. package/src/LinearBareDisplay/index.ts +4 -2
  111. package/src/LinearBasicDisplay/index.ts +1 -0
  112. package/src/LinearGenomeView/README.md +2 -1
  113. package/src/LinearGenomeView/components/ImportForm.tsx +3 -0
  114. package/src/LinearGenomeView/components/LinearGenomeView.test.tsx +132 -134
  115. package/src/LinearGenomeView/components/LinearGenomeViewSvg.tsx +1 -2
  116. package/src/LinearGenomeView/components/Ruler.tsx +11 -28
  117. package/src/LinearGenomeView/components/SearchBox.tsx +2 -0
  118. package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.tsx.snap +2 -5
  119. package/src/LinearGenomeView/index.ts +1 -0
  120. package/src/index.ts +3 -0
  121. package/dist/BaseLinearDisplay/models/TooLargeMessage.js.map +0 -1
  122. package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +0 -1
  123. package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +0 -1
  124. package/esm/BaseLinearDisplay/models/TooLargeMessage.js.map +0 -1
  125. package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +0 -1
  126. package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-linear-genome-view",
3
- "version": "2.2.2",
3
+ "version": "2.3.1",
4
4
  "description": "JBrowse 2 linear genome view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -47,6 +47,7 @@
47
47
  "file-saver": "^2.0.0",
48
48
  "material-ui-popup-state": "^3.0.0",
49
49
  "normalize-wheel": "^1.0.1",
50
+ "react-error-boundary": "^3.0.0",
50
51
  "react-popper": "^2.0.0"
51
52
  },
52
53
  "peerDependencies": {
@@ -55,15 +56,13 @@
55
56
  "mobx": "^6.0.0",
56
57
  "mobx-react": "^7.0.0",
57
58
  "mobx-state-tree": "^5.0.0",
58
- "prop-types": "^15.0.0",
59
59
  "react": ">=16.8.0",
60
60
  "react-dom": ">=16.8.0",
61
- "react-error-boundary": "^3.0.0",
62
- "tss-react": "^3.0.0"
61
+ "tss-react": "^4.0.0"
63
62
  },
64
63
  "publishConfig": {
65
64
  "access": "public"
66
65
  },
67
66
  "module": "esm/index.js",
68
- "gitHead": "abbc00e8feedbc58de84a7a3e735ec0224909b29"
67
+ "gitHead": "75c4cba2f50c626c62881abd5851dbf2435c2401"
69
68
  }
@@ -7,6 +7,7 @@ import { Menu } from '@jbrowse/core/ui'
7
7
 
8
8
  // locals
9
9
  import Tooltip from './Tooltip'
10
+ import BlockMsg from './BlockMsg'
10
11
  import LinearBlocks from './LinearBlocks'
11
12
  import { BaseLinearDisplayModel } from '../models/BaseLinearDisplayModel'
12
13
 
@@ -21,94 +22,95 @@ const useStyles = makeStyles()({
21
22
  })
22
23
 
23
24
  type Coord = [number, number]
24
- const BaseLinearDisplay = observer(
25
- (props: { model: BaseLinearDisplayModel; children?: React.ReactNode }) => {
26
- const { classes } = useStyles()
27
- const theme = useTheme()
28
- const ref = useRef<HTMLDivElement>(null)
29
- const [clientRect, setClientRect] = useState<DOMRect>()
30
- const [offsetMouseCoord, setOffsetMouseCoord] = useState<Coord>([0, 0])
31
- const [clientMouseCoord, setClientMouseCoord] = useState<Coord>([0, 0])
32
- const [contextCoord, setContextCoord] = useState<Coord>()
33
- const { model, children } = props
34
- const {
35
- TooltipComponent,
36
- DisplayMessageComponent,
37
- contextMenuItems,
38
- height,
39
- setContextMenuFeature,
40
- } = model
25
+ const BaseLinearDisplay = observer(function (props: {
26
+ model: BaseLinearDisplayModel
27
+ children?: React.ReactNode
28
+ }) {
29
+ const { classes } = useStyles()
30
+ const theme = useTheme()
31
+ const ref = useRef<HTMLDivElement>(null)
32
+ const [clientRect, setClientRect] = useState<DOMRect>()
33
+ const [offsetMouseCoord, setOffsetMouseCoord] = useState<Coord>([0, 0])
34
+ const [clientMouseCoord, setClientMouseCoord] = useState<Coord>([0, 0])
35
+ const [contextCoord, setContextCoord] = useState<Coord>()
36
+ const { model, children } = props
37
+ const {
38
+ TooltipComponent,
39
+ DisplayMessageComponent,
40
+ contextMenuItems,
41
+ height,
42
+ setContextMenuFeature,
43
+ } = model
41
44
 
42
- return (
43
- <div
44
- ref={ref}
45
- data-testid={`display-${getConf(model, 'displayId')}`}
46
- className={classes.display}
47
- onContextMenu={event => {
48
- event.preventDefault()
49
- if (contextCoord) {
50
- // There's already a context menu open, so close it
51
- setContextCoord(undefined)
52
- } else if (ref.current) {
53
- setContextCoord([event.clientX, event.clientY])
54
- }
55
- }}
56
- onMouseMove={event => {
57
- if (!ref.current) {
58
- return
59
- }
60
- const rect = ref.current.getBoundingClientRect()
61
- const { left, top } = rect
62
- setOffsetMouseCoord([event.clientX - left, event.clientY - top])
63
- setClientMouseCoord([event.clientX, event.clientY])
64
- setClientRect(rect)
65
- }}
66
- >
67
- {DisplayMessageComponent ? (
68
- <DisplayMessageComponent model={model} />
69
- ) : (
70
- <LinearBlocks {...props} />
71
- )}
72
- {children}
45
+ return (
46
+ <div
47
+ ref={ref}
48
+ data-testid={`display-${getConf(model, 'displayId')}`}
49
+ className={classes.display}
50
+ onContextMenu={event => {
51
+ event.preventDefault()
52
+ if (contextCoord) {
53
+ // There's already a context menu open, so close it
54
+ setContextCoord(undefined)
55
+ } else if (ref.current) {
56
+ setContextCoord([event.clientX, event.clientY])
57
+ }
58
+ }}
59
+ onMouseMove={event => {
60
+ if (!ref.current) {
61
+ return
62
+ }
63
+ const rect = ref.current.getBoundingClientRect()
64
+ const { left, top } = rect
65
+ setOffsetMouseCoord([event.clientX - left, event.clientY - top])
66
+ setClientMouseCoord([event.clientX, event.clientY])
67
+ setClientRect(rect)
68
+ }}
69
+ >
70
+ {DisplayMessageComponent ? (
71
+ <DisplayMessageComponent model={model} />
72
+ ) : (
73
+ <LinearBlocks {...props} />
74
+ )}
75
+ {children}
73
76
 
74
- <TooltipComponent
75
- model={model}
76
- height={height}
77
- offsetMouseCoord={offsetMouseCoord}
78
- clientMouseCoord={clientMouseCoord}
79
- clientRect={clientRect}
80
- mouseCoord={offsetMouseCoord}
81
- />
77
+ <TooltipComponent
78
+ model={model}
79
+ height={height}
80
+ offsetMouseCoord={offsetMouseCoord}
81
+ clientMouseCoord={clientMouseCoord}
82
+ clientRect={clientRect}
83
+ mouseCoord={offsetMouseCoord}
84
+ />
82
85
 
83
- <Menu
84
- open={Boolean(contextCoord) && Boolean(contextMenuItems().length)}
85
- onMenuItemClick={(_, callback) => {
86
- callback()
87
- setContextCoord(undefined)
88
- }}
89
- onClose={() => {
86
+ <Menu
87
+ open={Boolean(contextCoord) && Boolean(contextMenuItems().length)}
88
+ onMenuItemClick={(_, callback) => {
89
+ callback()
90
+ setContextCoord(undefined)
91
+ }}
92
+ onClose={() => {
93
+ setContextCoord(undefined)
94
+ setContextMenuFeature(undefined)
95
+ }}
96
+ TransitionProps={{
97
+ onExit: () => {
90
98
  setContextCoord(undefined)
91
99
  setContextMenuFeature(undefined)
92
- }}
93
- TransitionProps={{
94
- onExit: () => {
95
- setContextCoord(undefined)
96
- setContextMenuFeature(undefined)
97
- },
98
- }}
99
- anchorReference="anchorPosition"
100
- anchorPosition={
101
- contextCoord
102
- ? { top: contextCoord[1], left: contextCoord[0] }
103
- : undefined
104
- }
105
- style={{ zIndex: theme.zIndex.tooltip }}
106
- menuItems={contextMenuItems()}
107
- />
108
- </div>
109
- )
110
- },
111
- )
100
+ },
101
+ }}
102
+ anchorReference="anchorPosition"
103
+ anchorPosition={
104
+ contextCoord
105
+ ? { top: contextCoord[1], left: contextCoord[0] }
106
+ : undefined
107
+ }
108
+ style={{ zIndex: theme.zIndex.tooltip }}
109
+ menuItems={contextMenuItems()}
110
+ />
111
+ </div>
112
+ )
113
+ })
112
114
 
113
115
  export default BaseLinearDisplay
114
- export { Tooltip }
116
+ export { Tooltip, BlockMsg }
@@ -28,17 +28,21 @@ const useStyles = makeStyles()(theme => ({
28
28
  },
29
29
  }))
30
30
 
31
- const ContentBlock = observer(
32
- ({ block, children }: { block: BaseBlock; children: React.ReactNode }) => {
33
- const { classes } = useStyles()
34
- const { widthPx } = block
35
- return (
36
- <div style={{ width: widthPx }} className={classes.contentBlock}>
37
- {children}
38
- </div>
39
- )
40
- },
41
- )
31
+ const ContentBlock = observer(function ({
32
+ block,
33
+ children,
34
+ }: {
35
+ block: BaseBlock
36
+ children: React.ReactNode
37
+ }) {
38
+ const { classes } = useStyles()
39
+ const { widthPx } = block
40
+ return (
41
+ <div style={{ width: widthPx }} className={classes.contentBlock}>
42
+ {children}
43
+ </div>
44
+ )
45
+ })
42
46
 
43
47
  function ElidedBlock({ width }: { width: number }) {
44
48
  const { classes } = useStyles()
@@ -29,14 +29,14 @@ export default function BlockMsg({
29
29
  </Button>
30
30
  ) : null
31
31
  return (
32
- <Tooltip title={message}>
33
- <Alert
34
- severity={severity}
35
- action={button}
36
- classes={{ message: classes.ellipses }}
37
- >
38
- {message}
39
- </Alert>
40
- </Tooltip>
32
+ <Alert
33
+ severity={severity}
34
+ action={button}
35
+ classes={{ message: classes.ellipses }}
36
+ >
37
+ <Tooltip title={message}>
38
+ <div>{message}</div>
39
+ </Tooltip>
40
+ </Alert>
41
41
  )
42
42
  }
@@ -16,6 +16,8 @@ import {
16
16
  } from './Block'
17
17
  import { LinearGenomeViewModel } from '../../LinearGenomeView'
18
18
 
19
+ type LGV = LinearGenomeViewModel
20
+
19
21
  const useStyles = makeStyles()({
20
22
  linearBlocks: {
21
23
  whiteSpace: 'nowrap',
@@ -37,70 +39,72 @@ const useStyles = makeStyles()({
37
39
  boxSizing: 'border-box',
38
40
  },
39
41
  })
40
- const RenderedBlocks = observer(
41
- ({ model }: { model: BaseLinearDisplayModel }) => {
42
- const { classes } = useStyles()
43
- const { blockDefinitions, blockState } = model
44
- return (
45
- <>
46
- {blockDefinitions.map(block => {
47
- if (block instanceof ContentBlock) {
48
- const state = blockState.get(block.key)
49
42
 
50
- return (
51
- <ContentBlockComponent
52
- block={block}
53
- key={`${model.id}-${block.key}`}
54
- >
55
- {state && state.ReactComponent ? (
56
- <state.ReactComponent model={state} />
57
- ) : null}
58
- {state && state.maxHeightReached ? (
59
- <div
60
- className={classes.heightOverflowed}
61
- style={{
62
- top: state.layout.getTotalHeight() - 16,
63
- pointerEvents: 'none',
64
- height: 16,
65
- }}
66
- >
67
- Max height reached
68
- </div>
69
- ) : null}
70
- </ContentBlockComponent>
71
- )
72
- }
73
- if (block instanceof ElidedBlock) {
74
- return (
75
- <ElidedBlockComponent
76
- key={`${model.id}-${block.key}`}
77
- width={block.widthPx}
78
- />
79
- )
80
- }
81
- if (block instanceof InterRegionPaddingBlock) {
82
- return (
83
- <InterRegionPaddingBlockComponent
84
- key={block.key}
85
- width={block.widthPx}
86
- style={{ background: 'none' }}
87
- boundary={block.variant === 'boundary'}
88
- />
89
- )
90
- }
91
- throw new Error(`invalid block type ${typeof block}`)
92
- })}
93
- </>
94
- )
95
- },
96
- )
43
+ const RenderedBlocks = observer(function ({
44
+ model,
45
+ }: {
46
+ model: BaseLinearDisplayModel
47
+ }) {
48
+ const { classes } = useStyles()
49
+ const { blockDefinitions, blockState } = model
50
+ return (
51
+ <>
52
+ {blockDefinitions.map(block => {
53
+ if (block instanceof ContentBlock) {
54
+ const state = blockState.get(block.key)
55
+
56
+ return (
57
+ <ContentBlockComponent
58
+ block={block}
59
+ key={`${model.id}-${block.key}`}
60
+ >
61
+ {state && state.ReactComponent ? (
62
+ <state.ReactComponent model={state} />
63
+ ) : null}
64
+ {state && state.maxHeightReached ? (
65
+ <div
66
+ className={classes.heightOverflowed}
67
+ style={{
68
+ top: state.layout.getTotalHeight() - 16,
69
+ pointerEvents: 'none',
70
+ height: 16,
71
+ }}
72
+ >
73
+ Max height reached
74
+ </div>
75
+ ) : null}
76
+ </ContentBlockComponent>
77
+ )
78
+ }
79
+ if (block instanceof ElidedBlock) {
80
+ return (
81
+ <ElidedBlockComponent
82
+ key={`${model.id}-${block.key}`}
83
+ width={block.widthPx}
84
+ />
85
+ )
86
+ }
87
+ if (block instanceof InterRegionPaddingBlock) {
88
+ return (
89
+ <InterRegionPaddingBlockComponent
90
+ key={block.key}
91
+ width={block.widthPx}
92
+ style={{ background: 'none' }}
93
+ boundary={block.variant === 'boundary'}
94
+ />
95
+ )
96
+ }
97
+ throw new Error(`invalid block type ${typeof block}`)
98
+ })}
99
+ </>
100
+ )
101
+ })
97
102
  function LinearBlocks({ model }: { model: BaseLinearDisplayModel }) {
98
103
  const { classes } = useStyles()
99
104
  const { blockDefinitions } = model
100
- const viewModel = getContainingView(model) as LinearGenomeViewModel
105
+ const viewModel = getContainingView(model) as LGV
101
106
  return (
102
107
  <div
103
- data-testid="Blockset"
104
108
  className={classes.linearBlocks}
105
109
  style={{
106
110
  left: blockDefinitions.offsetPx - viewModel.offsetPx,
@@ -1,4 +1,4 @@
1
- export { baseLinearDisplayConfigSchema } from './models/baseLinearDisplayConfigSchema'
1
+ export { default as baseLinearDisplayConfigSchema } from './models/configSchema'
2
2
  export { BaseLinearDisplay } from './models/BaseLinearDisplayModel'
3
3
  export type { BlockModel } from './models/serverSideRenderedBlock'
4
4
  export type {
@@ -8,4 +8,5 @@ export type {
8
8
  export {
9
9
  default as BaseLinearDisplayComponent,
10
10
  Tooltip,
11
+ BlockMsg,
11
12
  } from './components/BaseLinearDisplay'
@@ -11,12 +11,13 @@ import {
11
11
  getViewParams,
12
12
  isSelectionContainer,
13
13
  isSessionModelWithWidgets,
14
+ isFeature,
15
+ Feature,
14
16
  } from '@jbrowse/core/util'
15
17
  import { Stats } from '@jbrowse/core/data_adapters/BaseAdapter'
16
18
  import { BaseBlock } from '@jbrowse/core/util/blockTypes'
17
19
  import { Region } from '@jbrowse/core/util/types'
18
20
  import CompositeMap from '@jbrowse/core/util/compositeMap'
19
- import { Feature, isFeature } from '@jbrowse/core/util/simpleFeature'
20
21
  import {
21
22
  getParentRenderProps,
22
23
  getRpcSessionId,
@@ -28,9 +29,9 @@ import { addDisposer, isAlive, types, Instance } from 'mobx-state-tree'
28
29
  import MenuOpenIcon from '@mui/icons-material/MenuOpen'
29
30
 
30
31
  // locals
31
- import TooLargeMessage from './TooLargeMessage'
32
32
  import { LinearGenomeViewModel, ExportSvgOptions } from '../../LinearGenomeView'
33
33
  import { Tooltip } from '../components/BaseLinearDisplay'
34
+ import TooLargeMessage from '../components/TooLargeMessage'
34
35
  import BlockState, { renderBlockData } from './serverSideRenderedBlock'
35
36
 
36
37
  type LGV = LinearGenomeViewModel
@@ -104,10 +105,10 @@ function stateModelFactory() {
104
105
  )
105
106
  .volatile(() => ({
106
107
  currBpPerPx: 0,
108
+ scrollTop: 0,
107
109
  message: '',
108
110
  featureIdUnderMouse: undefined as undefined | string,
109
111
  contextMenuFeature: undefined as undefined | Feature,
110
- scrollTop: 0,
111
112
  estimatedRegionStatsP: undefined as undefined | Promise<Stats>,
112
113
  estimatedRegionStats: undefined as undefined | Stats,
113
114
  }))
@@ -2,13 +2,13 @@ import { ConfigurationSchema } from '@jbrowse/core/configuration'
2
2
 
3
3
  /**
4
4
  * #config BaseLinearDisplay
5
- * BaseLinearDisplay is a "base" config that is extended by classes like
6
- * "LinearBasicDisplay" (used for feature tracks, etc) and "LinearBareDisplay"
5
+ * `BaseLinearDisplay` is a "base" config that is extended by classes like
6
+ * `LinearBasicDisplay` (used for feature tracks, etc) and `LinearBareDisplay`
7
7
  * (more stripped down than even the basic display, not commonly used)
8
8
  */
9
9
  function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars
10
10
 
11
- export const baseLinearDisplayConfigSchema = ConfigurationSchema(
11
+ const baseLinearDisplayConfigSchema = ConfigurationSchema(
12
12
  'BaseLinearDisplay',
13
13
  {
14
14
  /**
@@ -37,3 +37,5 @@ export const baseLinearDisplayConfigSchema = ConfigurationSchema(
37
37
  explicitIdentifier: 'displayId',
38
38
  },
39
39
  )
40
+
41
+ export default baseLinearDisplayConfigSchema
@@ -0,0 +1,24 @@
1
+ export interface RenderProps {
2
+ rendererType: any // eslint-disable-line @typescript-eslint/no-explicit-any
3
+ renderArgs: { [key: string]: any } // eslint-disable-line @typescript-eslint/no-explicit-any
4
+ renderProps: { [key: string]: any } // eslint-disable-line @typescript-eslint/no-explicit-any
5
+ displayError: unknown
6
+ rpcManager: { call: Function }
7
+ cannotBeRenderedReason: string
8
+ }
9
+
10
+ export interface ErrorProps {
11
+ displayError: string
12
+ }
13
+
14
+ export function getDisplayStr(totalBytes: number) {
15
+ let displayBp
16
+ if (Math.floor(totalBytes / 1000000) > 0) {
17
+ displayBp = `${parseFloat((totalBytes / 1000000).toPrecision(3))} Mb`
18
+ } else if (Math.floor(totalBytes / 1000) > 0) {
19
+ displayBp = `${parseFloat((totalBytes / 1000).toPrecision(3))} Kb`
20
+ } else {
21
+ displayBp = `${Math.floor(totalBytes)} bytes`
22
+ }
23
+ return displayBp
24
+ }
@@ -5,17 +5,14 @@ import {
5
5
  import PluginManager from '@jbrowse/core/PluginManager'
6
6
  import configSchemaF from './configSchema'
7
7
 
8
- export default (pluginManager: PluginManager) => {
9
- pluginManager.addTrackType(() => {
10
- const configSchema = configSchemaF(pluginManager)
8
+ export default (pm: PluginManager) => {
9
+ pm.addTrackType(() => {
10
+ const configSchema = configSchemaF(pm)
11
11
  return new TrackType({
12
12
  name: 'FeatureTrack',
13
+ displayName: 'Feature track',
13
14
  configSchema,
14
- stateModel: createBaseTrackModel(
15
- pluginManager,
16
- 'FeatureTrack',
17
- configSchema,
18
- ),
15
+ stateModel: createBaseTrackModel(pm, 'FeatureTrack', configSchema),
19
16
  })
20
17
  })
21
18
  }
@@ -1,8 +1,10 @@
1
- import { DisplayType } from '@jbrowse/core/pluggableElementTypes'
2
1
  import PluginManager from '@jbrowse/core/PluginManager'
3
- import { BaseLinearDisplayComponent } from '../BaseLinearDisplay'
2
+ import { DisplayType } from '@jbrowse/core/pluggableElementTypes'
3
+
4
+ // locals
4
5
  import { configSchemaFactory } from './configSchema'
5
6
  import { stateModelFactory } from './model'
7
+ import { BaseLinearDisplayComponent } from '../BaseLinearDisplay/'
6
8
 
7
9
  export default (pluginManager: PluginManager) => {
8
10
  pluginManager.addDisplayType(() => {
@@ -11,6 +11,7 @@ export default (pluginManager: PluginManager) => {
11
11
  const config = configSchema(pluginManager)
12
12
  return new DisplayType({
13
13
  name: 'LinearBasicDisplay',
14
+ displayName: 'Basic deature display',
14
15
  configSchema: config,
15
16
  stateModel: modelFactory(config),
16
17
  trackType: 'FeatureTrack',
@@ -1,6 +1,7 @@
1
1
  # Key LinearGenomeView state fields
2
2
 
3
- - displayedRegions - array of { refName, start, end }, tiled in the display left to right
3
+ - displayedRegions - array of { refName, start, end }, tiled in the display left
4
+ to right
4
5
  - offsetPx - the offset in px of the left edge of the view
5
6
  - bpPerPx - ratio of basepairs to screen pixels
6
7
  - width - width in px of the view
@@ -82,6 +82,8 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
82
82
  try {
83
83
  if (option?.getDisplayString() === input && option.hasLocation()) {
84
84
  await navToOption(option)
85
+ } else if (option?.results?.length) {
86
+ model.setSearchResults(option.results, option.getLabel())
85
87
  } else {
86
88
  const [ref, rest] = splitLast(input, ':')
87
89
  const allRefs = assembly?.allRefNamesWithLowerCase || []
@@ -144,6 +146,7 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
144
146
  setSelectedAsm(val)
145
147
  setValue('')
146
148
  }}
149
+ localStorageKey="lgv"
147
150
  session={session}
148
151
  selected={selectedAsm}
149
152
  />