@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apollo-annotation/jbrowse-plugin-apollo",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "description": "Apollo plugin for JBrowse 2",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -48,9 +48,9 @@
48
48
  }
49
49
  },
50
50
  "dependencies": {
51
- "@apollo-annotation/common": "^0.3.4",
52
- "@apollo-annotation/mst": "^0.3.4",
53
- "@apollo-annotation/shared": "^0.3.4",
51
+ "@apollo-annotation/common": "^0.3.6",
52
+ "@apollo-annotation/mst": "^0.3.6",
53
+ "@apollo-annotation/shared": "^0.3.6",
54
54
  "@emotion/react": "^11.10.6",
55
55
  "@emotion/styled": "^11.10.6",
56
56
  "@gmod/gff": "1.2.0",
@@ -1,4 +1,7 @@
1
- import { AbstractMenuManager, AbstractSessionModel } from '@jbrowse/core/util'
1
+ import {
2
+ type AbstractMenuManager,
3
+ type AbstractSessionModel,
4
+ } from '@jbrowse/core/util'
2
5
 
3
6
  import {
4
7
  AddAssembly,
@@ -7,7 +10,7 @@ import {
7
10
  ImportFeatures,
8
11
  ManageUsers,
9
12
  } from '../components'
10
- import { ApolloSessionModel } from '../session'
13
+ import { type ApolloSessionModel } from '../session'
11
14
 
12
15
  export function addMenuItems(rootModel: AbstractMenuManager) {
13
16
  rootModel.appendToMenu('Apollo', {
@@ -12,6 +12,7 @@ import { makeStyles } from 'tss-react/mui'
12
12
 
13
13
  import { Dialog } from '../../components/Dialog'
14
14
  import { createFetchErrorMessage } from '../../util'
15
+
15
16
  import { GoogleButton, GuestButton, MicrosoftButton } from './LoginButtons'
16
17
 
17
18
  const useStyles = makeStyles()((theme) => ({
@@ -1,5 +1,5 @@
1
1
  import AccountCircleIcon from '@mui/icons-material/AccountCircle'
2
- import { Button, ButtonProps } from '@mui/material'
2
+ import { Button, type ButtonProps } from '@mui/material'
3
3
  import React from 'react'
4
4
  import { makeStyles } from 'tss-react/mui'
5
5
 
@@ -1,4 +1,4 @@
1
- import { SvgIcon, SvgIconProps } from '@mui/material'
1
+ import { SvgIcon, type SvgIconProps } from '@mui/material'
2
2
  import React from 'react'
3
3
 
4
4
  // Icon source: https://developers.google.com/identity/branding-guidelines
@@ -1,6 +1,6 @@
1
1
  import { ConfigurationSchema } from '@jbrowse/core/configuration'
2
2
  import { BaseInternetAccountConfig } from '@jbrowse/core/pluggableElementTypes'
3
- import { Instance } from 'mobx-state-tree'
3
+ import { type Instance } from 'mobx-state-tree'
4
4
 
5
5
  const ApolloConfigSchema = ConfigurationSchema(
6
6
  'ApolloInternetAccount',
@@ -7,31 +7,32 @@
7
7
  /* eslint-disable @typescript-eslint/no-misused-promises */
8
8
  import { Change } from '@apollo-annotation/common'
9
9
  import {
10
- ChangeMessage,
11
- CheckResultUpdate,
12
- RequestUserInformationMessage,
13
- UserLocation,
14
- UserLocationMessage,
10
+ type ChangeMessage,
11
+ type CheckResultUpdate,
12
+ type RequestUserInformationMessage,
13
+ type UserLocation,
14
+ type UserLocationMessage,
15
15
  getDecodedToken,
16
16
  makeUserSessionId,
17
17
  } from '@apollo-annotation/shared'
18
18
  import { ConfigurationReference, getConf } from '@jbrowse/core/configuration'
19
19
  import { InternetAccount } from '@jbrowse/core/pluggableElementTypes'
20
20
  import {
21
- AbstractSessionModel,
21
+ type AbstractSessionModel,
22
22
  isAbstractMenuManager,
23
23
  isElectron,
24
24
  } from '@jbrowse/core/util'
25
25
  import { autorun } from 'mobx'
26
- import { Instance, flow, getRoot, types } from 'mobx-state-tree'
26
+ import { type Instance, flow, getRoot, types } from 'mobx-state-tree'
27
27
  import { io } from 'socket.io-client'
28
28
 
29
- import { Collaborator } from '../session'
30
- import { ApolloRootModel } from '../types'
29
+ import { type Collaborator } from '../session'
30
+ import { type ApolloRootModel } from '../types'
31
31
  import { createFetchErrorMessage } from '../util'
32
+
32
33
  import { addMenuItems } from './addMenuItems'
33
34
  import { AuthTypeSelector } from './components/AuthTypeSelector'
34
- import { ApolloInternetAccountConfigModel } from './configSchema'
35
+ import { type ApolloInternetAccountConfigModel } from './configSchema'
35
36
 
36
37
  type AuthType = 'google' | 'microsoft' | 'guest'
37
38
 
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-unsafe-assignment */
2
2
  /* eslint-disable @typescript-eslint/no-confusing-void-expression */
3
3
  import {
4
- SessionWithWidgets,
4
+ type SessionWithWidgets,
5
5
  getSession,
6
6
  isSessionModelWithWidgets,
7
7
  } from '@jbrowse/core/util'
@@ -1,13 +1,15 @@
1
- import { RefNameAliases } from './../BackendDrivers/BackendDriver'
1
+ import { readConfObject } from '@jbrowse/core/configuration'
2
2
  import {
3
- BaseRefNameAliasAdapter,
4
3
  BaseAdapter,
4
+ type BaseRefNameAliasAdapter,
5
5
  } from '@jbrowse/core/data_adapters/BaseAdapter'
6
- import { readConfObject } from '@jbrowse/core/configuration'
7
- import { ApolloSessionModel } from '../session'
8
- import { BackendDriver } from '../BackendDrivers'
6
+ import type RpcServer from 'librpc-web-mod/dist/server'
9
7
  import { nanoid } from 'nanoid'
10
- import RpcServer from 'librpc-web-mod/dist/server'
8
+
9
+ import { type BackendDriver } from '../BackendDrivers'
10
+ import { type ApolloSessionModel } from '../session'
11
+
12
+ import { type RefNameAliases } from './../BackendDrivers/BackendDriver'
11
13
 
12
14
  declare global {
13
15
  const rpcServer: RpcServer
@@ -1,8 +1,8 @@
1
+ import type PluginManager from '@jbrowse/core/PluginManager'
1
2
  import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'
2
- import PluginManager from '@jbrowse/core/PluginManager'
3
3
 
4
- import configSchema from './configSchema'
5
4
  import ApolloRefNameAliasAdapter from './ApolloRefNameAliasAdapter'
5
+ import configSchema from './configSchema'
6
6
 
7
7
  export function installApolloRefNameAliasAdapter(pluginManager: PluginManager) {
8
8
  pluginManager.addAdapterType(
@@ -6,12 +6,12 @@
6
6
  import { readConfObject } from '@jbrowse/core/configuration'
7
7
  import { BaseSequenceAdapter } from '@jbrowse/core/data_adapters/BaseAdapter'
8
8
  import { ObservableCreate } from '@jbrowse/core/util/rxjs'
9
- import SimpleFeature, { Feature } from '@jbrowse/core/util/simpleFeature'
10
- import { NoAssemblyRegion, Region } from '@jbrowse/core/util/types'
9
+ import SimpleFeature, { type Feature } from '@jbrowse/core/util/simpleFeature'
10
+ import { type NoAssemblyRegion, type Region } from '@jbrowse/core/util/types'
11
11
  import { nanoid } from 'nanoid'
12
12
 
13
- import { BackendDriver } from '../BackendDrivers'
14
- import { ApolloSessionModel } from '../session'
13
+ import { type BackendDriver } from '../BackendDrivers'
14
+ import { type ApolloSessionModel } from '../session'
15
15
 
16
16
  // declare global {
17
17
  // var rpcServer: import('librpc-web-mod').RpcServer
@@ -127,6 +127,19 @@ export class ApolloSequenceAdapter extends BaseSequenceAdapter {
127
127
  const backendDriver = dataStore.getBackendDriver(
128
128
  assemblyId,
129
129
  ) as BackendDriver
130
+ const regions = await backendDriver.getRegions(
131
+ regionWithAssemblyName.assemblyName,
132
+ )
133
+ const region = regions.find(
134
+ (region) => region.refName === regionWithAssemblyName.refName,
135
+ )
136
+ if (!region) {
137
+ observer.error('Cannot get region')
138
+ return
139
+ }
140
+ if (regionWithAssemblyName.end > region.end) {
141
+ regionWithAssemblyName.end = region.end
142
+ }
130
143
  const { seq } = await backendDriver.getSequence(regionWithAssemblyName)
131
144
  observer.next(
132
145
  new SimpleFeature({
@@ -1,5 +1,5 @@
1
+ import type PluginManager from '@jbrowse/core/PluginManager'
1
2
  import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'
2
- import PluginManager from '@jbrowse/core/PluginManager'
3
3
 
4
4
  import { ApolloSequenceAdapter } from './ApolloSequenceAdapter'
5
5
  import configSchema from './configSchema'
@@ -1,14 +1,15 @@
1
- import { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
1
+ import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
2
+ import BaseResult from '@jbrowse/core/TextSearch/BaseResults'
3
+ import { type Assembly } from '@jbrowse/core/assemblyManager/assembly'
2
4
  import { readConfObject } from '@jbrowse/core/configuration'
3
5
  import {
4
6
  BaseAdapter,
5
- BaseTextSearchAdapter,
6
- BaseTextSearchArgs,
7
+ type BaseTextSearchAdapter,
8
+ type BaseTextSearchArgs,
7
9
  } from '@jbrowse/core/data_adapters/BaseAdapter'
8
- import BaseResult from '@jbrowse/core/TextSearch/BaseResults'
9
- import { AbstractSessionModel, UriLocation } from '@jbrowse/core/util'
10
- import { ApolloSessionModel } from '../session'
11
- import { Assembly } from '@jbrowse/core/assemblyManager/assembly'
10
+ import { type AbstractSessionModel, type UriLocation } from '@jbrowse/core/util'
11
+
12
+ import { type ApolloSessionModel } from '../session'
12
13
 
13
14
  export class ApolloTextSearchAdapter
14
15
  extends BaseAdapter
@@ -1,5 +1,5 @@
1
+ import type PluginManager from '@jbrowse/core/PluginManager'
1
2
  import { TextSearchAdapterType } from '@jbrowse/core/pluggableElementTypes'
2
- import PluginManager from '@jbrowse/core/PluginManager'
3
3
 
4
4
  import { ApolloTextSearchAdapter } from './ApolloTextSearchAdapter'
5
5
  import configSchema from './configSchema'
@@ -1,13 +1,13 @@
1
- import { Change, ClientDataStore } from '@apollo-annotation/common'
1
+ import { type Change, type ClientDataStore } from '@apollo-annotation/common'
2
2
  import {
3
- AnnotationFeatureSnapshot,
4
- CheckResultSnapshot,
3
+ type AnnotationFeatureSnapshot,
4
+ type CheckResultSnapshot,
5
5
  } from '@apollo-annotation/mst'
6
- import { ValidationResultSet } from '@apollo-annotation/shared'
7
- import { Assembly } from '@jbrowse/core/assemblyManager/assembly'
8
- import { Region } from '@jbrowse/core/util'
6
+ import { type ValidationResultSet } from '@apollo-annotation/shared'
7
+ import { type Assembly } from '@jbrowse/core/assemblyManager/assembly'
8
+ import { type Region } from '@jbrowse/core/util'
9
9
 
10
- import { SubmitOpts } from '../ChangeManager'
10
+ import { type SubmitOpts } from '../ChangeManager'
11
11
 
12
12
  export interface RefNameAliases {
13
13
  refName: string
@@ -4,21 +4,25 @@
4
4
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
5
5
  /* eslint-disable @typescript-eslint/no-unsafe-call */
6
6
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
7
- import { AssemblySpecificChange, Change } from '@apollo-annotation/common'
7
+ import { type AssemblySpecificChange, Change } from '@apollo-annotation/common'
8
8
  import {
9
- AnnotationFeatureSnapshot,
10
- ApolloRefSeqI,
11
- CheckResultSnapshot,
9
+ type AnnotationFeatureSnapshot,
10
+ type ApolloRefSeqI,
11
+ type CheckResultSnapshot,
12
12
  } from '@apollo-annotation/mst'
13
- import { ChangeMessage, ValidationResultSet } from '@apollo-annotation/shared'
13
+ import {
14
+ type ChangeMessage,
15
+ ValidationResultSet,
16
+ } from '@apollo-annotation/shared'
14
17
  import { getConf } from '@jbrowse/core/configuration'
15
- import { BaseInternetAccountModel } from '@jbrowse/core/pluggableElementTypes'
16
- import { Region, getSession } from '@jbrowse/core/util'
17
- import { Socket } from 'socket.io-client'
18
+ import { type BaseInternetAccountModel } from '@jbrowse/core/pluggableElementTypes'
19
+ import { type Region, getSession } from '@jbrowse/core/util'
20
+ import { type Socket } from 'socket.io-client'
18
21
 
19
- import { ChangeManager, SubmitOpts } from '../ChangeManager'
22
+ import { ChangeManager, type SubmitOpts } from '../ChangeManager'
20
23
  import { createFetchErrorMessage } from '../util'
21
- import { BackendDriver, RefNameAliases } from './BackendDriver'
24
+
25
+ import { BackendDriver, type RefNameAliases } from './BackendDriver'
22
26
 
23
27
  export interface ApolloRefSeqResponse {
24
28
  _id: string
@@ -1,25 +1,26 @@
1
1
  /* eslint-disable @typescript-eslint/require-await */
2
2
  import {
3
- AssemblySpecificChange,
4
- Change,
3
+ type AssemblySpecificChange,
4
+ type Change,
5
5
  isAssemblySpecificChange,
6
6
  } from '@apollo-annotation/common'
7
7
  import {
8
- AnnotationFeatureSnapshot,
9
- CheckResultSnapshot,
8
+ type AnnotationFeatureSnapshot,
9
+ type CheckResultSnapshot,
10
10
  } from '@apollo-annotation/mst'
11
11
  import {
12
- annotationFeatureToGFF3,
13
12
  ValidationResultSet,
13
+ annotationFeatureToGFF3,
14
14
  splitStringIntoChunks,
15
15
  } from '@apollo-annotation/shared'
16
- import gff, { GFF3Item } from '@gmod/gff'
16
+ import gff, { type GFF3Item } from '@gmod/gff'
17
17
  import { getConf } from '@jbrowse/core/configuration'
18
- import { Region, getSession } from '@jbrowse/core/util'
18
+ import { type Region, getSession } from '@jbrowse/core/util'
19
19
  import { getSnapshot } from 'mobx-state-tree'
20
20
 
21
21
  import { checkFeatures, loadAssemblyIntoClient } from '../util'
22
- import { BackendDriver, RefNameAliases } from './BackendDriver'
22
+
23
+ import { BackendDriver, type RefNameAliases } from './BackendDriver'
23
24
 
24
25
  export class DesktopFileDriver extends BackendDriver {
25
26
  async loadAssembly(assemblyName: string) {
@@ -32,7 +33,7 @@ export class DesktopFileDriver extends BackendDriver {
32
33
  file: string
33
34
  }
34
35
 
35
- // eslint-disable-next-line @typescript-eslint/no-require-imports
36
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/consistent-type-imports
36
37
  const fs = require('node:fs') as typeof import('fs')
37
38
  const fileContents = await fs.promises.readFile(file, 'utf8')
38
39
  return loadAssemblyIntoClient(assemblyName, fileContents, this.clientStore)
@@ -166,7 +167,7 @@ export class DesktopFileDriver extends BackendDriver {
166
167
 
167
168
  const gff3Contents = gff.formatSync(gff3Items)
168
169
 
169
- // eslint-disable-next-line @typescript-eslint/no-require-imports
170
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/consistent-type-imports
170
171
  const fs = require('node:fs') as typeof import('fs')
171
172
  await fs.promises.writeFile(file, gff3Contents, 'utf8')
172
173
 
@@ -1,17 +1,21 @@
1
1
  /* eslint-disable @typescript-eslint/require-await */
2
- import { AssemblySpecificChange, Change } from '@apollo-annotation/common'
3
2
  import {
4
- AnnotationFeatureSnapshot,
5
- CheckResultSnapshot,
3
+ type AssemblySpecificChange,
4
+ type Change,
5
+ } from '@apollo-annotation/common'
6
+ import {
7
+ type AnnotationFeatureSnapshot,
8
+ type CheckResultSnapshot,
6
9
  } from '@apollo-annotation/mst'
7
10
  import { ValidationResultSet } from '@apollo-annotation/shared'
8
11
  import { getConf } from '@jbrowse/core/configuration'
9
- import { Region, getSession } from '@jbrowse/core/util'
12
+ import { type Region, getSession } from '@jbrowse/core/util'
10
13
 
11
- import { SubmitOpts } from '../ChangeManager'
12
- import { BackendDriver, RefNameAliases } from './BackendDriver'
14
+ import { type SubmitOpts } from '../ChangeManager'
13
15
  import { checkFeatures } from '../util'
14
16
 
17
+ import { BackendDriver, type RefNameAliases } from './BackendDriver'
18
+
15
19
  export class InMemoryFileDriver extends BackendDriver {
16
20
  async getFeatures(): Promise<
17
21
  [AnnotationFeatureSnapshot[], CheckResultSnapshot[]]
@@ -2,18 +2,18 @@
2
2
  /* eslint-disable @typescript-eslint/no-unsafe-call */
3
3
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
4
4
  import {
5
- Change,
6
- ClientDataStore,
5
+ type Change,
6
+ type ClientDataStore,
7
7
  isAssemblySpecificChange,
8
8
  } from '@apollo-annotation/common'
9
9
  import {
10
- ValidationResultSet,
10
+ type ValidationResultSet,
11
11
  validationRegistry,
12
12
  } from '@apollo-annotation/shared'
13
13
  import { getSession } from '@jbrowse/core/util'
14
- import { IAnyStateTreeNode } from 'mobx-state-tree'
14
+ import { type IAnyStateTreeNode } from 'mobx-state-tree'
15
15
 
16
- import { ApolloSessionModel } from './session'
16
+ import { type ApolloSessionModel } from './session'
17
17
 
18
18
  export interface SubmitOpts {
19
19
  /** defaults to true */
@@ -1,14 +1,22 @@
1
1
  import { getSession } from '@jbrowse/core/util'
2
+ import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
3
+ import {
4
+ Accordion,
5
+ AccordionDetails,
6
+ AccordionSummary,
7
+ Typography,
8
+ } from '@mui/material'
2
9
  import { observer } from 'mobx-react'
3
- import React from 'react'
10
+ import React, { useEffect, useState } from 'react'
4
11
  import { makeStyles } from 'tss-react/mui'
5
12
 
6
- import { ApolloSessionModel } from '../session'
13
+ import { type ApolloSessionModel } from '../session'
14
+
7
15
  import { Attributes } from './Attributes'
8
16
  import { BasicInformation } from './BasicInformation'
9
- import { ApolloFeatureDetailsWidget as ApolloFeatureDetails } from './model'
10
- import { Sequence } from './Sequence'
11
17
  import { FeatureDetailsNavigation } from './FeatureDetailsNavigation'
18
+ import { Sequence } from './Sequence'
19
+ import { type ApolloFeatureDetailsWidget as ApolloFeatureDetails } from './model'
12
20
 
13
21
  const useStyles = makeStyles()((theme) => ({
14
22
  root: {
@@ -24,6 +32,12 @@ export const ApolloFeatureDetailsWidget = observer(
24
32
  const currentAssembly = session.apolloDataStore.assemblies.get(assembly)
25
33
  const { classes } = useStyles()
26
34
 
35
+ const [panelState, setPanelState] = useState<string[]>(['attributes'])
36
+
37
+ useEffect(() => {
38
+ setPanelState(['attributes'])
39
+ }, [feature])
40
+
27
41
  if (!(feature && currentAssembly)) {
28
42
  return null
29
43
  }
@@ -39,6 +53,14 @@ export const ApolloFeatureDetailsWidget = observer(
39
53
  ])
40
54
  }
41
55
 
56
+ function handlePanelChange(expanded: boolean, panel: string) {
57
+ if (expanded) {
58
+ setPanelState([...panelState, panel])
59
+ } else {
60
+ setPanelState(panelState.filter((p) => p !== panel))
61
+ }
62
+ }
63
+
42
64
  return (
43
65
  <div className={classes.root}>
44
66
  <BasicInformation
@@ -46,22 +68,72 @@ export const ApolloFeatureDetailsWidget = observer(
46
68
  session={session}
47
69
  assembly={currentAssembly._id}
48
70
  />
49
- <hr />
50
- <Attributes
51
- feature={feature}
52
- session={session}
53
- assembly={currentAssembly._id}
54
- editable={true}
55
- />
56
- <hr />
57
- <Sequence
58
- feature={feature}
59
- session={session}
60
- assembly={currentAssembly._id}
61
- refName={refName}
62
- />
63
- <hr />
64
- <FeatureDetailsNavigation model={model} feature={feature} />
71
+ <Accordion
72
+ style={{ marginTop: 10 }}
73
+ expanded={panelState.includes('attributes')}
74
+ onChange={(e, expanded) => {
75
+ handlePanelChange(expanded, 'attributes')
76
+ }}
77
+ >
78
+ <AccordionSummary
79
+ expandIcon={<ExpandMoreIcon style={{ color: 'white' }} />}
80
+ aria-controls="panel1-content"
81
+ id="panel1-header"
82
+ >
83
+ <Typography component="span">Attributes</Typography>
84
+ </AccordionSummary>
85
+ <AccordionDetails>
86
+ <Attributes
87
+ feature={feature}
88
+ session={session}
89
+ assembly={currentAssembly._id}
90
+ editable={true}
91
+ />
92
+ </AccordionDetails>
93
+ </Accordion>
94
+ <Accordion
95
+ style={{ marginTop: 10 }}
96
+ expanded={panelState.includes('sequence')}
97
+ onChange={(e, expanded) => {
98
+ handlePanelChange(expanded, 'sequence')
99
+ }}
100
+ >
101
+ <AccordionSummary
102
+ expandIcon={<ExpandMoreIcon style={{ color: 'white' }} />}
103
+ aria-controls="panel2-content"
104
+ id="panel2-header"
105
+ >
106
+ <Typography component="span">Sequence</Typography>
107
+ </AccordionSummary>
108
+ <AccordionDetails>
109
+ {panelState.includes('sequence') && (
110
+ <Sequence
111
+ feature={feature}
112
+ session={session}
113
+ assembly={currentAssembly._id}
114
+ refName={refName}
115
+ />
116
+ )}
117
+ </AccordionDetails>
118
+ </Accordion>
119
+ <Accordion
120
+ style={{ marginTop: 10 }}
121
+ expanded={panelState.includes('related_features')}
122
+ onChange={(e, expanded) => {
123
+ handlePanelChange(expanded, 'related_features')
124
+ }}
125
+ >
126
+ <AccordionSummary
127
+ expandIcon={<ExpandMoreIcon style={{ color: 'white' }} />}
128
+ aria-controls="panel3-content"
129
+ id="panel3-header"
130
+ >
131
+ <Typography component="span">Related features</Typography>
132
+ </AccordionSummary>
133
+ <AccordionDetails>
134
+ <FeatureDetailsNavigation model={model} feature={feature} />
135
+ </AccordionDetails>
136
+ </Accordion>
65
137
  </div>
66
138
  )
67
139
  },