Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add column resizers to the variant ANN/CSQ panels (#3698)
- Loading branch information
Showing
5 changed files
with
106 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
plugins/variants/src/VariantFeatureWidget/VariantAnnotationTable.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react' | ||
import { BaseCard } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail' | ||
import AnnotGrid from './AnnotGrid' | ||
|
||
export default function VariantAnnotationTable({ | ||
data, | ||
fields, | ||
title, | ||
}: { | ||
data: string[] | ||
fields: string[] | ||
title: string | ||
}) { | ||
return data.length ? ( | ||
<BaseCard title={title}> | ||
<AnnotGrid | ||
rows={ | ||
data.map((elt, id) => ({ | ||
id, | ||
...Object.fromEntries(elt.split('|').map((e, i) => [fields[i], e])), | ||
})) || [] | ||
} | ||
columns={fields.map(c => ({ field: c }))} | ||
/> | ||
</BaseCard> | ||
) : null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters