aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/rebaseline_server/static/loader.js
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-08 21:15:20 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-08 21:15:20 +0000
commit97f0b089da0d9c4fe8aa2532b5f61d2615f6bf65 (patch)
treec3de814058820576d1af42f000958599b6b5dcd6 /gm/rebaseline_server/static/loader.js
parentdaeec365ffb755c955382a5ece4a1235b9958c35 (diff)
rebaseline_server JSON: pass category values as values, not keys
BUG=skia:1758 NOTRY=True R=borenet@google.com Author: epoger@google.com Review URL: https://codereview.chromium.org/270413002 git-svn-id: http://skia.googlecode.com/svn/trunk@14658 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/rebaseline_server/static/loader.js')
-rw-r--r--gm/rebaseline_server/static/loader.js32
1 files changed, 28 insertions, 4 deletions
diff --git a/gm/rebaseline_server/static/loader.js b/gm/rebaseline_server/static/loader.js
index dc33bd0a93..f5a4f7bf4d 100644
--- a/gm/rebaseline_server/static/loader.js
+++ b/gm/rebaseline_server/static/loader.js
@@ -148,13 +148,15 @@ Loader.controller(
constants.KEY__RESULT_TYPE__NOCOMPARISON] = true;
$scope.hiddenResultTypes[
constants.KEY__RESULT_TYPE__SUCCEEDED] = true;
- $scope.allResultTypes = Object.keys(
+ $scope.allResultTypes = $scope.columnSliceOf2DArray(
$scope.extraColumnHeaders[constants.KEY__EXTRACOLUMN__RESULT_TYPE]
- [constants.KEY__VALUES_AND_COUNTS]);
+ [constants.KEY__EXTRACOLUMNHEADERS__VALUES_AND_COUNTS],
+ 0);
$scope.hiddenConfigs = {};
- $scope.allConfigs = Object.keys(
+ $scope.allConfigs = $scope.columnSliceOf2DArray(
$scope.extraColumnHeaders[constants.KEY__EXTRACOLUMN__CONFIG]
- [constants.KEY__VALUES_AND_COUNTS]);
+ [constants.KEY__EXTRACOLUMNHEADERS__VALUES_AND_COUNTS],
+ 0);
// Associative array of partial string matches per category.
$scope.categoryValueMatch = {};
@@ -744,6 +746,28 @@ Loader.controller(
//
/**
+ * Returns a single "column slice" of a 2D array.
+ *
+ * For example, if array is:
+ * [[A0, A1],
+ * [B0, B1],
+ * [C0, C1]]
+ * and index is 0, this this will return:
+ * [A0, B0, C0]
+ *
+ * @param array a Javascript Array
+ * @param column (numeric): index within each row array
+ */
+ $scope.columnSliceOf2DArray = function(array, column) {
+ var slice = [];
+ var numRows = array.length;
+ for (var row = 0; row < numRows; row++) {
+ slice.push(array[row][column]);
+ }
+ return slice;
+ }
+
+ /**
* Returns a human-readable (in local time zone) time string for a
* particular moment in time.
*