Merge pull request #1494 from alixander/label-pad

fix icon pad
This commit is contained in:
Alexander Wang 2023-07-23 21:33:35 -07:00 committed by GitHub
commit 0402934c09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 611 additions and 5 deletions

View file

@ -215,11 +215,11 @@ func (diagram Diagram) BoundingBox() (topLeft, bottomRight Point) {
if strings.HasPrefix(targetShape.IconPosition, "OUTSIDE_TOP") {
y1 = go2.Min(y1, targetShape.Pos.Y-label.PADDING-size)
} else if strings.HasPrefix(targetShape.IconPosition, "OUTSIDE_BOTTOM") {
y2 = go2.Max(y2, targetShape.Pos.Y+label.PADDING+size)
y2 = go2.Max(y2, targetShape.Pos.Y+targetShape.Height+label.PADDING+size)
} else if strings.HasPrefix(targetShape.IconPosition, "OUTSIDE_LEFT") {
x1 = go2.Min(x1, targetShape.Pos.X-label.PADDING-size)
} else if strings.HasPrefix(targetShape.IconPosition, "OUTSIDE_RIGHT") {
x2 = go2.Max(x2, targetShape.Pos.X+label.PADDING+size)
x2 = go2.Max(x2, targetShape.Pos.X+targetShape.Width+label.PADDING+size)
}
}

View file

