| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2015 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2015 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/statistics.html"> | 8 <link rel="import" href="/tracing/base/statistics.html"> |
| 9 <link rel="import" href="/tracing/ui/base/bar_chart.html"> | 9 <link rel="import" href="/tracing/ui/base/bar_chart.html"> |
| 10 <link rel="import" href="/tracing/value/ui/scalar_span.html"> | 10 <link rel="import" href="/tracing/value/ui/scalar_span.html"> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 this.brushedBins_ = []; | 55 this.brushedBins_ = []; |
| 56 this.chart_.addEventListener('item-mousedown', | 56 this.chart_.addEventListener('item-mousedown', |
| 57 this.onMouseDown_.bind(this)); | 57 this.onMouseDown_.bind(this)); |
| 58 this.chart_.addEventListener('item-mousemove', | 58 this.chart_.addEventListener('item-mousemove', |
| 59 this.onMouseMove_.bind(this)); | 59 this.onMouseMove_.bind(this)); |
| 60 this.chart_.addEventListener('item-mouseup', | 60 this.chart_.addEventListener('item-mouseup', |
| 61 this.onMouseUp_.bind(this)); | 61 this.onMouseUp_.bind(this)); |
| 62 }, | 62 }, |
| 63 | 63 |
| 64 ready: function() { | 64 ready: function() { |
| 65 this.$.container.appendChild(this.chart_); | 65 Polymer.dom(this.$.container).appendChild(this.chart_); |
| 66 }, | 66 }, |
| 67 | 67 |
| 68 // TODO(polymer): Convert to Polymer property. | 68 // TODO(polymer): Convert to Polymer property. |
| 69 get brushedBins() { | 69 get brushedBins() { |
| 70 return this.brushedBins_; | 70 return this.brushedBins_; |
| 71 }, | 71 }, |
| 72 | 72 |
| 73 updateBrushedRange_: function(currentX) { | 73 updateBrushedRange_: function(currentX) { |
| 74 this.brushedBins_ = [this.histogram_.getBinForValue(currentX)]; | 74 this.brushedBins_ = [this.histogram_.getBinForValue(currentX)]; |
| 75 var r = new tr.b.Range(); | 75 var r = new tr.b.Range(); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 chartData.sort(function(x, y) { | 186 chartData.sort(function(x, y) { |
| 187 return x.x - y.x; | 187 return x.x - y.x; |
| 188 }); | 188 }); |
| 189 this.$.container.style.display = chartData.length ? '' : 'none'; | 189 this.$.container.style.display = chartData.length ? '' : 'none'; |
| 190 this.chart_.data = chartData; | 190 this.chart_.data = chartData; |
| 191 this.brushedBins_ = []; | 191 this.brushedBins_ = []; |
| 192 this.chart_.brushedRange = new tr.b.Range(); | 192 this.chart_.brushedRange = new tr.b.Range(); |
| 193 } | 193 } |
| 194 }); | 194 }); |
| 195 </script> | 195 </script> |
| OLD | NEW |