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

Side by Side Diff: tools/turbolizer/graph-view.js

Issue 2171543004: [turbolizer] Remember the last phase, search query, and pane expansions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@t-p6
Patch Set: Fix bug in remembering pane state. Created 4 years, 5 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 | « no previous file | tools/turbolizer/turbo-visualizer.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 "use strict"; 5 "use strict";
6 6
7 class GraphView extends View { 7 class GraphView extends View {
8 constructor (d3, id, nodes, edges, broker) { 8 constructor (d3, id, nodes, edges, broker) {
9 super(id, broker); 9 super(id, broker);
10 var graph = this; 10 var graph = this;
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 graph.viewSelection(); 503 graph.viewSelection();
504 } 504 }
505 505
506 toggleTypesAction(graph) { 506 toggleTypesAction(graph) {
507 graph.toggleTypes(); 507 graph.toggleTypes();
508 } 508 }
509 509
510 searchInputAction(graph) { 510 searchInputAction(graph) {
511 if (d3.event.keyCode == 13) { 511 if (d3.event.keyCode == 13) {
512 graph.state.selection.clear(); 512 graph.state.selection.clear();
513 var reg = new RegExp(this.value); 513 var query = this.value;
514 window.sessionStorage.setItem("lastSearch", query);
515
516 var reg = new RegExp(query);
514 var filterFunction = function(n) { 517 var filterFunction = function(n) {
515 return (reg.exec(n.getDisplayLabel()) != null || 518 return (reg.exec(n.getDisplayLabel()) != null ||
516 (graph.state.showTypes && reg.exec(n.getDisplayType())) || 519 (graph.state.showTypes && reg.exec(n.getDisplayType())) ||
517 reg.exec(n.opcode) != null); 520 reg.exec(n.opcode) != null);
518 }; 521 };
519 if (d3.event.ctrlKey) { 522 if (d3.event.ctrlKey) {
520 graph.nodes.forEach(function(n, i) { 523 graph.nodes.forEach(function(n, i) {
521 if (filterFunction(n)) { 524 if (filterFunction(n)) {
522 n.visible = true; 525 n.visible = true;
523 } 526 }
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 } 990 }
988 991
989 viewWholeGraph() { 992 viewWholeGraph() {
990 var graph = this; 993 var graph = this;
991 var minScale = graph.minScale(); 994 var minScale = graph.minScale();
992 var translation = [0, 0]; 995 var translation = [0, 0];
993 translation = graph.getVisibleTranslation(translation, minScale); 996 translation = graph.getVisibleTranslation(translation, minScale);
994 graph.translateClipped(translation, minScale); 997 graph.translateClipped(translation, minScale);
995 } 998 }
996 } 999 }
OLDNEW
« no previous file with comments | « no previous file | tools/turbolizer/turbo-visualizer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698