-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #313 from SafetyGraphics/dev-v1.1.1
Dev v1.2.0
- Loading branch information
Showing
14 changed files
with
424 additions
and
114 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,15 @@ | ||
export function relabelMeasureControls() { | ||
var chart = this; | ||
var config = this.config; | ||
const all_settings = ['x_options', 'y_options', 'point_size_options']; | ||
const controlLabels = ['X-axis Measure', 'Y-axis Measure', 'Point Size']; | ||
const controlWraps = chart.controls.wrap | ||
.selectAll('div') | ||
.filter(controlInput => controlLabels.indexOf(controlInput.label) > -1); | ||
const controls = controlWraps.select('select'); | ||
const options = controls.selectAll('option'); | ||
var allKeys = Object.keys(config.measure_values); | ||
options | ||
.text(d => (allKeys.indexOf(d) > -1 ? config.measure_values[d] : d)) | ||
.property('value', d => d); | ||
} |
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
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
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
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,23 @@ | ||
<html> | ||
<head> | ||
<title>Hepatic Safety Explorer - Example 2</title> | ||
|
||
<meta http-equiv = 'Content-Type' content = 'text/html; charset = utf-8'> | ||
|
||
<script type = 'text/javascript' src = 'https://d3js.org/d3.v3.min.js'></script> | ||
<script type = 'text/javascript' src = 'https://cdn.jsdelivr.net/gh/RhoInc/Webcharts@1/build/webcharts.min.js'></script> | ||
<script type = 'text/javascript' src = '../../hepexplorer.js'></script> | ||
<link type = 'text/css' rel = 'stylesheet' href = 'https://cdn.jsdelivr.net/gh/RhoInc/Webcharts@1/css/webcharts.min.css'> | ||
<link type = 'text/css' rel = 'stylesheet' href = '../index.css'> | ||
|
||
</head> | ||
|
||
<body> | ||
<div id = 'title'>Hepatic Safety Explorer</div> | ||
<div id = 'subtitle'>Example 4 - Example with custom measures</div> | ||
<div id= 'info'>This is a demo page for the interactive Hepatic Explorer created by the ASA-DIA Interactive Safety Graphics working group. Code, details and documentation are available on <a href="https://github.com/SafetyGraphics/hep-explorer">github</a>.</div> | ||
<div id = 'container'></div> | ||
</body> | ||
|
||
<script type = 'text/javascript' src = './index.js'></script> | ||
</html> |
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,80 @@ | ||
const 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: ['TRTA','SEX'], | ||
filters: [ | ||
{ | ||
value_col: 'TRTA', | ||
label: 'Treatment' | ||
}, | ||
{ | ||
value_col: 'SEX', | ||
label: 'Sex' | ||
}, | ||
{ | ||
value_col: 'SUBJID', | ||
label: 'ID' | ||
} | ||
], | ||
measure_values:{ | ||
'ALT':'ALT (SGPT)', | ||
'AST':'AST (SGOT)', | ||
'TB':'Total Bilirubin', | ||
'ALP':"Alkaline Phosphatase", | ||
'GGT':"GGT", | ||
"LDH":"LDH" | ||
}, | ||
add_measures:true, | ||
/* | ||
**Code below is required when measure_values is customized prior to v1.1.1** | ||
cuts:{ | ||
ALT: { | ||
relative_baseline: 3.8, | ||
relative_uln: 3 | ||
}, | ||
AST: { | ||
relative_baseline: 3.8, | ||
relative_uln: 3 | ||
}, | ||
TB: { | ||
relative_baseline: 4.8, | ||
relative_uln: 2 | ||
}, | ||
ALP: { | ||
relative_baseline: 3.8, | ||
relative_uln: 1 | ||
}, | ||
GGT: { | ||
relative_baseline: 3.8, | ||
relative_uln: 3 | ||
}, | ||
LDH: { | ||
relative_baseline: 3.8, | ||
relative_uln: 3 | ||
} | ||
}, | ||
*/ | ||
baseline:{ | ||
value_col:"STUDYDAY", | ||
values:[1] | ||
}, | ||
analysisFlag:{ | ||
value_col:"EPOCH", | ||
values:["Analysis"] | ||
} | ||
}; | ||
const chart = hepexplorer('#container', settings); | ||
d3.csv('../example2/allQuads.csv', function(data) { | ||
data.forEach(function(d){ | ||
d.EPOCH = +d.STUDYDAY > 1 ? "Analysis" : "Baseline"; | ||
d.AgeGroup = +d.AGE < 60 ? "<60":"60+"; | ||
}) | ||
chart.init(data); | ||
}); |