-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
126 changed files
with
16,122 additions
and
539 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
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,20 @@ | ||
Copyright (c) 2018-2019, Triad National Security, LLC. All rights reserved. | ||
|
||
This software was produced under U.S. Government contract 89233218CNA000001 for | ||
Los Alamos National Laboratory (LANL), which is operated by Triad National | ||
Security, LLC for the U.S. Department of Energy/National Nuclear Security | ||
Administration. | ||
|
||
All rights in the program are reserved by Triad National Security, LLC, and the | ||
U.S. Department of Energy/National Nuclear Security Administration. The | ||
Government is granted for itself and others acting on its behalf a nonexclusive, | ||
paid-up, irrevocable worldwide license in this material to reproduce, prepare | ||
derivative works, distribute copies to the public, perform publicly and display | ||
publicly, and to permit others to do so. | ||
|
||
This is open source software; you can redistribute it and/or modify it under the | ||
terms of the "3-Clause BSD License". If software is modified to produce | ||
derivative works, such modified software should be clearly marked, so as not to | ||
confuse it with the version available from LANL. Full text of the "3-Clause BSD | ||
License" can be found in the License file in the main development branch of the | ||
repository. |
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,29 @@ | ||
* { | ||
font-family: helvetica !important; | ||
} | ||
|
||
div.container { | ||
width: 100%; | ||
border: 1px solid gray; | ||
} | ||
|
||
body { | ||
background-color: #f9f9f9; | ||
} | ||
|
||
header, footer { | ||
padding-left: 1px; | ||
padding-right: 1px; | ||
padding-top: 10px; | ||
padding-bottom: 10px; | ||
color: white; | ||
background-color: #373737; | ||
clear: left; | ||
text-align: center; | ||
} | ||
|
||
#header h2 { | ||
display: inline-block; | ||
margin: initial; | ||
} | ||
|
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,26 @@ | ||
#resultsArea { | ||
float: left; | ||
left: 0px; | ||
right: 0px; | ||
width: 100%; | ||
padding: 10px; | ||
background-color: white; | ||
} | ||
|
||
.imageArea { | ||
float: left; | ||
position: relative; | ||
width: 75%; | ||
} | ||
|
||
.sliderArea { | ||
float: left; | ||
position: relative; | ||
width: 20%; | ||
} | ||
|
||
.cinemaImage { | ||
float: left; | ||
position: relative; | ||
padding: 2px; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,28 @@ | ||
Copyright (c) 2018-2019, Triad National Security, LLC. All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or | ||
without modification, are permitted provided that the following conditions | ||
are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, | ||
this list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of Los Alamos National Security, LLC, Los Alamos | ||
National Laboratory, LANL, the U.S. Government, nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR CONTRIBUTORS | ||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE | ||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | ||
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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 @@ | ||
1.0 |
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
<!doctype html> | ||
<html> | ||
|
||
<head> | ||
<meta app="cinema:compare" version="1.0"> | ||
<meta charset="utf-8"> | ||
<link rel='stylesheet' href='cinema/compare/1.0/css/compare.css'> | ||
<link rel='stylesheet' href='cinema/compare/1.0/css/common.css'> | ||
<script src='cinema/lib/d3.v4.min.js'></script> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<header> | ||
<h2>CinemaCompare</h2> | ||
</header> | ||
|
||
<div id="resultsArea"> | ||
<div class="imageArea" id="imageArea"></div> | ||
<div class="sliderArea"> | ||
<div id="sliderContainer" class="sliderContainer"> | ||
<div> | ||
<div>Image Size</div> | ||
<input type="range" min="1" max="100" id="imageSize" step="1"> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<footer> </footer> | ||
|
||
</div> | ||
|
||
<script> | ||
function onlyUnique(value, index, self) { | ||
return self.indexOf(value) === index; | ||
} | ||
|
||
function getLookupKey(keys, query) { | ||
var key = ""; | ||
keys.forEach(function(item, index) { | ||
key += query[item] + "_"; | ||
}); | ||
|
||
return key; | ||
} | ||
|
||
var dataSets = ["data/test.cdb"]; | ||
// START: add code to manage databases to view | ||
var dataSets = [ | ||
"tmp/samples.cdb", | ||
"tmp/visualization.cdb" | ||
]; | ||
// END: add code to manage databases to view | ||
|
||
var dataResults = null; | ||
var dataValues = null; | ||
var query = {}; | ||
var images = []; | ||
|
||
var q = d3.queue(); | ||
dataSets.forEach(function(item, index) { | ||
q.defer(d3.csv, item + "/data.csv"); | ||
}); | ||
q.awaitAll(function(error, results) { | ||
var values = {}; | ||
results.forEach(function(item, index) { | ||
var keys = Object.keys(item[0]).filter(function(d) { | ||
return !isNaN(+item[0][d]); | ||
}); | ||
|
||
var lookup = {}; | ||
|
||
item.forEach(function(result, index) { | ||
keys.forEach(function(key, index) { | ||
if (!(key in values)) { | ||
values[key] = []; | ||
} | ||
|
||
values[key].push(result[key]); | ||
}); | ||
|
||
lookup[getLookupKey(keys, result)] = result; | ||
}) | ||
|
||
results[index] = {keys: keys, results: results[index], lookup: lookup}; | ||
}); | ||
|
||
var keys = Object.keys(values); | ||
keys.forEach(function(key, index) { | ||
values[key] = values[key].filter(onlyUnique); | ||
values[key] = values[key].sort(function(a, b){return (+a)-(+b)}); | ||
}); | ||
|
||
doneLoading(results, values); | ||
}); | ||
|
||
function updateResults() { | ||
dataResults.forEach(function(result, index) { | ||
var imgSrcKey = getLookupKey(result.keys, query); | ||
if (imgSrcKey in result.lookup) { | ||
var imgSrc = dataSets[index] + "/" +result.lookup[imgSrcKey]["FILE"]; | ||
images[index].img.attr("src", imgSrc); | ||
} | ||
else { | ||
images[index].img.attr("src", "images/empty.png"); | ||
} | ||
}); | ||
} | ||
|
||
function doneLoading(results, values) { | ||
var imageSizeSlider = d3.select("#imageSize") | ||
.property("value", (100/dataSets.length)-1) | ||
.on("input", function() { | ||
images.forEach(function(item, index) { | ||
item.img.style("width","" + imageSizeSlider.node().value + "%"); | ||
item.img.attr("height", null); | ||
}); | ||
}); | ||
|
||
dataResults = results; | ||
dataValues = values; | ||
|
||
var keys = Object.keys(values); | ||
keys.forEach(function(key, index) { | ||
var sliderDiv = d3.select("#sliderContainer").append("div"); | ||
sliderDiv.append("div") | ||
.html(key) | ||
.style("padding", "5px"); | ||
var slider = sliderDiv.append("div") | ||
.append("input") | ||
.attr("type","range") | ||
.attr("min", "0") | ||
.attr("max", values[key].length - 1) | ||
.property("value", "0") | ||
.style("float", "left"); | ||
var sliderText = sliderDiv.append("input") | ||
.attr("type","text") | ||
.attr("value", values[key][0]) | ||
.style("width", "40px") | ||
.on("input", function() { | ||
query[key] = this.value; | ||
var index = values[key].indexOf(this.value); | ||
slider.property("value", index); | ||
updateResults(); | ||
}); | ||
|
||
slider.on("input", function() { | ||
var val = values[key][+this.value]; | ||
sliderText.property("value", val); | ||
query[key] = val; | ||
updateResults(); | ||
}); | ||
|
||
query[key] = values[key][0]; | ||
}); | ||
|
||
dataResults.forEach(function(result, index) { | ||
var imgSrcKey = getLookupKey(result.keys, query); | ||
|
||
var img = d3.select("#imageArea").append("img") | ||
.attr("class", "cinemaImage") | ||
.attr("src", "images/empty.png") | ||
.style("width","" + imageSizeSlider.node().value + "%") | ||
.on("load", function() { | ||
if (this.src != "images/empty.png") { | ||
images[index].height = this.height; | ||
} | ||
}) | ||
.on("error", function() { | ||
this.src='images/empty.png'; | ||
this.height = images[index].height; | ||
}); | ||
|
||
images.push({img: img}); | ||
|
||
if (imgSrcKey in result.lookup) { | ||
var imgSrc = dataSets[index] + "/" + result.lookup[imgSrcKey]["FILE"]; | ||
images[index].img.attr("src", imgSrc); | ||
} | ||
else { | ||
images[index].img.attr("src", "images/empty.png"); | ||
} | ||
|
||
}); | ||
} | ||
|
||
</script> | ||
</body> | ||
</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,2 @@ | ||
from . import install | ||
from . import cdb |
Binary file not shown.
Binary file not shown.
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 @@ | ||
from . import cdb |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.