OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2016 The Chromium Authors. All rights reserved. | 3 Copyright (c) 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/base/math/range.html"> |
8 <link rel="import" href="/tracing/base/multi_dimensional_view.html"> | 9 <link rel="import" href="/tracing/base/multi_dimensional_view.html"> |
9 <link rel="import" href="/tracing/base/range.html"> | |
10 <link rel="import" href="/tracing/base/unit.html"> | 10 <link rel="import" href="/tracing/base/unit.html"> |
11 <link rel="import" href="/tracing/ui/analysis/analysis_sub_view.html"> | 11 <link rel="import" href="/tracing/ui/analysis/analysis_sub_view.html"> |
12 <link rel="import" href="/tracing/ui/base/table.html"> | 12 <link rel="import" href="/tracing/ui/base/table.html"> |
13 <link rel="import" href="/tracing/value/ui/scalar_span.html"> | 13 <link rel="import" href="/tracing/value/ui/scalar_span.html"> |
14 | 14 |
15 <dom-module id='tr-ui-a-multi-sample-sub-view'> | 15 <dom-module id='tr-ui-a-multi-sample-sub-view'> |
16 <template> | 16 <template> |
17 <style> | 17 <style> |
18 :host { display: block; } | 18 :host { display: block; } |
19 #control { | 19 #control { |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 this.$.table.rebuild(); | 190 this.$.table.rebuild(); |
191 }, | 191 }, |
192 | 192 |
193 createPercentColumn_: function(title, samplingDataTotal) { | 193 createPercentColumn_: function(title, samplingDataTotal) { |
194 var field = title.toLowerCase(); | 194 var field = title.toLowerCase(); |
195 return { | 195 return { |
196 title: title + ' percent', | 196 title: title + ' percent', |
197 value: function(row) { | 197 value: function(row) { |
198 return tr.v.ui.createScalarSpan( | 198 return tr.v.ui.createScalarSpan( |
199 row.values[0][field] / samplingDataTotal, { | 199 row.values[0][field] / samplingDataTotal, { |
200 customContextRange: tr.b.Range.PERCENT_RANGE, | 200 customContextRange: tr.b.math.Range.PERCENT_RANGE, |
201 unit: tr.b.Unit.byName.normalizedPercentage, | 201 unit: tr.b.Unit.byName.normalizedPercentage, |
202 context: { minimumFractionDigits: 2, maximumFractionDigits: 2 }, | 202 context: { minimumFractionDigits: 2, maximumFractionDigits: 2 }, |
203 }); | 203 }); |
204 }, | 204 }, |
205 width: '60px', | 205 width: '60px', |
206 cmp: (a, b) => a.values[0][field] - b.values[0][field] | 206 cmp: (a, b) => a.values[0][field] - b.values[0][field] |
207 }; | 207 }; |
208 }, | 208 }, |
209 | 209 |
210 createSamplesColumn_: function(title) { | 210 createSamplesColumn_: function(title) { |
(...skipping 14 matching lines...) Expand all Loading... |
225 | 225 |
226 tr.ui.analysis.AnalysisSubView.register( | 226 tr.ui.analysis.AnalysisSubView.register( |
227 'tr-ui-a-multi-sample-sub-view', | 227 'tr-ui-a-multi-sample-sub-view', |
228 tr.model.Sample, | 228 tr.model.Sample, |
229 { | 229 { |
230 multi: true, | 230 multi: true, |
231 title: 'Samples', | 231 title: 'Samples', |
232 }); | 232 }); |
233 })(); | 233 })(); |
234 </script> | 234 </script> |
OLD | NEW |