Skip to content

Commit 78d59f9

Browse files
author
Sebastian Benjamin
authored
MUI data grid replacement + details and genotype link columns (#159)
* Swap out datagrid component for MuiDataGrid
1 parent 405cdaf commit 78d59f9

File tree

23 files changed

+586
-1137
lines changed

23 files changed

+586
-1137
lines changed

jbrowse/src/client/JBrowse/Browser/components/JBrowseFooter.tsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { observer } from 'mobx-react';
2-
import { Box, Button } from '@material-ui/core';
2+
import { Box, Button, ThemeProvider } from '@material-ui/core';
33
import React from 'react';
44
import HelpDialog from './HelpDialog';
55
import { makeStyles } from '@material-ui/core/styles';
6-
6+
import { createJBrowseTheme } from '@jbrowse/core/ui';
7+
import { readConfObject } from '@jbrowse/core/configuration';
78

89
const useStyles = makeStyles({
910
button: {
@@ -29,13 +30,20 @@ const JBrowseFooter = observer(props => {
2930
<></>
3031
)
3132
}
33+
34+
// This is added to ensure on the first render the buttons use the right color.
35+
// NOTE: consider pushing this up one level into Browser.tsx
36+
const theme = createJBrowseTheme(readConfObject(viewState.config.configuration, 'theme'))
37+
3238
return (
3339
<>
34-
<Box padding={'5px'}>
35-
<Button className={styles.button} onClick={openTrackSelector} variant="contained" color="primary">Open Track Selector</Button>
36-
<Button className={styles.button} onClick={showHelpDialog} variant="contained" color="primary">View Help</Button>
37-
</Box>
38-
<HelpDialog isOpen={dialogOpen} setDialogOpen={setDialogOpen} bgColor={bgColor} />
40+
<ThemeProvider theme={theme}>
41+
<Box padding={'5px'}>
42+
<Button className={styles.button} onClick={openTrackSelector} variant="contained" color="primary">Open Track Selector</Button>
43+
<Button className={styles.button} onClick={showHelpDialog} variant="contained" color="primary">View Help</Button>
44+
</Box>
45+
<HelpDialog isOpen={dialogOpen} setDialogOpen={setDialogOpen} bgColor={bgColor} />
46+
</ThemeProvider>
3947
</>
4048
)
4149
})

jbrowse/src/client/JBrowse/Browser/plugins/ExtendedVariantPlugin/ExtendedVariantAdapter/ExtendedVcfFeature.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
import { VcfFeature } from '@jbrowse/plugin-variants'
2+
import VcfParser from '@gmod/vcf'
23

34
export default class ExtendedVcfFeature extends VcfFeature {
4-
constructor(args: { variant: any; parser: any; id: string }) {
5+
private readonly vcfParser: VcfParser
6+
7+
constructor(args: { variant: any; parser: VcfParser; id: string }) {
58
args.variant = ExtendedVcfFeature.extractImpact(args.variant)
69
//args.variant = ExtendedVcfFeature.calculateVariableSamples(args.variant)
710

8-
super(args);
11+
super(args)
12+
13+
this.vcfParser = args.parser
14+
}
15+
16+
public getInfoFieldMeta(propKey: string): VcfParser {
17+
const map = this.vcfParser.getMetadata("INFO")
18+
19+
return map ? map[propKey] : null
920
}
1021

1122
static calculateVariableSamples(variant: {

jbrowse/src/client/JBrowse/Browser/plugins/ExtendedVariantPlugin/FilterWidget/FilterComponent.js

Lines changed: 0 additions & 242 deletions
This file was deleted.

jbrowse/src/client/JBrowse/Browser/plugins/ExtendedVariantPlugin/FilterWidget/FilterWidget.js

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)