@apollo-annotation/jbrowse-plugin-apollo 0.3.4 → 0.3.6

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 (131) hide show
  1. package/dist/index.esm.js +5466 -4490
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/jbrowse-plugin-apollo.cjs.development.js +5283 -4318
  4. package/dist/jbrowse-plugin-apollo.cjs.development.js.map +1 -1
  5. package/dist/jbrowse-plugin-apollo.cjs.production.min.js +1 -1
  6. package/dist/jbrowse-plugin-apollo.cjs.production.min.js.map +1 -1
  7. package/dist/jbrowse-plugin-apollo.umd.development.js +6806 -4088
  8. package/dist/jbrowse-plugin-apollo.umd.development.js.map +1 -1
  9. package/dist/jbrowse-plugin-apollo.umd.production.min.js +1 -1
  10. package/dist/jbrowse-plugin-apollo.umd.production.min.js.map +1 -1
  11. package/package.json +4 -4
  12. package/src/ApolloInternetAccount/addMenuItems.ts +5 -2
  13. package/src/ApolloInternetAccount/components/AuthTypeSelector.tsx +1 -0
  14. package/src/ApolloInternetAccount/components/LoginButtons.tsx +1 -1
  15. package/src/ApolloInternetAccount/components/LoginIcons.tsx +1 -1
  16. package/src/ApolloInternetAccount/configSchema.ts +1 -1
  17. package/src/ApolloInternetAccount/model.ts +11 -10
  18. package/src/ApolloJobModel.ts +1 -1
  19. package/src/ApolloRefNameAliasAdapter/ApolloRefNameAliasAdapter.ts +8 -6
  20. package/src/ApolloRefNameAliasAdapter/index.ts +2 -2
  21. package/src/ApolloSequenceAdapter/ApolloSequenceAdapter.ts +17 -4
  22. package/src/ApolloSequenceAdapter/index.ts +1 -1
  23. package/src/ApolloTextSearchAdapter/ApolloTextSearchAdapter.ts +8 -7
  24. package/src/ApolloTextSearchAdapter/index.ts +1 -1
  25. package/src/BackendDrivers/BackendDriver.ts +7 -7
  26. package/src/BackendDrivers/CollaborationServerDriver.ts +14 -10
  27. package/src/BackendDrivers/DesktopFileDriver.ts +11 -10
  28. package/src/BackendDrivers/InMemoryFileDriver.ts +10 -6
  29. package/src/ChangeManager.ts +5 -5
  30. package/src/FeatureDetailsWidget/ApolloFeatureDetailsWidget.tsx +92 -20
  31. package/src/FeatureDetailsWidget/ApolloTranscriptDetailsWidget.tsx +170 -27
  32. package/src/FeatureDetailsWidget/AttributeKey.tsx +50 -0
  33. package/src/FeatureDetailsWidget/AttributeKeySelector.tsx +104 -0
  34. package/src/FeatureDetailsWidget/Attributes.tsx +213 -320
  35. package/src/FeatureDetailsWidget/BasicInformation.tsx +8 -9
  36. package/src/FeatureDetailsWidget/DefaultAttributeEditor.tsx +104 -0
  37. package/src/FeatureDetailsWidget/DefaultAttributeViewer.tsx +22 -0
  38. package/src/FeatureDetailsWidget/FeatureDetailsNavigation.tsx +10 -8
  39. package/src/FeatureDetailsWidget/NumberTextField.tsx +1 -1
  40. package/src/FeatureDetailsWidget/Sequence.tsx +18 -35
  41. package/src/FeatureDetailsWidget/StringTextField.tsx +1 -1
  42. package/src/FeatureDetailsWidget/TranscriptSequence.tsx +140 -95
  43. package/src/FeatureDetailsWidget/TranscriptWidgetEditLocation.tsx +600 -0
  44. package/src/FeatureDetailsWidget/TranscriptWidgetSummary.tsx +54 -0
  45. package/src/FeatureDetailsWidget/model.ts +8 -3
  46. package/src/LinearApolloDisplay/components/LinearApolloDisplay.tsx +19 -12
  47. package/src/LinearApolloDisplay/glyphs/BoxGlyph.ts +19 -41
  48. package/src/LinearApolloDisplay/glyphs/GeneGlyph.ts +44 -22
  49. package/src/LinearApolloDisplay/glyphs/GenericChildGlyph.ts +6 -5
  50. package/src/LinearApolloDisplay/glyphs/Glyph.ts +7 -7
  51. package/src/LinearApolloDisplay/stateModel/base.ts +52 -10
  52. package/src/LinearApolloDisplay/stateModel/index.ts +4 -3
  53. package/src/LinearApolloDisplay/stateModel/layouts.ts +8 -34
  54. package/src/LinearApolloDisplay/stateModel/mouseEvents.ts +13 -12
  55. package/src/LinearApolloDisplay/stateModel/rendering.ts +63 -31
  56. package/src/LinearApolloSixFrameDisplay/components/LinearApolloSixFrameDisplay.tsx +221 -0
  57. package/src/LinearApolloSixFrameDisplay/components/TrackLines.tsx +40 -0
  58. package/src/LinearApolloSixFrameDisplay/components/index.ts +2 -0
  59. package/src/LinearApolloSixFrameDisplay/configSchema.ts +7 -0
  60. package/src/LinearApolloSixFrameDisplay/glyphs/GeneGlyph.ts +821 -0
  61. package/src/LinearApolloSixFrameDisplay/glyphs/Glyph.ts +63 -0
  62. package/src/LinearApolloSixFrameDisplay/glyphs/index.ts +1 -0
  63. package/src/LinearApolloSixFrameDisplay/index.ts +2 -0
  64. package/src/LinearApolloSixFrameDisplay/stateModel/base.ts +261 -0
  65. package/src/LinearApolloSixFrameDisplay/stateModel/index.ts +27 -0
  66. package/src/LinearApolloSixFrameDisplay/stateModel/layouts.ts +236 -0
  67. package/src/LinearApolloSixFrameDisplay/stateModel/mouseEvents.ts +349 -0
  68. package/src/LinearApolloSixFrameDisplay/stateModel/rendering.ts +199 -0
  69. package/src/LinearApolloSixFrameDisplay/types.ts +1 -0
  70. package/src/OntologyManager/OntologyStore/fulltext-stopwords.ts +10 -1
  71. package/src/OntologyManager/OntologyStore/fulltext.test.ts +1 -1
  72. package/src/OntologyManager/OntologyStore/fulltext.ts +8 -3
  73. package/src/OntologyManager/OntologyStore/index.test.ts +4 -1
  74. package/src/OntologyManager/OntologyStore/index.ts +19 -14
  75. package/src/OntologyManager/OntologyStore/indexeddb-schema.ts +6 -5
  76. package/src/OntologyManager/OntologyStore/indexeddb-storage.ts +11 -5
  77. package/src/OntologyManager/index.ts +10 -6
  78. package/src/OntologyManager/util.ts +3 -2
  79. package/src/TabularEditor/HybridGrid/ChangeHandling.ts +2 -2
  80. package/src/TabularEditor/HybridGrid/Feature.tsx +9 -8
  81. package/src/TabularEditor/HybridGrid/FeatureAttributes.tsx +1 -1
  82. package/src/TabularEditor/HybridGrid/HybridGrid.tsx +3 -2
  83. package/src/TabularEditor/HybridGrid/NumberCell.tsx +8 -1
  84. package/src/TabularEditor/HybridGrid/ToolBar.tsx +15 -13
  85. package/src/TabularEditor/HybridGrid/featureContextMenuItems.ts +9 -33
  86. package/src/TabularEditor/TabularEditorPane.tsx +1 -1
  87. package/src/TabularEditor/model.ts +2 -2
  88. package/src/TabularEditor/types.ts +5 -2
  89. package/src/components/AddAssembly.tsx +611 -291
  90. package/src/components/AddChildFeature.tsx +6 -5
  91. package/src/components/AddFeature.tsx +211 -38
  92. package/src/components/AddRefSeqAliases.tsx +14 -12
  93. package/src/components/CopyFeature.tsx +8 -7
  94. package/src/components/CreateApolloAnnotation.tsx +154 -46
  95. package/src/components/DeleteAssembly.tsx +9 -8
  96. package/src/components/DeleteFeature.tsx +5 -4
  97. package/src/components/Dialog.tsx +1 -1
  98. package/src/components/DownloadGFF3.tsx +11 -10
  99. package/src/components/FilterFeatures.tsx +6 -4
  100. package/src/components/ImportFeatures.tsx +7 -6
  101. package/src/components/LogOut.tsx +5 -4
  102. package/src/components/ManageChecks.tsx +9 -8
  103. package/src/components/ManageUsers.tsx +11 -10
  104. package/src/components/OntologyTermAutocomplete.tsx +5 -5
  105. package/src/components/OntologyTermMultiSelect.tsx +9 -6
  106. package/src/components/OpenLocalFile.tsx +4 -3
  107. package/src/components/ViewChangeLog.tsx +7 -6
  108. package/src/components/ViewCheckResults.tsx +8 -7
  109. package/src/components/index.ts +0 -1
  110. package/src/extensions/annotationFromJBrowseFeature.test.ts +1 -0
  111. package/src/extensions/annotationFromJBrowseFeature.ts +14 -12
  112. package/src/extensions/annotationFromPileup.ts +6 -6
  113. package/src/index.ts +33 -50
  114. package/src/makeDisplayComponent.tsx +93 -41
  115. package/src/session/ClientDataStore.ts +21 -17
  116. package/src/session/session.ts +20 -26
  117. package/src/types.ts +4 -4
  118. package/src/util/annotationFeatureUtils.ts +53 -0
  119. package/src/util/index.ts +4 -3
  120. package/src/util/loadAssemblyIntoClient.ts +10 -3
  121. package/src/ApolloSixFrameRenderer/ApolloSixFrameRenderer.tsx +0 -13
  122. package/src/ApolloSixFrameRenderer/components/ApolloRendering.tsx +0 -707
  123. package/src/ApolloSixFrameRenderer/configSchema.ts +0 -7
  124. package/src/ApolloSixFrameRenderer/index.ts +0 -3
  125. package/src/FeatureDetailsWidget/TranscriptBasic.tsx +0 -200
  126. package/src/SixFrameFeatureDisplay/components/TrackLines.tsx +0 -19
  127. package/src/SixFrameFeatureDisplay/components/index.ts +0 -1
  128. package/src/SixFrameFeatureDisplay/configSchema.ts +0 -21
  129. package/src/SixFrameFeatureDisplay/index.ts +0 -2
  130. package/src/SixFrameFeatureDisplay/stateModel.ts +0 -439
  131. package/src/components/ModifyFeatureAttribute.tsx +0 -460
