generated from samply/lens-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.component.ts
58 lines (53 loc) · 1.65 KB
/
main.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { Component } from '@angular/core';
import { ResultRenderer } from '@samply/lens-core';
import {
BarChartComponent,
PieChartComponent,
} from '@samply/lens-components/chart-js';
import { ResultSummaryBarComponent } from '@samply/lens-components/result-summary-bar';
import { BeaconResultTableComponent } from '../components/beacon-result-table/beacon-result-table.component';
/**
* Defines the components that will be used to build the Beacon search GUI.
*/
@Component({
selector: 'app-main',
templateUrl: './main.component.html',
styleUrls: ['./main.component.css'],
})
export class MainComponent {
private siteHeaders: Map<string, string> = new Map<string, string>();
private genderHeaders: Map<string, string> = new Map<string, string>()
.set('male', 'männlich')
.set('female', 'weiblich')
.set('other', 'sonstiges / intersexuell')
.set('unknown', 'unbekannt');
public diagrams: ResultRenderer[] = [
new ResultRenderer(
'',
[{ key: 'patients', subset: 'sites' }],
BeaconResultTableComponent,
{
headers: this.siteHeaders,
clickDisabled: true,
displayProperties: ['extra-wide-diagram'],
}
),
new ResultRenderer(
'Gender Distribution',
[{ key: 'patients', subset: 'Gender' }],
PieChartComponent,
{ headers: this.genderHeaders }
),
new ResultRenderer(
"Ethnicity",
[{key: "patients", subset: "Ethnicity"}],
BarChartComponent
),
new ResultRenderer(
'Samples',
[{ key: 'specimen', subset: 'sample_kind' }],
BarChartComponent,
{ xAxisTitle: 'Sample types', yAxisTitle: 'Sample count' }
),
];
}