From c22a8e1ef2644cd45b92089501c9808bcc47a7ee Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Thu, 13 Mar 2025 20:04:14 -0600 Subject: [PATCH] round --- .../c4-person-label/dagre/board.exp.json | 16 +- .../c4-person-label/dagre/sketch.exp.svg | 576 ++++++++--------- .../txtar/c4-person-label/elk/board.exp.json | 10 +- .../txtar/c4-person-label/elk/sketch.exp.svg | 576 ++++++++--------- .../c4-person-shape/dagre/board.exp.json | 44 +- .../c4-person-shape/dagre/sketch.exp.svg | 574 ++++++++-------- .../txtar/c4-person-shape/elk/board.exp.json | 30 +- .../txtar/c4-person-shape/elk/sketch.exp.svg | 574 ++++++++-------- .../txtar/c4-theme/dagre/board.exp.json | 168 ++--- .../txtar/c4-theme/dagre/sketch.exp.svg | 612 +++++++++--------- .../txtar/c4-theme/elk/board.exp.json | 100 +-- .../txtar/c4-theme/elk/sketch.exp.svg | 612 +++++++++--------- .../small-c4-person/dagre/sketch.exp.svg | 4 +- .../txtar/small-c4-person/elk/sketch.exp.svg | 4 +- lib/shape/shape_c4_person.go | 41 +- 15 files changed, 1970 insertions(+), 1971 deletions(-) diff --git a/e2etests/testdata/txtar/c4-person-label/dagre/board.exp.json b/e2etests/testdata/txtar/c4-person-label/dagre/board.exp.json index def972f1f..46d5d7efb 100644 --- a/e2etests/testdata/txtar/c4-person-label/dagre/board.exp.json +++ b/e2etests/testdata/txtar/c4-person-label/dagre/board.exp.json @@ -581,12 +581,12 @@ "y": 697.2000122070312 }, { - "x": 1602.199951171875, - "y": 1062.199951171875 + "x": 1602.4000244140625, + "y": 1061.800048828125 }, { - "x": 1475, - "y": 1195 + "x": 1476, + "y": 1193 } ], "isCurve": true, @@ -621,12 +621,12 @@ "link": "", "route": [ { - "x": 1453, - "y": 1116 + "x": 1454, + "y": 1115 }, { - "x": 1482.4000244140625, - "y": 1046.4000244140625 + "x": 1482.5999755859375, + "y": 1046.199951171875 }, { "x": 1485.4000244140625, diff --git a/e2etests/testdata/txtar/c4-person-label/dagre/sketch.exp.svg b/e2etests/testdata/txtar/c4-person-label/dagre/sketch.exp.svg index 25c78740e..50b84155b 100644 --- a/e2etests/testdata/txtar/c4-person-label/dagre/sketch.exp.svg +++ b/e2etests/testdata/txtar/c4-person-label/dagre/sketch.exp.svg @@ -1,13 +1,13 @@ -

Personal Banking Customer

+

Personal Banking Customer

[person]

A customer of the bank, with personal bank accounts

-

Personal Banking Customer

+

Personal Banking Customer

[person]

A customer of the bank, with personal bank accounts

-

Personal Banking Customer

+

Personal Banking Customer

[person]

A customer of the bank, with personal bank accounts

-

Personal Banking Customer

+

Personal Banking Customer

[person]

A customer of the bank, with pekkrsonal bank ccountskks.

-

Personal Banking Customerk

+

Personal Banking Customerk

[person]

A customer of the bank, with pekkrsonal bank accountskks.

A customer of the bank, with pekkrsonal bank accountskks.

A customer of the bank, with pekkrsonal bank accountskks.

-

Personal Banking Customer

+

Personal Banking Customer

[person]

A customer of the bank, with pekkrsonal bank accountskks.

-

Personal Banking Customer

+

Personal Banking Customer

[person]

A customer of the bank, with pekkrsonal bank accountskks.

-
+
- - - - - - - + + + + + + +
\ No newline at end of file diff --git a/e2etests/testdata/txtar/c4-person-label/elk/board.exp.json b/e2etests/testdata/txtar/c4-person-label/elk/board.exp.json index e46b21769..475186c2e 100644 --- a/e2etests/testdata/txtar/c4-person-label/elk/board.exp.json +++ b/e2etests/testdata/txtar/c4-person-label/elk/board.exp.json @@ -338,7 +338,7 @@ }, { "x": 1414, - "y": 699 + "y": 700 } ], "animated": false, @@ -377,7 +377,7 @@ }, { "x": 1237, - "y": 1232 + "y": 1233 } ], "animated": false, @@ -411,7 +411,7 @@ "link": "", "route": [ { - "x": 1466, + "x": 1465, "y": 1485 }, { @@ -451,7 +451,7 @@ "route": [ { "x": 1620, - "y": 1603 + "y": 1602 }, { "x": 1620, @@ -494,7 +494,7 @@ }, { "x": 1526, - "y": 1233 + "y": 1234 } ], "animated": false, diff --git a/e2etests/testdata/txtar/c4-person-label/elk/sketch.exp.svg b/e2etests/testdata/txtar/c4-person-label/elk/sketch.exp.svg index 5a6e872f4..c47068bb4 100644 --- a/e2etests/testdata/txtar/c4-person-label/elk/sketch.exp.svg +++ b/e2etests/testdata/txtar/c4-person-label/elk/sketch.exp.svg @@ -1,13 +1,13 @@ -

Personal Banking Customer

+

Personal Banking Customer

[person]

A customer of the bank, with personal bank accounts

-

Personal Banking Customer

+

Personal Banking Customer

[person]

A customer of the bank, with personal bank accounts

-

Personal Banking Customer

+

Personal Banking Customer

[person]

A customer of the bank, with personal bank accounts

-

Personal Banking Customer

+

Personal Banking Customer

[person]

A customer of the bank, with pekkrsonal bank ccountskks.

-

Personal Banking Customerk

+

Personal Banking Customerk

[person]

A customer of the bank, with pekkrsonal bank accountskks.

A customer of the bank, with pekkrsonal bank accountskks.

A customer of the bank, with pekkrsonal bank accountskks.

-

Personal Banking Customer

+

Personal Banking Customer

[person]

A customer of the bank, with pekkrsonal bank accountskks.

-

Personal Banking Customer

+

Personal Banking Customer

[person]

A customer of the bank, with pekkrsonal bank accountskks.

-
+
- - - - - - - + + + + + + +
\ No newline at end of file diff --git a/e2etests/testdata/txtar/c4-person-shape/dagre/board.exp.json b/e2etests/testdata/txtar/c4-person-shape/dagre/board.exp.json index bd1bb8ae3..6927d0036 100644 --- a/e2etests/testdata/txtar/c4-person-shape/dagre/board.exp.json +++ b/e2etests/testdata/txtar/c4-person-shape/dagre/board.exp.json @@ -16,10 +16,10 @@ "type": "c4-person", "pos": { "x": 0, - "y": 507 + "y": 506 }, "width": 336, - "height": 342, + "height": 341, "opacity": 1, "strokeDash": 0, "strokeWidth": 1, @@ -100,7 +100,7 @@ "type": "person", "pos": { "x": 101, - "y": 311 + "y": 310 }, "width": 134, "height": 89, @@ -145,7 +145,7 @@ "y": 273 }, "width": 210, - "height": 525, + "height": 524, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -183,11 +183,11 @@ "id": "styling.c4styled", "type": "c4-person", "pos": { - "x": 449, + "x": 450, "y": 303 }, - "width": 84, - "height": 104, + "width": 83, + "height": 103, "opacity": 1, "strokeDash": 0, "strokeWidth": 1, @@ -226,7 +226,7 @@ "type": "c4-person", "pos": { "x": 416, - "y": 588 + "y": 587 }, "width": 150, "height": 180, @@ -292,19 +292,19 @@ "route": [ { "x": 168, - "y": 426 + "y": 425 }, { "x": 168, - "y": 450.79998779296875 + "y": 449.79998779296875 }, { "x": 168, - "y": 467 + "y": 466 }, { "x": 168, - "y": 507 + "y": 506 } ], "isCurve": true, @@ -339,20 +339,20 @@ "link": "", "route": [ { - "x": 262, + "x": 261, "y": 119 }, { - "x": 186.8000030517578, + "x": 186.60000610351562, "y": 177.8000030517578 }, { "x": 168, - "y": 264.6000061035156 + "y": 264.3999938964844 }, { "x": 168, - "y": 311 + "y": 310 } ], "isCurve": true, @@ -387,11 +387,11 @@ "link": "", "route": [ { - "x": 397, + "x": 398, "y": 119 }, { - "x": 472.20001220703125, + "x": 472.3999938964844, "y": 177.8000030517578 }, { @@ -436,19 +436,19 @@ "route": [ { "x": 491, - "y": 407 + "y": 406 }, { "x": 491, - "y": 447 + "y": 446 }, { "x": 491, - "y": 483.20001220703125 + "y": 482.20001220703125 }, { "x": 491, - "y": 588 + "y": 587 } ], "isCurve": true, diff --git a/e2etests/testdata/txtar/c4-person-shape/dagre/sketch.exp.svg b/e2etests/testdata/txtar/c4-person-shape/dagre/sketch.exp.svg index 251910a6e..09f65b478 100644 --- a/e2etests/testdata/txtar/c4-person-shape/dagre/sketch.exp.svg +++ b/e2etests/testdata/txtar/c4-person-shape/dagre/sketch.exp.svg @@ -1,27 +1,27 @@ -

Personal Banking Customer

+

Personal Banking Customer

[person]

A customer of the bank, with
personal bank accounts

-
C4 Style PersonStandard Personstylingc4styledCustom Size Compare shapes - - - - +
C4 Style PersonStandard Personstylingc4styledCustom Size Compare shapes + + + + - - + +
\ No newline at end of file diff --git a/e2etests/testdata/txtar/c4-person-shape/elk/board.exp.json b/e2etests/testdata/txtar/c4-person-shape/elk/board.exp.json index 52e292df6..7e26d5c32 100644 --- a/e2etests/testdata/txtar/c4-person-shape/elk/board.exp.json +++ b/e2etests/testdata/txtar/c4-person-shape/elk/board.exp.json @@ -16,10 +16,10 @@ "type": "c4-person", "pos": { "x": 12, - "y": 938 + "y": 937 }, "width": 336, - "height": 342, + "height": 341, "opacity": 1, "strokeDash": 0, "strokeWidth": 1, @@ -100,7 +100,7 @@ "type": "person", "pos": { "x": 113, - "y": 753 + "y": 752 }, "width": 134, "height": 89, @@ -145,7 +145,7 @@ "y": 229 }, "width": 250, - "height": 454, + "height": 453, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -183,11 +183,11 @@ "id": "styling.c4styled", "type": "c4-person", "pos": { - "x": 339, + "x": 340, "y": 279 }, - "width": 84, - "height": 104, + "width": 83, + "height": 103, "opacity": 1, "strokeDash": 0, "strokeWidth": 1, @@ -226,7 +226,7 @@ "type": "c4-person", "pos": { "x": 306, - "y": 453 + "y": 452 }, "width": 150, "height": 180, @@ -292,11 +292,11 @@ "route": [ { "x": 180, - "y": 868 + "y": 867 }, { "x": 180, - "y": 938 + "y": 937 } ], "animated": false, @@ -331,7 +331,7 @@ "route": [ { "x": 258, - "y": 143 + "y": 144 }, { "x": 257.5830078125, @@ -343,7 +343,7 @@ }, { "x": 180, - "y": 753 + "y": 752 } ], "animated": false, @@ -378,7 +378,7 @@ "route": [ { "x": 304, - "y": 143 + "y": 144 }, { "x": 303.9159851074219, @@ -425,11 +425,11 @@ "route": [ { "x": 381, - "y": 383 + "y": 382 }, { "x": 382, - "y": 453 + "y": 452 } ], "animated": false, diff --git a/e2etests/testdata/txtar/c4-person-shape/elk/sketch.exp.svg b/e2etests/testdata/txtar/c4-person-shape/elk/sketch.exp.svg index 6305b8c57..f1cdfda47 100644 --- a/e2etests/testdata/txtar/c4-person-shape/elk/sketch.exp.svg +++ b/e2etests/testdata/txtar/c4-person-shape/elk/sketch.exp.svg @@ -1,27 +1,27 @@ -

Personal Banking Customer

+

Personal Banking Customer

[person]

A customer of the bank, with
personal bank accounts

-
C4 Style PersonStandard Personstylingc4styledCustom Size Compare shapes - - - - +
C4 Style PersonStandard Personstylingc4styledCustom Size Compare shapes + + + + - - + +
\ No newline at end of file diff --git a/e2etests/testdata/txtar/c4-theme/dagre/board.exp.json b/e2etests/testdata/txtar/c4-theme/dagre/board.exp.json index 4b80ded31..bfeabddd5 100644 --- a/e2etests/testdata/txtar/c4-theme/dagre/board.exp.json +++ b/e2etests/testdata/txtar/c4-theme/dagre/board.exp.json @@ -18,8 +18,8 @@ "x": 1089, "y": 0 }, - "width": 415, - "height": 394, + "width": 414, + "height": 393, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -58,7 +58,7 @@ "type": "rectangle", "pos": { "x": 147, - "y": 551 + "y": 550 }, "width": 2407, "height": 915, @@ -100,7 +100,7 @@ "type": "rectangle", "pos": { "x": 177, - "y": 581 + "y": 580 }, "width": 550, "height": 164, @@ -142,7 +142,7 @@ "type": "rectangle", "pos": { "x": 390, - "y": 866 + "y": 865 }, "width": 609, "height": 164, @@ -184,7 +184,7 @@ "type": "rectangle", "pos": { "x": 1123, - "y": 866 + "y": 865 }, "width": 707, "height": 164, @@ -226,7 +226,7 @@ "type": "rectangle", "pos": { "x": 1246, - "y": 1167 + "y": 1166 }, "width": 461, "height": 164, @@ -268,7 +268,7 @@ "type": "rectangle", "pos": { "x": 1890, - "y": 866 + "y": 865 }, "width": 634, "height": 164, @@ -310,7 +310,7 @@ "type": "rectangle", "pos": { "x": 2410, - "y": 1603 + "y": 1602 }, "width": 360, "height": 164, @@ -352,7 +352,7 @@ "type": "rectangle", "pos": { "x": 0, - "y": 1603 + "y": 1602 }, "width": 629, "height": 164, @@ -418,19 +418,19 @@ "route": [ { "x": 1089, - "y": 262 + "y": 261 }, { "x": 579.4000244140625, - "y": 422.3999938964844 + "y": 421.3999938964844 }, { "x": 452, - "y": 541 + "y": 540 }, { "x": 452, - "y": 581 + "y": 580 } ], "isCurve": true, @@ -466,19 +466,19 @@ "route": [ { "x": 452, - "y": 744.5 + "y": 743.5 }, { "x": 452, - "y": 793.2999877929688 + "y": 792.2999877929688 }, { "x": 472.3999938964844, - "y": 817.7000122070312 + "y": 816.7000122070312 }, { "x": 554, - "y": 866.5 + "y": 865.5 } ], "isCurve": true, @@ -514,43 +514,43 @@ "route": [ { "x": 1091, - "y": 349 + "y": 348 }, { "x": 967.7999877929688, - "y": 439.79998779296875 + "y": 438.79998779296875 }, { "x": 937, - "y": 476.20001220703125 + "y": 475.20001220703125 }, { "x": 937, - "y": 496.75 + "y": 495.75 }, { "x": 937, - "y": 517.2990112304688 + "y": 516.2990112304688 }, { "x": 937, - "y": 557.4000244140625 + "y": 556.4000244140625 }, { "x": 937, - "y": 597 + "y": 596 }, { "x": 937, - "y": 636.5999755859375 + "y": 635.5999755859375 }, { "x": 916.5999755859375, - "y": 817.7000122070312 + "y": 816.7000122070312 }, { "x": 835, - "y": 866.5 + "y": 865.5 } ], "isCurve": true, @@ -585,44 +585,44 @@ "link": "", "route": [ { - "x": 1430, - "y": 394 + "x": 1429, + "y": 393 }, { - "x": 1466.800048828125, - "y": 448.79998779296875 + "x": 1466.5999755859375, + "y": 447.79998779296875 }, { "x": 1476, - "y": 476.20001220703125 + "y": 475.20001220703125 }, { "x": 1476, - "y": 496.75 + "y": 495.75 }, { "x": 1476, - "y": 517.2990112304688 + "y": 516.2990112304688 }, { "x": 1476, - "y": 557.4000244140625 + "y": 556.4000244140625 }, { "x": 1476, - "y": 597 + "y": 596 }, { "x": 1476, - "y": 636.5999755859375 + "y": 635.5999755859375 }, { "x": 1476, - "y": 817.7000122070312 + "y": 816.7000122070312 }, { "x": 1476, - "y": 866.5 + "y": 865.5 } ], "isCurve": true, @@ -658,19 +658,19 @@ "route": [ { "x": 694.5, - "y": 1029.5 + "y": 1028.5 }, { "x": 694.5, - "y": 1084.699951171875 + "y": 1083.699951171875 }, { "x": 804.7000122070312, - "y": 1119.7220458984375 + "y": 1118.7220458984375 }, { "x": 1245.5, - "y": 1204.6099853515625 + "y": 1203.6099853515625 } ], "isCurve": true, @@ -706,19 +706,19 @@ "route": [ { "x": 1476, - "y": 1029.5 + "y": 1028.5 }, { "x": 1476, - "y": 1084.699951171875 + "y": 1083.699951171875 }, { "x": 1476, - "y": 1112.300048828125 + "y": 1111.300048828125 }, { "x": 1476, - "y": 1167.5 + "y": 1166.5 } ], "isCurve": true, @@ -754,19 +754,19 @@ "route": [ { "x": 1245.5, - "y": 1275.1949462890625 + "y": 1274.1949462890625 }, { "x": 500.6990051269531, - "y": 1427.8389892578125 + "y": 1426.8389892578125 }, { "x": 314.5, - "y": 1548.300048828125 + "y": 1547.300048828125 }, { "x": 314.5, - "y": 1603.5 + "y": 1602.5 } ], "isCurve": true, @@ -806,99 +806,99 @@ }, { "x": 2410.199951171875, - "y": 417.6000061035156 + "y": 416.79998779296875 }, { "x": 2637, - "y": 476.20001220703125 + "y": 475.20001220703125 }, { "x": 2637, - "y": 496.75 + "y": 495.75 }, { "x": 2637, - "y": 517.2990112304688 + "y": 516.2990112304688 }, { "x": 2637, - "y": 557.4000244140625 + "y": 556.4000244140625 }, { "x": 2637, - "y": 597 + "y": 596 }, { "x": 2637, - "y": 636.5999755859375 + "y": 635.5999755859375 }, { "x": 2637, - "y": 691.5 + "y": 690.5 }, { "x": 2637, - "y": 734.25 + "y": 733.25 }, { "x": 2637, - "y": 777 + "y": 776 }, { "x": 2637, - "y": 834 + "y": 833 }, { "x": 2637, - "y": 876.75 + "y": 875.75 }, { "x": 2637, - "y": 919.5 + "y": 918.5 }, { "x": 2637, - "y": 978.0999755859375 + "y": 977.0999755859375 }, { "x": 2637, - "y": 1023.25 + "y": 1022.25 }, { "x": 2637, - "y": 1068.4000244140625 + "y": 1067.4000244140625 }, { "x": 2637, - "y": 1128.5999755859375 + "y": 1127.5999755859375 }, { "x": 2637, - "y": 1173.75 + "y": 1172.75 }, { "x": 2637, - "y": 1218.9000244140625 + "y": 1217.9000244140625 }, { "x": 2637, - "y": 1292.4000244140625 + "y": 1291.4000244140625 }, { "x": 2637, - "y": 1357.5 + "y": 1356.5 }, { "x": 2637, - "y": 1422.5999755859375 + "y": 1421.5999755859375 }, { "x": 2632.800048828125, - "y": 1548.300048828125 + "y": 1547.300048828125 }, { "x": 2616, - "y": 1603.5 + "y": 1602.5 } ], "isCurve": true, @@ -934,19 +934,19 @@ "route": [ { "x": 1707.5, - "y": 1282.843994140625 + "y": 1281.843994140625 }, { "x": 2241.5, - "y": 1429.3680419921875 + "y": 1428.3680419921875 }, { "x": 2394.39990234375, - "y": 1548.300048828125 + "y": 1547.300048828125 }, { "x": 2472, - "y": 1603.5 + "y": 1602.5 } ], "isCurve": true, @@ -982,19 +982,19 @@ "route": [ { "x": 2206.5, - "y": 1029.5 + "y": 1028.5 }, { "x": 2206.5, - "y": 1084.699951171875 + "y": 1083.699951171875 }, { "x": 2106.5, - "y": 1119.0999755859375 + "y": 1118.0999755859375 }, { "x": 1706.5, - "y": 1201.5 + "y": 1200.5 } ], "isCurve": true, diff --git a/e2etests/testdata/txtar/c4-theme/dagre/sketch.exp.svg b/e2etests/testdata/txtar/c4-theme/dagre/sketch.exp.svg index fb2279b45..ba14d5df2 100644 --- a/e2etests/testdata/txtar/c4-theme/dagre/sketch.exp.svg +++ b/e2etests/testdata/txtar/c4-theme/dagre/sketch.exp.svg @@ -1,20 +1,20 @@ -

Personal Banking Customer

+

Personal Banking Customer

[person]

A customer of the bank, with personal bank accounts.

-

Internet Banking System

+

Internet Banking System

[Software System]

-

E-mail System

+

E-mail System

[Software System]

The internal Microsoft Exchange e-mail system.

-

Mainframe Banking System

+

Mainframe Banking System

[Software System]

Stores all of the core banking information about customers, accounts, transactions, etc.

-

Web Application

+

Web Application

[Container: Java and Spring MVC]

Delivers the static content and the Internet banking single page application.

-

Single-Page Application

+

Single-Page Application

[Container: JavaScript and Angular]

Provides all of the Internet banking functionality to customers via their web browser.

-

Mobile App

+

Mobile App

[Container: Xamarin]

Provides a limited subset of the Internet banking functionality to customers via their mobile device.

-

API Application

+

API Application

[Container: Java and Spring MVC]

Provides Internet banking functionality via a JSON/HTTPS API.

-

Database

+

Database

[Container: Oracle Database Schema]

Stores user registration information, hashed authentication credentials, access logs, etc.

-
Visits bigbank.com/ib using[HTTPS]Delivers to the customer's web browserViews account balances, and makes payments usingViews account balances, and makes payments usingMakes API calls to[JSON/HTTPS]Makes API calls to[JSON/HTTPS]Makes API calls to[XML/HTTPS]Sends e-mails toSends e-mail using Reads from and writes to[SQL/TCP] - - - - - - - - - - - - - - - - - - - - +
Visits bigbank.com/ib using[HTTPS]Delivers to the customer's web browserViews account balances, and makes payments usingViews account balances, and makes payments usingMakes API calls to[JSON/HTTPS]Makes API calls to[JSON/HTTPS]Makes API calls to[XML/HTTPS]Sends e-mails toSends e-mail using Reads from and writes to[SQL/TCP] + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/e2etests/testdata/txtar/c4-theme/elk/board.exp.json b/e2etests/testdata/txtar/c4-theme/elk/board.exp.json index 4d6d3ccd8..4f90b629b 100644 --- a/e2etests/testdata/txtar/c4-theme/elk/board.exp.json +++ b/e2etests/testdata/txtar/c4-theme/elk/board.exp.json @@ -15,11 +15,11 @@ "id": "customer", "type": "c4-person", "pos": { - "x": 704, + "x": 705, "y": 12 }, - "width": 415, - "height": 394, + "width": 414, + "height": 393, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -58,7 +58,7 @@ "type": "rectangle", "pos": { "x": 12, - "y": 658 + "y": 657 }, "width": 2218, "height": 1035, @@ -100,7 +100,7 @@ "type": "rectangle", "pos": { "x": 62, - "y": 708 + "y": 707 }, "width": 550, "height": 164, @@ -142,7 +142,7 @@ "type": "rectangle", "pos": { "x": 190, - "y": 1043 + "y": 1042 }, "width": 609, "height": 164, @@ -184,7 +184,7 @@ "type": "rectangle", "pos": { "x": 819, - "y": 1043 + "y": 1042 }, "width": 707, "height": 164, @@ -226,7 +226,7 @@ "type": "rectangle", "pos": { "x": 942, - "y": 1394 + "y": 1393 }, "width": 461, "height": 164, @@ -268,7 +268,7 @@ "type": "rectangle", "pos": { "x": 1546, - "y": 1043 + "y": 1042 }, "width": 634, "height": 164, @@ -310,7 +310,7 @@ "type": "rectangle", "pos": { "x": 1746, - "y": 1895 + "y": 1894 }, "width": 360, "height": 164, @@ -352,7 +352,7 @@ "type": "rectangle", "pos": { "x": 781, - "y": 1895 + "y": 1894 }, "width": 629, "height": 164, @@ -418,19 +418,19 @@ "route": [ { "x": 788, - "y": 406 + "y": 405 }, { - "x": 787.75, - "y": 446 + "x": 788.0499877929688, + "y": 445 }, { "x": 359.25, - "y": 446 + "y": 445 }, { "x": 359.25, - "y": 708 + "y": 707 } ], "animated": false, @@ -465,11 +465,11 @@ "route": [ { "x": 393, - "y": 872 + "y": 871 }, { "x": 393, - "y": 1043 + "y": 1042 } ], "animated": false, @@ -504,19 +504,19 @@ "route": [ { "x": 871, - "y": 406 + "y": 405 }, { - "x": 870.75, - "y": 496 + "x": 870.8489990234375, + "y": 495 }, { "x": 652, - "y": 496 + "y": 495 }, { "x": 652, - "y": 1043 + "y": 1042 } ], "animated": false, @@ -551,11 +551,11 @@ "route": [ { "x": 954, - "y": 406 + "y": 405 }, { - "x": 953.75, - "y": 1043 + "x": 953.6489868164062, + "y": 1042 } ], "animated": false, @@ -590,19 +590,19 @@ "route": [ { "x": 494.5, - "y": 1207 + "y": 1206 }, { "x": 494.5, - "y": 1354 + "y": 1353 }, { "x": 1057.25, - "y": 1354 + "y": 1353 }, { "x": 1057.25, - "y": 1394 + "y": 1393 } ], "animated": false, @@ -637,11 +637,11 @@ "route": [ { "x": 1172.5, - "y": 1207 + "y": 1206 }, { "x": 1172.5, - "y": 1394 + "y": 1393 } ], "animated": false, @@ -676,11 +676,11 @@ "route": [ { "x": 1095.666015625, - "y": 1558 + "y": 1557 }, { "x": 1095.666015625, - "y": 1895 + "y": 1894 } ], "animated": false, @@ -714,28 +714,28 @@ "link": "", "route": [ { - "x": 1037, - "y": 406 + "x": 1036, + "y": 405 }, { - "x": 1036.75, - "y": 446 + "x": 1036.448974609375, + "y": 445 }, { "x": 2303.5, - "y": 446 + "y": 445 }, { "x": 2303.5, - "y": 1855 + "y": 1854 }, { "x": 1986.8330078125, - "y": 1855 + "y": 1854 }, { "x": 1986.8330078125, - "y": 1895 + "y": 1894 } ], "animated": false, @@ -770,19 +770,19 @@ "route": [ { "x": 1249.3330078125, - "y": 1558 + "y": 1557 }, { "x": 1249.3330078125, - "y": 1855 + "y": 1854 }, { "x": 1866.8330078125, - "y": 1855 + "y": 1854 }, { "x": 1866.8330078125, - "y": 1895 + "y": 1894 } ], "animated": false, @@ -817,19 +817,19 @@ "route": [ { "x": 1863, - "y": 1207 + "y": 1206 }, { "x": 1863, - "y": 1354 + "y": 1353 }, { "x": 1287.75, - "y": 1354 + "y": 1353 }, { "x": 1287.75, - "y": 1394 + "y": 1393 } ], "animated": false, diff --git a/e2etests/testdata/txtar/c4-theme/elk/sketch.exp.svg b/e2etests/testdata/txtar/c4-theme/elk/sketch.exp.svg index 46f088711..19d96dd6b 100644 --- a/e2etests/testdata/txtar/c4-theme/elk/sketch.exp.svg +++ b/e2etests/testdata/txtar/c4-theme/elk/sketch.exp.svg @@ -1,20 +1,20 @@ -

Personal Banking Customer

+

Personal Banking Customer

[person]

A customer of the bank, with personal bank accounts.

-

Internet Banking System

+

Internet Banking System

[Software System]

-

E-mail System

+

E-mail System

[Software System]

The internal Microsoft Exchange e-mail system.

-

Mainframe Banking System

+

Mainframe Banking System

[Software System]

Stores all of the core banking information about customers, accounts, transactions, etc.

-

Web Application

+

Web Application

[Container: Java and Spring MVC]

Delivers the static content and the Internet banking single page application.

-

Single-Page Application

+

Single-Page Application

[Container: JavaScript and Angular]

Provides all of the Internet banking functionality to customers via their web browser.

-

Mobile App

+

Mobile App

[Container: Xamarin]

Provides a limited subset of the Internet banking functionality to customers via their mobile device.

-

API Application

+

API Application

[Container: Java and Spring MVC]

Provides Internet banking functionality via a JSON/HTTPS API.

-

Database

+

Database

[Container: Oracle Database Schema]

Stores user registration information, hashed authentication credentials, access logs, etc.

-
Visits bigbank.com/ib using[HTTPS]Delivers to the customer's web browserViews account balances, and makes payments usingViews account balances, and makes payments usingMakes API calls to[JSON/HTTPS]Makes API calls to[JSON/HTTPS]Makes API calls to[XML/HTTPS]Sends e-mails toSends e-mail using Reads from and writes to[SQL/TCP] - - - - - - - - - - - - - - - - - - - - +
Visits bigbank.com/ib using[HTTPS]Delivers to the customer's web browserViews account balances, and makes payments usingViews account balances, and makes payments usingMakes API calls to[JSON/HTTPS]Makes API calls to[JSON/HTTPS]Makes API calls to[XML/HTTPS]Sends e-mails toSends e-mail using Reads from and writes to[SQL/TCP] + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/e2etests/testdata/txtar/small-c4-person/dagre/sketch.exp.svg b/e2etests/testdata/txtar/small-c4-person/dagre/sketch.exp.svg index a743498d0..eab5e1bdf 100644 --- a/e2etests/testdata/txtar/small-c4-person/dagre/sketch.exp.svg +++ b/e2etests/testdata/txtar/small-c4-person/dagre/sketch.exp.svg @@ -89,7 +89,7 @@ .d2-1864249435 .color-AA4{color:#EDF0FD;} .d2-1864249435 .color-AA5{color:#F7F8FE;} .d2-1864249435 .color-AB4{color:#EDF0FD;} - .d2-1864249435 .color-AB5{color:#F7F8FE;}.appendix text.text{fill:#0A0F25}.md{--color-fg-default:#0A0F25;--color-fg-muted:#676C7E;--color-fg-subtle:#9499AB;--color-canvas-default:#FFFFFF;--color-canvas-subtle:#EEF1F8;--color-border-default:#0D32B2;--color-border-muted:#0D32B2;--color-neutral-muted:#EEF1F8;--color-accent-fg:#0D32B2;--color-accent-emphasis:#0D32B2;--color-attention-subtle:#676C7E;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-darker-d2-1864249435);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker-d2-1864249435);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark-d2-1864249435);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker-d2-1864249435);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark-d2-1864249435);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal-d2-1864249435);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal-d2-1864249435);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>c4-person + .d2-1864249435 .color-AB5{color:#F7F8FE;}.appendix text.text{fill:#0A0F25}.md{--color-fg-default:#0A0F25;--color-fg-muted:#676C7E;--color-fg-subtle:#9499AB;--color-canvas-default:#FFFFFF;--color-canvas-subtle:#EEF1F8;--color-border-default:#0D32B2;--color-border-muted:#0D32B2;--color-neutral-muted:#EEF1F8;--color-accent-fg:#0D32B2;--color-accent-emphasis:#0D32B2;--color-attention-subtle:#676C7E;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-darker-d2-1864249435);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker-d2-1864249435);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark-d2-1864249435);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker-d2-1864249435);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark-d2-1864249435);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal-d2-1864249435);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal-d2-1864249435);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright-d2-1864249435);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>c4-person - + \ No newline at end of file diff --git a/e2etests/testdata/txtar/small-c4-person/elk/sketch.exp.svg b/e2etests/testdata/txtar/small-c4-person/elk/sketch.exp.svg index fa51d71b6..8d06fbfb8 100644 --- a/e2etests/testdata/txtar/small-c4-person/elk/sketch.exp.svg +++ b/e2etests/testdata/txtar/small-c4-person/elk/sketch.exp.svg @@ -89,7 +89,7 @@ .d2-1736778707 .color-AA4{color:#EDF0FD;} .d2-1736778707 .color-AA5{color:#F7F8FE;} .d2-1736778707 .color-AB4{color:#EDF0FD;} - .d2-1736778707 .color-AB5{color:#F7F8FE;}.appendix text.text{fill:#0A0F25}.md{--color-fg-default:#0A0F25;--color-fg-muted:#676C7E;--color-fg-subtle:#9499AB;--color-canvas-default:#FFFFFF;--color-canvas-subtle:#EEF1F8;--color-border-default:#0D32B2;--color-border-muted:#0D32B2;--color-neutral-muted:#EEF1F8;--color-accent-fg:#0D32B2;--color-accent-emphasis:#0D32B2;--color-attention-subtle:#676C7E;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-darker-d2-1736778707);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker-d2-1736778707);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark-d2-1736778707);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker-d2-1736778707);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark-d2-1736778707);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal-d2-1736778707);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal-d2-1736778707);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>c4-person + .d2-1736778707 .color-AB5{color:#F7F8FE;}.appendix text.text{fill:#0A0F25}.md{--color-fg-default:#0A0F25;--color-fg-muted:#676C7E;--color-fg-subtle:#9499AB;--color-canvas-default:#FFFFFF;--color-canvas-subtle:#EEF1F8;--color-border-default:#0D32B2;--color-border-muted:#0D32B2;--color-neutral-muted:#EEF1F8;--color-accent-fg:#0D32B2;--color-accent-emphasis:#0D32B2;--color-attention-subtle:#676C7E;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-darker-d2-1736778707);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker-d2-1736778707);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark-d2-1736778707);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker-d2-1736778707);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark-d2-1736778707);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal-d2-1736778707);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal-d2-1736778707);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright-d2-1736778707);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>c4-person - + \ No newline at end of file diff --git a/lib/shape/shape_c4_person.go b/lib/shape/shape_c4_person.go index e08dc2810..b2a571d2b 100644 --- a/lib/shape/shape_c4_person.go +++ b/lib/shape/shape_c4_person.go @@ -38,21 +38,21 @@ func (s shapeC4Person) GetInnerBox() *geo.Box { width := s.Box.Width height := s.Box.Height - headRadius := width * HEAD_RADIUS_FACTOR + headRadius := math.Round(width * HEAD_RADIUS_FACTOR) headCenterY := headRadius - bodyTop := headCenterY + headRadius*BODY_TOP_FACTOR + bodyTop := math.Round(headCenterY + headRadius*BODY_TOP_FACTOR) // Horizontal padding = 5% of width - horizontalPadding := width * 0.05 + horizontalPadding := math.Round(width * 0.05) // Vertical padding = 3% of height - verticalPadding := height * 0.03 + verticalPadding := math.Round(height * 0.03) tl := s.Box.TopLeft.Copy() tl.X += horizontalPadding tl.Y += bodyTop + verticalPadding - innerWidth := width - (horizontalPadding * 2) - innerHeight := height - bodyTop - (verticalPadding * 2) + innerWidth := math.Round(width - (horizontalPadding * 2)) + innerHeight := math.Round(height - bodyTop - (verticalPadding * 2)) return geo.NewBox(tl, innerWidth, innerHeight) } @@ -63,15 +63,14 @@ func bodyPath(box *geo.Box) *svg.SvgPathContext { pc := svg.NewSVGPathContext(box.TopLeft, 1, 1) - headRadius := width * HEAD_RADIUS_FACTOR + headRadius := math.Round(width * HEAD_RADIUS_FACTOR) headCenterY := headRadius - bodyTop := headCenterY + headRadius*BODY_TOP_FACTOR + bodyTop := math.Round(headCenterY + headRadius*BODY_TOP_FACTOR) bodyWidth := width - bodyHeight := height - bodyTop + bodyHeight := math.Round(height - bodyTop) bodyLeft := 0 - // Use the same corner radius calculation as frontend - cornerRadius := math.Min(width*CORNER_RADIUS_FACTOR, bodyHeight*0.25) + cornerRadius := math.Round(math.Min(width*CORNER_RADIUS_FACTOR, bodyHeight*0.25)) pc.StartAt(pc.Absolute(float64(bodyLeft), bodyTop+cornerRadius)) @@ -92,8 +91,8 @@ func headPath(box *geo.Box) *svg.SvgPathContext { pc := svg.NewSVGPathContext(box.TopLeft, 1, 1) - headRadius := width * HEAD_RADIUS_FACTOR - headCenterX := width / 2 + headRadius := math.Round(width * HEAD_RADIUS_FACTOR) + headCenterX := math.Round(width / 2) headCenterY := headRadius pc.StartAt(pc.Absolute(headCenterX, headCenterY-headRadius)) @@ -126,8 +125,8 @@ func (s shapeC4Person) Perimeter() []geo.Intersectable { bodyPerimeter := bodyPath(s.Box).Path - headRadius := width * HEAD_RADIUS_FACTOR - headCenterX := s.Box.TopLeft.X + width/2 + headRadius := math.Round(width * HEAD_RADIUS_FACTOR) + headCenterX := s.Box.TopLeft.X + math.Round(width/2) headCenterY := s.Box.TopLeft.Y + headRadius headCenter := geo.NewPoint(headCenterX, headCenterY) @@ -148,19 +147,19 @@ func (s shapeC4Person) GetDimensionsToFit(width, height, paddingX, paddingY floa contentHeight := height + paddingY // Account for 10% total horizontal padding (5% on each side) - totalWidth := contentWidth / 0.9 - headRadius := totalWidth * HEAD_RADIUS_FACTOR + totalWidth := math.Round(contentWidth / 0.9) + headRadius := math.Round(totalWidth * HEAD_RADIUS_FACTOR) // Use positioning matching frontend headCenterY := headRadius - bodyTop := headCenterY + headRadius*BODY_TOP_FACTOR + bodyTop := math.Round(headCenterY + headRadius*BODY_TOP_FACTOR) // Include vertical padding - verticalPadding := totalWidth * 0.06 // 3% top + 3% bottom - totalHeight := contentHeight + bodyTop + verticalPadding + verticalPadding := math.Round(totalWidth * 0.06) // 3% top + 3% bottom + totalHeight := math.Round(contentHeight + bodyTop + verticalPadding) // Calculate minimum height - minHeight := totalWidth * 0.95 + minHeight := math.Round(totalWidth * 0.95) if totalHeight < minHeight { totalHeight = minHeight }