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

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

Issue 3009553002: Refactor Histogram relationship diagnostics. (Closed)
Patch Set: Created 3 years, 3 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/analysis/analysis_link.html">
9 <link rel="import" href="/tracing/ui/base/table.html">
10 <link rel="import" href="/tracing/value/ui/diagnostic_span_behavior.html">
11 <link rel="import" href="/tracing/value/ui/scalar_span.html">
12
13 <dom-module id="tr-v-ui-related-histogram-map-span">
14 <template>
15 <tr-ui-b-table id="table"></tr-ui-b-table>
16 </template>
17 </dom-module>
18
19 <script>
20 'use strict';
21 tr.exportTo('tr.v.ui', function() {
22 Polymer({
23 is: 'tr-v-ui-related-histogram-map-span',
24 behaviors: [tr.v.ui.DIAGNOSTIC_SPAN_BEHAVIOR],
25
26 ready() {
27 this.$.table.showHeader = false;
28 this.$.table.tableColumns = [
29 {value: row => row[0]},
30 {value: row => row[1]},
31 ];
32 },
33
34 updateContents_() {
35 Polymer.dom(this).textContent = '';
36
37 const rows = [];
38
39 const histogramNames = new Set();
40 for (const [name, hist] of this.diagnostic) {
41 histogramNames.add(hist.name);
42 }
43 if (histogramNames.size > 1) {
44 const link = document.createElement('tr-ui-a-analysis-link');
45 link.setSelectionAndContent(Array.from(histogramNames), 'Select All');
46 rows.push([link, '']);
47 }
48
49 for (const [name, hist] of this.diagnostic) {
50 const link = document.createElement('tr-ui-a-analysis-link');
51 link.setSelectionAndContent([hist.name], name);
52 const scalarSpan = tr.v.ui.createScalarSpan(hist);
53 rows.push([link, scalarSpan]);
54 }
55 this.$.table.tableRows = rows;
56 this.$.table.rebuild();
57 }
58 });
59
60 return {};
61 });
62 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/value/ui/histogram_span_test.html ('k') | tracing/tracing/value/ui/related_histogram_map_span_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698