diff --git a/javascripts/results_charts.js b/javascripts/results_charts.js index b6b34d1..5313342 100644 --- a/javascripts/results_charts.js +++ b/javascripts/results_charts.js @@ -1,19 +1,13 @@ -function reConstructAccvsPerfChart(category, division, with_power, data) { +function reConstructAccvsPerfChart(category) { availabilities = [ "Available", "Preview", "RDI" ]; availabilities.forEach(function(availability) { // filtered data as per the user choice //console.log(filteredResults.length); - constructAccvsPerfChart(category, division, with_power, availability); + drawAccvsPerfPlot(category, availability); }); } -function constructAccvsPerfChart(category, division, with_power, availability) { - if(division == "open") { - drawAccvsPerfPlot(category, division, with_power, availability); - } -} - -function drawAccvsPerfPlot(category, division, with_power, availability) { +function drawAccvsPerfPlot(category, availability) { // the data here is the preprocessed data through function preprocessData models = [] if (category == "datacenter") { @@ -28,9 +22,9 @@ function drawAccvsPerfPlot(category, division, with_power, availability) { if (accuracyUnits.hasOwnProperty(model)) { accuracyMetric = accuracyUnits[model].split(",")[0].trim(); } - if (category === "datacenter" && division === "open") { + if (category === "datacenter") { let extractedData = extractTableDataForAccVsPerf(model, availability); - const chartContainer = document.getElementById(`AccVsPerfScatterPlot_${model}_${division}_${category}_${availability}`); + const chartContainer = document.getElementById(`AccVsPerfScatterPlot_${model}_open_${category}_${availability}`); if (extractedData.length === 0) { if (chartContainer) { chartContainer.style.display = 'none'; // hide the div @@ -42,7 +36,7 @@ function drawAccvsPerfPlot(category, division, with_power, availability) { } // let filteredData = filterForAccvsPerfPlot(data, model, category, division, accuracyMetric); if (extractedData.length !== 0) { - let chart = new CanvasJS.Chart(`AccVsPerfScatterPlot_${model}_${division}_${category}_${availability}`, { + let chart = new CanvasJS.Chart(`AccVsPerfScatterPlot_${model}_open_${category}_${availability}`, { animationEnabled: true, theme: "light2", title:{ diff --git a/javascripts/results_tablesorter.js b/javascripts/results_tablesorter.js index 14f41cc..4800a33 100644 --- a/javascripts/results_tablesorter.js +++ b/javascripts/results_tablesorter.js @@ -41,7 +41,9 @@ $(document).ready(function() { readAllData().then(function(allData) { // console.log(allData); reConstructTables(category, division, with_power[0], allData); - reConstructAccvsPerfChart(category, division, with_power[0], allData); + if (division === "open") { + reConstructAccvsPerfChart(category); + } constructChartFromSummary(allData, category, division, with_power[0]); }).catch(function(error) { console.error(error); @@ -573,7 +575,7 @@ function constructOpenTableModel(model, category, with_power, availability, myda //console.log(html); return html; } -function constructOpenTable(category, division, with_power, availability, data) { +function constructOpenTable(category, with_power, availability, data) { models = [] if (category == "datacenter") { models = models_datacenter; @@ -584,9 +586,9 @@ function constructOpenTable(category, division, with_power, availability, data) html = '' models.forEach(function(model, index) { html += constructOpenTableModel(model, category, with_power, availability, data); - if (category === "datacenter" && division === "open") { + if (category === "datacenter") { html += ` - + `; } }); @@ -609,7 +611,7 @@ function constructTable(category, division, with_power, availability, data) { } var needsFooter = Object.keys(mydata).length > 5; if(division == "open") { - html = constructOpenTable(category, division, with_power, availability, mydata); + html = constructOpenTable(category, with_power, availability, mydata); //console.log(html); return html; }