Skip to content

Commit 70bffd9

Browse files
author
Konstantin
committed
fix/feat: set aspect ratio to 3:1
1 parent 196f421 commit 70bffd9

14 files changed

+73
-62
lines changed

src/rebdhuhn/graphviz.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def convert_graph_to_dot(ebd_graph: EbdGraph) -> str:
160160
f'<B><FONT POINT-SIZE="18">{ebd_graph.metadata.chapter}</FONT></B><BR/><BR/>'
161161
f'<B><FONT POINT-SIZE="16">{ebd_graph.metadata.section}</FONT></B><BR/><BR/><BR/><BR/>'
162162
)
163-
dot_attributes: dict[str, str] = {"labelloc": '"t"', "label": f"<{header}>"}
163+
dot_attributes: dict[str, str] = {"labelloc": '"t"', "label": f"<{header}>", "size":"\"3,1\""}
164164
dot_code = "digraph D {\n"
165165
for dot_attr_key, dot_attr_value in dot_attributes.items():
166166
dot_code += f"{ADD_INDENT}{dot_attr_key}={dot_attr_value};\n"

unittests/__snapshots__/test_table_to_graph.ambr

+18-12
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# serializer version: 1
22
# name: TestEbdTableModels.test_table_to_digraph_dot_real_kroki_request[table0-DiGraph with 6 nodes and 5 edges][test_table_to_digraph_dot_real_kroki_request_E_0003_Bestellung der Aggregationsebene RZ prüfen]
33
'''
4-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1055pt" height="428pt" viewBox="0.00 0.00 1054.50 427.82">
4+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="177pt" height="72pt" viewBox="0.00 0.00 177.47 72.00">
55
<!--curl - -request POST - -url https://kroki.io/ via local kroki docker container instance hosted at http://localhost:8125/- -header 'Content-Type: application/json' - -data 'digraph D {
66
labelloc="t";
77
label=<<B><FONT POINT-SIZE="18">7.39 AD: Bestellung der Aggregationsebene der Bilanzkreissummenzeitreihe auf Ebene der Regelzone</FONT></B><BR/><BR/><B><FONT POINT-SIZE="16">7.39.1 E_0003_Bestellung der Aggregationsebene RZ pr&#252;fen</FONT></B><BR/><BR/><BR/><BR/>>;
8+
size="3,1";
89
"Start" [margin="0.2,0.12", shape=box, style=filled, fillcolor="#7a8da1", label=<<B>E_0003</B><BR align="center"/><FONT point-size="12"><B><U>Pr&#252;fende Rolle:</U> &#220;NB</B></FONT><BR align="center"/>>];
910
"1" [margin="0.2,0.12", shape=box, style="filled,rounded", fillcolor="#7aab8a", label=<<B>1: </B>Erfolgt der Eingang der Bestellung fristgerecht?<BR align="left"/>>];
1011
"A01" [margin="0.17,0.08", shape=box, style=filled, fillcolor="#cfb986", label=<<B>A01</B><BR align="center"/><FONT point-size="12"><U>Hinweis:</U><BR align="left"/>Frist&#252;berschreitung<BR align="left"/></FONT>>];
@@ -19,7 +20,7 @@
1920
"2" -> "Ende" [label="Ja"];
2021

2122
bgcolor="transparent";
22-
}'--><g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 423.82)">
23+
}'--><g id="graph0" class="graph" transform="scale(0.168295 0.168295) rotate(0) translate(4 423.82)">
2324
<title>D</title>
2425
<text text-anchor="start" x="8" y="-399.72" font-family="Times,serif" font-weight="bold" font-size="18.00">7.39 AD: Bestellung der Aggregationsebene der Bilanzkreissummenzeitreihe auf Ebene der Regelzone</text>
2526
<text text-anchor="start" x="250.62" y="-369.62" font-family="Times,serif" font-weight="bold" font-size="16.00">7.39.1 E_0003_Bestellung der Aggregationsebene RZ pr&#252;fen</text>
@@ -107,10 +108,11 @@
107108
# ---
108109
# name: TestEbdTableModels.test_table_to_digraph_dot_real_kroki_request[table1-DiGraph with 22 nodes and 21 edges][test_table_to_digraph_dot_real_kroki_request_E_0015_MaBiS-ZP Aktivierung prüfen]
109110
'''
110-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="3190pt" height="1370pt" viewBox="0.00 0.00 3190.30 1369.98">
111+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="168pt" height="72pt" viewBox="0.00 0.00 167.67 72.00">
111112
<!--curl - -request POST - -url https://kroki.io/ via local kroki docker container instance hosted at http://localhost:8125/- -header 'Content-Type: application/json' - -data 'digraph D {
112113
labelloc="t";
113114
label=<<B><FONT POINT-SIZE="18">7.17 AD: Aktivierung eines MaBiS-ZP f&#252;r Bilanzierungsgebietssummenzeitreihen vom &#220;NB an BIKO und NB</FONT></B><BR/><BR/><B><FONT POINT-SIZE="16">7.17.1 E_0015_MaBiS-ZP Aktivierung pr&#252;fen</FONT></B><BR/><BR/><BR/><BR/>>;
115+
size="3,1";
114116
"Start" [margin="0.2,0.12", shape=box, style=filled, fillcolor="#7a8da1", label=<<B>E_0015</B><BR align="center"/><FONT point-size="12"><B><U>Pr&#252;fende Rolle:</U> BIKO</B></FONT><BR align="center"/>>];
115117
"1" [margin="0.2,0.12", shape=box, style="filled,rounded", fillcolor="#7aab8a", label=<<B>1: </B>Erfolgt die Aktivierung nach Ablauf der Clearingfrist f&#252;r die KBKA?<BR align="left"/>>];
116118
"A01" [margin="0.17,0.08", shape=box, style=filled, fillcolor="#cfb986", label=<<B>A01</B><BR align="center"/><FONT point-size="12"><U>Hinweis:</U><BR align="left"/>Cluster Ablehnung<BR align="left"/>Frist&#252;berschreitung<BR align="left"/></FONT>>];
@@ -157,7 +159,7 @@
157159
"10" -> "A11" [label="Nein"];
158160

159161
bgcolor="transparent";
160-
}'--><g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 1365.98)">
162+
}'--><g id="graph0" class="graph" transform="scale(0.0525555 0.0525555) rotate(0) translate(4 1365.98)">
161163
<title>D</title>
162164
<text text-anchor="start" x="1044.78" y="-1341.88" font-family="Times,serif" font-weight="bold" font-size="18.00">7.17 AD: Aktivierung eines MaBiS-ZP f&#252;r Bilanzierungsgebietssummenzeitreihen vom &#220;NB an BIKO und NB</text>
163165
<text text-anchor="start" x="1389.78" y="-1311.78" font-family="Times,serif" font-weight="bold" font-size="16.00">7.17.1 E_0015_MaBiS-ZP Aktivierung pr&#252;fen</text>
@@ -490,10 +492,11 @@
490492
# ---
491493
# name: TestEbdTableModels.test_table_to_digraph_dot_real_kroki_request[table2-DiGraph with 10 nodes and 11 edges][test_table_to_digraph_dot_real_kroki_request_E_0025_Prüfmitteilung prüfen]
492494
'''
493-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1086pt" height="653pt" viewBox="0.00 0.00 1085.55 652.88">
495+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="120pt" height="72pt" viewBox="0.00 0.00 119.72 72.00">
494496
<!--curl - -request POST - -url https://kroki.io/ via local kroki docker container instance hosted at http://localhost:8125/- -header 'Content-Type: application/json' - -data 'digraph D {
495497
labelloc="t";
496498
label=<<B><FONT POINT-SIZE="18">7.41 AD: &#220;bermittlung Pr&#252;fmitteilung f&#252;r die Bilanzkreissummenzeitreihe vom BKV an BIKO und &#220;NB</FONT></B><BR/><BR/><B><FONT POINT-SIZE="16">7.41.2 E_0025_Pr&#252;fmitteilung pr&#252;fen</FONT></B><BR/><BR/><BR/><BR/>>;
499+
size="3,1";
497500
"Start" [margin="0.2,0.12", shape=box, style=filled, fillcolor="#7a8da1", label=<<B>E_0025</B><BR align="center"/><FONT point-size="12"><B><U>Pr&#252;fende Rolle:</U> BIKO</B></FONT><BR align="center"/>>];
498501
"1" [margin="0.2,0.12", shape=box, style="filled,rounded", fillcolor="#7aab8a", label=<<B>1: </B>Erfolgt der Eingang der Pr&#252;fmitteilung nach Ablauf der Clearingfrist f&#252;r die KBKA?<BR align="left"/>>];
499502
"A01" [margin="0.17,0.08", shape=box, style=filled, fillcolor="#cfb986", label=<<B>A01</B><BR align="center"/><FONT point-size="12"><U>Hinweis:</U><BR align="left"/>Frist&#252;berschreitung<BR align="left"/></FONT>>];
@@ -518,7 +521,7 @@
518521
"5" -> "Ende" [label="Nein"];
519522

520523
bgcolor="transparent";
521-
}'--><g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 648.88)">
524+
}'--><g id="graph0" class="graph" transform="scale(0.110281 0.110281) rotate(0) translate(4 648.88)">
522525
<title>D</title>
523526
<text text-anchor="start" x="20.15" y="-624.78" font-family="Times,serif" font-weight="bold" font-size="18.00">7.41 AD: &#220;bermittlung Pr&#252;fmitteilung f&#252;r die Bilanzkreissummenzeitreihe vom BKV an BIKO und &#220;NB</text>
524527
<text text-anchor="start" x="371.15" y="-594.68" font-family="Times,serif" font-weight="bold" font-size="16.00">7.41.2 E_0025_Pr&#252;fmitteilung pr&#252;fen</text>
@@ -682,10 +685,11 @@
682685
# ---
683686
# name: TestEbdTableModels.test_table_to_digraph_dot_real_kroki_request[table3-DiGraph with 23 nodes and 27 edges][test_table_to_digraph_dot_real_kroki_request_E_0401_Abmeldung prüfen]
684687
'''
685-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="2128pt" height="1559pt" viewBox="0.00 0.00 2128.14 1558.52">
688+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="98pt" height="72pt" viewBox="0.00 0.00 98.32 72.00">
686689
<!--curl - -request POST - -url https://kroki.io/ via local kroki docker container instance hosted at http://localhost:8125/- -header 'Content-Type: application/json' - -data 'digraph D {
687690
labelloc="t";
688691
label=<<B><FONT POINT-SIZE="18">6.2 AD: Lieferende LF an NB</FONT></B><BR/><BR/><B><FONT POINT-SIZE="16">6.2.1 E_0401_Abmeldung pr&#252;fen</FONT></B><BR/><BR/><BR/><BR/>>;
692+
size="3,1";
689693
"Start" [margin="0.2,0.12", shape=box, style=filled, fillcolor="#7a8da1", label=<<B>E_0401</B><BR align="center"/><FONT point-size="12"><B><U>Pr&#252;fende Rolle:</U> NB</B></FONT><BR align="center"/>>];
690694
"1" [margin="0.2,0.12", shape=box, style="filled,rounded", fillcolor="#7aab8a", label=<<B>1: </B>Liegt ein Transaktionsgrund vor, der eine Abmeldung nur in<BR align="left"/>die Zukunft zul&#228;sst?<BR align="left"/>Das ist bei den folgenden Transaktionsgr&#252;nden der Fall:<BR align="left"/>&#61599; Wechsel<BR align="left"/>&#61599; Ende der ESV ohne Folgelieferung<BR align="left"/>&#61599; Aufhebung einer zuk&#252;nftigen Zuordnung wegen<BR align="left"/>aufgehobenem Vertragsverh&#228;ltnis<BR align="left"/>>];
691695
"2" [margin="0.2,0.12", shape=box, style="filled,rounded", fillcolor="#7aab8a", label=<<B>2: </B>Liegt ein Transaktionsgrund vor, welcher mitteilt, dass der<BR align="left"/>Kunde vor Lieferbeginn ausgezogen ist, bzw. die<BR align="left"/>Marktlokation vor Lieferbeginn stillgelegt wurde?<BR align="left"/>Das ist bei den folgenden Transaktionsgr&#252;nden der Fall:<BR align="left"/>&#61599; Aufhebung einer zuk&#252;nftigen Zuordnung wegen Auszug<BR align="left"/>des Kunden<BR align="left"/>&#61599; Aufhebung einer zuk&#252;nftigen Zuordnung wegen<BR align="left"/>Stilllegung<BR align="left"/>>];
@@ -739,7 +743,7 @@
739743
"13" -> "A09" [label="Ja"];
740744

741745
bgcolor="transparent";
742-
}'--><g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 1554.52)">
746+
}'--><g id="graph0" class="graph" transform="scale(0.0461977 0.0461977) rotate(0) translate(4 1554.52)">
743747
<title>D</title>
744748
<text text-anchor="start" x="916.44" y="-1530.42" font-family="Times,serif" font-weight="bold" font-size="18.00">6.2 AD: Lieferende LF an NB</text>
745749
<text text-anchor="start" x="913.44" y="-1500.32" font-family="Times,serif" font-weight="bold" font-size="16.00">6.2.1 E_0401_Abmeldung pr&#252;fen</text>
@@ -1176,10 +1180,11 @@
11761180
# ---
11771181
# name: TestEbdTableModels.test_table_to_digraph_dot_with_watermark_real_kroki_request[False][test_table_to_digraph_dot_with_watermark_real_kroki_request_background_False]
11781182
'''
1179-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1055pt" height="428pt" viewBox="0.00 0.00 1054.50 427.82">
1183+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="177pt" height="72pt" viewBox="0.00 0.00 177.47 72.00">
11801184
<!--curl - -request POST - -url https://kroki.io/ via local kroki docker container instance hosted at http://localhost:8125/- -header 'Content-Type: application/json' - -data 'digraph D {
11811185
labelloc="t";
11821186
label=<<B><FONT POINT-SIZE="18">7.39 AD: Bestellung der Aggregationsebene der Bilanzkreissummenzeitreihe auf Ebene der Regelzone</FONT></B><BR/><BR/><B><FONT POINT-SIZE="16">7.39.1 E_0003_Bestellung der Aggregationsebene RZ pr&#252;fen</FONT></B><BR/><BR/><BR/><BR/>>;
1187+
size="3,1";
11831188
"Start" [margin="0.2,0.12", shape=box, style=filled, fillcolor="#7a8da1", label=<<B>E_0003</B><BR align="center"/><FONT point-size="12"><B><U>Pr&#252;fende Rolle:</U> &#220;NB</B></FONT><BR align="center"/>>];
11841189
"1" [margin="0.2,0.12", shape=box, style="filled,rounded", fillcolor="#7aab8a", label=<<B>1: </B>Erfolgt der Eingang der Bestellung fristgerecht?<BR align="left"/>>];
11851190
"A01" [margin="0.17,0.08", shape=box, style=filled, fillcolor="#cfb986", label=<<B>A01</B><BR align="center"/><FONT point-size="12"><U>Hinweis:</U><BR align="left"/>Frist&#252;berschreitung<BR align="left"/></FONT>>];
@@ -1194,7 +1199,7 @@
11941199
"2" -> "Ende" [label="Ja"];
11951200

11961201
bgcolor="transparent";
1197-
}'--><g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 423.82)">
1202+
}'--><g id="graph0" class="graph" transform="scale(0.168295 0.168295) rotate(0) translate(4 423.82)">
11981203
<title>D</title>
11991204
<text text-anchor="start" x="8" y="-399.72" font-family="Times,serif" font-weight="bold" font-size="18.00">7.39 AD: Bestellung der Aggregationsebene der Bilanzkreissummenzeitreihe auf Ebene der Regelzone</text>
12001205
<text text-anchor="start" x="250.62" y="-369.62" font-family="Times,serif" font-weight="bold" font-size="16.00">7.39.1 E_0003_Bestellung der Aggregationsebene RZ pr&#252;fen</text>
@@ -1282,10 +1287,11 @@
12821287
# ---
12831288
# name: TestEbdTableModels.test_table_to_digraph_dot_with_watermark_real_kroki_request[True][test_table_to_digraph_dot_with_watermark_real_kroki_request_background_True]
12841289
'''
1285-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1055pt" height="428pt" viewBox="0.00 0.00 1054.50 427.82">
1290+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="177pt" height="72pt" viewBox="0.00 0.00 177.47 72.00">
12861291
<!--curl - -request POST - -url https://kroki.io/ via local kroki docker container instance hosted at http://localhost:8125/- -header 'Content-Type: application/json' - -data 'digraph D {
12871292
labelloc="t";
12881293
label=<<B><FONT POINT-SIZE="18">7.39 AD: Bestellung der Aggregationsebene der Bilanzkreissummenzeitreihe auf Ebene der Regelzone</FONT></B><BR/><BR/><B><FONT POINT-SIZE="16">7.39.1 E_0003_Bestellung der Aggregationsebene RZ pr&#252;fen</FONT></B><BR/><BR/><BR/><BR/>>;
1294+
size="3,1";
12891295
"Start" [margin="0.2,0.12", shape=box, style=filled, fillcolor="#7a8da1", label=<<B>E_0003</B><BR align="center"/><FONT point-size="12"><B><U>Pr&#252;fende Rolle:</U> &#220;NB</B></FONT><BR align="center"/>>];
12901296
"1" [margin="0.2,0.12", shape=box, style="filled,rounded", fillcolor="#7aab8a", label=<<B>1: </B>Erfolgt der Eingang der Bestellung fristgerecht?<BR align="left"/>>];
12911297
"A01" [margin="0.17,0.08", shape=box, style=filled, fillcolor="#cfb986", label=<<B>A01</B><BR align="center"/><FONT point-size="12"><U>Hinweis:</U><BR align="left"/>Frist&#252;berschreitung<BR align="left"/></FONT>>];
@@ -1300,7 +1306,7 @@
13001306
"2" -> "Ende" [label="Ja"];
13011307

13021308
bgcolor="transparent";
1303-
}'--><g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 423.82)">
1309+
}'--><g id="graph0" class="graph" transform="scale(0.168295 0.168295) rotate(0) translate(4 423.82)">
13041310
<title>D</title>
13051311
<text text-anchor="start" x="8" y="-399.72" font-family="Times,serif" font-weight="bold" font-size="18.00">7.39 AD: Bestellung der Aggregationsebene der Bilanzkreissummenzeitreihe auf Ebene der Regelzone</text>
13061312
<text text-anchor="start" x="250.62" y="-369.62" font-family="Times,serif" font-weight="bold" font-size="16.00">7.39.1 E_0003_Bestellung der Aggregationsebene RZ pr&#252;fen</text>

unittests/output/E_0003.dot.svg

+6-6
Loading

0 commit comments

Comments
 (0)