OLD | NEW |
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 Loading... |
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> |
OLD | NEW |