OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2014 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2014 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/raf.html"> | 8 <link rel="import" href="/tracing/base/raf.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/ui/base/d3.html"> | 10 <link rel="import" href="/tracing/ui/base/d3.html"> |
(...skipping 17 matching lines...) Expand all Loading... |
28 (this.graphHeight - chartPoint.y) / this.barHeight)) | 28 (this.graphHeight - chartPoint.y) / this.barHeight)) |
29 }; | 29 }; |
30 }, | 30 }, |
31 | 31 |
32 getXForDatum_(datum, index) { | 32 getXForDatum_(datum, index) { |
33 return index; | 33 return index; |
34 }, | 34 }, |
35 | 35 |
36 get yAxisWidth() { | 36 get yAxisWidth() { |
37 if (this.data.length === 0) return 0; | 37 if (this.data.length === 0) return 0; |
38 return Y_AXIS_PADDING + tr.b.Statistics.max( | 38 return Y_AXIS_PADDING + tr.b.math.Statistics.max( |
39 this.data_, d => tr.ui.b.getSVGTextSize(this, d.x).width); | 39 this.data_, d => tr.ui.b.getSVGTextSize(this, d.x).width); |
40 }, | 40 }, |
41 | 41 |
42 get defaultGraphHeight() { | 42 get defaultGraphHeight() { |
43 return (3 + this.textHeightPx_) * this.data.length; | 43 return (3 + this.textHeightPx_) * this.data.length; |
44 }, | 44 }, |
45 | 45 |
46 updateYAxis_(yAxis) { | 46 updateYAxis_(yAxis) { |
47 // Building the y-axis requires measuring text. | 47 // Building the y-axis requires measuring text. |
48 // If necessary, wait for this element to be displayed. | 48 // If necessary, wait for this element to be displayed. |
(...skipping 25 matching lines...) Expand all Loading... |
74 } | 74 } |
75 } | 75 } |
76 } | 76 } |
77 }; | 77 }; |
78 | 78 |
79 return { | 79 return { |
80 NameBarChart, | 80 NameBarChart, |
81 }; | 81 }; |
82 }); | 82 }); |
83 </script> | 83 </script> |
OLD | NEW |