-
Notifications
You must be signed in to change notification settings - Fork 5
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 #253 from RhoInc/v1.4.0-dev
web-codebook v1.4.0
- Loading branch information
Showing
80 changed files
with
4,814 additions
and
1,134 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Web Codebook</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://rawgit.com/RhoInc/Webcharts/master/build/webcharts.js'></script> | ||
<script type = 'text/javascript' src = '../webcodebook.js'></script> | ||
<script src="https://rawgit.com/RhoInc/viz-library/master/util/web/data/dataFiles.js"></script> | ||
|
||
<link type = 'text/css' rel = 'stylesheet' href = 'https://rawgit.com/RhoInc/Webcharts/master/css/webcharts.css'> | ||
<link type = 'text/css' rel = 'stylesheet' href = '../../css/webcodebook.css'> | ||
<link type = 'text/css' rel = 'stylesheet' href = './index.css'> | ||
</head> | ||
|
||
<body> | ||
<div id = 'title'>Web Codebook - Explorer</div> | ||
<div id = 'subtitle'>Test Page</div> | ||
<div id = 'container'></div> | ||
</body> | ||
|
||
<script type = 'text/javascript' src = './explorer.js' defer></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,24 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Web Codebook</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://rawgit.com/RhoInc/Webcharts/master/build/webcharts.js'></script> | ||
<script type = 'text/javascript' src = 'https://rawgit.com/RhoInc/web-codebook/master/build/webcodebook.js'></script> | ||
<script src="https://rawgit.com/RhoInc/viz-library/master/util/web/data/dataFiles.js"></script> | ||
|
||
<link type = 'text/css' rel = 'stylesheet' href = 'https://rawgit.com/RhoInc/Webcharts/master/css/webcharts.css'> | ||
<link type = 'text/css' rel = 'stylesheet' href = 'https://rawgit.com/RhoInc/web-codebook/master/css/webcodebook.css'> | ||
<link type = 'text/css' rel = 'stylesheet' href = './index.css'> | ||
</head> | ||
|
||
<body> | ||
<div id = 'title'>Web Codebook - Explorer</div> | ||
<div id = 'subtitle'>Test Page</div> | ||
<div id = 'container'></div> | ||
</body> | ||
|
||
<script type = 'text/javascript' src = './explorer.js' defer></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,65 @@ | ||
document.onreadystatechange = function () { | ||
if (document.readyState === 'complete') { | ||
//Load local build if in local environment. | ||
if (window.origin !== 'https://rhoinc.github.io') { | ||
var head = document.getElementsByTagName('head')[0]; | ||
|
||
//...load local build. | ||
var script = document.createElement('script'); | ||
script.type = 'text/javascript'; | ||
script.src = '../webcodebook.js'; | ||
head.appendChild(script); | ||
|
||
//...load local stylesheet. | ||
for (var i = 0; i < document.styleSheets.length; i++) { | ||
var styleSheet = document.styleSheets[i]; | ||
if (styleSheet.href.indexOf('webcodebook') > -1) | ||
styleSheet.disabled = true; | ||
} | ||
var link = document.createElement('link'); | ||
link.type = 'text/css'; | ||
link.rel = 'stylesheet'; | ||
link.href = '../../css/webcodebook.css'; | ||
head.appendChild(link); | ||
} | ||
|
||
function initExplorer(fileList){ | ||
// console.log(fileList) | ||
var metaFiles = ["AE","DM","LB"] //list of files to add meta data | ||
d3.csv("https://rawgit.com/RhoInc/viz-library/master/data/safetyData/variableMetaData.csv",function(error,meta){ | ||
meta.forEach(function(f){ | ||
f.file = f.Form+".csv" | ||
f.label = f.Label | ||
// console.log(f) | ||
}) | ||
var fileList_clean = fileList.map(function(f){ | ||
f.path = "https://rawgit.com/RhoInc/viz-library/master"+f.rel_path.slice(1); | ||
f.shortname = f.filename.replace(/\.[^/.]+$/, "") | ||
if(metaFiles.indexOf(f.shortname)>-1){ | ||
f.meta = meta.filter(m=>m.Form == f.shortname) | ||
.map(function(m){ | ||
m.value_col = m.Variable; | ||
return m; | ||
}) | ||
f["Metadata included?"] = "Yes" | ||
}else{ | ||
f["Metadata included?"] = "No" | ||
} | ||
return f; | ||
}) | ||
|
||
var settings = { | ||
labelColumn:"filename", | ||
ignoredColumns: ["local_path","rel_path","path"], | ||
files:fileList_clean, | ||
meta:meta | ||
}; | ||
console.log(settings) | ||
var explorer = webcodebook.createExplorer("#container", settings).init(); | ||
}) | ||
|
||
} | ||
|
||
initExplorer(dataFiles) | ||
} | ||
} |
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,25 @@ | ||
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,300); | ||
* { | ||
padding: 0; | ||
margin: 0; | ||
font-family: 'Open Sans'; | ||
} | ||
#title { | ||
width: 96%; | ||
padding: 0 0 1% 0; | ||
border-bottom: 2px solid lightgray; | ||
margin: 2% 2% 1% 2%; | ||
font-size: 32px; | ||
font-weight: normal; | ||
} | ||
#subtitle { | ||
width: 96%; | ||
margin: 0 2% 1% 2%; | ||
font-size: 24px; | ||
font-weight: lighter; | ||
} | ||
#container { | ||
width: 96%; | ||
margin: 1% 2%; | ||
display: inline-block; | ||
} |
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 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Web Codebook</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://rawgit.com/RhoInc/Webcharts/master/build/webcharts.js'></script> | ||
<script type = 'text/javascript' src = 'https://rawgit.com/RhoInc/web-codebook/master/build/webcodebook.js'></script> | ||
|
||
<link type = 'text/css' rel = 'stylesheet' href = 'https://rawgit.com/RhoInc/Webcharts/master/css/webcharts.css'> | ||
<link type = 'text/css' rel = 'stylesheet' href = 'https://rawgit.com/RhoInc/web-codebook/master/css/webcodebook.css'> | ||
<link type = 'text/css' rel = 'stylesheet' href = './index.css'> | ||
</head> | ||
|
||
<body> | ||
<div id = 'title'>Web Codebook</div> | ||
<div id = 'subtitle'>Test Page</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,50 @@ | ||
document.onreadystatechange = function () { | ||
if (document.readyState === 'complete') { | ||
//Load local build if in local environment. | ||
if (window.origin !== 'https://rhoinc.github.io') { | ||
var head = document.getElementsByTagName('head')[0]; | ||
|
||
//...load local build. | ||
var script = document.createElement('script'); | ||
script.type = 'text/javascript'; | ||
script.src = '../webcodebook.js'; | ||
head.appendChild(script); | ||
|
||
//...load local stylesheet. | ||
for (var i = 0; i < document.styleSheets.length; i++) { | ||
var styleSheet = document.styleSheets[i]; | ||
if (styleSheet.href.indexOf('webcodebook') > -1) | ||
styleSheet.disabled = true; | ||
} | ||
var link = document.createElement('link'); | ||
link.type = 'text/css'; | ||
link.rel = 'stylesheet'; | ||
link.href = '../../css/webcodebook.css'; | ||
head.appendChild(link); head.appendChild(script); | ||
} | ||
|
||
d3.csv( | ||
'https://rawgit.com/RhoInc/viz-library/master/data/testData/ADTIMELINES_partialMissing.csv', | ||
function(error,data) { | ||
if (error) | ||
console.log(error); | ||
|
||
var settings = { | ||
// chartVisibility: 'hidden', | ||
meta:[ | ||
{ | ||
value_col:"USUBJID", | ||
label:"Subject ID", | ||
description: "Unique Identifier" | ||
} | ||
] | ||
}; | ||
var instance = webcodebook.createCodebook( | ||
'#container', | ||
settings | ||
); | ||
instance.init(data); | ||
} | ||
); | ||
}; | ||
} |
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,24 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Web Codebook</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://rawgit.com/RhoInc/Webcharts/master/build/webcharts.js'></script> | ||
<script type = 'text/javascript' src = '../webcodebook.js'></script> | ||
|
||
<link type = 'text/css' rel = 'stylesheet' href = 'https://rawgit.com/RhoInc/Webcharts/master/css/webcharts.css'> | ||
<link type = 'text/css' rel = 'stylesheet' href = '../../css/webcodebook.css'> | ||
<link type = 'text/css' rel = 'stylesheet' href = './index.css'> | ||
<script type = 'text/javascript' src = './index.js'></script> | ||
|
||
</head> | ||
|
||
<body> | ||
<div id = 'title'>Web Codebook</div> | ||
<div id = 'subtitle'>Test Page</div> | ||
<div id = 'container'></div> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.