mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
feat(devtools): making small frames clickable
This commit is contained in:
committed by
Minko Gechev
parent
290afbb5c0
commit
ee7d8e58c6
+1
-1
@@ -64,7 +64,7 @@
|
||||
}
|
||||
|
||||
.selected {
|
||||
border: 1px solid #00000050;
|
||||
border: 1px solid #00000050 !important;
|
||||
}
|
||||
|
||||
.txt-frames {
|
||||
|
||||
+4
-2
@@ -88,6 +88,7 @@ export class TimelineComponent {
|
||||
const multiplicationFactor = parseFloat((MAX_HEIGHT / maxValue).toFixed(2));
|
||||
this.graphData = timeline.map(d => {
|
||||
const height = d.timeSpent * multiplicationFactor;
|
||||
const colorPercentage = Math.round((height / MAX_HEIGHT) * 100);
|
||||
let backgroundColor = 'rgb(237, 213, 94)';
|
||||
if (height > 33) {
|
||||
backgroundColor = 'rgb(240, 117, 117)';
|
||||
@@ -98,11 +99,12 @@ export class TimelineComponent {
|
||||
const style = {
|
||||
'margin-left': '1px',
|
||||
'margin-right': '1px',
|
||||
'background-color': backgroundColor,
|
||||
background: `-webkit-linear-gradient(bottom, ${backgroundColor} ${colorPercentage}%, #f3f3f3 ${colorPercentage}%)`,
|
||||
border: '1px solid #d0d0d0',
|
||||
cursor: 'pointer',
|
||||
'min-width': '25px',
|
||||
width: '25px',
|
||||
height: `${height}px`,
|
||||
height: '50px',
|
||||
};
|
||||
const toolTip = `${d.source} TimeSpent: ${d.timeSpent.toFixed(3)}ms`;
|
||||
return { ...d, style, toolTip };
|
||||
|
||||
Reference in New Issue
Block a user