Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor summary row #254

Merged
merged 33 commits into from
May 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
bfd198d
Merge branch 'unique-selectors' into v1.4.0-dev
jwildfire Apr 11, 2018
2167ec9
merge test page branch
jwildfire Apr 11, 2018
b6bb537
don't automatically open test pages on build
jwildfire Apr 11, 2018
79801bf
local testing
jwildfire Apr 11, 2018
b680399
import clone
jwildfire Apr 11, 2018
407c72a
start layout refactor #187
jwildfire Apr 11, 2018
b267188
summary table refactor underway. #187
jwildfire Apr 11, 2018
4215b6f
updated controls/toggle for new layout. #187
jwildfire Apr 11, 2018
7dd9179
pull type tag left. #187
jwildfire Apr 11, 2018
646ad75
add metadata as tags
jwildfire Apr 11, 2018
92b0d8f
add metadata as tags
jwildfire Apr 11, 2018
5b45b09
add basic explorer page
jwildfire Apr 14, 2018
810da15
add SDTM metadata to explorer
jwildfire Apr 14, 2018
9bdd804
hide metadata when details are collapsed
jwildfire Apr 14, 2018
daa356e
framework for sparklines #256
jwildfire Apr 14, 2018
8a943f0
sparklines #256
jwildfire Apr 15, 2018
f9d178a
update explorer example
jwildfire Apr 15, 2018
114bd9f
minor sparkline improvements
jwildfire Apr 15, 2018
9ba20b5
change lines to 50-bin histograms for continuous
jwildfire Apr 17, 2018
8f7af87
refactor row/col counts. fix #251
jwildfire Apr 18, 2018
3128920
clean up console logs and explorer example
jwildfire Apr 18, 2018
c2260b3
fix callbacks on cloned codebook. fixed #259
jwildfire Apr 18, 2018
d8b943a
fix hover css. fix #260
jwildfire Apr 19, 2018
0e44aed
fix the explorer so that it indicates which file is loaded and can lo…
samussiah Apr 24, 2018
50cf647
remove stray console.logs()s
samussiah Apr 24, 2018
6b349b8
Fix typo
May 11, 2018
e101fd3
add code that waits until the loading state of the document is comple…
samussiah May 14, 2018
533d56b
Merge branch 'v1.4.0-dev' into explorer-fix
May 14, 2018
6500f18
Merge pull request #265 from RhoInc/test-page-fix
May 14, 2018
f05faab
build type fix
jwildfire May 31, 2018
ae1b3dd
merge v1.4.0-dev updates
jwildfire May 31, 2018
6bdd270
merge refactor-summary-row brach
jwildfire May 31, 2018
c2d7528
Merge pull request #263 from RhoInc/explorer-fix
May 31, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions build/test-page/explorer-local.html
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>
24 changes: 24 additions & 0 deletions build/test-page/explorer.html
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>
65 changes: 65 additions & 0 deletions build/test-page/explorer.js
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)
}
}
79 changes: 45 additions & 34 deletions build/test-page/index.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,50 @@
//Load local build if in local environment.
if (window.origin !== 'https://rhoinc.github.io') {
var head = document.getElementsByTagName('head')[0];
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 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);
}
//...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/safetyData/SDTM/DM.csv',
function(error,data) {
if (error)
console.log(error);
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: 'visible'
};
var instance = webcodebook.createCodebook(
'#container',
settings
var settings = {
// chartVisibility: 'hidden',
meta:[
{
value_col:"USUBJID",
label:"Subject ID",
description: "Unique Identifier"
}
]
};
var instance = webcodebook.createCodebook(
'#container',
settings
);
instance.init(data);
}
);
instance.init(data);
}
);
};
}
24 changes: 24 additions & 0 deletions build/test-page/local.html
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>
Loading