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

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

Issue 2168713005: [turbolizer] Redetermine graph bounding box after dragging a node. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@t-p1
Patch Set: 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 | « tools/turbolizer/graph-layout.js ('k') | no next file » | 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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 var graph = this, 464 var graph = this,
465 state = graph.state, 465 state = graph.state,
466 consts = graph.consts; 466 consts = graph.consts;
467 467
468 var mouseDownNode = state.mouseDownNode; 468 var mouseDownNode = state.mouseDownNode;
469 469
470 if (!mouseDownNode) return; 470 if (!mouseDownNode) return;
471 471
472 if (state.justDragged) { 472 if (state.justDragged) {
473 // dragged, not clicked 473 // dragged, not clicked
474 redetermineGraphBoundingBox(graph);
474 state.justDragged = false; 475 state.justDragged = false;
475 } else{ 476 } else{
476 // clicked, not dragged 477 // clicked, not dragged
477 var extend = d3.event.shiftKey; 478 var extend = d3.event.shiftKey;
478 var selection = graph.state.selection; 479 var selection = graph.state.selection;
479 if (!extend) { 480 if (!extend) {
480 selection.clear(); 481 selection.clear();
481 } 482 }
482 selection.select(d3node[0][0], true); 483 selection.select(d3node[0][0], true);
483 } 484 }
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 } 963 }
963 964
964 viewWholeGraph() { 965 viewWholeGraph() {
965 var graph = this; 966 var graph = this;
966 var minScale = graph.minScale(); 967 var minScale = graph.minScale();
967 var translation = [0, 0]; 968 var translation = [0, 0];
968 translation = graph.getVisibleTranslation(translation, minScale); 969 translation = graph.getVisibleTranslation(translation, minScale);
969 graph.translateClipped(translation, minScale); 970 graph.translateClipped(translation, minScale);
970 } 971 }
971 } 972 }
OLDNEW
« no previous file with comments | « tools/turbolizer/graph-layout.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698