Commit 5cf194d1 authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[tools] Hide System-analyzer timeline-tracks

- Allow hiding individual timeline-tracks to clear up screen space.
- Auto-hide timeline-tracks when there are no entries

Bug: v8:10644
Change-Id: Ibde37242fa1fcb827ca176ee7576a23715c45bda
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2584954Reviewed-by: 's avatarSathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71739}
parent ff606a06
...@@ -230,4 +230,31 @@ button:hover { ...@@ -230,4 +230,31 @@ button:hover {
} }
.legend h3 { .legend h3 {
margin-top: 10px; margin-top: 10px;
}
.panelCloserLabel {
float: left;
cursor: zoom-out;
margin: 0 10px 0 0;
transition: transform 0.2s ease-out;
user-select: none;
}
.panelCloserInput {
display: none;
}
.panel .panelCloserInput:checked ~ .panelCloserLabel,
.panelCloserInput:checked ~ .panelCloserLabel {
cursor: zoom-in;
transform: rotate(-90deg);
display: inherit;
}
.panel .panelCloserInput:checked ~ h2 {
display: inherit;
border-radius: 7px;
margin-bottom: -20px;
padding-bottom: 10px;
}
.panelCloserInput:checked ~ * {
display: none;
} }
\ No newline at end of file
...@@ -31,6 +31,7 @@ found in the LICENSE file. --> ...@@ -31,6 +31,7 @@ found in the LICENSE file. -->
cursor: -webkit-zoom-in; cursor: -webkit-zoom-in;
color: rgba(var(--border-color), 1); color: rgba(var(--border-color), 1);
} }
.toggle::before { .toggle::before {
content: "▶"; content: "▶";
} }
...@@ -82,7 +83,10 @@ found in the LICENSE file. --> ...@@ -82,7 +83,10 @@ found in the LICENSE file. -->
top: 40px; top: 40px;
} }
</style> </style>
<div class="panel"> <div class="panel">
<input type="checkbox" id="closer" class="panelCloserInput">
<label class="panelCloserLabel" for="closer"></label>
<h2 id="title"></h2> <h2 id="title"></h2>
<div class="selection"> <div class="selection">
<input type="radio" id="show-all" name="selectionType" value="all"> <input type="radio" id="show-all" name="selectionType" value="all">
......
...@@ -16,7 +16,7 @@ found in the LICENSE file. --> ...@@ -16,7 +16,7 @@ found in the LICENSE file. -->
border-radius: 0 0 0 7px; border-radius: 0 0 0 7px;
height: calc(100% - 34px); height: calc(100% - 34px);
width: 30px; width: 30px;
background-color: rgba(var(--border-color),0.2); background-color: var(--border-color);
} }
</style> </style>
</head> </head>
......
...@@ -63,19 +63,30 @@ found in the LICENSE file. --> ...@@ -63,19 +63,30 @@ found in the LICENSE file. -->
font-size: 10px; font-size: 10px;
} }
#title { .title {
position: relative; position: relative;
float: left; float: left;
width: 20px; width: 20px;
writing-mode: vertical-rl; writing-mode: vertical-rl;
text-orientation: mixed; text-orientation: mixed;
margin: 0 0 0 -10px; margin: 20px 0 0 -10px;
padding: 5px 5px 0px 5px; padding: 5px 5px 0px 5px;
overflow: hidden; overflow: hidden;
border-radius: 7px; border-radius: 7px;
font-weight: 400; font-weight: 400;
} }
.panelCloserInput:checked ~ h3 {
display: inherit;
flex: 1;
writing-mode: unset;
text-orientation: unset;
background-color: var(--border-color);
border-radius: 0px;
padding: 5px;
margin: 0 -10px 0 20px;
}
.timelineLegend { .timelineLegend {
position: relative; position: relative;
float: right; float: right;
...@@ -140,28 +151,55 @@ found in the LICENSE file. --> ...@@ -140,28 +151,55 @@ found in the LICENSE file. -->
height: 100%; height: 100%;
position: absolute; position: absolute;
} }
.content {
display: flex;
position: relative;
}
.panelCloserLabel {
position: absolute;
top: 5px;
left: 0px;
}
.title {
flex: initial;
}
#timeline {
flex: 1;
}
.legend {
flex: initial;
}
</style> </style>
<h3 id="title"></h3> <div class="content">
<div class="timelineLegend"> <input type="checkbox" id="closer" class="panelCloserInput">
<table id="legendTable"> <label class="panelCloserLabel" for="closer"></label>
<thead> <h3 class="title" id="title"></h3>
<tr>
<td>Type</td> <div id="timeline">
<td>Count</td> <div id="selection">
<td>Percent</td> <div id="leftHandle"></div>
</tr> <div id="selectionBackground"></div>
</thead> <div id="rightHandle"></div>
<tbody></tbody> </div>
</table> <div id="timelineLabel">Frequency</div>
</div> <div id="timelineChunks"></div>
<div id="timeline"> <canvas id="timelineCanvas"></canvas>
<div id="selection"> </div>
<div id="leftHandle"></div>
<div id="selectionBackground"></div> <div class="timelineLegend">
<div id="rightHandle"></div> <table id="legendTable">
<thead>
<tr>
<td>Type</td>
<td>Count</td>
<td>Percent</td>
</tr>
</thead>
<tbody></tbody>
</table>
</div> </div>
<div id="timelineLabel">Frequency</div>
<div id="timelineChunks"></div>
<canvas id="timelineCanvas"></canvas>
</div> </div>
\ No newline at end of file
...@@ -51,6 +51,7 @@ DOM.defineCustomElement('view/timeline/timeline-track', ...@@ -51,6 +51,7 @@ DOM.defineCustomElement('view/timeline/timeline-track',
set data(timeline) { set data(timeline) {
this._timeline = timeline; this._timeline = timeline;
this._legend.timeline = timeline; this._legend.timeline = timeline;
this.$('.content').style.display = timeline.isEmpty() ? 'none' : 'relative';
this._updateChunks(); this._updateChunks();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment