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

Side by Side Diff: tracing/tracing/ui/base/scatter_chart_test.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
« no previous file with comments | « tracing/tracing/ui/base/scatter_chart.html ('k') | tracing/tracing/ui/base/timing_tool.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ui/base/scatter_chart.html"> 8 <link rel="import" href="/tracing/ui/base/scatter_chart.html">
9 9
10 <script> 10 <script>
(...skipping 21 matching lines...) Expand all
32 {x: 40, y: 20, radius: 5, color: 'purple'}, 32 {x: 40, y: 20, radius: 5, color: 'purple'},
33 {x: 50, y: 30, radius: 6, color: 'yellow'}, 33 {x: 50, y: 30, radius: 6, color: 'yellow'},
34 {x: 60, y: 20, radius: 7, color: 'green'}, 34 {x: 60, y: 20, radius: 7, color: 'green'},
35 {x: 70, y: 15, radius: 8, color: 'blue'}, 35 {x: 70, y: 15, radius: 8, color: 'blue'},
36 {x: 80, y: 20, radius: 9, color: 'red'} 36 {x: 80, y: 20, radius: 9, color: 'red'}
37 ]; 37 ];
38 38
39 var mouseDown = undefined; 39 var mouseDown = undefined;
40 40
41 function updateBrushedRange(e) { 41 function updateBrushedRange(e) {
42 var xRange = new tr.b.Range(); 42 var xRange = new tr.b.math.Range();
43 if (e.x !== mouseDown.x) { 43 if (e.x !== mouseDown.x) {
44 xRange.addValue(mouseDown.x); 44 xRange.addValue(mouseDown.x);
45 xRange.addValue(e.x); 45 xRange.addValue(e.x);
46 } 46 }
47 var yRange = new tr.b.Range(); 47 var yRange = new tr.b.math.Range();
48 if (e.y !== mouseDown.y) { 48 if (e.y !== mouseDown.y) {
49 yRange.addValue(mouseDown.y); 49 yRange.addValue(mouseDown.y);
50 yRange.addValue(e.y); 50 yRange.addValue(e.y);
51 } 51 }
52 chart.setBrushedRanges(xRange, yRange); 52 chart.setBrushedRanges(xRange, yRange);
53 } 53 }
54 54
55 chart.addEventListener('item-mousedown', function(e) { 55 chart.addEventListener('item-mousedown', function(e) {
56 mouseDown = e; 56 mouseDown = e;
57 }); 57 });
58 chart.addEventListener('item-mousemove', function(e) { 58 chart.addEventListener('item-mousemove', function(e) {
59 updateBrushedRange(e); 59 updateBrushedRange(e);
60 }); 60 });
61 chart.addEventListener('item-mouseup', function(e) { 61 chart.addEventListener('item-mouseup', function(e) {
62 updateBrushedRange(e); 62 updateBrushedRange(e);
63 mouseDown = undefined; 63 mouseDown = undefined;
64 }); 64 });
65 }); 65 });
66 }); 66 });
67 </script> 67 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/ui/base/scatter_chart.html ('k') | tracing/tracing/ui/base/timing_tool.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698