diff options
Diffstat (limited to 'src/client/view/layouts.js')
| -rw-r--r-- | src/client/view/layouts.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/client/view/layouts.js b/src/client/view/layouts.js index 76422c0b..5fb750a9 100644 --- a/src/client/view/layouts.js +++ b/src/client/view/layouts.js @@ -177,6 +177,12 @@ function(consts, $, d3, _) { return layout; } + function save_from_arr_id_x_y(data) { + layout.saved_nodes_position = _.object(data.map(function (d) { + return [d.id, {x: d.x, y: d.y, px: d.x, py: d.y, fixed: true}]; + })); + } + function restore() { if (layout.saved_nodes_position === undefined) { return layout; @@ -219,6 +225,7 @@ function(consts, $, d3, _) { links: links, save: save, restore: restore, + save_from_arr_id_x_y: save_from_arr_id_x_y, stop: save, start: restore, nodes_links: function (nodes, links) { |
