diff --git a/OverView Charts/column.html b/OverView Charts/column.html index c4aa624..eaa0abe 100644 --- a/OverView Charts/column.html +++ b/OverView Charts/column.html @@ -2,64 +2,104 @@ + + + + + + \ No newline at end of file diff --git a/OverView Charts/test.html b/OverView Charts/test.html new file mode 100644 index 0000000..ed8e3cd --- /dev/null +++ b/OverView Charts/test.html @@ -0,0 +1,57 @@ + + + + + Test + + + + + + + + + \ No newline at end of file diff --git a/TestingLineChart/.plot.js.swp b/TestingLineChart/.plot.js.swp new file mode 100644 index 0000000..00bf0b7 Binary files /dev/null and b/TestingLineChart/.plot.js.swp differ diff --git a/View/EcAura/output/average.json b/View/EcAura/output/average.json new file mode 100644 index 0000000..48f46ee --- /dev/null +++ b/View/EcAura/output/average.json @@ -0,0 +1,48 @@ +[ + { + "date": "2013 Jan", + "water": 12, + "electricity": 11, + "waste": 25, + "fuel": 10 + }, { + "date": "2013 Apr", + "water": 1, + "electricity": 20, + "waste": 5, + "fuel": 20 + },{ + "date": "2014 Apr", + "water": 12, + "electricity": 10, + "waste": 20, + "fuel": 10 + },{ + "date": "2015 Jul", + "water": 15, + "electricity": 14, + "waste": 21, + "fuel": 10 + }, + { + "date": "2016 Jan", + "water": 29, + "electricity": 20, + "waste": 21, + "fuel": 10 + }, +{ + "date": "2016 Mar", + "water": 10, + "electricity": 5, + "waste": 12, + "fuel": 20 + }, + { + "date": "2016 Oct", + "water": 9, + "electricity": 6, + "waste": 17, + "fuel": 8 + } +] \ No newline at end of file diff --git a/View/EcAura/output/timeline.json b/View/EcAura/output/timeline.json index 3c1e36a..4154d67 100644 --- a/View/EcAura/output/timeline.json +++ b/View/EcAura/output/timeline.json @@ -1,4 +1,4 @@ -[ +[ { "date": "2013 Jan", "water": 10, diff --git a/View/EcAura/sbar.html b/View/EcAura/sbar.html index 80cba54..7535318 100644 --- a/View/EcAura/sbar.html +++ b/View/EcAura/sbar.html @@ -2,51 +2,49 @@ - + rect:hover { + opacity: 0.8; + } + .tooltip{ + text-anchor: middle; + font-size: 12px; + font-weight: bold; + fill:green; + } + + + .node.active { + fill: blue; + } + + + --> - - - + + + @@ -64,7 +62,7 @@ height = 500 - margin.top - margin.bottom; var x = d3.scale.ordinal() - //.domain(data.map(function(d) { return d.date;} )) + //.domain(data.map(function(d) { return d.date;} )) .rangeRoundBands([0, width], .1); var y = d3.scale.linear() @@ -81,40 +79,42 @@ .scale(y) .orient("left"); - var tip = d3.tip() - .attr('class', 'd3-tip') - .offset([0, 0]) - .html(function(d) { - return "
Count: " + d.date + "
"; - }); +var tip = d3.tip() + .attr('class', 'd3-tip') + .offset([0, 0]) + .html(function(d) { + return "
Count: " + d.date + "
"; + }); + var svg = d3.select("body").append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) - .append("g") + .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); - - var url = "http://localhost/EcAura/output/timeline.json"; - + +// var url = "http://localhost/EcAura/output/timeline.json"; + -d3.json(url, function(error, data) { +d3.json('output/timeline.json', function(error, data) { if (error) throw error; - - - var layers = d3.layout.stack()(sentiment.map(function(c) { - return data.map(function(d) { - return {x: d.date, y: d[c]}; + var layers = d3.layout.stack()( + sentiment.map( + function(c) { + return data.map( + function(d) { + return {x: d.date, y: d[c]}; }); })); data.forEach(function(d) { d.date = parseDate(d.date); }); - data = data.sort(function(a, b) { - a = new Date(a.date); - b = new Date(b.date); - return a>b ? -1 : ab ? -1 : ab ? -1 : a diff --git a/View/aggregate/index.html b/View/aggregate/index.html new file mode 100644 index 0000000..e69de29 diff --git a/model/.index.html.swp b/model/.index.html.swp new file mode 100644 index 0000000..44cab24 Binary files /dev/null and b/model/.index.html.swp differ diff --git a/model/.test.html.swp b/model/.test.html.swp new file mode 100644 index 0000000..fc8365e Binary files /dev/null and b/model/.test.html.swp differ diff --git a/model/bk.png b/model/bk.png new file mode 100644 index 0000000..684f446 Binary files /dev/null and b/model/bk.png differ diff --git a/model/index.css b/model/index.css index b15774e..4a5c02c 100644 --- a/model/index.css +++ b/model/index.css @@ -3,32 +3,25 @@ float: left; width: 35%; height: 100vh; + overflow-y: auto; + display:block; background-color: #EFEFEF; } - paper-tabs paper-tab.iron-selected{ background-color: #303F9F; color: white; } - paper-tabs{ - background-color: #69F0AE; + color:#1A237E; + background-color: #C5CAE9; } - paper-input { - padding-left: 15px; -width:50%; - - +width:65%; } - - - paper-button{ background-color: #E8EAF6; - } #OutputBox { position: relative; @@ -38,13 +31,22 @@ paper-button{ background-color: white; }#InputVisualization { position: relative; - float: right; + float: left; width: 100%; height: 50vh; border-bottom: 1px solid black; background-color: white; - overflow: scroll; -}#OverallVisualization { + overflow-y: scroll; + overflow-x: hidden; +} +#InputVisualization svg{ + width: 600px; + display:block; + margin: auto; +} + + +#OverallVisualization { position: relative; float: right; width: 100%; @@ -52,7 +54,11 @@ paper-button{ background-color: white; } - +#OverallVisualization svg{ + width: 600px; + display:block; + margin: auto; +} li { display: block; color: #000; @@ -60,19 +66,15 @@ li { vertical-align:middle; margin: 0px; } - - #logo img{ - -margin: 6px; - - +margin: 20px; +padding-bottom: 3px; } #logo{ - background-color: #DDD; + background-color: white; + width: 100%; + background-image: url(bk.png); } - - /*This is to style the headings within each tab, e.g. Water, Fuel, etc.*/ .ParameterHeading {} Add Comment \ No newline at end of file diff --git a/model/index.html b/model/index.html index bade48b..df758b9 100644 --- a/model/index.html +++ b/model/index.html @@ -35,57 +35,57 @@ - +
- + - Water + Water Electricity Waste Fuel @@ -94,59 +94,60 @@
-
+
- -

+ +

-
-
-
-
-

-
+
+
+
+
+

+
-
-

- -
-
-
-
- -

-
+
+

+ +
+
+
+
+ +

+
-
-

- +

+

+ -
-
-
-
-

-
+
+
+
+
+

+
-
-

+

+

-
-
-

-
+
+
+

+
-
-

+

+

+<<<<<<< HEAD


@@ -161,15 +162,31 @@ Get Score! +
+
+
+
+
+

+
+ Add + +
+ + + + + +>>>>>>> f8d72111364bfb48039a4b99e6134ef78da52eae -
-
-
+
+
+
​ -
+
-

OVERVIEW

+

OVERVIEW

@@ -196,9 +213,8 @@

OVERVIEW

} } - myDataRef.on('value', function(snapshot) { - - current_graph = $(".iron-selected").attr("href") + function update_graphs() { + current_graph = $(".iron-selected").attr("href") current_graph = current_graph.substring(1, current_graph.length); console.log(current_graph) //console.log($(".iron-selected").value); @@ -221,6 +237,33 @@

OVERVIEW

var averages = get_score(firebasepath, "nyuad") d3.selectAll("#OverallVisualization > *").remove(); add_many_series_to_svg(averages, parseDate, "#OverallVisualization") + } + + myDataRef.on('value', function(snapshot) { + update_graphs() + // current_graph = $(".iron-selected").attr("href") + // current_graph = current_graph.substring(1, current_graph.length); + // console.log(current_graph) + // //console.log($(".iron-selected").value); + // console.log("Change found.") + // //get_feature(firebasepath, "electricity") + // console.log(d3.select("svg")) + // //d3.select('svg').remove(); + // //d3.select('svg').remove(); + // console.log(d3.select("svg")) + + // var x1 = get_org(firebasepath, "nyuad") + // console.log(x1) + // data = x1[current_graph] + + // console.log(data) + // if (data) { + // d3.selectAll("#InputVisualization > *").remove(); + // add_series_to_svg(data, parseDate, "#InputVisualization"); + // } + // var averages = get_score(firebasepath, "nyuad") + // d3.selectAll("#OverallVisualization > *").remove(); + // add_many_series_to_svg(averages, parseDate, "#OverallVisualization") }); $('#submitButton').on('click', function () { @@ -349,74 +392,15 @@

OVERVIEW

console.log("Tab was clicked!"); for (i in fields) { - console.log($("#" + fields[i])) + //console.log($("#" + fields[i])) $("#" + fields[i]).val(''); } + update_graphs() }); - $('paper-tab[href="#water"]').on('click', function() { - d3.select("svg").remove(); - d3.select("svg").remove(); - d3.select("svg").remove(); - var x1 = get_org(firebasepath, "nyuad") - data = x1["water"] - if (data) { - add_series_to_svg(data, parseDate, "#InputVisualization") - } - var averages = get_score(firebasepath, "nyuad") - add_many_series_to_svg(averages, parseDate, "#OverallVisualization") - }); - - $('paper-tab[href="#electricity"]').on('click', function() { - d3.select("svg").remove(); - d3.select("svg").remove(); - d3.select("svg").remove(); - var x1 = get_org(firebasepath, "nyuad") - data = x1["electricity"] - if (data) { - add_series_to_svg(data, parseDate, "#InputVisualization") - } - var averages = get_score(firebasepath, "nyuad") - add_many_series_to_svg(averages, parseDate, "#OverallVisualization") - }); - $('paper-tab[href="#waste"]').on('click', function() { - d3.select("svg").remove(); - d3.select("svg").remove(); - d3.select("svg").remove(); - var x1 = get_org(firebasepath, "nyuad") - data = x1["oil"] - if (data) { - add_series_to_svg(data, parseDate, "#InputVisualization") - } - var averages = get_score(firebasepath, "nyuad") - add_many_series_to_svg(averages, parseDate, "#OverallVisualization") - }); - $('paper-tab[href="#fuel"]').on('click', function() { - d3.select("svg").remove(); - d3.select("svg").remove(); - d3.select("svg").remove(); - var x1 = get_org(firebasepath, "nyuad") - data = x1["fuel"] - if (data) { - add_series_to_svg(data, parseDate, "#InputVisualization") - } - var averages = get_score(firebasepath, "nyuad") - add_many_series_to_svg(averages, parseDate, "#OverallVisualization") - }); - $('paper-tab[href="#food"]').on('click', function() { - d3.select("svg").remove(); - d3.select("svg").remove(); - d3.select("svg").remove(); - var x1 = get_org(firebasepath, "nyuad") - data = x1["food"] - if (data) { - add_series_to_svg(data, parseDate, "#InputVisualization") - } - var averages = get_score(firebasepath, "nyuad") - add_many_series_to_svg(averages, parseDate, "#OverallVisualization") - }); + function displayChatMessage(name, text) { diff --git a/model/io.js b/model/io.js index 009dad3..23411d2 100644 --- a/model/io.js +++ b/model/io.js @@ -56,11 +56,13 @@ function set_date(firebasepath, org, feature, date, dateobject) { // Convert from the database time series format to the visualize time series format function parse_time_series(series) { + console.log('entering time series'); var series_res = new Array(); for (var element in series) { - series_res.push(series[element]) + series_res.push(series[element]); } - return series_res + console.log(series_res); + return series_res; } // Get the Time series for the organization "org", for the feature "feature" @@ -68,11 +70,13 @@ function parse_time_series(series) { function get_org_feature(firebasepath, org, feature){ var path = firebasepath + "/orgs/" + org + "/data/" + feature + "/series/"; var featureRef = new Firebase(path) + return_value = new Object() featureRef.on("value", function(snapshot) { - return parse_time_series(snapshot.val()); + return_value = parse_time_series(snapshot.val()); }, function (errorObject) { console.log("The read failed: " + errorObject.code); }); + return return_value; } function getvalue(date, arr) { diff --git a/model/nano.save b/model/nano.save new file mode 100644 index 0000000..e97a5c8 --- /dev/null +++ b/model/nano.save @@ -0,0 +1 @@ +ewdate, diff --git a/model/test.html.save b/model/test.html.save new file mode 100644 index 0000000..fb9e26d --- /dev/null +++ b/model/test.html.save @@ -0,0 +1,45 @@ + + + + + + + + +
+ + + + + + + + +