-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
50 lines (49 loc) · 1.53 KB
/
index.js
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
document.onreadystatechange = function () {
if (document.readyState === 'complete') {
let settings = {
max_width: 600,
value_col: 'LBORRES',
measure_col: 'TESTNAM',
visit_col:"VISIT",
// visitn_col: 'VISITNUM',
studyday_col: 'STUDYDAY',
normal_col_low: 'LBORRESLO',
normal_col_high: 'LBORRESHI',
id_col: 'SUBJID',
group_cols: ['SEX',"AgeGroup"],
filters: [
{
value_col: 'SEX',
label: 'Sex'
},
{
value_col: 'AgeGroup',
label: 'Age'
}
],
measure_values:{
'ALT':'ALT (SGPT)',
'AST':'AST (SGOT)',
'TB':'Total Bilirubin',
'ALP':"Alkaline Phosphatase"
},
baseline:{
value_col:"STUDYDAY",
values:[1]
}
};
const chart = hepexplorer('#container', settings);
d3.csv('ex.csv', function(data) {
console.log(data)
data.forEach(function(d){
d.EPOCH = +d.STUDYDAY > 1 ? "Analysis" : "Baseline";
d.AgeGroup = +d.AGE < 60 ? "<60":"60+";
})
chart.init(data);
});
//const chart = safetyedish('#container', {});
//d3.csv('../../viz-library/data/safetyData/ADBDS.csv', function(data) {
// chart.init(data);
//});
}
}