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

Side by Side Diff: tracing/tracing/value/ui/histogram_set_table_cell.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
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/base/timing.html"> 8 <link rel="import" href="/tracing/base/timing.html">
9 <link rel="import" href="/tracing/base/unit.html"> 9 <link rel="import" href="/tracing/base/unit.html">
10 <link rel="import" href="/tracing/ui/base/name_line_chart.html"> 10 <link rel="import" href="/tracing/ui/base/name_line_chart.html">
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 this.row.rootViewState.addUpdateListener(this.rootListener_); 119 this.row.rootViewState.addUpdateListener(this.rootListener_);
120 } 120 }
121 }, 121 },
122 122
123 detached() { 123 detached() {
124 this.row.rootViewState.removeUpdateListener(this.rootListener_); 124 this.row.rootViewState.removeUpdateListener(this.rootListener_);
125 // Don't need to removeUpdateListener for the row and cells; their 125 // Don't need to removeUpdateListener for the row and cells; their
126 // lifetimes are the same as |this|. 126 // lifetimes are the same as |this|.
127 }, 127 },
128 128
129 build(row, displayLabel, viewState) { 129 build(row, displayLabel, histograms, viewState) {
130 this.row_ = row; 130 this.row_ = row;
131 this.displayLabel_ = displayLabel; 131 this.displayLabel_ = displayLabel;
132 this.histograms_ = histograms;
132 this.viewState_ = viewState; 133 this.viewState_ = viewState;
133 this.histogram_ = this.row.columns.get(displayLabel); 134 this.histogram_ = this.row.columns.get(displayLabel);
134 135
135 if (this.viewState) { 136 if (this.viewState) {
136 // this.viewState is undefined when this.histogram_ is undefined. 137 // this.viewState is undefined when this.histogram_ is undefined.
137 // In that case, onViewStateUpdate_ wouldn't be able to do anything 138 // In that case, onViewStateUpdate_ wouldn't be able to do anything
138 // anyway. 139 // anyway.
139 this.viewState.addUpdateListener(this.onViewStateUpdate_.bind(this)); 140 this.viewState.addUpdateListener(this.onViewStateUpdate_.bind(this));
140 } 141 }
141 this.row.viewState.addUpdateListener(this.onRowStateUpdate_.bind(this)); 142 this.row.viewState.addUpdateListener(this.onRowStateUpdate_.bind(this));
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 212
212 // Wait to create the histogram-span until the user wants to display it 213 // Wait to create the histogram-span until the user wants to display it
213 // in order to speed up creating lots of histogram-set-table-cells when 214 // in order to speed up creating lots of histogram-set-table-cells when
214 // building the table. 215 // building the table.
215 // Wait to pass the Histogram to the histogram-span until it's displayed 216 // Wait to pass the Histogram to the histogram-span until it's displayed
216 // so that it can size its BarChart appropriately. 217 // so that it can size its BarChart appropriately.
217 if (open && this.histogramSpan_ === undefined) { 218 if (open && this.histogramSpan_ === undefined) {
218 this.histogramSpan_ = document.createElement('tr-v-ui-histogram-span'); 219 this.histogramSpan_ = document.createElement('tr-v-ui-histogram-span');
219 this.histogramSpan_.rowState = this.row.viewState; 220 this.histogramSpan_.rowState = this.row.viewState;
220 this.histogramSpan_.viewState = this.viewState; 221 this.histogramSpan_.viewState = this.viewState;
221 this.histogramSpan_.referenceHistogram = this.referenceHistogram; 222 this.histogramSpan_.build(
222 this.histogramSpan_.histogram = this.histogram; 223 this.histogram, this.referenceHistogram, this.histograms_);
223 this.histogramSpan_.alpha = this.row.rootViewState.alpha; 224 this.histogramSpan_.alpha = this.row.rootViewState.alpha;
224 this.$.histogram.appendChild(this.histogramSpan_); 225 this.$.histogram.appendChild(this.histogramSpan_);
225 } 226 }
226 227
227 this.viewState.isOpen = open; 228 this.viewState.isOpen = open;
228 }, 229 },
229 230
230 onViewStateUpdate_(event) { 231 onViewStateUpdate_(event) {
231 if (event.delta.isOpen) { 232 if (event.delta.isOpen) {
232 this.isHistogramOpen = this.viewState.isOpen; 233 this.isHistogramOpen = this.viewState.isOpen;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 return; 312 return;
312 } 313 }
313 314
314 this.$.open_histogram.style.display = 'block'; 315 this.$.open_histogram.style.display = 'block';
315 this.$.open_histogram.style.visibility = 'visible'; 316 this.$.open_histogram.style.visibility = 'visible';
316 this.$.scalar.style.display = 'flex'; 317 this.$.scalar.style.display = 'flex';
317 318
318 const referenceHistogram = this.referenceHistogram; 319 const referenceHistogram = this.referenceHistogram;
319 320
320 if (this.histogramSpan_) { 321 if (this.histogramSpan_) {
321 // Reset in case HistogramSetViewState.referenceDisplayLabel changed. 322 // Rebuild in case HistogramSetViewState.referenceDisplayLabel changed.
322 this.histogramSpan_.referenceHistogram = referenceHistogram; 323 this.histogramSpan_.build(
323 324 this.histogram, this.referenceHistogram, this.histograms_);
324 this.histogramSpan_.alpha = this.row.rootViewState.alpha; 325 this.histogramSpan_.alpha = this.row.rootViewState.alpha;
325 } 326 }
326 327
327 if ((referenceHistogram instanceof tr.v.Histogram) && 328 if ((referenceHistogram instanceof tr.v.Histogram) &&
328 (this.histogram.unit === referenceHistogram.unit) && 329 (this.histogram.unit === referenceHistogram.unit) &&
329 (referenceHistogram.numValues > 0)) { 330 (referenceHistogram.numValues > 0)) {
330 this.$.scalar.significance = this.histogram.getDifferenceSignificance( 331 this.$.scalar.significance = this.histogram.getDifferenceSignificance(
331 referenceHistogram, this.row.rootViewState.alpha); 332 referenceHistogram, this.row.rootViewState.alpha);
332 } 333 }
333 334
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 396
396 hideOverview() { 397 hideOverview() {
397 this.$.overview_container.style.display = 'none'; 398 this.$.overview_container.style.display = 'none';
398 } 399 }
399 }); 400 });
400 401
401 return { 402 return {
402 }; 403 };
403 }); 404 });
404 </script> 405 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/value/ui/histogram_set_table.html ('k') | tracing/tracing/value/ui/histogram_set_table_row.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698