Skip to content

Commit

Permalink
temporary workaround for "avg" apply
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitaeverywhere committed Dec 22, 2014
1 parent 6e11c89 commit 52a28c0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
13 changes: 7 additions & 6 deletions source/js/DataController.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,13 @@ DataController.prototype.resetRawData = function () {
} else {
summary[i] = {
// very hard workaround (applying "avg" last column spec)
//value: ((rawData[x].length - 1 === parseInt(i)
// && _.controller.CONFIG["_temp_lastColSpec"]
// && _.controller.CONFIG["_temp_lastColSpec"]["levelSummary"] === "avg")
// ? countAverageByColumn
// : countSummaryByColumn)(rawData, xh, rawData.length - 1, i),
value: (countSummaryByColumn)(rawData, xh, rawData.length - 1, i),
value: ((rawData[x].length - 1 === parseInt(i)
&& _.controller.CONFIG["_temp_lastColSpec"]
&& _.controller.CONFIG["_temp_lastColSpec"]["levelSummary"] === "avg")
? countAverageByColumn
: countSummaryByColumn)(rawData, xh, rawData.length - 1, i),
// end
//value: (countSummaryByColumn)(rawData, xh, rawData.length - 1, i),
style: "font-weight: 900;"
}
}
Expand Down
29 changes: 15 additions & 14 deletions source/js/DataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,21 @@ DataSource.prototype.getCurrentData = function (callback) {
}

// temporary hard workaround (getting last column specs)
//_.GLOBAL_CONFIG["_temp_lastColSpec"] = (function (lev) {
// var tc = lev,
// f = function (lev) {
// if (lev["childLevels"] && lev["childLevels"].length > 0) {
// for (var i in lev["childLevels"]) {
// f(lev["childLevels"][i]);
// }
// } else {
// tc = lev;
// }
// };
// if (lev) f(lev);
// return tc;
//})(data["columnLevels"][data["columnLevels"].length - 1]);
_.GLOBAL_CONFIG["_temp_lastColSpec"] = (function (lev) {
var tc = lev,
f = function (lev) {
if (lev["childLevels"] && lev["childLevels"].length > 0) {
for (var i in lev["childLevels"]) {
f(lev["childLevels"][i]);
}
} else {
tc = lev;
}
};
if (lev) f(lev);
return tc;
})(data["columnLevels"][data["columnLevels"].length - 1]);
// end

};

Expand Down

0 comments on commit 52a28c0

Please sign in to comment.