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

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

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 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
(Empty)
1 <!DOCTYPE html>
2 <!--
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
5 found in the LICENSE file.
6 -->
7
8 <link rel="import" href="/tracing/ui/base/table.html">
9 <link rel="import" href="/tracing/value/ui/scalar_span.html">
10
11 <dom-module name="tr-v-ui-numeric-stats-span">
12 <template>
13 <tr-ui-b-table id="stats"></tr-ui-b-table>
14 </template>
15 </dom-module>
16 <script>
17 'use strict';
18 Polymer({
19 is: 'tr-v-ui-numeric-stats-span',
20
21 ready: function() {
22 this.numeric_ = undefined;
23
24 this.$.stats.showHeader = false;
25 this.$.stats.tableColumns = [
26 {
27 value: function(row) {
28 return row.name;
29 }
30 },
31 {
32 align: tr.ui.b.TableFormat.ColumnAlignment.RIGHT,
33 value: function(row) {
34 return tr.v.ui.createScalarSpan(row.value);
35 }
36 }
37 ];
38 },
39
40 get numeric() {
41 return this.numeric_;
42 },
43
44 set numeric(n) {
45 this.numeric_ = n;
46 this.updateContents_();
47 },
48
49 updateContents_: function() {
50 var rows = [];
51 if (this.numeric_) {
52 var stats = this.numeric_.getSummarizedScalarNumericsWithNames();
53 stats.forEach(function(stat) {
54 rows.push({
55 name: stat.name,
56 value: stat.scalar
57 });
58 });
59 }
60 this.$.stats.tableRows = rows;
61 this.$.stats.rebuild();
62 }
63 });
64 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/value/ui/iteration_info_span.html ('k') | tracing/tracing/value/ui/numeric_stats_span_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698