Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: gm/rebaseline_server/static/loader.js

Issue 270413002: rebaseline_server JSON: pass category values as values, not keys (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/rebaseline_server/static/constants.js ('k') | gm/rebaseline_server/static/view.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rebaseline_server/static/loader.js
diff --git a/gm/rebaseline_server/static/loader.js b/gm/rebaseline_server/static/loader.js
index dc33bd0a93a971b01cf303e86627953ee8d0589f..f5a4f7bf4da680be4eb25db2da4afc40714ecb11 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.
*
« no previous file with comments | « gm/rebaseline_server/static/constants.js ('k') | gm/rebaseline_server/static/view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698