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

Side by Side Diff: tracing/tracing/ui/base/name_bar_chart.html

Issue 2771723003: [tracing] Move math utilities from base into their own subdirectory (attempt 2) (Closed)
Patch Set: rebase Created 3 years, 9 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 (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
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
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>
OLDNEW
« no previous file with comments | « tracing/tracing/ui/base/line_chart_test.html ('k') | tracing/tracing/ui/base/name_bar_chart_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698