Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configuration options for track's graphical and table views #340

Closed
garrettjstevens opened this issue Nov 29, 2023 · 1 comment · Fixed by #461
Closed

Add configuration options for track's graphical and table views #340

garrettjstevens opened this issue Nov 29, 2023 · 1 comment · Fixed by #461
Assignees

Comments

@garrettjstevens
Copy link
Contributor

User should be able to:

  • Don't show table (separate from collapsing the table, just not show it altogether)
  • Only show table (similar to above)
  • Show table above graphical instead of below
  • Split graphical and table displays into separate tracks
@garrettjstevens
Copy link
Contributor Author

These options should be in the track menu. An example of how they might be added is:

--- a/packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/stateModel/base.ts
+++ b/packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/stateModel/base.ts
@@ -119,6 +119,40 @@ export function baseModelFactory(
           .apolloSelectedFeature
       },
     }))
+    .views((self) => {
+      const { trackMenuItems: superTrackMenuItems } = self
+      return {
+        trackMenuItems() {
+          return [
+            ...superTrackMenuItems(),
+            {
+              label: 'Show graphical display',
+              type: 'radio',
+              checked: self.graphical && !self.table,
+              onClick: () => {
+                self.showGraphicalOnly()
+              },
+            },
+            {
+              label: 'Show table display',
+              type: 'radio',
+              checked: self.table && !self.graphical,
+              onClick: () => {
+                self.showTableOnly()
+              },
+            },
+            {
+              label: 'Show both graphical and text display',
+              type: 'radio',
+              checked: self.table && self.graphical,
+              onClick: () => {
+                self.showGraphicalAndTable()
+              },
+            },
+          ]
+        },
+      }
+    })
     .actions((self) => ({
       setSelectedFeature(feature?: AnnotationFeature) {
         ;(

(I just made up the action/state names for this example, they might need to be different)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
2 participants