| 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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 case 65: | 618 case 65: |
| 619 // 'a' | 619 // 'a' |
| 620 graph.selectAllNodes(); | 620 graph.selectAllNodes(); |
| 621 allowRepetition = false; | 621 allowRepetition = false; |
| 622 break; | 622 break; |
| 623 case 38: | 623 case 38: |
| 624 case 40: { | 624 case 40: { |
| 625 showSelectionFrontierNodes(d3.event.keyCode == 38, undefined, true); | 625 showSelectionFrontierNodes(d3.event.keyCode == 38, undefined, true); |
| 626 break; | 626 break; |
| 627 } | 627 } |
| 628 case 82: |
| 629 // 'r' |
| 630 if (!d3.event.ctrlKey) { |
| 631 this.layoutAction(this); |
| 632 } else { |
| 633 eventHandled = false; |
| 634 } |
| 635 break; |
| 636 case 191: |
| 637 // '/' |
| 638 document.getElementById("search-input").focus(); |
| 639 document.getElementById("search-input").select(); |
| 640 break; |
| 628 default: | 641 default: |
| 629 eventHandled = false; | 642 eventHandled = false; |
| 630 break; | 643 break; |
| 631 } | 644 } |
| 632 if (eventHandled) { | 645 if (eventHandled) { |
| 633 d3.event.preventDefault(); | 646 d3.event.preventDefault(); |
| 634 } | 647 } |
| 635 if (!allowRepetition) { | 648 if (!allowRepetition) { |
| 636 state.lastKeyDown = d3.event.keyCode; | 649 state.lastKeyDown = d3.event.keyCode; |
| 637 } | 650 } |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 } | 1000 } |
| 988 | 1001 |
| 989 viewWholeGraph() { | 1002 viewWholeGraph() { |
| 990 var graph = this; | 1003 var graph = this; |
| 991 var minScale = graph.minScale(); | 1004 var minScale = graph.minScale(); |
| 992 var translation = [0, 0]; | 1005 var translation = [0, 0]; |
| 993 translation = graph.getVisibleTranslation(translation, minScale); | 1006 translation = graph.getVisibleTranslation(translation, minScale); |
| 994 graph.translateClipped(translation, minScale); | 1007 graph.translateClipped(translation, minScale); |
| 995 } | 1008 } |
| 996 } | 1009 } |
| OLD | NEW |