Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
|
epoger
2014/02/06 18:00:59
You can try it out at
http://172.24.179.183:8888/
| |
| 2 * Loader: | 2 * Loader: |
| 3 * Reads GM result reports written out by results.py, and imports | 3 * Reads GM result reports written out by results.py, and imports |
| 4 * them into $scope.categories and $scope.testData . | 4 * them into $scope.categories and $scope.testData . |
| 5 */ | 5 */ |
| 6 var Loader = angular.module( | 6 var Loader = angular.module( |
| 7 'Loader', | 7 'Loader', |
| 8 ['diff_viewer'] | 8 ['diff_viewer'] |
| 9 ); | 9 ); |
| 10 | 10 |
| 11 | 11 |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 410 $scope.hiddenResultTypes = {}; | 410 $scope.hiddenResultTypes = {}; |
| 411 // TODO(epoger): Maybe change $scope.allResultTypes to be a Set like | 411 // TODO(epoger): Maybe change $scope.allResultTypes to be a Set like |
| 412 // $scope.hiddenResultTypes (rather than an array), so this operation is | 412 // $scope.hiddenResultTypes (rather than an array), so this operation is |
| 413 // simpler (just assign or add allResultTypes to hiddenResultTypes). | 413 // simpler (just assign or add allResultTypes to hiddenResultTypes). |
| 414 $scope.toggleValuesInSet($scope.allResultTypes, $scope.hiddenResultTypes); | 414 $scope.toggleValuesInSet($scope.allResultTypes, $scope.hiddenResultTypes); |
| 415 $scope.toggleValueInSet(resultType, $scope.hiddenResultTypes); | 415 $scope.toggleValueInSet(resultType, $scope.hiddenResultTypes); |
| 416 $scope.updateResults(); | 416 $scope.updateResults(); |
| 417 } | 417 } |
| 418 | 418 |
| 419 /** | 419 /** |
| 420 * Update $scope.hiddenResultTypes so that ALL resultTypes are showing, | |
| 421 * and update the visible results. | |
| 422 */ | |
| 423 $scope.showAllResultTypes = function() { | |
| 424 $scope.hiddenResultTypes = {}; | |
| 425 $scope.updateResults(); | |
| 426 } | |
| 427 | |
| 428 /** | |
| 420 * Update $scope.hiddenConfigs so that ONLY this config is showing, | 429 * Update $scope.hiddenConfigs so that ONLY this config is showing, |
| 421 * and update the visible results. | 430 * and update the visible results. |
| 422 * | 431 * |
| 423 * @param config | 432 * @param config |
| 424 */ | 433 */ |
| 425 $scope.showOnlyConfig = function(config) { | 434 $scope.showOnlyConfig = function(config) { |
| 426 $scope.hiddenConfigs = {}; | 435 $scope.hiddenConfigs = {}; |
| 427 $scope.toggleValuesInSet($scope.allConfigs, $scope.hiddenConfigs); | 436 $scope.toggleValuesInSet($scope.allConfigs, $scope.hiddenConfigs); |
| 428 $scope.toggleValueInSet(config, $scope.hiddenConfigs); | 437 $scope.toggleValueInSet(config, $scope.hiddenConfigs); |
| 429 $scope.updateResults(); | 438 $scope.updateResults(); |
| 430 } | 439 } |
| 431 | 440 |
| 441 /** | |
| 442 * Update $scope.hiddenConfigs so that ALL configs are showing, | |
| 443 * and update the visible results. | |
| 444 */ | |
| 445 $scope.showAllConfigs = function() { | |
| 446 $scope.hiddenConfigs = {}; | |
| 447 $scope.updateResults(); | |
| 448 } | |
| 449 | |
| 432 | 450 |
| 433 // | 451 // |
| 434 // Operations for sending info back to the server. | 452 // Operations for sending info back to the server. |
| 435 // | 453 // |
| 436 | 454 |
| 437 /** | 455 /** |
| 438 * Tell the server that the actual results of these particular tests | 456 * Tell the server that the actual results of these particular tests |
| 439 * are acceptable. | 457 * are acceptable. |
| 440 * | 458 * |
| 441 * @param testDataSubset an array of test results, most likely a subset of | 459 * @param testDataSubset an array of test results, most likely a subset of |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 525 | 543 |
| 526 // | 544 // |
| 527 // Operations we use to mimic Set semantics, in such a way that | 545 // Operations we use to mimic Set semantics, in such a way that |
| 528 // checking for presence within the Set is as fast as possible. | 546 // checking for presence within the Set is as fast as possible. |
| 529 // But getting a list of all values within the Set is not necessarily | 547 // But getting a list of all values within the Set is not necessarily |
| 530 // possible. | 548 // possible. |
| 531 // TODO(epoger): move into a separate .js file? | 549 // TODO(epoger): move into a separate .js file? |
| 532 // | 550 // |
| 533 | 551 |
| 534 /** | 552 /** |
| 553 * Returns the number of values present within set "set". | |
| 554 * | |
| 555 * @param set an Object which we use to mimic set semantics | |
| 556 */ | |
| 557 $scope.setSize = function(set) { | |
| 558 return Object.keys(set).length; | |
| 559 } | |
| 560 | |
| 561 /** | |
| 535 * Returns true if value "value" is present within set "set". | 562 * Returns true if value "value" is present within set "set". |
| 536 * | 563 * |
| 537 * @param value a value of any type | 564 * @param value a value of any type |
| 538 * @param set an Object which we use to mimic set semantics | 565 * @param set an Object which we use to mimic set semantics |
| 539 * (this should make isValueInSet faster than if we used an Array) | 566 * (this should make isValueInSet faster than if we used an Array) |
| 540 */ | 567 */ |
| 541 $scope.isValueInSet = function(value, set) { | 568 $scope.isValueInSet = function(value, set) { |
| 542 return (true == set[value]); | 569 return (true == set[value]); |
| 543 } | 570 } |
| 544 | 571 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 650 * TODO(epoger): It might be nice to tint the color when it's not completely | 677 * TODO(epoger): It might be nice to tint the color when it's not completely |
| 651 * black or completely white. | 678 * black or completely white. |
| 652 */ | 679 */ |
| 653 $scope.brightnessStringToHexColor = function(brightnessString) { | 680 $scope.brightnessStringToHexColor = function(brightnessString) { |
| 654 var v = parseInt(brightnessString); | 681 var v = parseInt(brightnessString); |
| 655 return $scope.hexColorString(v, v, v); | 682 return $scope.hexColorString(v, v, v); |
| 656 } | 683 } |
| 657 | 684 |
| 658 } | 685 } |
| 659 ); | 686 ); |
| OLD | NEW |