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

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

Issue 1429863004: Actually fix analysis link hovering (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Created 5 years, 1 month 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/chart_base.html ('k') | tracing/tracing/ui/brushing_state.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) 2012 The Chromium Authors. All rights reserved. 3 Copyright (c) 2012 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/color_scheme.html"> 8 <link rel="import" href="/tracing/base/color_scheme.html">
9 <link rel="import" href="/tracing/model/selection_state.html"> 9 <link rel="import" href="/tracing/model/selection_state.html">
10 10
11 <script> 11 <script>
12 'use strict'; 12 'use strict';
13 13
14 /** 14 /**
15 * @fileoverview Provides color scheme related functions. 15 * @fileoverview Provides color scheme related functions.
16 */ 16 */
17 tr.exportTo('tr.ui.b', function() { 17 tr.exportTo('tr.ui.b', function() {
18 var ColorScheme = tr.b.ColorScheme; 18 var ColorScheme = tr.b.ColorScheme;
19 19
20 var colors = ColorScheme.colors; 20 var colors = ColorScheme.colors;
21 var colorsAsStrings = ColorScheme.colorsAsStrings; 21 var colorsAsStrings = ColorScheme.colorsAsStrings;
22 var numBaseColors = ColorScheme.properties.numBaseColors; 22 var numColorsPerVariant = ColorScheme.properties.numColorsPerVariant;
23 23
24 var SelectionState = tr.model.SelectionState; 24 var SelectionState = tr.model.SelectionState;
25 25
26 /** 26 /**
27 * Provides methods to get view values for events. 27 * Provides methods to get view values for events.
28 */ 28 */
29 var EventPresenter = { 29 var EventPresenter = {
30 getSelectableItemColorAsString: function(item) { 30 getSelectableItemColorAsString: function(item) {
31 var colorId = item.colorId + this.getColorIdOffset_(item); 31 var colorId = item.colorId + this.getColorIdOffset_(item);
32 return colorsAsStrings[colorId]; 32 return colorsAsStrings[colorId];
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 opt_alphaMultiplier) { 73 opt_alphaMultiplier) {
74 var event = {selectionState: selectionState}; 74 var event = {selectionState: selectionState};
75 var c = colors[colorId + this.getColorIdOffset_(event)]; 75 var c = colors[colorId + this.getColorIdOffset_(event)];
76 return c.toStringWithAlphaOverride( 76 return c.toStringWithAlphaOverride(
77 opt_alphaMultiplier !== undefined ? opt_alphaMultiplier : 1.0); 77 opt_alphaMultiplier !== undefined ? opt_alphaMultiplier : 1.0);
78 }, 78 },
79 79
80 getBarSnapshotColor: function(snapshot, offset) { 80 getBarSnapshotColor: function(snapshot, offset) {
81 var colorId = 81 var colorId =
82 (snapshot.objectInstance.colorId + offset) % 82 (snapshot.objectInstance.colorId + offset) %
83 numBaseColors; 83 numColorsPerVariant;
84 colorId += this.getColorIdOffset_(snapshot); 84 colorId += this.getColorIdOffset_(snapshot);
85 return colors[colorId].toStringWithAlphaOverride(1.0); 85 return colors[colorId].toStringWithAlphaOverride(1.0);
86 } 86 }
87 }; 87 };
88 88
89 return { 89 return {
90 EventPresenter: EventPresenter 90 EventPresenter: EventPresenter
91 }; 91 };
92 }); 92 });
93 </script> 93 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/ui/base/chart_base.html ('k') | tracing/tracing/ui/brushing_state.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698