| 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 var DEFAULT_NODE_ROW_SEPARATION = 130 | 5 var DEFAULT_NODE_ROW_SEPARATION = 130 |
| 6 | 6 |
| 7 var traceLayout = false; | 7 var traceLayout = false; |
| 8 | 8 |
| 9 function newGraphOccupation(graph){ | 9 function newGraphOccupation(graph){ |
| 10 var isSlotFilled = []; | 10 var isSlotFilled = []; |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 } | 364 } |
| 365 startNodes.forEach(dfsRankOrder); | 365 startNodes.forEach(dfsRankOrder); |
| 366 | 366 |
| 367 endNodes.forEach(function(n) { | 367 endNodes.forEach(function(n) { |
| 368 n.rank = maxRank + 1; | 368 n.rank = maxRank + 1; |
| 369 }); | 369 }); |
| 370 | 370 |
| 371 var rankSets = []; | 371 var rankSets = []; |
| 372 // Collect sets for each rank. | 372 // Collect sets for each rank. |
| 373 graph.nodes.forEach(function(n, i){ | 373 graph.nodes.forEach(function(n, i){ |
| 374 n.y = n.rank * (DEFAULT_NODE_ROW_SEPARATION + graph.getNodeHeight() + | 374 n.y = n.rank * (DEFAULT_NODE_ROW_SEPARATION + graph.getNodeHeight(n) + |
| 375 2 * DEFAULT_NODE_BUBBLE_RADIUS); | 375 2 * DEFAULT_NODE_BUBBLE_RADIUS); |
| 376 if (n.visible) { | 376 if (n.visible) { |
| 377 if (rankSets[n.rank] === undefined) { | 377 if (rankSets[n.rank] === undefined) { |
| 378 rankSets[n.rank] = [n]; | 378 rankSets[n.rank] = [n]; |
| 379 } else { | 379 } else { |
| 380 rankSets[n.rank].push(n); | 380 rankSets[n.rank].push(n); |
| 381 } | 381 } |
| 382 } | 382 } |
| 383 }); | 383 }); |
| 384 | 384 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 | 475 |
| 476 if (node.x < graph.minGraphX) { | 476 if (node.x < graph.minGraphX) { |
| 477 graph.minGraphX = node.x; | 477 graph.minGraphX = node.x; |
| 478 } | 478 } |
| 479 if ((node.x + node.getTotalNodeWidth()) > graph.maxGraphNodeX) { | 479 if ((node.x + node.getTotalNodeWidth()) > graph.maxGraphNodeX) { |
| 480 graph.maxGraphNodeX = node.x + node.getTotalNodeWidth(); | 480 graph.maxGraphNodeX = node.x + node.getTotalNodeWidth(); |
| 481 } | 481 } |
| 482 if ((node.y - 50) < graph.minGraphY) { | 482 if ((node.y - 50) < graph.minGraphY) { |
| 483 graph.minGraphY = node.y - 50; | 483 graph.minGraphY = node.y - 50; |
| 484 } | 484 } |
| 485 if ((node.y + graph.getNodeHeight() + 50) > graph.maxGraphY) { | 485 if ((node.y + graph.getNodeHeight(node) + 50) > graph.maxGraphY) { |
| 486 graph.maxGraphY = node.y + graph.getNodeHeight() + 50; | 486 graph.maxGraphY = node.y + graph.getNodeHeight(node) + 50; |
| 487 } | 487 } |
| 488 } | 488 } |
| 489 | 489 |
| 490 graph.maxGraphX = graph.maxGraphNodeX + | 490 graph.maxGraphX = graph.maxGraphNodeX + |
| 491 graph.maxBackEdgeNumber * MINIMUM_EDGE_SEPARATION; | 491 graph.maxBackEdgeNumber * MINIMUM_EDGE_SEPARATION; |
| 492 | 492 |
| 493 } | 493 } |
| OLD | NEW |