diff --git a/packages/jbrowse-plugin-apollo/src/FeatureDetailsWidget/ApolloFeatureDetailsWidget.tsx b/packages/jbrowse-plugin-apollo/src/FeatureDetailsWidget/ApolloFeatureDetailsWidget.tsx index 5e1f18a2..171aecd3 100644 --- a/packages/jbrowse-plugin-apollo/src/FeatureDetailsWidget/ApolloFeatureDetailsWidget.tsx +++ b/packages/jbrowse-plugin-apollo/src/FeatureDetailsWidget/ApolloFeatureDetailsWidget.tsx @@ -8,6 +8,7 @@ import { Attributes } from './Attributes' import { BasicInformation } from './BasicInformation' import { ApolloFeatureDetailsWidget as ApolloFeatureDetails } from './model' import { Sequence } from './Sequence' +import { FeatureDetailsNavigation } from './FeatureDetailsNavigation' const useStyles = makeStyles()((theme) => ({ root: { @@ -59,6 +60,9 @@ export const ApolloFeatureDetailsWidget = observer( assembly={currentAssembly._id} refName={refName} /> +
+ +
) }, diff --git a/packages/jbrowse-plugin-apollo/src/FeatureDetailsWidget/FeatureDetailsNavigation.tsx b/packages/jbrowse-plugin-apollo/src/FeatureDetailsWidget/FeatureDetailsNavigation.tsx new file mode 100644 index 00000000..1de22cc2 --- /dev/null +++ b/packages/jbrowse-plugin-apollo/src/FeatureDetailsWidget/FeatureDetailsNavigation.tsx @@ -0,0 +1,58 @@ +import React from 'react' + +import { Button, Typography } from '@mui/material' +import { observer } from 'mobx-react' + +import { AnnotationFeature } from '@apollo-annotation/mst' +import { ApolloFeatureDetailsWidget as ApolloFeatureDetails } from './model' + +export const FeatureDetailsNavigation = observer( + function FeatureDetailsNavigation(props: { + model: ApolloFeatureDetails + feature: AnnotationFeature + }) { + const { feature, model } = props + const { children, parent } = feature + const childrenSnapshot = [] + if (children) { + for (const [, child] of children) { + childrenSnapshot.push(child) + } + } + + return ( +
+ {parent && ( +
+ Parent: + +
+ )} + {childrenSnapshot.length > 0 && ( +
+ Children: + {childrenSnapshot.map((child) => ( +
+ +
+ ))} +
+ )} +
+ ) + }, +)