Skip to content

Commit f7d2390

Browse files
authored
Fix minimap selection extend limits in toolchain profiler view. (#25057)
1 parent 02264e0 commit f7d2390

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tools/toolchain_profiler.results_template.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -588,11 +588,12 @@
588588
.attr('d', function(d) { return d.path; });
589589

590590
// draw the selection area
591+
var selectionExtent = [
592+
d3.min(items, function(d) { return d.start; }),
593+
d3.max(items, function(d) { return d.end; })];
591594
var brush = d3.svg.brush()
592595
.x(x)
593-
.extent([
594-
d3.min(items, function(d) { return d.start; }),
595-
d3.max(items, function(d) { return d.end; })])
596+
.extent(selectionExtent)
596597
.on("brush", display);
597598

598599
mini.append('g')
@@ -606,8 +607,8 @@
606607
display();
607608

608609
function display () {
609-
var minExtent = Math.max(0, brush.extent()[0]);
610-
var maxExtent = Math.min(lastEndTime, brush.extent()[1]);
610+
var minExtent = Math.max(selectionExtent[0], brush.extent()[0]);
611+
var maxExtent = Math.min(selectionExtent[1], brush.extent()[1]);
611612
var visItems = items.filter(function (d) { return d.start < maxExtent && d.end > minExtent});
612613

613614
mini.select('.brush').call(brush.extent([minExtent, maxExtent]));

0 commit comments

Comments
 (0)