Skip to content

Commit

Permalink
Added example data start.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Orban committed Aug 6, 2018
1 parent 2ba47e6 commit b10b4b6
Show file tree
Hide file tree
Showing 5 changed files with 193 additions and 101 deletions.
7 changes: 2 additions & 5 deletions cinema_bandit.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,10 @@ <h1>Cinema:Bandit</h1>
<div id="sidebar">
<!--The side bar is split vertically into thirds where each third contains a "socket" where one
of the views can be placed-->
<div id="visarSocketContainer" class="sidebarThird">
<!--div id="visarSocketContainer" class="sidebarThird">
<span>Visar</span>
<div id="visarSocket" class="socket">
<div id="visarContainer" class="viewContainer">
<!--The Visar Chart is created in here-->
</div>
<div id="visarSocketOverlay" class="socketOverlay" mode="disabled"></div>
</div>
Expand All @@ -105,7 +104,6 @@ <h1>Cinema:Bandit</h1>
<span>Diffraction Image</span>
<div id="diffractionImageSocket" class="socket">
<div id="diffractionImageContainer" class="viewContainer">
<!--The Diffraction Image display is created in here-->
</div>
<div id="diffractionImageSocketOverlay" class="socketOverlay" mode="disabled"></div>
</div>
Expand All @@ -114,11 +112,10 @@ <h1>Cinema:Bandit</h1>
<span>Diffraction Graph</span>
<div id="diffractionSocket" class="socket">
<div id="diffractionContainer" class="viewContainer">
<!--The Diffraction chart is created in here-->
</div>
<div id="diffractionSocketOverlay" class="socketOverlay" mode="disabled"></div>
</div>
</div>
</div-->
</div>
<!--The Main View-->
<div id="resultsArea">
Expand Down
101 changes: 100 additions & 1 deletion databases.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,105 @@
[
{
"name": "Sphere0",
"directory": "examples/sphere_multi-image.cdb",
"info": [
{
"name": "visar",
"type": "line",
"data":
[
{
"column": "FILE_visar1",
"xcol": null,
"ycol": 0,
"delimiter": null
},
{
"column": "FILE_visar2",
"xcol": null,
"ycol": 1,
"delimiter": null
}
]
}
]
},
{
"name": "Sphere",
"directory": "examples/sphere_multi-image.cdb"
"directory": "examples/sphere_multi-image.cdb",
"info": [
{
"name": "Visar",
"type": "line",
"data":
[
{
"column": "FILE_visar1",
"xcol": null,
"ycol": 0,
"delimiter": null
},
{
"column": "FILE_visar2",
"xcol": null,
"ycol": 1,
"delimiter": null
}
]
},
{
"name": "Diffraction Image",
"type": "image",
"data":
[
"FILE_diffraction_image1",
"FILE_diffraction_image2"
]
},
{
"name": "Diffraction Graph",
"type": "line",
"data":
[
{
"column": "FILE_diffraction1",
"xcol": null,
"ycol": 0,
"delimiter": null
},
{
"column": "FILE_diffraction2",
"xcol": null,
"ycol": 1,
"delimiter": null
}
]
}
]
},
{
"name": "Sphere2",
"directory": "examples/sphere_multi-image.cdb",
"info": [
{
"name": "Visar",
"type": "line",
"data":
[
{
"column": "FILE_visar1",
"xcol": null,
"ycol": 0,
"delimiter": null
},
{
"column": "FILE_visar2",
"xcol": null,
"ycol": 1,
"delimiter": null
}
]
}
]
}
]
42 changes: 21 additions & 21 deletions examples/sphere_multi-image.cdb/data.csv
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
theta,phi,visar_file1,visar_file2,visar1_yCol,visar2_yCol,diffraction_image1,diffraction_image2,diffraction_file1,diffraction_file2,diffraction1_yCol,diffraction2_yCol
0,-180,graph1/0_-180.txt,graph1/0_-180.txt,0,1,image/-180/0.png,image/-180/0.png,graph1/0_-180.txt,graph1/0_-180.txt,0,1
0,-162,graph1/0_-162.txt,graph1/0_-162.txt,0,1,image/-162/0.png,image/-180/0.png,graph1/0_-162.txt,graph1/0_-162.txt,0,1
0,-144,graph1/0_-144.txt,graph1/0_-144.txt,0,1,image/-144/0.png,image/-180/0.png,graph1/0_-144.txt,graph1/0_-144.txt,0,1
0,-126,graph1/0_-126.txt,graph1/0_-126.txt,0,1,image/-126/0.png,image/-180/0.png,graph1/0_-126.txt,graph1/0_-126.txt,0,1
0,-108,graph1/0_-108.txt,graph1/0_-108.txt,0,1,image/-108/0.png,image/-180/0.png,graph1/0_-108.txt,graph1/0_-108.txt,0,1
0,-90,graph1/0_-90.txt,graph1/0_-90.txt,0,1,image/-90/0.png,image/-180/0.png,graph1/0_-90.txt,graph1/0_-90.txt,0,1
0,-72,graph1/0_-72.txt,graph1/0_-72.txt,0,1,image/-72/0.png,image/-180/0.png,graph1/0_-72.txt,graph1/0_-72.txt,0,1
0,-54,graph1/0_-54.txt,graph1/0_-54.txt,0,1,image/-54/0.png,image/-180/0.png,graph1/0_-54.txt,graph1/0_-54.txt,0,1
0,-36,graph1/0_-36.txt,graph1/0_-36.txt,0,1,image/-36/0.png,image/-180/0.png,graph1/0_-36.txt,graph1/0_-36.txt,0,1
0,-18,graph1/0_-18.txt,graph1/0_-18.txt,0,1,image/-18/0.png,image/-180/0.png,graph1/0_-18.txt,graph1/0_-18.txt,0,1
0,0,graph1/0_0.txt,graph1/0_0.txt,0,1,image/0/0.png,image/-180/0.png,graph1/0_0.txt,graph1/0_0.txt,0,1
0,18,graph1/0_18.txt,graph1/0_18.txt,0,1,image/18/0.png,image/-180/0.png,graph1/0_18.txt,graph1/0_18.txt,0,1
0,36,graph1/0_36.txt,graph1/0_36.txt,0,1,image/36/0.png,image/-180/0.png,graph1/0_36.txt,graph1/0_36.txt,0,1
0,54,graph1/0_54.txt,graph1/0_54.txt,0,1,image/54/0.png,image/-180/0.png,graph1/0_54.txt,graph1/0_54.txt,0,1
0,72,graph1/0_72.txt,graph1/0_72.txt,0,1,image/72/0.png,image/-180/0.png,graph1/0_72.txt,graph1/0_72.txt,0,1
0,90,graph1/0_90.txt,graph1/0_90.txt,0,1,image/90/0.png,image/-180/0.png,graph1/0_90.txt,graph1/0_90.txt,0,1
0,108,graph1/0_108.txt,graph1/0_108.txt,0,1,image/108/0.png,image/-180/0.png,graph1/0_108.txt,graph1/0_108.txt,0,1
0,126,graph1/0_126.txt,graph1/0_126.txt,0,1,image/126/0.png,image/-180/0.png,graph1/0_126.txt,graph1/0_126.txt,0,1
0,144,graph1/0_144.txt,graph1/0_144.txt,0,1,image/144/0.png,image/-180/0.png,graph1/0_144.txt,graph1/0_144.txt,0,1
0,162,graph1/0_162.txt,graph1/0_162.txt,0,1,image/162/0.png,image/-180/0.png,graph1/0_162.txt,graph1/0_162.txt,0,1
theta,phi,FILE_visar1,FILE_visar2,FILE_diffraction_image1,FILE_diffraction_image2,FILE_diffraction1,FILE_diffraction2
0,-180,graph1/0_-180.txt,graph1/0_-180.txt,image/-180/0.png,image/-180/0.png,graph1/0_-180.txt,graph1/0_-180.txt
0,-162,graph1/0_-162.txt,graph1/0_-162.txt,image/-162/0.png,image/-180/0.png,graph1/0_-162.txt,graph1/0_-162.txt
0,-144,graph1/0_-144.txt,graph1/0_-144.txt,image/-144/0.png,image/-180/0.png,graph1/0_-144.txt,graph1/0_-144.txt
0,-126,graph1/0_-126.txt,graph1/0_-126.txt,image/-126/0.png,image/-180/0.png,graph1/0_-126.txt,graph1/0_-126.txt
0,-108,graph1/0_-108.txt,graph1/0_-108.txt,image/-108/0.png,image/-180/0.png,graph1/0_-108.txt,graph1/0_-108.txt
0,-90,graph1/0_-90.txt,graph1/0_-90.txt,image/-90/0.png,image/-180/0.png,graph1/0_-90.txt,graph1/0_-90.txt
0,-72,graph1/0_-72.txt,graph1/0_-72.txt,image/-72/0.png,image/-180/0.png,graph1/0_-72.txt,graph1/0_-72.txt
0,-54,graph1/0_-54.txt,graph1/0_-54.txt,image/-54/0.png,image/-180/0.png,graph1/0_-54.txt,graph1/0_-54.txt
0,-36,graph1/0_-36.txt,graph1/0_-36.txt,image/-36/0.png,image/-180/0.png,graph1/0_-36.txt,graph1/0_-36.txt
0,-18,graph1/0_-18.txt,graph1/0_-18.txt,image/-18/0.png,image/-180/0.png,graph1/0_-18.txt,graph1/0_-18.txt
0,0,graph1/0_0.txt,graph1/0_0.txt,image/0/0.png,image/-180/0.png,graph1/0_0.txt,graph1/0_0.txt
0,18,graph1/0_18.txt,graph1/0_18.txt,image/18/0.png,image/-180/0.png,graph1/0_18.txt,graph1/0_18.txt
0,36,graph1/0_36.txt,graph1/0_36.txt,image/36/0.png,image/-180/0.png,graph1/0_36.txt,graph1/0_36.txt
0,54,graph1/0_54.txt,graph1/0_54.txt,image/54/0.png,image/-180/0.png,graph1/0_54.txt,graph1/0_54.txt
0,72,graph1/0_72.txt,graph1/0_72.txt,image/72/0.png,image/-180/0.png,graph1/0_72.txt,graph1/0_72.txt
0,90,graph1/0_90.txt,graph1/0_90.txt,image/90/0.png,image/-180/0.png,graph1/0_90.txt,graph1/0_90.txt
0,108,graph1/0_108.txt,graph1/0_108.txt,image/108/0.png,image/-180/0.png,graph1/0_108.txt,graph1/0_108.txt
0,126,graph1/0_126.txt,graph1/0_126.txt,image/126/0.png,image/-180/0.png,graph1/0_126.txt,graph1/0_126.txt
0,144,graph1/0_144.txt,graph1/0_144.txt,image/144/0.png,image/-180/0.png,graph1/0_144.txt,graph1/0_144.txt
0,162,graph1/0_162.txt,graph1/0_162.txt,image/162/0.png,image/-180/0.png,graph1/0_162.txt,graph1/0_162.txt
7 changes: 4 additions & 3 deletions js/LineChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var BaseLineColor = "grey";

//Create a new line chart and append it to the given parent.
//Uses function provided by getData to retrieve data files when loading
function LineChart(parent, getData) {
function LineChart(parent, getData, config) {

//Sizing
this.parent = parent;
Expand Down Expand Up @@ -150,6 +150,7 @@ function LineChart(parent, getData) {

//Data variables
this.getData = getData;
this.config = config;
this.fullDsList = [];
this.loadedData = {};
this.extentX = [];
Expand Down Expand Up @@ -628,7 +629,7 @@ LineChart.prototype.loadSingleData = function(index, callback) {
// columnY: Specify which column of data in the file to use for the y-axis of the line
// (Set to -1 to just use first two columns for x and y, respectively)
// delimiter: Specifiy the character used to deliminate data in the file
var d = this.getData(index);
var d = this.getData(index, this.config);

if (d == null) {
callback(false);
Expand Down Expand Up @@ -667,7 +668,7 @@ LineChart.prototype.loadSingleData = function(index, callback) {
if (dataSet.columnY >= 0) {
rows.forEach(function(row, index) {
var xval = index;
if (dataSet.columnX >= 0) {
if (dataSet.columnX && dataSet.columnX >= 0) {
xval = row[dataSet.columnX];
}
points.push({x : xval, y : row[dataSet.columnY]});
Expand Down
Loading

0 comments on commit b10b4b6

Please sign in to comment.