@@ -13,22 +13,23 @@ import {
13
13
  DialogContentText,
14
14
  MenuItem,
15
15
  Select,
16
- SelectChangeEvent,
16
+ type SelectChangeEvent,
17
17
  } from '@mui/material'
18
18
  import {
19
19
  DataGrid,
20
- GridColDef,
21
- GridRowsProp,
20
+ type GridColDef,
21
+ type GridRowsProp,
22
22
  GridToolbar,
23
23
  } from '@mui/x-data-grid'
24
24
  import { getRoot } from 'mobx-state-tree'
25
25
  import React, { useEffect, useState } from 'react'
26
26
  import { makeStyles } from 'tss-react/mui'
27
27
 
28
- import { ApolloInternetAccountModel } from '../ApolloInternetAccount/model'
29
- import { ApolloSessionModel } from '../session'
30
- import { ApolloRootModel } from '../types'
28
+ import { type ApolloInternetAccountModel } from '../ApolloInternetAccount/model'
29
+ import { type ApolloSessionModel } from '../session'
30
+ import { type ApolloRootModel } from '../types'
31
31
  import { createFetchErrorMessage } from '../util'
32
+
32
33
  import { Dialog } from './Dialog'
33
34
 
34
35
  interface ViewChangeLogProps {
@@ -4,7 +4,7 @@
4
4
  /* eslint-disable @typescript-eslint/no-unsafe-argument */
5
5
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
6
6
  /* eslint-disable @typescript-eslint/no-unsafe-return */
7
- import { Assembly } from '@jbrowse/core/assemblyManager/assembly'
7
+ import { type Assembly } from '@jbrowse/core/assemblyManager/assembly'
8
8
  import {
9
9
  Button,
10
10
  DialogActions,
@@ -12,21 +12,22 @@ import {
12
12
  DialogContentText,
13
13
  MenuItem,
14
14
  Select,
15
- SelectChangeEvent,
15
+ type SelectChangeEvent,
16
16
  } from '@mui/material'
17
17
  import {
18
18
  DataGrid,
19
- GridColDef,
20
- GridRowsProp,
19
+ type GridColDef,
20
+ type GridRowsProp,
21
21
  GridToolbar,
22
22
  } from '@mui/x-data-grid'
23
23
  import { getRoot } from 'mobx-state-tree'
24
24
  import React, { useEffect, useState } from 'react'
25
25
 
26
- import { ApolloInternetAccountModel } from '../ApolloInternetAccount/model'
27
- import { ApolloSessionModel } from '../session'
28
- import { ApolloRootModel } from '../types'
26
+ import { type ApolloInternetAccountModel } from '../ApolloInternetAccount/model'
27
+ import { type ApolloSessionModel } from '../session'
28
+ import { type ApolloRootModel } from '../types'
29
29
  import { createFetchErrorMessage } from '../util'
30
+
30
31
  import { Dialog } from './Dialog'
31
32
 
32
33
  interface ViewCheckResultsProps {
@@ -9,7 +9,6 @@ export * from './ImportFeatures'
9
9
  export * from './LogOut'
10
10
  export * from './ManageChecks'
11
11
  export * from './ManageUsers'
12
- export * from './ModifyFeatureAttribute'
13
12
  export * from './OpenLocalFile'
14
13
  export * from './ViewChangeLog'
15
14
  export * from './AddRefSeqAliases'
@@ -1,5 +1,6 @@
1
1
  import SimpleFeature from '@jbrowse/core/util/simpleFeature'
2
2
  import { describe, expect, it } from '@jest/globals'
3
+
3
4
  import { jbrowseFeatureToAnnotationFeature } from './annotationFromJBrowseFeature'
4
5
 
5
6
  describe('Convert JBrowse feature to annotation feature', () => {
@@ -3,26 +3,28 @@
3
3
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
4
4
  /* eslint-disable @typescript-eslint/no-unsafe-call */
5
5
  /* eslint-disable @typescript-eslint/no-unsafe-return */
6
- import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'
7
- import PluggableElementBase from '@jbrowse/core/pluggableElementTypes/PluggableElementBase'
8
- import AddIcon from '@mui/icons-material/Add'
6
+ import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
7
+ import { gff3ToAnnotationFeature } from '@apollo-annotation/shared'
8
+ import { type GFF3Feature } from '@gmod/gff'
9
+ import { type Assembly } from '@jbrowse/core/assemblyManager/assembly'
10
+ import type DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'
11
+ import type PluggableElementBase from '@jbrowse/core/pluggableElementTypes/PluggableElementBase'
9
12
  import {
10
- AbstractSessionModel,
13
+ type AbstractSessionModel,
11
14
  getContainingView,
12
15
  getSession,
13
16
  } from '@jbrowse/core/util'
14
- import { Assembly } from '@jbrowse/core/assemblyManager/assembly'
15
- import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
16
- import { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
17
- import { Feature } from '@jbrowse/core/util/simpleFeature'
17
+ import { type Feature } from '@jbrowse/core/util/simpleFeature'
18
+ import { type LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
19
+ import AddIcon from '@mui/icons-material/Add'
20
+
18
21
  import { CreateApolloAnnotation } from '../components/CreateApolloAnnotation'
19
- import { GFF3Feature } from '@gmod/gff'
20
- import { gff3ToAnnotationFeature } from '@apollo-annotation/shared'
21
22
 
22
23
  function simpleFeatureToGFF3Feature(
23
24
  feature: Feature,
24
25
  refSeqId: string,
25
26
  ): GFF3Feature {
27
+ // eslint-disable-next-line unicorn/prefer-structured-clone
26
28
  const xfeature = JSON.parse(JSON.stringify(feature))
27
29
  const children = xfeature.subfeatures
28
30
  const gff3Feature = [
@@ -130,11 +132,11 @@ export function annotationFromJBrowseFeature(
130
132
  }))
131
133
  .views((self) => {
132
134
  const superContextMenuItems = self.contextMenuItems
133
- const session = getSession(self)
134
- const assembly = self.getAssembly()
135
135
 
136
136
  return {
137
137
  contextMenuItems() {
138
+ const session = getSession(self)
139
+ const assembly = self.getAssembly()
138
140
  const feature = self.contextMenuFeature
139
141
  if (!feature) {
140
142
  return superContextMenuItems()
@@ -3,17 +3,17 @@
3
3
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
4
4
  /* eslint-disable @typescript-eslint/no-unsafe-call */
5
5
  /* eslint-disable @typescript-eslint/no-unsafe-return */
6
- import { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
6
+ import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
7
7
  import { AddFeatureChange } from '@apollo-annotation/shared'
8
- import { Assembly } from '@jbrowse/core/assemblyManager/assembly'
9
- import { DisplayType } from '@jbrowse/core/pluggableElementTypes'
10
- import PluggableElementBase from '@jbrowse/core/pluggableElementTypes/PluggableElementBase'
8
+ import { type Assembly } from '@jbrowse/core/assemblyManager/assembly'
9
+ import { type DisplayType } from '@jbrowse/core/pluggableElementTypes'
10
+ import type PluggableElementBase from '@jbrowse/core/pluggableElementTypes/PluggableElementBase'
11
11
  import { getContainingView, getSession } from '@jbrowse/core/util'
12
- import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
12
+ import { type LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
13
13
  import AddIcon from '@mui/icons-material/Add'
14
14
  import ObjectID from 'bson-objectid'
15
15
 
16
- import { ApolloSessionModel } from '../session'
16
+ import { type ApolloSessionModel } from '../session'
17
17
 
18
18
  function parseCigar(cigar: string): [string | undefined, number][] {
19
19
  return (cigar.toUpperCase().match(/\d+\D/g) ?? []).map((op) => {
package/src/index.ts CHANGED
@@ -9,41 +9,52 @@ import {
9
9
  changes,
10
10
  validationRegistry,
11
11
  } from '@apollo-annotation/shared'
12
+ import Plugin from '@jbrowse/core/Plugin'
13
+ import type PluginManager from '@jbrowse/core/PluginManager'
12
14
  import { ConfigurationSchema } from '@jbrowse/core/configuration'
13
15
  import {
14
16
  DisplayType,
15
17
  InternetAccountType,
16
- PluggableElementType,
18
+ type PluggableElementType,
17
19
  TrackType,
18
- ViewType,
20
+ type ViewType,
19
21
  WidgetType,
20
22
  createBaseTrackConfig,
21
23
  createBaseTrackModel,
22
24
  } from '@jbrowse/core/pluggableElementTypes'
23
- import Plugin from '@jbrowse/core/Plugin'
24
- import PluginManager from '@jbrowse/core/PluginManager'
25
25
  import {
26
- AbstractSessionModel,
27
- Region,
26
+ type AbstractSessionModel,
27
+ type Region,
28
28
  getSession,
29
29
  isAbstractMenuManager,
30
30
  } from '@jbrowse/core/util'
31
- import { LinearGenomeViewStateModel } from '@jbrowse/plugin-linear-genome-view'
31
+ import { type LinearGenomeViewStateModel } from '@jbrowse/plugin-linear-genome-view'
32
32
  import AddIcon from '@mui/icons-material/Add'
33
33
 
34
34
  import { version } from '../package.json'
35
+
35
36
  import {
36
37
  configSchema as apolloInternetAccountConfigSchema,
37
38
  modelFactory as apolloInternetAccountModelFactory,
38
39
  } from './ApolloInternetAccount'
40
+ import { installApolloRefNameAliasAdapter } from './ApolloRefNameAliasAdapter'
39
41
  import { installApolloSequenceAdapter } from './ApolloSequenceAdapter'
40
- import {
41
- ApolloSixFrameRenderer,
42
- ReactComponent as ApolloSixFrameRendererReactComponent,
43
- configSchema as apolloSixFrameRendererConfigSchema,
44
- } from './ApolloSixFrameRenderer'
45
42
  import { installApolloTextSearchAdapter } from './ApolloTextSearchAdapter'
46
- import { BackendDriver } from './BackendDrivers'
43
+ import { type BackendDriver } from './BackendDrivers'
44
+ import {
45
+ ApolloFeatureDetailsWidget,
46
+ ApolloFeatureDetailsWidgetModel,
47
+ ApolloTranscriptDetailsModel,
48
+ ApolloTranscriptDetailsWidget,
49
+ } from './FeatureDetailsWidget'
50
+ import {
51
+ configSchema as linearApolloDisplayConfigSchema,
52
+ stateModelFactory as LinearApolloDisplayStateModelFactory,
53
+ } from './LinearApolloDisplay'
54
+ import {
55
+ configSchema as linearApolloSixFrameDisplayConfigSchema,
56
+ stateModelFactory as LinearApolloSixFrameDisplayStateModelFactory,
57
+ } from './LinearApolloSixFrameDisplay'
47
58
  import {
48
59
  AddFeature,
49
60
  DownloadGFF3,
@@ -55,29 +66,14 @@ import {
55
66
  } from './components'
56
67
  import ApolloPluginConfigurationSchema from './config'
57
68
  import {
58
- annotationFromPileup,
59
69
  annotationFromJBrowseFeature,
70
+ annotationFromPileup,
60
71
  } from './extensions'
61
72
  import {
62
- ApolloFeatureDetailsWidget,
63
- ApolloFeatureDetailsWidgetModel,
64
- ApolloTranscriptDetailsModel,
65
- ApolloTranscriptDetailsWidget,
66
- } from './FeatureDetailsWidget'
67
- import {
68
- stateModelFactory as LinearApolloDisplayStateModelFactory,
69
- configSchema as linearApolloDisplayConfigSchema,
70
- } from './LinearApolloDisplay'
71
- import {
72
- DisplayComponent,
73
- makeSixFrameDisplayComponent,
73
+ LinearApolloDisplayComponent,
74
+ LinearApolloSixFrameDisplayComponent,
74
75
  } from './makeDisplayComponent'
75
- import { ApolloSessionModel, extendSession } from './session'
76
- import {
77
- stateModelFactory as SixFrameFeatureDisplayStateModelFactory,
78
- configSchemaFactory as sixFrameFeatureDisplayConfigSchemaFactory,
79
- } from './SixFrameFeatureDisplay'
80
- import { installApolloRefNameAliasAdapter } from './ApolloRefNameAliasAdapter'
76
+ import { type ApolloSessionModel, extendSession } from './session'
81
77
 
82
78
  interface RpcHandle {
83
79
  on(event: string, listener: (event: MessageEvent) => void): this
@@ -186,38 +182,25 @@ export default class ApolloPlugin extends Plugin {
186
182
  ),
187
183
  trackType: 'ApolloTrack',
188
184
  viewType: 'LinearGenomeView',
189
- ReactComponent: DisplayComponent,
185
+ ReactComponent: LinearApolloDisplayComponent,
190
186
  })
191
187
  })
192
188
 
193
189
  pluginManager.addDisplayType(() => {
194
- const configSchema =
195
- sixFrameFeatureDisplayConfigSchemaFactory(pluginManager)
196
- const SixFrameDisplayComponent =
197
- makeSixFrameDisplayComponent(pluginManager)
190
+ const configSchema = linearApolloSixFrameDisplayConfigSchema
198
191
  return new DisplayType({
199
- name: 'SixFrameFeatureDisplay',
192
+ name: 'LinearApolloSixFrameDisplay',
200
193
  configSchema,
201
- stateModel: SixFrameFeatureDisplayStateModelFactory(
194
+ stateModel: LinearApolloSixFrameDisplayStateModelFactory(
202
195
  pluginManager,
203
196
  configSchema,
204
197
  ),
205
198
  trackType: 'ApolloTrack',
206
199
  viewType: 'LinearGenomeView',
207
- ReactComponent: SixFrameDisplayComponent,
200
+ ReactComponent: LinearApolloSixFrameDisplayComponent,
208
201
  })
209
202
  })
210
203
 
211
- pluginManager.addRendererType(
212
- () =>
213
- new ApolloSixFrameRenderer({
214
- name: 'ApolloSixFrameRenderer',
215
- ReactComponent: ApolloSixFrameRendererReactComponent,
216
- configSchema: apolloSixFrameRendererConfigSchema,
217
- pluginManager,
218
- }),
219
- )
220
-
221
204
  pluginManager.addToExtensionPoint(
222
205
  'Core-extendSession',
223
206
  // @ts-expect-error not sure how to deal with snapshot model types
@@ -1,6 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/unbound-method */
2
- import PluginManager from '@jbrowse/core/PluginManager'
3
- import type LinearGenomeViewPlugin from '@jbrowse/plugin-linear-genome-view'
2
+ import { getSession } from '@jbrowse/core/util'
4
3
  import ExpandLessIcon from '@mui/icons-material/ExpandLess'
5
4
  import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
6
5
  import { Alert, Typography, alpha } from '@mui/material'
@@ -9,13 +8,11 @@ import React, { useCallback, useEffect, useRef } from 'react'
9
8
  import { makeStyles } from 'tss-react/mui'
10
9
 
11
10
  import { LinearApolloDisplay } from './LinearApolloDisplay/components'
12
- import { LinearApolloDisplay as LinearApolloDisplayI } from './LinearApolloDisplay/stateModel'
13
- import { TrackLines } from './SixFrameFeatureDisplay/components'
14
- import { SixFrameFeatureDisplay } from './SixFrameFeatureDisplay/stateModel'
11
+ import { type LinearApolloDisplay as LinearApolloDisplayI } from './LinearApolloDisplay/stateModel'
12
+ import { LinearApolloSixFrameDisplay } from './LinearApolloSixFrameDisplay/components'
13
+ import { type LinearApolloSixFrameDisplay as LinearApolloSixFrameDisplayI } from './LinearApolloSixFrameDisplay/stateModel'
15
14
  import { TabularEditorPane } from './TabularEditor'
16
-
17
- import { getSession } from '@jbrowse/core/util'
18
- import { ApolloSessionModel } from './session'
15
+ import { type ApolloSessionModel } from './session'
19
16
 
20
17
  const accordionControlHeight = 12
21
18
 
@@ -63,7 +60,7 @@ const useStyles = makeStyles()((theme) => ({
63
60
  }))
64
61
 
65
62
  function scrollSelectedFeatureIntoView(
66
- model: LinearApolloDisplayI,
63
+ model: LinearApolloDisplayI | LinearApolloSixFrameDisplayI,
67
64
  scrollContainerRef: React.RefObject<HTMLDivElement>,
68
65
  ) {
69
66
  const { apolloRowHeight, selectedFeature } = model
@@ -157,7 +154,7 @@ const AccordionControl = observer(function AccordionControl({
157
154
  )
158
155
  })
159
156
 
160
- export const DisplayComponent = observer(function DisplayComponent({
157
+ export const LinearApolloDisplayComponent = observer(function DisplayComponent({
161
158
  model,
162
159
  ...other
163
160
  }: {
@@ -171,7 +168,6 @@ export const DisplayComponent = observer(function DisplayComponent({
171
168
  const { classes } = useStyles()
172
169
 
173
170
  const {
174
- detailsHeight,
175
171
  graphical,
176
172
  height: overallHeight,
177
173
  isShown,
@@ -187,7 +183,7 @@ export const DisplayComponent = observer(function DisplayComponent({
187
183
  }, [model, selectedFeature])
188
184
 
189
185
  const onDetailsResize = (delta: number) => {
190
- model.setDetailsHeight(detailsHeight - delta)
186
+ model.setDetailsHeight(model.detailsHeight - delta)
191
187
  }
192
188
 
193
189
  if (!ontologyStore) {
@@ -199,9 +195,9 @@ export const DisplayComponent = observer(function DisplayComponent({
199
195
  }
200
196
 
201
197
  if (graphical && table) {
202
- const tabularHeight = tabularEditor.isShown ? detailsHeight : 0
198
+ const tabularHeight = tabularEditor.isShown ? model.detailsHeight : 0
203
199
  const featureAreaHeight = isShown
204
- ? overallHeight - detailsHeight - accordionControlHeight * 2
200
+ ? overallHeight - model.detailsHeight - accordionControlHeight * 2
205
201
  : 0
206
202
  return (
207
203
  <div style={{ height: overallHeight }}>
@@ -249,40 +245,96 @@ export const DisplayComponent = observer(function DisplayComponent({
249
245
  )
250
246
  })
251
247
 
252
- export function makeSixFrameDisplayComponent(pluginManager: PluginManager) {
253
- const LGVPlugin = pluginManager.getPlugin('LinearGenomeViewPlugin') as
254
- | LinearGenomeViewPlugin
255
- | undefined
256
- if (!LGVPlugin) {
257
- throw new Error('LinearGenomeView plugin not found')
258
- }
259
- const { BaseLinearDisplayComponent } = LGVPlugin.exports
260
- function ApolloDisplayComponent({
248
+ export const LinearApolloSixFrameDisplayComponent = observer(
249
+ function DisplayComponent({
261
250
  model,
262
251
  ...other
263
252
  }: {
264
- model: SixFrameFeatureDisplay
253
+ model: LinearApolloSixFrameDisplayI
265
254
  }) {
255
+ const session = getSession(model) as unknown as ApolloSessionModel
256
+ const { ontologyManager } = session.apolloDataStore
257
+ const { featureTypeOntology } = ontologyManager
258
+ const ontologyStore = featureTypeOntology?.dataStore
259
+
266
260
  const { classes } = useStyles()
267
- const { height, selectedFeature } = model
268
- let { detailsHeight } = model
269
- if (!selectedFeature) {
270
- detailsHeight = 0
261
+
262
+ const {
263
+ detailsHeight,
264
+ graphical,
265
+ height: overallHeight,
266
+ isShown,
267
+ selectedFeature,
268
+ table,
269
+ tabularEditor,
270
+ toggleShown,
271
+ } = model
272
+
273
+ const canvasScrollContainerRef = useRef<HTMLDivElement>(null)
274
+ useEffect(() => {
275
+ scrollSelectedFeatureIntoView(model, canvasScrollContainerRef)
276
+ }, [model, selectedFeature])
277
+
278
+ const onDetailsResize = (delta: number) => {
279
+ model.setDetailsHeight(detailsHeight - delta)
271
280
  }
272
- const featureAreaHeight = height - detailsHeight
273
- return (
274
- <div style={{ height: model.height }}>
275
- <div className={classes.shading} style={{ height: featureAreaHeight }}>
276
- <BaseLinearDisplayComponent model={model} {...other} />
281
+
282
+ if (!ontologyStore) {
283
+ return (
284
+ <div className={classes.alertContainer}>
285
+ <Alert severity="error">Could not load feature type ontology.</Alert>
286
+ </div>
287
+ )
288
+ }
289
+
290
+ if (graphical && table) {
291
+ const tabularHeight = tabularEditor.isShown ? detailsHeight : 0
292
+ const featureAreaHeight = isShown
293
+ ? overallHeight - detailsHeight - accordionControlHeight * 2
294
+ : 0
295
+ return (
296
+ <div style={{ height: overallHeight }}>
297
+ <AccordionControl
298
+ open={isShown}
299
+ title="Graphical"
300
+ onClick={toggleShown}
301
+ />
302
+ <div
303
+ className={classes.shading}
304
+ ref={canvasScrollContainerRef}
305
+ style={{ height: featureAreaHeight }}
306
+ >
307
+ <LinearApolloSixFrameDisplay model={model} {...other} />
308
+ </div>
309
+ <AccordionControl
310
+ title="Table"
311
+ open={tabularEditor.isShown}
312
+ onClick={tabularEditor.togglePane}
313
+ onResize={onDetailsResize}
314
+ />
315
+ <div className={classes.details} style={{ height: tabularHeight }}>
316
+ <TabularEditorPane model={model} />
317
+ </div>
277
318
  </div>
278
- {/* <div className={classes.details} style={{ height: detailsHeight }}>
279
- <ApolloDetails model={model} />
280
- </div> */}
281
- <div className="testTrackLines">
282
- <TrackLines model={model} />
319
+ )
320
+ }
321
+
322
+ if (graphical) {
323
+ return (
324
+ <div
325
+ className={classes.shading}
326
+ ref={canvasScrollContainerRef}
327
+ style={{ height: overallHeight }}
328
+ >
329
+ <LinearApolloSixFrameDisplay model={model} {...other} />
283
330
  </div>
331
+ )
332
+ }
333
+
334
+ return (
335
+ <div className={classes.details} style={{ height: overallHeight }}>
336
+ <TabularEditorPane model={model} />
284
337
  </div>
285
338
  )
286
- }
287
- return observer(ApolloDisplayComponent)
288
- }
339
+ },
340
+ )
@@ -2,23 +2,27 @@
2
2
  /* eslint-disable @typescript-eslint/no-unsafe-assignment */
3
3
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
4
4
  /* eslint-disable @typescript-eslint/no-unsafe-argument */
5
- import { ClientDataStore as ClientDataStoreType } from '@apollo-annotation/common'
5
+ import { type ClientDataStore as ClientDataStoreType } from '@apollo-annotation/common'
6
6
  import {
7
- AnnotationFeatureModel,
8
- AnnotationFeatureSnapshot,
7
+ type AnnotationFeatureModel,
8
+ type AnnotationFeatureSnapshot,
9
9
  ApolloAssembly,
10
- ApolloAssemblySnapshot,
10
+ type ApolloAssemblySnapshot,
11
11
  ApolloRefSeq,
12
- BackendDriverType,
12
+ type BackendDriverType,
13
13
  CheckResult,
14
- CheckResultSnapshot,
14
+ type CheckResultSnapshot,
15
15
  } from '@apollo-annotation/mst'
16
16
  import { getConf, readConfObject } from '@jbrowse/core/configuration'
17
- import { ConfigurationModel } from '@jbrowse/core/configuration/types'
18
- import { Region, getSession, isElectron } from '@jbrowse/core/util'
19
- import { LocalPathLocation, UriLocation } from '@jbrowse/core/util/types/mst'
17
+ import { type ConfigurationModel } from '@jbrowse/core/configuration/types'
18
+ import { type Region, getSession, isElectron } from '@jbrowse/core/util'
20
19
  import {
21
- Instance,
20
+ type LocalPathLocation,
21
+ type UriLocation,
22
+ } from '@jbrowse/core/util/types/mst'
23
+ import { autorun } from 'mobx'
24
+ import {
25
+ type Instance,
22
26
  addDisposer,
23
27
  flow,
24
28
  getParentOfType,
@@ -28,21 +32,21 @@ import {
28
32
  } from 'mobx-state-tree'
29
33
 
30
34
  import {
31
- ApolloInternetAccount,
35
+ type ApolloInternetAccount,
32
36
  CollaborationServerDriver,
33
37
  DesktopFileDriver,
34
38
  InMemoryFileDriver,
35
39
  } from '../BackendDrivers'
36
40
  import { ChangeManager } from '../ChangeManager'
37
- import ApolloPluginConfigurationSchema from '../config'
38
41
  import {
39
42
  OntologyManagerType,
40
- OntologyRecordConfiguration,
41
- TextIndexFieldDefinition,
43
+ type OntologyRecordConfiguration,
44
+ type TextIndexFieldDefinition,
42
45
  } from '../OntologyManager'
43
- import { ApolloRootModel } from '../types'
44
- import { autorun } from 'mobx'
45
- import { ApolloSessionModel } from './session'
46
+ import type ApolloPluginConfigurationSchema from '../config'
47
+ import { type ApolloRootModel } from '../types'
48
+
49
+ import { type ApolloSessionModel } from './session'
46
50
 
47
51
  export function clientDataStoreFactory(
48
52
  AnnotationFeatureExtended: typeof AnnotationFeatureModel,
@@ -1,27 +1,31 @@
1
1
  /* eslint-disable @typescript-eslint/no-unsafe-return */
2
2
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
3
3
  /* eslint-disable @typescript-eslint/no-unsafe-assignment */
4
- import { ClientDataStore as ClientDataStoreType } from '@apollo-annotation/common'
4
+ import { type ClientDataStore as ClientDataStoreType } from '@apollo-annotation/common'
5
5
  import {
6
- AnnotationFeature,
6
+ type AnnotationFeature,
7
7
  AnnotationFeatureModel,
8
8
  } from '@apollo-annotation/mst'
9
9
  import {
10
- filterJBrowseConfig,
11
10
  ImportJBrowseConfigChange,
12
- JBrowseConfig,
13
- UserLocation,
11
+ type JBrowseConfig,
12
+ type UserLocation,
13
+ filterJBrowseConfig,
14
14
  } from '@apollo-annotation/shared'
15
- import { readConfObject, getConf } from '@jbrowse/core/configuration'
16
- import { BaseTrackConfig } from '@jbrowse/core/pluggableElementTypes'
17
- import PluginManager from '@jbrowse/core/PluginManager'
18
- import { AbstractSessionModel, SessionWithAddTracks } from '@jbrowse/core/util'
19
- import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
15
+ import type PluginManager from '@jbrowse/core/PluginManager'
16
+ import { type AssemblyModel } from '@jbrowse/core/assemblyManager/assembly'
17
+ import { getConf, readConfObject } from '@jbrowse/core/configuration'
18
+ import { type BaseTrackConfig } from '@jbrowse/core/pluggableElementTypes'
19
+ import {
20
+ type AbstractSessionModel,
21
+ type SessionWithAddTracks,
22
+ } from '@jbrowse/core/util'
23
+ import { type LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
20
24
  import SaveIcon from '@mui/icons-material/Save'
21
25
  import { autorun, observable } from 'mobx'
22
26
  import {
23
- Instance,
24
- SnapshotOut,
27
+ type Instance,
28
+ type SnapshotOut,
25
29
  applySnapshot,
26
30
  flow,
27
31
  getRoot,
@@ -29,13 +33,13 @@ import {
29
33
  types,
30
34
  } from 'mobx-state-tree'
31
35
 
32
- import { ApolloInternetAccountModel } from '../ApolloInternetAccount/model'
36
+ import { type ApolloInternetAccountModel } from '../ApolloInternetAccount/model'
33
37
  import { ApolloJobModel } from '../ApolloJobModel'
34
- import { ChangeManager } from '../ChangeManager'
35
- import { ApolloRootModel } from '../types'
38
+ import { type ChangeManager } from '../ChangeManager'
39
+ import { type ApolloRootModel } from '../types'
36
40
  import { createFetchErrorMessage } from '../util'
41
+
37
42
  import { clientDataStoreFactory } from './ClientDataStore'
38
- import { AssemblyModel } from '@jbrowse/core/assemblyManager/assembly'
39
43
 
40
44
  export interface ApolloSession extends AbstractSessionModel {
41
45
  apolloDataStore: ClientDataStoreType & { changeManager: ChangeManager }
@@ -119,16 +123,6 @@ export function extendSession(
119
123
  : {}),
120
124
  },
121
125
  },
122
- displays: [
123
- {
124
- type: 'LinearApolloDisplay',
125
- displayId: `${trackId}-LinearApolloDisplay`,
126
- },
127
- {
128
- type: 'SixFrameFeatureDisplay',
129
- displayId: `${trackId}-SixFrameFeatureDisplay`,
130
- },
131
- ],
132
126
  })
133
127
  }
134
128
  },
package/src/types.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { BaseInternetAccountModel } from '@jbrowse/core/pluggableElementTypes'
2
- import { AppRootModel } from '@jbrowse/core/util'
1
+ import { type BaseInternetAccountModel } from '@jbrowse/core/pluggableElementTypes'
2
+ import { type AppRootModel } from '@jbrowse/core/util'
3
3
 
4
- import { ApolloInternetAccountModel } from './ApolloInternetAccount/model'
5
- import { ApolloSessionModel } from './session'
4
+ import { type ApolloInternetAccountModel } from './ApolloInternetAccount/model'
5
+ import { type ApolloSessionModel } from './session'
6
6
 
7
7
  export interface ApolloRootModel extends Omit<AppRootModel, 'session'> {
8
8
  session: ApolloSessionModel