--- a/server/python/django/renkanmanager/utils.py Mon Jan 05 14:02:12 2015 +0100
+++ b/server/python/django/renkanmanager/utils.py Mon Jan 05 17:29:55 2015 +0100
@@ -42,7 +42,7 @@
-class LineNodePlacer(NodePlacer):
+class LineNodePlacer(NodePlacer): #vertical lines
max_length = 0
@@ -66,6 +66,29 @@
self.cat_nb_nodes[c].append({ "x": order*500, "y": 100*(i+offset) })
+class HorLineNodePlacer(NodePlacer): #horizontal lines
+
+ max_length = 0
+
+ def init(self, cat_nb_nodes_initial):
+ for c in cat_nb_nodes_initial:
+ nb = cat_nb_nodes_initial[c]
+ if isinstance(cat_nb_nodes_initial[c], tuple):
+ _, nb = nb
+ self.max_length = nb if nb > self.max_length else self.max_length
+ for i_cat,c in enumerate(cat_nb_nodes_initial):
+ self.cat_nb_nodes[c] = []
+ order = i_cat
+ nb = cat_nb_nodes_initial[c]
+ if isinstance(cat_nb_nodes_initial[c], tuple):
+ order, nb = nb
+ offset = float(self.max_length - nb) / 2
+ for i in xrange(nb):
+ if c=="northwest":
+ self.cat_nb_nodes[c].append({ "x": offset, "y": order*500 })
+ else:
+ self.cat_nb_nodes[c].append({ "x": 100*(i+offset), "y": order*500 })
+
class CircleNodePlacer(NodePlacer):