From 9eba6219d6e729a149a2bd9d417c95445d6570a5 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Thu, 13 Mar 2025 11:55:30 -0600 Subject: [PATCH] fix c4 person dimensions --- .../c4-person-shape/dagre/board.exp.json | 100 +-- .../c4-person-shape/dagre/sketch.exp.svg | 578 ++++++++--------- .../txtar/c4-person-shape/elk/board.exp.json | 82 +-- .../txtar/c4-person-shape/elk/sketch.exp.svg | 578 ++++++++--------- .../txtar/c4-theme/dagre/board.exp.json | 184 +++--- .../txtar/c4-theme/dagre/sketch.exp.svg | 612 +++++++++--------- .../txtar/c4-theme/elk/board.exp.json | 106 +-- .../txtar/c4-theme/elk/sketch.exp.svg | 612 +++++++++--------- .../small-c4-person/dagre/board.exp.json | 2 +- .../small-c4-person/dagre/sketch.exp.svg | 156 ++--- .../txtar/small-c4-person/elk/board.exp.json | 2 +- .../txtar/small-c4-person/elk/sketch.exp.svg | 156 ++--- lib/shape/shape.go | 2 +- lib/shape/shape_c4_person.go | 19 +- 14 files changed, 1596 insertions(+), 1593 deletions(-) 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 f14fb0556..eb7cde4fb 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": 544 + "y": 612 }, - "width": 312, - "height": 350, + "width": 390, + "height": 468, "opacity": 1, "strokeDash": 0, "strokeWidth": 1, @@ -57,11 +57,11 @@ "id": "c4person", "type": "c4-person", "pos": { - "x": 244, + "x": 286, "y": 0 }, - "width": 135, - "height": 152, + "width": 169, + "height": 203, "opacity": 1, "strokeDash": 0, "strokeWidth": 1, @@ -99,8 +99,8 @@ "id": "regular_person", "type": "person", "pos": { - "x": 89, - "y": 339 + "x": 128, + "y": 399 }, "width": 134, "height": 89, @@ -141,11 +141,11 @@ "id": "styling", "type": "rectangle", "pos": { - "x": 362, - "y": 293 + "x": 440, + "y": 344 }, "width": 210, - "height": 546, + "height": 622, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -183,11 +183,11 @@ "id": "styling.c4styled", "type": "c4-person", "pos": { - "x": 425, - "y": 323 + "x": 492, + "y": 374 }, - "width": 85, - "height": 121, + "width": 107, + "height": 138, "opacity": 1, "strokeDash": 0, "strokeWidth": 1, @@ -225,8 +225,8 @@ "id": "styling.c4sized", "type": "c4-person", "pos": { - "x": 392, - "y": 629 + "x": 470, + "y": 756 }, "width": 150, "height": 180, @@ -291,20 +291,20 @@ "link": "", "route": [ { - "x": 156, - "y": 454 + "x": 195, + "y": 514 }, { - "x": 156, - "y": 486 + "x": 195, + "y": 552.4000244140625 }, { - "x": 156, - "y": 502.79998779296875 + "x": 195, + "y": 571.5999755859375 }, { - "x": 156, - "y": 538 + "x": 195, + "y": 610 } ], "isCurve": true, @@ -339,20 +339,20 @@ "link": "", "route": [ { - "x": 245, - "y": 135 + "x": 287, + "y": 179 }, { - "x": 173.8000030517578, - "y": 197 + "x": 213.3990020751953, + "y": 246.60000610351562 }, { - "x": 156, - "y": 286.20001220703125 - }, - { - "x": 156, + "x": 195, "y": 339 + }, + { + "x": 195, + "y": 399 } ], "isCurve": true, @@ -387,20 +387,20 @@ "link": "", "route": [ { - "x": 379, - "y": 135 + "x": 455, + "y": 180 }, { - "x": 449.3999938964844, - "y": 197 + "x": 527, + "y": 246.8000030517578 }, { - "x": 467, - "y": 283.6000061035156 + "x": 545, + "y": 334.20001220703125 }, { - "x": 467, - "y": 326 + "x": 545, + "y": 375 } ], "isCurve": true, @@ -435,20 +435,20 @@ "link": "", "route": [ { - "x": 467, - "y": 445 + "x": 545, + "y": 512 }, { - "x": 467, - "y": 484.20001220703125 + "x": 545, + "y": 552 }, { - "x": 467, - "y": 520.7990112304688 + "x": 545, + "y": 600.5999755859375 }, { - "x": 467, - "y": 628 + "x": 545, + "y": 755 } ], "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 395dc0e3d..4965fde2b 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 c9290285f..7c12572db 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": 975 + "y": 1043 }, - "width": 312, - "height": 350, + "width": 390, + "height": 468, "opacity": 1, "strokeDash": 0, "strokeWidth": 1, @@ -57,11 +57,11 @@ "id": "c4person", "type": "c4-person", "pos": { - "x": 201, + "x": 223, "y": 12 }, - "width": 135, - "height": 152, + "width": 169, + "height": 203, "opacity": 1, "strokeDash": 0, "strokeWidth": 1, @@ -99,8 +99,8 @@ "id": "regular_person", "type": "person", "pos": { - "x": 101, - "y": 790 + "x": 140, + "y": 858 }, "width": 134, "height": 89, @@ -141,11 +141,11 @@ "id": "styling", "type": "rectangle", "pos": { - "x": 244, - "y": 249 + "x": 283, + "y": 300 }, "width": 250, - "height": 471, + "height": 488, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -183,11 +183,11 @@ "id": "styling.c4styled", "type": "c4-person", "pos": { - "x": 327, - "y": 299 + "x": 355, + "y": 350 }, - "width": 85, - "height": 121, + "width": 107, + "height": 138, "opacity": 1, "strokeDash": 0, "strokeWidth": 1, @@ -225,8 +225,8 @@ "id": "styling.c4sized", "type": "c4-person", "pos": { - "x": 294, - "y": 490 + "x": 333, + "y": 558 }, "width": 150, "height": 180, @@ -291,12 +291,12 @@ "link": "", "route": [ { - "x": 168, - "y": 905 + "x": 207, + "y": 973 }, { - "x": 168, - "y": 969 + "x": 207, + "y": 1041 } ], "animated": false, @@ -330,20 +330,20 @@ "link": "", "route": [ { - "x": 246, - "y": 165 + "x": 280, + "y": 216 }, { - "x": 246.25, - "y": 204 + "x": 279.5830078125, + "y": 255 }, { - "x": 168, - "y": 204 + "x": 207, + "y": 255 }, { - "x": 168, - "y": 790 + "x": 207, + "y": 858 } ], "animated": false, @@ -377,20 +377,20 @@ "link": "", "route": [ { - "x": 291, - "y": 165 + "x": 336, + "y": 216 }, { - "x": 291.25, - "y": 204 + "x": 335.9159851074219, + "y": 255 }, { - "x": 369.5, - "y": 204 + "x": 408.5, + "y": 255 }, { - "x": 370, - "y": 302 + "x": 409, + "y": 351 } ], "animated": false, @@ -424,12 +424,12 @@ "link": "", "route": [ { - "x": 369, - "y": 421 + "x": 408, + "y": 488 }, { - "x": 370, - "y": 489 + "x": 409, + "y": 557 } ], "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 d04252bfb..08e6f0148 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 bdb6871ab..372879a1c 100644 --- a/e2etests/testdata/txtar/c4-theme/dagre/board.exp.json +++ b/e2etests/testdata/txtar/c4-theme/dagre/board.exp.json @@ -15,11 +15,11 @@ "id": "customer", "type": "c4-person", "pos": { - "x": 1105, + "x": 1057, "y": 0 }, - "width": 383, - "height": 429, + "width": 479, + "height": 575, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -58,7 +58,7 @@ "type": "rectangle", "pos": { "x": 147, - "y": 586 + "y": 732 }, "width": 2407, "height": 915, @@ -100,7 +100,7 @@ "type": "rectangle", "pos": { "x": 177, - "y": 616 + "y": 762 }, "width": 550, "height": 164, @@ -142,7 +142,7 @@ "type": "rectangle", "pos": { "x": 390, - "y": 901 + "y": 1047 }, "width": 609, "height": 164, @@ -184,7 +184,7 @@ "type": "rectangle", "pos": { "x": 1123, - "y": 901 + "y": 1047 }, "width": 707, "height": 164, @@ -226,7 +226,7 @@ "type": "rectangle", "pos": { "x": 1246, - "y": 1202 + "y": 1348 }, "width": 461, "height": 164, @@ -268,7 +268,7 @@ "type": "rectangle", "pos": { "x": 1890, - "y": 901 + "y": 1047 }, "width": 634, "height": 164, @@ -310,7 +310,7 @@ "type": "rectangle", "pos": { "x": 2410, - "y": 1638 + "y": 1784 }, "width": 360, "height": 164, @@ -352,7 +352,7 @@ "type": "rectangle", "pos": { "x": 0, - "y": 1638 + "y": 1784 }, "width": 629, "height": 164, @@ -417,20 +417,20 @@ "link": "", "route": [ { - "x": 1105, - "y": 279 + "x": 1057, + "y": 388 }, { - "x": 582.5999755859375, - "y": 453.79998779296875 + "x": 573, + "y": 592.4000244140625 }, { "x": 452, - "y": 576 + "y": 722 }, { "x": 452, - "y": 616 + "y": 762 } ], "isCurve": true, @@ -466,19 +466,19 @@ "route": [ { "x": 452, - "y": 779.5 + "y": 925.5 }, { "x": 452, - "y": 828.2999877929688 + "y": 974.2999877929688 }, { "x": 472.3999938964844, - "y": 852.7000122070312 + "y": 998.7000122070312 }, { "x": 554, - "y": 901.5 + "y": 1047.5 } ], "isCurve": true, @@ -513,44 +513,44 @@ "link": "", "route": [ { - "x": 1105, - "y": 365 + "x": 1063, + "y": 519 }, { - "x": 970.5999755859375, - "y": 471 + "x": 962.2000122070312, + "y": 618.5999755859375 }, { "x": 937, - "y": 511.20001220703125 + "y": 657.2000122070312 }, { "x": 937, - "y": 531.75 + "y": 677.75 }, { "x": 937, - "y": 552.2999877929688 + "y": 698.2999877929688 }, { "x": 937, - "y": 592.4000244140625 + "y": 738.4000244140625 }, { "x": 937, - "y": 632 + "y": 778 }, { "x": 937, - "y": 671.5999755859375 + "y": 817.5999755859375 }, { "x": 916.5999755859375, - "y": 852.7000122070312 + "y": 998.7000122070312 }, { "x": 835, - "y": 901.5 + "y": 1047.5 } ], "isCurve": true, @@ -585,44 +585,44 @@ "link": "", "route": [ { - "x": 1432, - "y": 428 + "x": 1442, + "y": 576 }, { - "x": 1467.199951171875, - "y": 483.6000061035156 + "x": 1469.199951171875, + "y": 630 }, { "x": 1476, - "y": 511.20001220703125 + "y": 657.2000122070312 }, { "x": 1476, - "y": 531.75 + "y": 677.75 }, { "x": 1476, - "y": 552.2999877929688 + "y": 698.2999877929688 }, { "x": 1476, - "y": 592.4000244140625 + "y": 738.4000244140625 }, { "x": 1476, - "y": 632 + "y": 778 }, { "x": 1476, - "y": 671.5999755859375 + "y": 817.5999755859375 }, { "x": 1476, - "y": 852.7000122070312 + "y": 998.7000122070312 }, { "x": 1476, - "y": 901.5 + "y": 1047.5 } ], "isCurve": true, @@ -658,19 +658,19 @@ "route": [ { "x": 694.5, - "y": 1064.5 + "y": 1210.5 }, { "x": 694.5, - "y": 1119.699951171875 + "y": 1265.699951171875 }, { "x": 804.7000122070312, - "y": 1154.7220458984375 + "y": 1300.7220458984375 }, { "x": 1245.5, - "y": 1239.6099853515625 + "y": 1385.6099853515625 } ], "isCurve": true, @@ -706,19 +706,19 @@ "route": [ { "x": 1476, - "y": 1064.5 + "y": 1210.5 }, { "x": 1476, - "y": 1119.699951171875 + "y": 1265.699951171875 }, { "x": 1476, - "y": 1147.300048828125 + "y": 1293.300048828125 }, { "x": 1476, - "y": 1202.5 + "y": 1348.5 } ], "isCurve": true, @@ -754,19 +754,19 @@ "route": [ { "x": 1245.5, - "y": 1310.1949462890625 + "y": 1456.1949462890625 }, { "x": 500.6990051269531, - "y": 1462.8389892578125 + "y": 1608.8389892578125 }, { "x": 314.5, - "y": 1583.300048828125 + "y": 1729.300048828125 }, { "x": 314.5, - "y": 1638.5 + "y": 1784.5 } ], "isCurve": true, @@ -801,104 +801,104 @@ "link": "", "route": [ { - "x": 1488, - "y": 255 + "x": 1536, + "y": 351 }, { - "x": 2407.199951171875, - "y": 449 + "x": 2416.800048828125, + "y": 585 }, { "x": 2637, - "y": 511.20001220703125 + "y": 657.2000122070312 }, { "x": 2637, - "y": 531.75 + "y": 677.75 }, { "x": 2637, - "y": 552.2999877929688 + "y": 698.2999877929688 }, { "x": 2637, - "y": 592.4000244140625 + "y": 738.4000244140625 }, { "x": 2637, - "y": 632 + "y": 778 }, { "x": 2637, - "y": 671.5999755859375 + "y": 817.5999755859375 }, { "x": 2637, - "y": 726.5 + "y": 872.5 }, { "x": 2637, - "y": 769.25 + "y": 915.25 }, { "x": 2637, - "y": 812 + "y": 958 }, { "x": 2637, - "y": 869 + "y": 1015 }, { "x": 2637, - "y": 911.75 + "y": 1057.75 }, { "x": 2637, - "y": 954.5 + "y": 1100.5 }, { "x": 2637, - "y": 1013.0999755859375 + "y": 1159.0999755859375 }, { "x": 2637, - "y": 1058.25 + "y": 1204.25 }, { "x": 2637, - "y": 1103.4000244140625 + "y": 1249.4000244140625 }, { "x": 2637, - "y": 1163.5999755859375 + "y": 1309.5999755859375 }, { "x": 2637, - "y": 1208.75 + "y": 1354.75 }, { "x": 2637, - "y": 1253.9000244140625 + "y": 1399.9000244140625 }, { "x": 2637, - "y": 1327.4000244140625 + "y": 1473.4000244140625 }, { "x": 2637, - "y": 1392.5 + "y": 1538.5 }, { "x": 2637, - "y": 1457.5999755859375 + "y": 1603.5999755859375 }, { "x": 2632.800048828125, - "y": 1583.300048828125 + "y": 1729.300048828125 }, { "x": 2616, - "y": 1638.5 + "y": 1784.5 } ], "isCurve": true, @@ -934,19 +934,19 @@ "route": [ { "x": 1707.5, - "y": 1317.843994140625 + "y": 1463.843994140625 }, { "x": 2241.5, - "y": 1464.3680419921875 + "y": 1610.3680419921875 }, { "x": 2394.39990234375, - "y": 1583.300048828125 + "y": 1729.300048828125 }, { "x": 2472, - "y": 1638.5 + "y": 1784.5 } ], "isCurve": true, @@ -982,19 +982,19 @@ "route": [ { "x": 2206.5, - "y": 1064.5 + "y": 1210.5 }, { "x": 2206.5, - "y": 1119.699951171875 + "y": 1265.699951171875 }, { "x": 2106.5, - "y": 1154.0999755859375 + "y": 1300.0999755859375 }, { "x": 1706.5, - "y": 1236.5 + "y": 1382.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 1982bf242..48ce9e34b 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 d2a3bd3f0..1753ba0a8 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": 720, + "x": 672, "y": 12 }, - "width": 383, - "height": 429, + "width": 479, + "height": 575, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -58,7 +58,7 @@ "type": "rectangle", "pos": { "x": 12, - "y": 693 + "y": 839 }, "width": 2218, "height": 1035, @@ -100,7 +100,7 @@ "type": "rectangle", "pos": { "x": 62, - "y": 743 + "y": 889 }, "width": 550, "height": 164, @@ -142,7 +142,7 @@ "type": "rectangle", "pos": { "x": 190, - "y": 1078 + "y": 1224 }, "width": 609, "height": 164, @@ -184,7 +184,7 @@ "type": "rectangle", "pos": { "x": 819, - "y": 1078 + "y": 1224 }, "width": 707, "height": 164, @@ -226,7 +226,7 @@ "type": "rectangle", "pos": { "x": 942, - "y": 1429 + "y": 1575 }, "width": 461, "height": 164, @@ -268,7 +268,7 @@ "type": "rectangle", "pos": { "x": 1546, - "y": 1078 + "y": 1224 }, "width": 634, "height": 164, @@ -310,7 +310,7 @@ "type": "rectangle", "pos": { "x": 1746, - "y": 1930 + "y": 2076 }, "width": 360, "height": 164, @@ -352,7 +352,7 @@ "type": "rectangle", "pos": { "x": 781, - "y": 1930 + "y": 2076 }, "width": 629, "height": 164, @@ -417,20 +417,20 @@ "link": "", "route": [ { - "x": 797, - "y": 441 + "x": 769, + "y": 588 }, { - "x": 797.3499755859375, - "y": 481 + "x": 768.5499877929688, + "y": 627 }, { "x": 359.25, - "y": 481 + "y": 627 }, { "x": 359.25, - "y": 743 + "y": 889 } ], "animated": false, @@ -465,11 +465,11 @@ "route": [ { "x": 393, - "y": 907 + "y": 1053 }, { "x": 393, - "y": 1078 + "y": 1224 } ], "animated": false, @@ -503,20 +503,20 @@ "link": "", "route": [ { - "x": 874, - "y": 441 + "x": 864, + "y": 588 }, { - "x": 873.9500122070312, - "y": 531 + "x": 864.3499755859375, + "y": 677 }, { "x": 652, - "y": 531 + "y": 677 }, { "x": 652, - "y": 1078 + "y": 1224 } ], "animated": false, @@ -550,12 +550,12 @@ "link": "", "route": [ { - "x": 951, - "y": 441 + "x": 960, + "y": 588 }, { - "x": 950.5499877929688, - "y": 1078 + "x": 960.1500244140625, + "y": 1224 } ], "animated": false, @@ -590,19 +590,19 @@ "route": [ { "x": 494.5, - "y": 1242 + "y": 1388 }, { "x": 494.5, - "y": 1389 + "y": 1535 }, { "x": 1057.25, - "y": 1389 + "y": 1535 }, { "x": 1057.25, - "y": 1429 + "y": 1575 } ], "animated": false, @@ -637,11 +637,11 @@ "route": [ { "x": 1172.5, - "y": 1242 + "y": 1388 }, { "x": 1172.5, - "y": 1429 + "y": 1575 } ], "animated": false, @@ -676,11 +676,11 @@ "route": [ { "x": 1095.666015625, - "y": 1593 + "y": 1739 }, { "x": 1095.666015625, - "y": 1930 + "y": 2076 } ], "animated": false, @@ -714,28 +714,28 @@ "link": "", "route": [ { - "x": 1027, - "y": 441 + "x": 1056, + "y": 588 }, { - "x": 1027.1500244140625, - "y": 481 + "x": 1055.948974609375, + "y": 627 }, { "x": 2303.5, - "y": 481 + "y": 627 }, { "x": 2303.5, - "y": 1890 + "y": 2036 }, { "x": 1986.8330078125, - "y": 1890 + "y": 2036 }, { "x": 1986.8330078125, - "y": 1930 + "y": 2076 } ], "animated": false, @@ -770,19 +770,19 @@ "route": [ { "x": 1249.3330078125, - "y": 1593 + "y": 1739 }, { "x": 1249.3330078125, - "y": 1890 + "y": 2036 }, { "x": 1866.8330078125, - "y": 1890 + "y": 2036 }, { "x": 1866.8330078125, - "y": 1930 + "y": 2076 } ], "animated": false, @@ -817,19 +817,19 @@ "route": [ { "x": 1863, - "y": 1242 + "y": 1388 }, { "x": 1863, - "y": 1389 + "y": 1535 }, { "x": 1287.75, - "y": 1389 + "y": 1535 }, { "x": 1287.75, - "y": 1429 + "y": 1575 } ], "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 52d5d51f4..66502edd6 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/board.exp.json b/e2etests/testdata/txtar/small-c4-person/dagre/board.exp.json index be4ffa74e..678575f50 100644 --- a/e2etests/testdata/txtar/small-c4-person/dagre/board.exp.json +++ b/e2etests/testdata/txtar/small-c4-person/dagre/board.exp.json @@ -19,7 +19,7 @@ "y": 0 }, "width": 180, - "height": 114, + "height": 126, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, 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 afeff911b..68df2d2e2 100644 --- a/e2etests/testdata/txtar/small-c4-person/dagre/sketch.exp.svg +++ b/e2etests/testdata/txtar/small-c4-person/dagre/sketch.exp.svg @@ -1,9 +1,9 @@ -c4-person - - + .d2-144415964 .fill-N1{fill:#0A0F25;} + .d2-144415964 .fill-N2{fill:#676C7E;} + .d2-144415964 .fill-N3{fill:#9499AB;} + .d2-144415964 .fill-N4{fill:#CFD2DD;} + .d2-144415964 .fill-N5{fill:#DEE1EB;} + .d2-144415964 .fill-N6{fill:#EEF1F8;} + .d2-144415964 .fill-N7{fill:#FFFFFF;} + .d2-144415964 .fill-B1{fill:#0D32B2;} + .d2-144415964 .fill-B2{fill:#0D32B2;} + .d2-144415964 .fill-B3{fill:#E3E9FD;} + .d2-144415964 .fill-B4{fill:#E3E9FD;} + .d2-144415964 .fill-B5{fill:#EDF0FD;} + .d2-144415964 .fill-B6{fill:#F7F8FE;} + .d2-144415964 .fill-AA2{fill:#4A6FF3;} + .d2-144415964 .fill-AA4{fill:#EDF0FD;} + .d2-144415964 .fill-AA5{fill:#F7F8FE;} + .d2-144415964 .fill-AB4{fill:#EDF0FD;} + .d2-144415964 .fill-AB5{fill:#F7F8FE;} + .d2-144415964 .stroke-N1{stroke:#0A0F25;} + .d2-144415964 .stroke-N2{stroke:#676C7E;} + .d2-144415964 .stroke-N3{stroke:#9499AB;} + .d2-144415964 .stroke-N4{stroke:#CFD2DD;} + .d2-144415964 .stroke-N5{stroke:#DEE1EB;} + .d2-144415964 .stroke-N6{stroke:#EEF1F8;} + .d2-144415964 .stroke-N7{stroke:#FFFFFF;} + .d2-144415964 .stroke-B1{stroke:#0D32B2;} + .d2-144415964 .stroke-B2{stroke:#0D32B2;} + .d2-144415964 .stroke-B3{stroke:#E3E9FD;} + .d2-144415964 .stroke-B4{stroke:#E3E9FD;} + .d2-144415964 .stroke-B5{stroke:#EDF0FD;} + .d2-144415964 .stroke-B6{stroke:#F7F8FE;} + .d2-144415964 .stroke-AA2{stroke:#4A6FF3;} + .d2-144415964 .stroke-AA4{stroke:#EDF0FD;} + .d2-144415964 .stroke-AA5{stroke:#F7F8FE;} + .d2-144415964 .stroke-AB4{stroke:#EDF0FD;} + .d2-144415964 .stroke-AB5{stroke:#F7F8FE;} + .d2-144415964 .background-color-N1{background-color:#0A0F25;} + .d2-144415964 .background-color-N2{background-color:#676C7E;} + .d2-144415964 .background-color-N3{background-color:#9499AB;} + .d2-144415964 .background-color-N4{background-color:#CFD2DD;} + .d2-144415964 .background-color-N5{background-color:#DEE1EB;} + .d2-144415964 .background-color-N6{background-color:#EEF1F8;} + .d2-144415964 .background-color-N7{background-color:#FFFFFF;} + .d2-144415964 .background-color-B1{background-color:#0D32B2;} + .d2-144415964 .background-color-B2{background-color:#0D32B2;} + .d2-144415964 .background-color-B3{background-color:#E3E9FD;} + .d2-144415964 .background-color-B4{background-color:#E3E9FD;} + .d2-144415964 .background-color-B5{background-color:#EDF0FD;} + .d2-144415964 .background-color-B6{background-color:#F7F8FE;} + .d2-144415964 .background-color-AA2{background-color:#4A6FF3;} + .d2-144415964 .background-color-AA4{background-color:#EDF0FD;} + .d2-144415964 .background-color-AA5{background-color:#F7F8FE;} + .d2-144415964 .background-color-AB4{background-color:#EDF0FD;} + .d2-144415964 .background-color-AB5{background-color:#F7F8FE;} + .d2-144415964 .color-N1{color:#0A0F25;} + .d2-144415964 .color-N2{color:#676C7E;} + .d2-144415964 .color-N3{color:#9499AB;} + .d2-144415964 .color-N4{color:#CFD2DD;} + .d2-144415964 .color-N5{color:#DEE1EB;} + .d2-144415964 .color-N6{color:#EEF1F8;} + .d2-144415964 .color-N7{color:#FFFFFF;} + .d2-144415964 .color-B1{color:#0D32B2;} + .d2-144415964 .color-B2{color:#0D32B2;} + .d2-144415964 .color-B3{color:#E3E9FD;} + .d2-144415964 .color-B4{color:#E3E9FD;} + .d2-144415964 .color-B5{color:#EDF0FD;} + .d2-144415964 .color-B6{color:#F7F8FE;} + .d2-144415964 .color-AA2{color:#4A6FF3;} + .d2-144415964 .color-AA4{color:#EDF0FD;} + .d2-144415964 .color-AA5{color:#F7F8FE;} + .d2-144415964 .color-AB4{color:#EDF0FD;} + .d2-144415964 .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-144415964);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker-d2-144415964);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright-d2-144415964);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright-d2-144415964);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright-d2-144415964);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright-d2-144415964);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark-d2-144415964);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright-d2-144415964);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright-d2-144415964);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright-d2-144415964);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright-d2-144415964);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker-d2-144415964);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark-d2-144415964);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal-d2-144415964);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal-d2-144415964);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright-d2-144415964);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright-d2-144415964);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright-d2-144415964);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/board.exp.json b/e2etests/testdata/txtar/small-c4-person/elk/board.exp.json index 899afe63f..90602f386 100644 --- a/e2etests/testdata/txtar/small-c4-person/elk/board.exp.json +++ b/e2etests/testdata/txtar/small-c4-person/elk/board.exp.json @@ -19,7 +19,7 @@ "y": 12 }, "width": 180, - "height": 114, + "height": 126, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, 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 68477ef9d..3a19838ab 100644 --- a/e2etests/testdata/txtar/small-c4-person/elk/sketch.exp.svg +++ b/e2etests/testdata/txtar/small-c4-person/elk/sketch.exp.svg @@ -1,9 +1,9 @@ -c4-person - - + .d2-1179796372 .fill-N1{fill:#0A0F25;} + .d2-1179796372 .fill-N2{fill:#676C7E;} + .d2-1179796372 .fill-N3{fill:#9499AB;} + .d2-1179796372 .fill-N4{fill:#CFD2DD;} + .d2-1179796372 .fill-N5{fill:#DEE1EB;} + .d2-1179796372 .fill-N6{fill:#EEF1F8;} + .d2-1179796372 .fill-N7{fill:#FFFFFF;} + .d2-1179796372 .fill-B1{fill:#0D32B2;} + .d2-1179796372 .fill-B2{fill:#0D32B2;} + .d2-1179796372 .fill-B3{fill:#E3E9FD;} + .d2-1179796372 .fill-B4{fill:#E3E9FD;} + .d2-1179796372 .fill-B5{fill:#EDF0FD;} + .d2-1179796372 .fill-B6{fill:#F7F8FE;} + .d2-1179796372 .fill-AA2{fill:#4A6FF3;} + .d2-1179796372 .fill-AA4{fill:#EDF0FD;} + .d2-1179796372 .fill-AA5{fill:#F7F8FE;} + .d2-1179796372 .fill-AB4{fill:#EDF0FD;} + .d2-1179796372 .fill-AB5{fill:#F7F8FE;} + .d2-1179796372 .stroke-N1{stroke:#0A0F25;} + .d2-1179796372 .stroke-N2{stroke:#676C7E;} + .d2-1179796372 .stroke-N3{stroke:#9499AB;} + .d2-1179796372 .stroke-N4{stroke:#CFD2DD;} + .d2-1179796372 .stroke-N5{stroke:#DEE1EB;} + .d2-1179796372 .stroke-N6{stroke:#EEF1F8;} + .d2-1179796372 .stroke-N7{stroke:#FFFFFF;} + .d2-1179796372 .stroke-B1{stroke:#0D32B2;} + .d2-1179796372 .stroke-B2{stroke:#0D32B2;} + .d2-1179796372 .stroke-B3{stroke:#E3E9FD;} + .d2-1179796372 .stroke-B4{stroke:#E3E9FD;} + .d2-1179796372 .stroke-B5{stroke:#EDF0FD;} + .d2-1179796372 .stroke-B6{stroke:#F7F8FE;} + .d2-1179796372 .stroke-AA2{stroke:#4A6FF3;} + .d2-1179796372 .stroke-AA4{stroke:#EDF0FD;} + .d2-1179796372 .stroke-AA5{stroke:#F7F8FE;} + .d2-1179796372 .stroke-AB4{stroke:#EDF0FD;} + .d2-1179796372 .stroke-AB5{stroke:#F7F8FE;} + .d2-1179796372 .background-color-N1{background-color:#0A0F25;} + .d2-1179796372 .background-color-N2{background-color:#676C7E;} + .d2-1179796372 .background-color-N3{background-color:#9499AB;} + .d2-1179796372 .background-color-N4{background-color:#CFD2DD;} + .d2-1179796372 .background-color-N5{background-color:#DEE1EB;} + .d2-1179796372 .background-color-N6{background-color:#EEF1F8;} + .d2-1179796372 .background-color-N7{background-color:#FFFFFF;} + .d2-1179796372 .background-color-B1{background-color:#0D32B2;} + .d2-1179796372 .background-color-B2{background-color:#0D32B2;} + .d2-1179796372 .background-color-B3{background-color:#E3E9FD;} + .d2-1179796372 .background-color-B4{background-color:#E3E9FD;} + .d2-1179796372 .background-color-B5{background-color:#EDF0FD;} + .d2-1179796372 .background-color-B6{background-color:#F7F8FE;} + .d2-1179796372 .background-color-AA2{background-color:#4A6FF3;} + .d2-1179796372 .background-color-AA4{background-color:#EDF0FD;} + .d2-1179796372 .background-color-AA5{background-color:#F7F8FE;} + .d2-1179796372 .background-color-AB4{background-color:#EDF0FD;} + .d2-1179796372 .background-color-AB5{background-color:#F7F8FE;} + .d2-1179796372 .color-N1{color:#0A0F25;} + .d2-1179796372 .color-N2{color:#676C7E;} + .d2-1179796372 .color-N3{color:#9499AB;} + .d2-1179796372 .color-N4{color:#CFD2DD;} + .d2-1179796372 .color-N5{color:#DEE1EB;} + .d2-1179796372 .color-N6{color:#EEF1F8;} + .d2-1179796372 .color-N7{color:#FFFFFF;} + .d2-1179796372 .color-B1{color:#0D32B2;} + .d2-1179796372 .color-B2{color:#0D32B2;} + .d2-1179796372 .color-B3{color:#E3E9FD;} + .d2-1179796372 .color-B4{color:#E3E9FD;} + .d2-1179796372 .color-B5{color:#EDF0FD;} + .d2-1179796372 .color-B6{color:#F7F8FE;} + .d2-1179796372 .color-AA2{color:#4A6FF3;} + .d2-1179796372 .color-AA4{color:#EDF0FD;} + .d2-1179796372 .color-AA5{color:#F7F8FE;} + .d2-1179796372 .color-AB4{color:#EDF0FD;} + .d2-1179796372 .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-1179796372);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker-d2-1179796372);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright-d2-1179796372);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright-d2-1179796372);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright-d2-1179796372);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright-d2-1179796372);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark-d2-1179796372);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright-d2-1179796372);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright-d2-1179796372);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright-d2-1179796372);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright-d2-1179796372);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker-d2-1179796372);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark-d2-1179796372);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal-d2-1179796372);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal-d2-1179796372);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright-d2-1179796372);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright-d2-1179796372);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright-d2-1179796372);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.go b/lib/shape/shape.go index 6e3e0b81b..6dd6cec7a 100644 --- a/lib/shape/shape.go +++ b/lib/shape/shape.go @@ -21,7 +21,7 @@ const ( CALLOUT_TYPE = "Callout" STORED_DATA_TYPE = "StoredData" PERSON_TYPE = "Person" - C4_PERSON_TYPE = "c4-person" + C4_PERSON_TYPE = "C4Person" DIAMOND_TYPE = "Diamond" OVAL_TYPE = "Oval" CIRCLE_TYPE = "Circle" diff --git a/lib/shape/shape_c4_person.go b/lib/shape/shape_c4_person.go index 8535c5b79..673afbf8f 100644 --- a/lib/shape/shape_c4_person.go +++ b/lib/shape/shape_c4_person.go @@ -138,16 +138,19 @@ func (s shapeC4Person) GetSVGPathData() []string { } func (s shapeC4Person) GetDimensionsToFit(width, height, paddingX, paddingY float64) (float64, float64) { - totalWidth := width + paddingX - totalHeight := height + paddingY - - if totalHeight < totalWidth*0.8 { - totalHeight = totalWidth * 0.8 + contentWidth := width + paddingX + contentHeight := height + paddingY + totalWidth := contentWidth / 0.8 + headRadius := totalWidth * 0.22 + bodyTop := totalWidth*0.18 + headRadius*0.8 + verticalPaddingRatio := 0.1 // 5% top + 5% bottom + totalHeight := (contentHeight + bodyTop) / (1 - verticalPaddingRatio) + minHeight := totalWidth * 1.2 + if totalHeight < minHeight { + totalHeight = minHeight } - - totalHeight *= 1.4 - totalWidth, totalHeight = LimitAR(totalWidth, totalHeight, C4_PERSON_AR_LIMIT) + return math.Ceil(totalWidth), math.Ceil(totalHeight) }