Browse Source

graph: remove border around coparents

Fabian Peter Hammerle 4 years ago
parent
commit
e0abe080fc
2 changed files with 11 additions and 11 deletions
  1. 5 5
      tests/persons/digraph.dot
  2. 6 6
      yamily/_graphviz.py

+ 5 - 5
tests/persons/digraph.dot

@@ -1,6 +1,6 @@
 digraph yamily {
 	subgraph "cluster_erika-mustermann" {
-		rank=same
+		rank=same style=invisible
 		"erika-mustermann" [label="Erika Mustermann\n*1957-08-12" shape=box]
 		"relation-erika-mustermann-thomas-mustermann" [shape=point width=0]
 		"erika-mustermann" -> "relation-erika-mustermann-thomas-mustermann" [arrowhead=none constraint=False]
@@ -8,7 +8,7 @@ digraph yamily {
 		"thomas-mustermann" [label="thomas-mustermann" shape=box]
 	}
 	subgraph "cluster_alice-mother" {
-		rank=same
+		rank=same style=invisible
 		"alice-mother" [label="Mum Test" shape=box]
 		"relation-alice-father-alice-mother" [shape=point width=0]
 		"alice-father" -> "relation-alice-father-alice-mother" [arrowhead=none constraint=False]
@@ -16,15 +16,15 @@ digraph yamily {
 		"alice-father" [label="alice-father" shape=box]
 	}
 	subgraph "cluster_alice-grandmother" {
-		rank=same
+		rank=same style=invisible
 		"alice-grandmother" [label="Grandma Test" shape=box]
 	}
 	subgraph cluster_alice {
-		rank=same
+		rank=same style=invisible
 		alice [label="Alice Test" shape=box]
 	}
 	subgraph "cluster_max-mustermann" {
-		rank=same
+		rank=same style=invisible
 		"max-mustermann" [label="Max Mustermann\n*1976-02-01" shape=box]
 	}
 	"alice-grandmother" -> "alice-father"

+ 6 - 6
yamily/_graphviz.py

@@ -66,11 +66,11 @@ def digraph(collection: PersonCollection) -> graphviz.dot.Digraph:
     >>> print(graph.source)
     digraph yamily {
     	subgraph cluster_grace {
-    		rank=same
+    		rank=same style=invisible
     		grace [label=grace shape=box]
     	}
     	subgraph cluster_carol {
-    		rank=same
+    		rank=same style=invisible
     		carol [label=carol shape=box]
     		"relation-bob-carol" [shape=point width=0]
     		bob -> "relation-bob-carol" [arrowhead=none constraint=False]
@@ -78,15 +78,15 @@ def digraph(collection: PersonCollection) -> graphviz.dot.Digraph:
     		bob [label=bob shape=box]
     	}
     	subgraph cluster_frank {
-    		rank=same
+    		rank=same style=invisible
     		frank [label=frank shape=box]
     	}
     	subgraph cluster_alice {
-    		rank=same
+    		rank=same style=invisible
     		alice [label=alice shape=box]
     	}
     	subgraph cluster_david {
-    		rank=same
+    		rank=same style=invisible
     		david [label=david shape=box]
     	}
     	grace -> carol
@@ -105,7 +105,7 @@ def digraph(collection: PersonCollection) -> graphviz.dot.Digraph:
             continue
         # https://graphviz.gitlab.io/_pages/Gallery/directed/cluster.html
         with graph.subgraph(name="cluster_" + person.identifier) as subgraph:
-            subgraph.attr(rank="same")
+            subgraph.attr(rank="same", style="invisible")
             _add_person_node(subgraph, person)
             nodes.add(person)
             for coparent in collection.get_coparents(person):