@ -2766,6 +2766,25 @@ scenarios: {
thunder
}
}`,
},
{
name: "label-near",
script: `
direction: right
x -> y
x: worker {
label.near: top-center
icon: https://icons.terrastruct.com/essentials%2F005-programmer.svg
icon.near: outside-top-right
}
y: profits {
label.near: bottom-right
icon: https://icons.terrastruct.com/essentials%2Fprofits.svg
icon.near: outside-bottom-center
}
`,
},
loadFromFile(t, "arrowhead_scaling"),
loadFromFile(t, "teleport_grid"),

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View file

@ -0,0 +1,202 @@
{
"name": "",
"isFolderOnly": false,
"fontFamily": "SourceSansPro",
"shapes": [
{
"id": "x",
"type": "rectangle",
"pos": {
"x": 0,
"y": 74
},
"width": 123,
"height": 123,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "B6",
"stroke": "B1",
"shadow": false,
"3d": false,
"multiple": false,
"double-border": false,
"tooltip": "",
"link": "",
"icon": {
"Scheme": "https",
"Opaque": "",
"User": null,
"Host": "icons.terrastruct.com",
"Path": "/essentials/005-programmer.svg",
"RawPath": "/essentials%2F005-programmer.svg",
"OmitHost": false,
"ForceQuery": false,
"RawQuery": "",
"Fragment": "",
"RawFragment": ""
},
"iconPosition": "OUTSIDE_TOP_RIGHT",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "worker",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "N1",
"italic": false,
"bold": true,
"underline": false,
"labelWidth": 52,
"labelHeight": 21,
"labelPosition": "INSIDE_TOP_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "y",
"type": "rectangle",
"pos": {
"x": 223,
"y": 74
},
"width": 118,
"height": 123,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "B6",
"stroke": "B1",
"shadow": false,
"3d": false,
"multiple": false,
"double-border": false,
"tooltip": "",
"link": "",
"icon": {
"Scheme": "https",
"Opaque": "",
"User": null,
"Host": "icons.terrastruct.com",
"Path": "/essentials/profits.svg",
"RawPath": "/essentials%2Fprofits.svg",
"OmitHost": false,
"ForceQuery": false,
"RawQuery": "",
"Fragment": "",
"RawFragment": ""
},
"iconPosition": "OUTSIDE_BOTTOM_CENTER",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "profits",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "N1",
"italic": false,
"bold": true,
"underline": false,
"labelWidth": 47,
"labelHeight": 21,
"labelPosition": "INSIDE_BOTTOM_RIGHT",
"zIndex": 0,
"level": 1
}
],
"connections": [
{
"id": "(x -> y)[0]",
"src": "x",
"srcArrow": "none",
"dst": "y",
"dstArrow": "triangle",
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"stroke": "B1",
"borderRadius": 10,
"label": "",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "N2",
"italic": true,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0,
"labelPosition": "",
"labelPercentage": 0,
"route": [
{
"x": 123,
"y": 151
},
{
"x": 163,
"y": 151
},
{
"x": 183,
"y": 151
},
{
"x": 223,
"y": 151
}
],
"isCurve": true,
"animated": false,
"tooltip": "",
"icon": null,
"zIndex": 0
}
],
"root": {
"id": "",
"type": "",
"pos": {
"x": 0,
"y": 0
},
"width": 0,
"height": 0,
"opacity": 0,
"strokeDash": 0,
"strokeWidth": 0,
"borderRadius": 0,
"fill": "N7",
"stroke": "",
"shadow": false,
"3d": false,
"multiple": false,
"double-border": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0,
"zIndex": 0,
"level": 0
}
}

View file

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.0-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 343 254"><svg id="d2-svg" class="d2-1091728639" width="343" height="254" viewBox="-1 7 343 254"><rect x="-1.000000" y="7.000000" width="343.000000" height="254.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
.d2-1091728639 .text-bold {
font-family: "d2-1091728639-font-bold";
}
@font-face {
font-family: d2-1091728639-font-bold;
src: url("data:application/font-woff;base64,d09GRgABAAAAAAkEAAoAAAAADlQAAguFAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAAA9AAAAGAAAABgXxHXrmNtYXAAAAFUAAAAWQAAAGoBnQHiZ2x5ZgAAAbAAAAM9AAADxGbHMuVoZWFkAAAE8AAAADYAAAA2G38e1GhoZWEAAAUoAAAAJ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8UiZMaJBlzan9BkzIcfRVqSSmU/KkIJrAuV3ZlF2ZkBEQm6srkgIxdOJXyTvDqc4umSyXY98uhHhSxzfybvklsr2Kzz9ujVmm3mXbALm6mesrsS6udYEx7ot87b4VrjgFe5e/dlk8v4ehfpfKPIFV5p/qEklYpLg3C4tfCnId49xHOncwVdHvqdDnxO6vKGvc4sePVqc0afDa/l26eH4mi5nHMujI7y4a0sxZ/yA4xs6siljR9afxcQifiYzdefiOFMdUzL1vGTuqdZIFd59wuUOpRvqyOUz0B6Vlk7zS7RnASNTRSaGU/VyqY3c+heaIqaqpZzt7X25DXPbveUW35Bqh0u1LjiVk1swet9UvXc0c60fj4CQlAtZDEiZ0qDgRrzPCbgixnGs7p1oSwpaK58yz41UEjEVgw6J4szI9Dcw3fjGfbChe2dvSSj/kunlqqr7ZHHq1e2M3qh7yzvfuhytTaBhU03X1DQQ18S0H2mn1vn78s31uqU85YiUmPBfL8AzPJrsc8AhY2UY6GZur0NTL0STlxyq+ksiWQ2l58giHODxnAMOeMnzd/q4ZOKMi1txWc/d4pgjuhx+UBUL+y5HvF59+/+sv4tpU7U4nq5OL+49xSd3UOsX2rPb97KniZWTmFu02604I2BacnG76zW5x3j/AAAA//8BAAD///S3T1F4nGJgZgCD/+cYjBiwAAAAAAD//wEAAP//LwECAwAAAA==");
}]]></style><style type="text/css"><![CDATA[.shape {
shape-rendering: geometricPrecision;
stroke-linejoin: round;
}
.connection {
stroke-linecap: round;
stroke-linejoin: round;
}
.blend {
mix-blend-mode: multiply;
opacity: 0.5;
}
.d2-1091728639 .fill-N1{fill:#0A0F25;}
.d2-1091728639 .fill-N2{fill:#676C7E;}
.d2-1091728639 .fill-N3{fill:#9499AB;}
.d2-1091728639 .fill-N4{fill:#CFD2DD;}
.d2-1091728639 .fill-N5{fill:#DEE1EB;}
.d2-1091728639 .fill-N6{fill:#EEF1F8;}
.d2-1091728639 .fill-N7{fill:#FFFFFF;}
.d2-1091728639 .fill-B1{fill:#0D32B2;}
.d2-1091728639 .fill-B2{fill:#0D32B2;}
.d2-1091728639 .fill-B3{fill:#E3E9FD;}
.d2-1091728639 .fill-B4{fill:#E3E9FD;}
.d2-1091728639 .fill-B5{fill:#EDF0FD;}
.d2-1091728639 .fill-B6{fill:#F7F8FE;}
.d2-1091728639 .fill-AA2{fill:#4A6FF3;}
.d2-1091728639 .fill-AA4{fill:#EDF0FD;}
.d2-1091728639 .fill-AA5{fill:#F7F8FE;}
.d2-1091728639 .fill-AB4{fill:#EDF0FD;}
.d2-1091728639 .fill-AB5{fill:#F7F8FE;}
.d2-1091728639 .stroke-N1{stroke:#0A0F25;}
.d2-1091728639 .stroke-N2{stroke:#676C7E;}
.d2-1091728639 .stroke-N3{stroke:#9499AB;}
.d2-1091728639 .stroke-N4{stroke:#CFD2DD;}
.d2-1091728639 .stroke-N5{stroke:#DEE1EB;}
.d2-1091728639 .stroke-N6{stroke:#EEF1F8;}
.d2-1091728639 .stroke-N7{stroke:#FFFFFF;}
.d2-1091728639 .stroke-B1{stroke:#0D32B2;}
.d2-1091728639 .stroke-B2{stroke:#0D32B2;}
.d2-1091728639 .stroke-B3{stroke:#E3E9FD;}
.d2-1091728639 .stroke-B4{stroke:#E3E9FD;}
.d2-1091728639 .stroke-B5{stroke:#EDF0FD;}
.d2-1091728639 .stroke-B6{stroke:#F7F8FE;}
.d2-1091728639 .stroke-AA2{stroke:#4A6FF3;}
.d2-1091728639 .stroke-AA4{stroke:#EDF0FD;}
.d2-1091728639 .stroke-AA5{stroke:#F7F8FE;}
.d2-1091728639 .stroke-AB4{stroke:#EDF0FD;}
.d2-1091728639 .stroke-AB5{stroke:#F7F8FE;}
.d2-1091728639 .background-color-N1{background-color:#0A0F25;}
.d2-1091728639 .background-color-N2{background-color:#676C7E;}
.d2-1091728639 .background-color-N3{background-color:#9499AB;}
.d2-1091728639 .background-color-N4{background-color:#CFD2DD;}
.d2-1091728639 .background-color-N5{background-color:#DEE1EB;}
.d2-1091728639 .background-color-N6{background-color:#EEF1F8;}
.d2-1091728639 .background-color-N7{background-color:#FFFFFF;}
.d2-1091728639 .background-color-B1{background-color:#0D32B2;}
.d2-1091728639 .background-color-B2{background-color:#0D32B2;}
.d2-1091728639 .background-color-B3{background-color:#E3E9FD;}
.d2-1091728639 .background-color-B4{background-color:#E3E9FD;}
.d2-1091728639 .background-color-B5{background-color:#EDF0FD;}
.d2-1091728639 .background-color-B6{background-color:#F7F8FE;}
.d2-1091728639 .background-color-AA2{background-color:#4A6FF3;}
.d2-1091728639 .background-color-AA4{background-color:#EDF0FD;}
.d2-1091728639 .background-color-AA5{background-color:#F7F8FE;}
.d2-1091728639 .background-color-AB4{background-color:#EDF0FD;}
.d2-1091728639 .background-color-AB5{background-color:#F7F8FE;}
.d2-1091728639 .color-N1{color:#0A0F25;}
.d2-1091728639 .color-N2{color:#676C7E;}
.d2-1091728639 .color-N3{color:#9499AB;}
.d2-1091728639 .color-N4{color:#CFD2DD;}
.d2-1091728639 .color-N5{color:#DEE1EB;}
.d2-1091728639 .color-N6{color:#EEF1F8;}
.d2-1091728639 .color-N7{color:#FFFFFF;}
.d2-1091728639 .color-B1{color:#0D32B2;}
.d2-1091728639 .color-B2{color:#0D32B2;}
.d2-1091728639 .color-B3{color:#E3E9FD;}
.d2-1091728639 .color-B4{color:#E3E9FD;}
.d2-1091728639 .color-B5{color:#EDF0FD;}
.d2-1091728639 .color-B6{color:#F7F8FE;}
.d2-1091728639 .color-AA2{color:#4A6FF3;}
.d2-1091728639 .color-AA4{color:#EDF0FD;}
.d2-1091728639 .color-AA5{color:#F7F8FE;}
.d2-1091728639 .color-AB4{color:#EDF0FD;}
.d2-1091728639 .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);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]></style><g id="x"><g class="shape" ><rect x="0.000000" y="74.000000" width="123.000000" height="123.000000" class=" stroke-B1 fill-B6" style="stroke-width:2;" /></g><image href="https://icons.terrastruct.com/essentials%2F005-programmer.svg" x="56.000000" y="7.000000" width="62" height="62" /><text x="61.500000" y="95.000000" class="text-bold fill-N1" style="text-anchor:middle;font-size:16px">worker</text></g><g id="y"><g class="shape" ><rect x="223.000000" y="74.000000" width="118.000000" height="123.000000" class=" stroke-B1 fill-B6" style="stroke-width:2;" /></g><image href="https://icons.terrastruct.com/essentials%2Fprofits.svg" x="252.500000" y="202.000000" width="59" height="59" /><text x="312.500000" y="187.000000" class="text-bold fill-N1" style="text-anchor:middle;font-size:16px">profits</text></g><g id="(x -&gt; y)[0]"><marker id="mk-3488378134" markerWidth="10.000000" markerHeight="12.000000" refX="7.000000" refY="6.000000" viewBox="0.000000 0.000000 10.000000 12.000000" orient="auto" markerUnits="userSpaceOnUse"> <polygon points="0.000000,0.000000 10.000000,6.000000 0.000000,12.000000" class="connection fill-B1" stroke-width="2" /> </marker><path d="M 125.000000 151.000000 C 163.000000 151.000000 183.000000 151.000000 219.000000 151.000000" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-end="url(#mk-3488378134)" mask="url(#d2-1091728639)" /></g><mask id="d2-1091728639" maskUnits="userSpaceOnUse" x="-1" y="7" width="343" height="254">
<rect x="-1" y="7" width="343" height="254" fill="white"></rect>
<rect x="35.500000" y="79.000000" width="52" height="21" fill="rgba(0,0,0,0.75)"></rect>
<rect x="289.000000" y="171.000000" width="47" height="21" fill="rgba(0,0,0,0.75)"></rect>
</mask></svg></svg>

After

Width:  |  Height:  |  Size: 11 KiB

193
e2etests/testdata/stable/label-near/elk/board.exp.json generated vendored Normal file
View file

@ -0,0 +1,193 @@
{
"name": "",
"isFolderOnly": false,
"fontFamily": "SourceSansPro",
"shapes": [
{
"id": "x",
"type": "rectangle",
"pos": {
"x": 12,
"y": 12
},
"width": 123,
"height": 118,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "B6",
"stroke": "B1",
"shadow": false,
"3d": false,
"multiple": false,
"double-border": false,
"tooltip": "",
"link": "",
"icon": {
"Scheme": "https",
"Opaque": "",
"User": null,
"Host": "icons.terrastruct.com",
"Path": "/essentials/005-programmer.svg",
"RawPath": "/essentials%2F005-programmer.svg",
"OmitHost": false,
"ForceQuery": false,
"RawQuery": "",
"Fragment": "",
"RawFragment": ""
},
"iconPosition": "OUTSIDE_TOP_RIGHT",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "worker",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "N1",
"italic": false,
"bold": true,
"underline": false,
"labelWidth": 52,
"labelHeight": 21,
"labelPosition": "INSIDE_TOP_CENTER",
"zIndex": 0,
"level": 1
},
{
"id": "y",
"type": "rectangle",
"pos": {
"x": 205,
"y": 12
},
"width": 118,
"height": 118,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"borderRadius": 0,
"fill": "B6",
"stroke": "B1",
"shadow": false,
"3d": false,
"multiple": false,
"double-border": false,
"tooltip": "",
"link": "",
"icon": {
"Scheme": "https",
"Opaque": "",
"User": null,
"Host": "icons.terrastruct.com",
"Path": "/essentials/profits.svg",
"RawPath": "/essentials%2Fprofits.svg",
"OmitHost": false,
"ForceQuery": false,
"RawQuery": "",
"Fragment": "",
"RawFragment": ""
},
"iconPosition": "OUTSIDE_BOTTOM_CENTER",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "profits",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "N1",
"italic": false,
"bold": true,
"underline": false,
"labelWidth": 47,
"labelHeight": 21,
"labelPosition": "INSIDE_BOTTOM_RIGHT",
"zIndex": 0,
"level": 1
}
],
"connections": [
{
"id": "(x -> y)[0]",
"src": "x",
"srcArrow": "none",
"dst": "y",
"dstArrow": "triangle",
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
"stroke": "B1",
"borderRadius": 10,
"label": "",
"fontSize": 16,
"fontFamily": "DEFAULT",
"language": "",
"color": "N2",
"italic": true,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0,
"labelPosition": "",
"labelPercentage": 0,
"route": [
{
"x": 135,
"y": 71
},
{
"x": 205,
"y": 71
}
],
"animated": false,
"tooltip": "",
"icon": null,
"zIndex": 0
}
],
"root": {
"id": "",
"type": "",
"pos": {
"x": 0,
"y": 0
},
"width": 0,
"height": 0,
"opacity": 0,
"strokeDash": 0,
"strokeWidth": 0,
"borderRadius": 0,
"fill": "N7",
"stroke": "",
"shadow": false,
"3d": false,
"multiple": false,
"double-border": false,
"tooltip": "",
"link": "",
"icon": null,
"iconPosition": "",
"blend": false,
"fields": null,
"methods": null,
"columns": null,
"label": "",
"fontSize": 0,
"fontFamily": "",
"language": "",
"color": "",
"italic": false,
"bold": false,
"underline": false,
"labelWidth": 0,
"labelHeight": 0,
"zIndex": 0,
"level": 0
}
}

View file

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.0-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 313 246"><svg id="d2-svg" class="d2-452147168" width="313" height="246" viewBox="11 -52 313 246"><rect x="11.000000" y="-52.000000" width="313.000000" height="246.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
.d2-452147168 .text-bold {
font-family: "d2-452147168-font-bold";
}
@font-face {
font-family: d2-452147168-font-bold;
src: url("data:application/font-woff;base64,d09GRgABAAAAAAkEAAoAAAAADlQAAguFAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAAA9AAAAGAAAABgXxHXrmNtYXAAAAFUAAAAWQAAAGoBnQHiZ2x5ZgAAAbAAAAM9AAADxGbHMuVoZWFkAAAE8AAAADYAAAA2G38e1GhoZWEAAAUoAAAAJAAAACQKfwXMaG10eAAABUwAAAA0AAAANBaSAdZsb2NhAAAFgAAAABwAAAAcBkIHZm1heHAAAAWcAAAAIAAAACAAJQD3bmFtZQAABbwAAAMoAAAIKgjwVkFwb3N0AAAI5AAAAB0AAAAg/9EAMgADAioCvAAFAAACigJYAAAASwKKAlgAAAFeADIBKQAAAgsHAwMEAwICBGAAAvcAAAADAAAAAAAAAABBREJPACAAIP//Au7/BgAAA9gBESAAAZ8AAAAAAfAClAAAACAAA3icTMvBCgFRAEbh786M65I8oh0lC5LyIKLIu/5yV3N23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/VyqY3c+heaIqaqpZzt7X25DXPbveUW35Bqh0u1LjiVk1swet9UvXc0c60fj4CQlAtZDEiZ0qDgRrzPCbgixnGs7p1oSwpaK58yz41UEjEVgw6J4szI9Dcw3fjGfbChe2dvSSj/kunlqqr7ZHHq1e2M3qh7yzvfuhytTaBhU03X1DQQ18S0H2mn1vn78s31uqU85YiUmPBfL8AzPJrsc8AhY2UY6GZur0NTL0STlxyq+ksiWQ2l58giHODxnAMOeMnzd/q4ZOKMi1txWc/d4pgjuhx+UBUL+y5HvF59+/+sv4tpU7U4nq5OL+49xSd3UOsX2rPb97KniZWTmFu02604I2BacnG76zW5x3j/AAAA//8BAAD///S3T1F4nGJgZgCD/+cYjBiwAAAAAAD//wEAAP//LwECAwAAAA==");
}]]></style><style type="text/css"><![CDATA[.shape {
shape-rendering: geometricPrecision;
stroke-linejoin: round;
}
.connection {
stroke-linecap: round;
stroke-linejoin: round;
}
.blend {
mix-blend-mode: multiply;
opacity: 0.5;
}
.d2-452147168 .fill-N1{fill:#0A0F25;}
.d2-452147168 .fill-N2{fill:#676C7E;}
.d2-452147168 .fill-N3{fill:#9499AB;}
.d2-452147168 .fill-N4{fill:#CFD2DD;}
.d2-452147168 .fill-N5{fill:#DEE1EB;}
.d2-452147168 .fill-N6{fill:#EEF1F8;}
.d2-452147168 .fill-N7{fill:#FFFFFF;}
.d2-452147168 .fill-B1{fill:#0D32B2;}
.d2-452147168 .fill-B2{fill:#0D32B2;}
.d2-452147168 .fill-B3{fill:#E3E9FD;}
.d2-452147168 .fill-B4{fill:#E3E9FD;}
.d2-452147168 .fill-B5{fill:#EDF0FD;}
.d2-452147168 .fill-B6{fill:#F7F8FE;}
.d2-452147168 .fill-AA2{fill:#4A6FF3;}
.d2-452147168 .fill-AA4{fill:#EDF0FD;}
.d2-452147168 .fill-AA5{fill:#F7F8FE;}
.d2-452147168 .fill-AB4{fill:#EDF0FD;}
.d2-452147168 .fill-AB5{fill:#F7F8FE;}
.d2-452147168 .stroke-N1{stroke:#0A0F25;}
.d2-452147168 .stroke-N2{stroke:#676C7E;}
.d2-452147168 .stroke-N3{stroke:#9499AB;}
.d2-452147168 .stroke-N4{stroke:#CFD2DD;}
.d2-452147168 .stroke-N5{stroke:#DEE1EB;}
.d2-452147168 .stroke-N6{stroke:#EEF1F8;}
.d2-452147168 .stroke-N7{stroke:#FFFFFF;}
.d2-452147168 .stroke-B1{stroke:#0D32B2;}
.d2-452147168 .stroke-B2{stroke:#0D32B2;}
.d2-452147168 .stroke-B3{stroke:#E3E9FD;}
.d2-452147168 .stroke-B4{stroke:#E3E9FD;}
.d2-452147168 .stroke-B5{stroke:#EDF0FD;}
.d2-452147168 .stroke-B6{stroke:#F7F8FE;}
.d2-452147168 .stroke-AA2{stroke:#4A6FF3;}
.d2-452147168 .stroke-AA4{stroke:#EDF0FD;}
.d2-452147168 .stroke-AA5{stroke:#F7F8FE;}
.d2-452147168 .stroke-AB4{stroke:#EDF0FD;}
.d2-452147168 .stroke-AB5{stroke:#F7F8FE;}
.d2-452147168 .background-color-N1{background-color:#0A0F25;}
.d2-452147168 .background-color-N2{background-color:#676C7E;}
.d2-452147168 .background-color-N3{background-color:#9499AB;}
.d2-452147168 .background-color-N4{background-color:#CFD2DD;}
.d2-452147168 .background-color-N5{background-color:#DEE1EB;}
.d2-452147168 .background-color-N6{background-color:#EEF1F8;}
.d2-452147168 .background-color-N7{background-color:#FFFFFF;}
.d2-452147168 .background-color-B1{background-color:#0D32B2;}
.d2-452147168 .background-color-B2{background-color:#0D32B2;}
.d2-452147168 .background-color-B3{background-color:#E3E9FD;}
.d2-452147168 .background-color-B4{background-color:#E3E9FD;}
.d2-452147168 .background-color-B5{background-color:#EDF0FD;}
.d2-452147168 .background-color-B6{background-color:#F7F8FE;}
.d2-452147168 .background-color-AA2{background-color:#4A6FF3;}
.d2-452147168 .background-color-AA4{background-color:#EDF0FD;}
.d2-452147168 .background-color-AA5{background-color:#F7F8FE;}
.d2-452147168 .background-color-AB4{background-color:#EDF0FD;}
.d2-452147168 .background-color-AB5{background-color:#F7F8FE;}
.d2-452147168 .color-N1{color:#0A0F25;}
.d2-452147168 .color-N2{color:#676C7E;}
.d2-452147168 .color-N3{color:#9499AB;}
.d2-452147168 .color-N4{color:#CFD2DD;}
.d2-452147168 .color-N5{color:#DEE1EB;}
.d2-452147168 .color-N6{color:#EEF1F8;}
.d2-452147168 .color-N7{color:#FFFFFF;}
.d2-452147168 .color-B1{color:#0D32B2;}
.d2-452147168 .color-B2{color:#0D32B2;}
.d2-452147168 .color-B3{color:#E3E9FD;}
.d2-452147168 .color-B4{color:#E3E9FD;}
.d2-452147168 .color-B5{color:#EDF0FD;}
.d2-452147168 .color-B6{color:#F7F8FE;}
.d2-452147168 .color-AA2{color:#4A6FF3;}
.d2-452147168 .color-AA4{color:#EDF0FD;}
.d2-452147168 .color-AA5{color:#F7F8FE;}
.d2-452147168 .color-AB4{color:#EDF0FD;}
.d2-452147168 .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);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]></style><g id="x"><g class="shape" ><rect x="12.000000" y="12.000000" width="123.000000" height="118.000000" class=" stroke-B1 fill-B6" style="stroke-width:2;" /></g><image href="https://icons.terrastruct.com/essentials%2F005-programmer.svg" x="71.000000" y="-52.000000" width="59" height="59" /><text x="73.500000" y="33.000000" class="text-bold fill-N1" style="text-anchor:middle;font-size:16px">worker</text></g><g id="y"><g class="shape" ><rect x="205.000000" y="12.000000" width="118.000000" height="118.000000" class=" stroke-B1 fill-B6" style="stroke-width:2;" /></g><image href="https://icons.terrastruct.com/essentials%2Fprofits.svg" x="234.500000" y="135.000000" width="59" height="59" /><text x="294.500000" y="120.000000" class="text-bold fill-N1" style="text-anchor:middle;font-size:16px">profits</text></g><g id="(x -&gt; y)[0]"><marker id="mk-3488378134" markerWidth="10.000000" markerHeight="12.000000" refX="7.000000" refY="6.000000" viewBox="0.000000 0.000000 10.000000 12.000000" orient="auto" markerUnits="userSpaceOnUse"> <polygon points="0.000000,0.000000 10.000000,6.000000 0.000000,12.000000" class="connection fill-B1" stroke-width="2" /> </marker><path d="M 137.000000 71.000000 L 201.000000 71.000000" fill="none" class="connection stroke-B1" style="stroke-width:2;" marker-end="url(#mk-3488378134)" mask="url(#d2-452147168)" /></g><mask id="d2-452147168" maskUnits="userSpaceOnUse" x="11" y="-52" width="313" height="246">
<rect x="11" y="-52" width="313" height="246" fill="white"></rect>
<rect x="47.500000" y="17.000000" width="52" height="21" fill="rgba(0,0,0,0.75)"></rect>
<rect x="271.000000" y="104.000000" width="47" height="21" fill="rgba(0,0,0,0.75)"></rect>
</mask></svg></svg>

After

Width:  |  Height:  |  Size: 10 KiB