Commits

Michele Orrù committed 12c2312

Webapp working \o/

Comments (0)

Files changed (1)

 """
 
 import csv
+import logging
 
 import flask
 from pattern.en import sentiment
     The graph is supposed to show people with strong accordance more near than
     people in opposition.
     """
-    talk_graph = graph.Graph()
+    talk_graph = graph.Graph(layout=graph._graph.SPRING)
 
     with open(txtcsv) as txt:
         csv_reader = csv.DictReader(txt,
             msg = line['msg']
 
             if not target:
-                logging.debug(('User %s reported this message referring to '
-                               'nobody: %s') % (author, msg))
-                continue
+                talk_graph.add_node(author)
             else:
                 # Add a new node using the Edge class declared above
                 talk_graph.add_edge(author, target,
                                     weight=sentiment(msg)[0],
                                     base=graph.Edge, type='is-related-to')
 
-    return graph.render(talk_graph, frames=1, ipf=0)
+    return graph.render(talk_graph)