-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add table visualisation for categorical values (#5012)
* Create table component for category data * Add table for categorical params to ClinicalData.tsx - Change logic related to showing checkboxes leaving only show N/A for table --------- Co-authored-by: alisman <lisman.aaron@gmail.com>
- Loading branch information
1 parent
e02291f
commit 3f3f27f
Showing
6 changed files
with
75 additions
and
6 deletions.
There are no files selected for viewing
Binary file modified
BIN
-284 KB
(0.0%)
...chart_exclude_overlapping_samples_chi_squared_test_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+109 Bytes
(100%)
...shots/reference/no_session_comparison_tab_clinical_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+109 Bytes
(100%)
...eenshots/reference/session_comparison_tab_clinical_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { FunctionComponent } from 'react'; | ||
import * as React from 'react'; | ||
import { IMultipleCategoryBarPlotData } from 'shared/components/plots/MultipleCategoryBarPlot'; | ||
|
||
type CategoryTableProps = { | ||
data: IMultipleCategoryBarPlotData[]; | ||
labels: string[]; | ||
}; | ||
|
||
export const CategoryTable: FunctionComponent<CategoryTableProps> = ( | ||
props: CategoryTableProps | ||
) => { | ||
const headers = | ||
props.labels.length === 1 ? ( | ||
<th colSpan={2}>{props.labels[0]}</th> | ||
) : ( | ||
[<th />, props.labels.map(label => <th colSpan={1}>{label}</th>)] | ||
); | ||
return ( | ||
<table className="table table-striped" style={{ minWidth: '400px' }}> | ||
<thead> | ||
<tr>{headers}</tr> | ||
</thead> | ||
<tbody> | ||
{props.data.map(d => ( | ||
<tr> | ||
<td>{d.minorCategory}</td> | ||
{d.counts.map(c => ( | ||
<td>{c.count}</td> | ||
))} | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
); | ||
}; |
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