OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |