| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright 2015 The Chromium Authors. All rights reserved. | 3 Copyright 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/model/event_set.html"> | 8 <link rel="import" href="/tracing/model/event_set.html"> |
| 9 <link rel="import" href="/tracing/ui/base/line_chart.html"> | 9 <link rel="import" href="/tracing/ui/base/line_chart.html"> |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 updateContents_: function() { | 67 updateContents_: function() { |
| 68 this.clearChart_(); | 68 this.clearChart_(); |
| 69 | 69 |
| 70 var data = this.getDataForLineChart_(); | 70 var data = this.getDataForLineChart_(); |
| 71 | 71 |
| 72 if (data.length === 0) | 72 if (data.length === 0) |
| 73 return; | 73 return; |
| 74 | 74 |
| 75 this.chart_ = this.createChart_(data); | 75 this.chart_ = this.createChart_(data); |
| 76 this.$.content.appendChild(this.chart_); | 76 Polymer.dom(this.$.content).appendChild(this.chart_); |
| 77 }, | 77 }, |
| 78 | 78 |
| 79 createChart_: function(data) { | 79 createChart_: function(data) { |
| 80 var chart = new tr.ui.b.LineChart(); | 80 var chart = new tr.ui.b.LineChart(); |
| 81 var width = document.body.clientWidth * CHART_WIDTH_FRACTION_OF_BODY; | 81 var width = document.body.clientWidth * CHART_WIDTH_FRACTION_OF_BODY; |
| 82 chart.setSize({width: width, height: chart.height}); | 82 chart.setSize({width: width, height: chart.height}); |
| 83 chart.chartTitle = CHART_TITLE; | 83 chart.chartTitle = CHART_TITLE; |
| 84 chart.data = data; | 84 chart.data = data; |
| 85 | 85 |
| 86 return chart; | 86 return chart; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 return points; | 132 return points; |
| 133 }, | 133 }, |
| 134 | 134 |
| 135 sortSamplesByTimestampAscending_: function(samples) { | 135 sortSamplesByTimestampAscending_: function(samples) { |
| 136 return samples.toArray().sort(function(smpl1, smpl2) { | 136 return samples.toArray().sort(function(smpl1, smpl2) { |
| 137 return smpl1.start - smpl2.start; | 137 return smpl1.start - smpl2.start; |
| 138 }); | 138 }); |
| 139 } | 139 } |
| 140 }); | 140 }); |
| 141 </script> | 141 </script> |
| OLD | NEW |