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

Side by Side Diff: tracing/tracing/value/ui/scalar_map_table.html

Issue 2771723003: [tracing] Move math utilities from base into their own subdirectory (attempt 2) (Closed)
Patch Set: rebase Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright 2016 The Chromium Authors. All rights reserved. 3 Copyright 2016 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 7
8 <link rel="import" href="/tracing/ui/base/table.html"> 8 <link rel="import" href="/tracing/ui/base/table.html">
9 <link rel="import" href="/tracing/value/ui/scalar_span.html"> 9 <link rel="import" href="/tracing/value/ui/scalar_span.html">
10 10
11 <dom-module name="tr-v-ui-scalar-map-table"> 11 <dom-module name="tr-v-ui-scalar-map-table">
12 <template> 12 <template>
13 <style> 13 <style>
14 </style> 14 </style>
15 <tr-ui-b-table id="table"></tr-ui-b-table> 15 <tr-ui-b-table id="table"></tr-ui-b-table>
16 </template> 16 </template>
17 </dom-module> 17 </dom-module>
18 18
19 <script> 19 <script>
20 'use strict'; 20 'use strict';
21 Polymer({ 21 Polymer({
22 is: 'tr-v-ui-scalar-map-table', 22 is: 'tr-v-ui-scalar-map-table',
23 23
24 created: function() { 24 created: function() {
25 /** @type {!Map.<string, !tr.b.Scalar>} */ 25 /** @type {!Map.<string, !tr.b.Scalar>} */
26 this.scalarMap_ = new Map(); 26 this.scalarMap_ = new Map();
27 27
28 /** @type {!Map.<string, !tr.b.Statistics.Significance>} */ 28 /** @type {!Map.<string, !tr.b.math.Statistics.Significance>} */
29 this.significance_ = new Map(); 29 this.significance_ = new Map();
30 }, 30 },
31 31
32 ready: function() { 32 ready: function() {
33 this.$.table.showHeader = false; 33 this.$.table.showHeader = false;
34 this.$.table.tableColumns = [ 34 this.$.table.tableColumns = [
35 { 35 {
36 value: function(row) { 36 value: function(row) {
37 return row.name; 37 return row.name;
38 } 38 }
(...skipping 21 matching lines...) Expand all
60 /** 60 /**
61 * @param {!Map.<string,!tr.b.Scalar>} map 61 * @param {!Map.<string,!tr.b.Scalar>} map
62 */ 62 */
63 set scalarMap(map) { 63 set scalarMap(map) {
64 this.scalarMap_ = map; 64 this.scalarMap_ = map;
65 this.updateContents_(); 65 this.updateContents_();
66 }, 66 },
67 67
68 /** 68 /**
69 * @param {string} key 69 * @param {string} key
70 * @param {!tr.b.Statistics.Significance} significance 70 * @param {!tr.b.math.Statistics.Significance} significance
71 */ 71 */
72 setSignificanceForKey: function(key, significance) { 72 setSignificanceForKey: function(key, significance) {
73 this.significance_.set(key, significance); 73 this.significance_.set(key, significance);
74 this.updateContents_(); 74 this.updateContents_();
75 }, 75 },
76 76
77 updateContents_: function() { 77 updateContents_: function() {
78 let rows = []; 78 let rows = [];
79 for (let [key, scalar] of this.scalarMap) { 79 for (let [key, scalar] of this.scalarMap) {
80 rows.push({ 80 rows.push({
81 name: key, 81 name: key,
82 value: scalar, 82 value: scalar,
83 significance: this.significance_.get(key), 83 significance: this.significance_.get(key),
84 anyRowsHaveSignificance: (this.significance_.size > 0) 84 anyRowsHaveSignificance: (this.significance_.size > 0)
85 }); 85 });
86 } 86 }
87 this.$.table.tableRows = rows; 87 this.$.table.tableRows = rows;
88 this.$.table.rebuild(); 88 this.$.table.rebuild();
89 } 89 }
90 }); 90 });
91 </script> 91 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/value/ui/scalar_context_controller_test.html ('k') | tracing/tracing/value/ui/scalar_span.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698