From 857e9278664ebfbec6ca33c02b6746ff6c0be1fc Mon Sep 17 00:00:00 2001 From: Marco Goldin Date: Sun, 26 Mar 2017 15:17:17 +0200 Subject: [PATCH 1/2] nodes graph layout positions coordinates --- fb_group.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fb_group.py b/fb_group.py index 122d757..16744c1 100644 --- a/fb_group.py +++ b/fb_group.py @@ -238,6 +238,12 @@ ) ) +# node positioning algo +# http://networkx.readthedocs.io/en/latest/reference/drawing.html +pos=nx.spring_layout(G) # Fruchterman-Reingold + +nx.set_node_attributes(G,'pos',pos) + try: graph_type = config.get("Graph","graph_type") except ConfigParser.NoOptionError, e: From 771d2646f53628a660f599a92538ad53f1222c6d Mon Sep 17 00:00:00 2001 From: Marco Goldin Date: Sun, 26 Mar 2017 15:22:18 +0200 Subject: [PATCH 2/2] nodes graph layout positions coordinates --- fb_group.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fb_group.py b/fb_group.py index 16744c1..fd164a3 100644 --- a/fb_group.py +++ b/fb_group.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import facebook, logging, ConfigParser, sys, json logging.basicConfig(level=logging.INFO) from datetime import datetime