# HG changeset patch # User Nicholas Jillings # Date 1479133421 0 # Node ID 2577d983f291f65595c24e76f2ac75e55f0a9a27 # Parent cc2364d8bc171bb494638b55f82058102f0338f3 Beautified entire project. diff -r cc2364d8bc17 -r 2577d983f291 analysis/analysis.css --- a/analysis/analysis.css Mon Nov 14 12:14:48 2016 +0000 +++ b/analysis/analysis.css Mon Nov 14 14:23:41 2016 +0000 @@ -5,12 +5,12 @@ div.code { margin: 5px; padding-left: 15px; - background-color: rgb(200,200,200); + background-color: rgb(200, 200, 200); border: 2px dashed black; } -table td tr{ +table td tr { padding: 5px; } -div.filter-entry{ +div.filter-entry { padding: 5px; -} \ No newline at end of file +} diff -r cc2364d8bc17 -r 2577d983f291 analysis/analysis.js --- a/analysis/analysis.js Mon Nov 14 12:14:48 2016 +0000 +++ b/analysis/analysis.js Mon Nov 14 14:23:41 2016 +0000 @@ -1,31 +1,26 @@ /* -* Analysis script for WAET -*/ + * Analysis script for WAET + */ // Firefox does not have an XMLDocument.prototype.getElementsByName // and there is no searchAll style command, this custom function will // search all children recusrively for the name. Used for XSD where all // element nodes must have a name and therefore can pull the schema node -XMLDocument.prototype.getAllElementsByName = function(name) -{ +XMLDocument.prototype.getAllElementsByName = function (name) { name = String(name); var selected = this.documentElement.getAllElementsByName(name); return selected; } -Element.prototype.getAllElementsByName = function(name) -{ +Element.prototype.getAllElementsByName = function (name) { name = String(name); var selected = []; var node = this.firstElementChild; - while(node != null) - { - if (node.getAttribute('name') == name) - { + while (node != null) { + if (node.getAttribute('name') == name) { selected.push(node); } - if (node.childElementCount > 0) - { + if (node.childElementCount > 0) { selected = selected.concat(node.getAllElementsByName(name)); } node = node.nextElementSibling; @@ -33,26 +28,21 @@ return selected; } -XMLDocument.prototype.getAllElementsByTagName = function(name) -{ +XMLDocument.prototype.getAllElementsByTagName = function (name) { name = String(name); var selected = this.documentElement.getAllElementsByTagName(name); return selected; } -Element.prototype.getAllElementsByTagName = function(name) -{ +Element.prototype.getAllElementsByTagName = function (name) { name = String(name); var selected = []; var node = this.firstElementChild; - while(node != null) - { - if (node.nodeName == name) - { + while (node != null) { + if (node.nodeName == name) { selected.push(node); } - if (node.childElementCount > 0) - { + if (node.childElementCount > 0) { selected = selected.concat(node.getAllElementsByTagName(name)); } node = node.nextElementSibling; @@ -62,15 +52,12 @@ // Firefox does not have an XMLDocument.prototype.getElementsByName if (typeof XMLDocument.prototype.getElementsByName != "function") { - XMLDocument.prototype.getElementsByName = function(name) - { + XMLDocument.prototype.getElementsByName = function (name) { name = String(name); var node = this.documentElement.firstElementChild; var selected = []; - while(node != null) - { - if (node.getAttribute('name') == name) - { + while (node != null) { + if (node.getAttribute('name') == name) { selected.push(node); } node = node.nextElementSibling; @@ -80,41 +67,42 @@ } var chartContext, testData; -window.onload = function() { +window.onload = function () { // Load the Visualization API and the corechart package. - google.charts.load('current', {'packages':['corechart']}); + google.charts.load('current', { + 'packages': ['corechart'] + }); chartContext = new Chart(); testData = new Data(); } function get(url) { - // Return a new promise. - return new Promise(function(resolve, reject) { - // Do the usual XHR stuff - var req = new XMLHttpRequest(); - req.open('GET', url); - req.onload = function() { - // This is called even on 404 etc - // so check the status - if (req.status == 200) { - // Resolve the promise with the response text - resolve(req.response); - } - else { - // Otherwise reject with the status text - // which will hopefully be a meaningful error - reject(Error(req.statusText)); - } - }; + // Return a new promise. + return new Promise(function (resolve, reject) { + // Do the usual XHR stuff + var req = new XMLHttpRequest(); + req.open('GET', url); + req.onload = function () { + // This is called even on 404 etc + // so check the status + if (req.status == 200) { + // Resolve the promise with the response text + resolve(req.response); + } else { + // Otherwise reject with the status text + // which will hopefully be a meaningful error + reject(Error(req.statusText)); + } + }; - // Handle network errors - req.onerror = function() { - reject(Error("Network Error")); - }; + // Handle network errors + req.onerror = function () { + reject(Error("Network Error")); + }; - // Make the request - req.send(); - }); + // Make the request + req.send(); + }); } function arrayMean(values) { @@ -128,15 +116,17 @@ function percentile(values, p) { //http://web.stanford.edu/class/archive/anthsci/anthsci192/anthsci192.1064/handouts/calculating%20percentiles.pdf - values.sort( function(a,b) {return a - b;} ); + values.sort(function (a, b) { + return a - b; + }); // get ordinal rank - var index = values.length*p/100; + var index = values.length * p / 100; var k = Math.floor(index); if (k == index) { return values[k]; } else { - var f = index-k; - var x_int = (1-f)*values[k]+f*values[k+1]; + var f = index - k; + var x_int = (1 - f) * values[k] + f * values[k + 1]; return x_int; } } @@ -166,19 +156,19 @@ function boxplotRow(array) { // Take an array of element values and return array of computed intervals var result = { - median : percentile(array,50), - pct25 : percentile(array,25), - pct75 : percentile(array,75), - IQR : null, + median: percentile(array, 50), + pct25: percentile(array, 25), + pct75: percentile(array, 75), + IQR: null, min: null, max: null, outliers: new Array() } - result.IQR = result.pct75-result.pct25; + result.IQR = result.pct75 - result.pct25; var rest = []; - var pct75_IQR = result.pct75+1.5*result.IQR; - var pct25_IQR = result.pct25-1.5*result.IQR; - for (var i=0; i pct75_IQR || point < pct25_IQR) { @@ -190,23 +180,27 @@ result.max = arrayMax(rest); result.min = arrayMin(rest); return result; - + } -function arrayHistogram(values,steps,min,max) { +function arrayHistogram(values, steps, min, max) { if (steps == undefined) { steps = 0.25; console.log("Warning: arrayHistogram called without steps size set, default to 0.25"); } - if (min == undefined) {min = arrayMin(values);} - if (max == undefined) {max = arrayMax(values);} + if (min == undefined) { + min = arrayMin(values); + } + if (max == undefined) { + max = arrayMax(values); + } var histogram = []; var index = min; - while(index < max) { + while (index < max) { histogram.push({ marker: index, lt: index, - rt: index+steps, + rt: index + steps, count: 0 }); index += steps; @@ -225,13 +219,13 @@ function Chart() { this.valueData; this.charts = []; - - this.chartObject = function(name) { + + this.chartObject = function (name) { // Create the charting object this.name = name; this.root = document.createElement("div"); this.root.className = "chart-holder"; - this.root.setAttribute("name",name); + this.root.setAttribute("name", name); this.chartDOM = document.createElement("div"); this.tableDOM = document.createElement("div"); this.latexDOM = document.createElement("div"); @@ -242,30 +236,31 @@ this.print = document.createElement("button"); this.sortDataButton = document.createElement("button"); this.sortDataButton.textContent = "Sort by Data"; - this.sortDataButton.addEventListener("click",this); - this.sortDataButton.setAttribute("name","sort-data"); + this.sortDataButton.addEventListener("click", this); + this.sortDataButton.setAttribute("name", "sort-data"); this.sortNameButton = document.createElement("button"); this.sortNameButton.textContent = "Sort by Name"; - this.sortNameButton.addEventListener("click",this); - this.sortNameButton.setAttribute("name","sort-name"); - this.draw = function() { - if (this.chart == undefined) {return;} + this.sortNameButton.addEventListener("click", this); + this.sortNameButton.setAttribute("name", "sort-name"); + this.draw = function () { + if (this.chart == undefined) { + return; + } this.tableDOM.innerHTML = null; this.latexDOM.innerHTML = null; this.buildTable(); this.writeLatex(); - this.chart.draw(this.data,this.options); + this.chart.draw(this.data, this.options); } - this.sortData = function() { + this.sortData = function () { this.data.sort(1); } - this.sortName = function() { + this.sortName = function () { this.data.sort(0); } - this.handleEvent = function() { + this.handleEvent = function () { // Only used to handle the chart.event.addListener(this,'ready') callback - switch(event.currentTarget.getAttribute("name")) - { + switch (event.currentTarget.getAttribute("name")) { case "download": window.open(this.chart.getImageURI()); break; @@ -279,7 +274,7 @@ break; } } - + this.root.appendChild(this.chartDOM); this.root.appendChild(this.tableDOM); this.root.appendChild(this.latexDOM); @@ -287,16 +282,15 @@ this.root.appendChild(this.sortNameButton); this.root.appendChild(this.print); this.print.textContent = "Download"; - this.print.setAttribute("name","download"); - this.print.addEventListener("click",this); + this.print.setAttribute("name", "download"); + this.print.addEventListener("click", this); this.root.appendChild(this.downloadDOM); - this.buildTable = function() { + this.buildTable = function () { var table = document.createElement("table"); table.border = "1"; var numRows = this.data.getNumberOfRows(); var numColumns = this.data.getNumberOfColumns(); - for (var columnIndex=0; columnIndex"; + this.rootDOM.innerHTML = "ID: " + specification.id + ", Type: " + specification.type + ""; this.rootDOM.className = "filter-entry"; - this.handleEvent = function(event) { - switch(this.specification.type) { + this.handleEvent = function (event) { + switch (this.specification.type) { case "number": var name = event.currentTarget.name; - eval("this."+name+" = event.currentTarget.value"); + eval("this." + name + " = event.currentTarget.value"); break; case "checkbox": break; @@ -762,29 +795,29 @@ } this.parent.getFileCount(); } - this.getFilterPairs = function() { + this.getFilterPairs = function () { var pairs = []; - switch(this.specification.type) { + switch (this.specification.type) { case "number": if (this.min != "") { - pairs.push([specification.id+"-min",this.min]); + pairs.push([specification.id + "-min", this.min]); } if (this.max != "") { - pairs.push([specification.id+"-max",this.max]); + pairs.push([specification.id + "-max", this.max]); } break; case "radio": case "checkbox": - for (var i=0; i - - - - - - - - -

Web Audio Evaluation Toolbox: Analysis

-
- -
-

Charts per test

- - -
-
-

Charts per test page

- -
-
-

Charts per element

- -
- -
- - \ No newline at end of file + + + + + + + + + + +

Web Audio Evaluation Toolbox: Analysis

+
+ +
+

Charts per test

+ + +
+
+

Charts per test page

+ +
+
+

Charts per element

+ +
+ +
+ + + diff -r cc2364d8bc17 -r 2577d983f291 index.html --- a/index.html Mon Nov 14 12:14:48 2016 +0000 +++ b/index.html Mon Nov 14 14:23:41 2016 +0000 @@ -1,55 +1,57 @@ - - + + - - + - Web Audio Evaluation Tool - - - - - - - - - - + Web Audio Evaluation Tool + + - - -