From b151af9366c260b4ed0676998ef98c4f206f4f56 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Tue, 31 Mar 2015 18:48:35 +0300 Subject: client/view/graph_view: small bug fix plus indentation --- src/client/view/graph_view.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/client/view/graph_view.js') diff --git a/src/client/view/graph_view.js b/src/client/view/graph_view.js index 12aeba48..b3e1b0a1 100644 --- a/src/client/view/graph_view.js +++ b/src/client/view/graph_view.js @@ -1231,8 +1231,8 @@ function GraphView(spec) { count = nodes.length, line = Math.floor(Math.sqrt(count)) + 1, rows = Math.ceil(count / line), - wspace = layout.wh[0] / (line + 2), - hspace = layout.wh[1] / (rows + 1); + wspace = this.wh[0] / (line + 2), + hspace = this.wh[1] / (rows + 1); for (var i = 0 ; i < nodes.length ; ++i) { var node = nodes[i]; @@ -1279,12 +1279,13 @@ function GraphView(spec) { if (layout !== undefined) { layout.stop(); } - layout = layout_creator().size([w, h]) - .on("tick", pushRedraw) - .on("end", record_position_to_local_storage) - .nodes(graph.nodes()) - .links(graph.links()) - .start(); + layout = layout_creator() + .size([w, h]) + .on("tick", pushRedraw) + .on("end", record_position_to_local_storage) + .nodes(graph.nodes()) + .links(graph.links()) + .start(); } if (!temporary) { -- cgit v1.3.1