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

Side by Side Diff: tracing/tracing/value/ui/composition_span.html

Issue 2334233003: Merge NumericValue into Histogram (Closed)
Patch Set: fix rail_power_metric Created 4 years, 3 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/value/numeric.html ('k') | tracing/tracing/value/ui/composition_span_test.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 2016 The Chromium Authors. All rights reserved. 3 Copyright 2016 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/extras/chrome/chrome_user_friendly_category_dr iver.html"> 8 <link rel="import" href="/tracing/extras/chrome/chrome_user_friendly_category_dr iver.html">
9 <link rel="import" href="/tracing/ui/base/column_chart.html"> 9 <link rel="import" href="/tracing/ui/base/column_chart.html">
10 <link rel="import" href="/tracing/ui/base/drag_handle.html"> 10 <link rel="import" href="/tracing/ui/base/drag_handle.html">
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 var cat = name.split(' '); 79 var cat = name.split(' ');
80 cat = cat[cat.length - 1]; 80 cat = cat[cat.length - 1];
81 var color = tr.e.chrome.ChromeUserFriendlyCategoryDriver.getColor(cat); 81 var color = tr.e.chrome.ChromeUserFriendlyCategoryDriver.getColor(cat);
82 var hsl = color.toHSL(); 82 var hsl = color.toHSL();
83 hsl.l *= 0.85; 83 hsl.l *= 0.85;
84 var highlightedColor = tr.b.Color.fromHSL(hsl); 84 var highlightedColor = tr.b.Color.fromHSL(hsl);
85 dataSeries.highlightedColor = highlightedColor; 85 dataSeries.highlightedColor = highlightedColor;
86 dataSeries.color = color; 86 dataSeries.color = color;
87 } 87 }
88 88
89 if (value instanceof tr.v.NumericValue) { 89 if (value instanceof tr.v.Histogram) {
90 dataSeries.target = value; 90 dataSeries.target = value;
91 if (value.numeric instanceof tr.v.ScalarNumeric) 91 data[name] = value.sum;
92 data[name] = value.numeric.value;
93 else if (value.numeric instanceof tr.v.Histogram)
94 data[name] = value.numeric.sum;
95 } else if (typeof value === 'number') { 92 } else if (typeof value === 'number') {
96 data[name] = value; 93 data[name] = value;
94 } else {
95 throw new Error('unsupported value ' + value);
97 } 96 }
98 } 97 }
99 this.chart_.data = [data]; 98 this.chart_.data = [data];
100 } 99 }
101 }); 100 });
102 </script> 101 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/value/numeric.html ('k') | tracing/tracing/value/ui/composition_span_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698