diff --git a/d2layouts/d2sequence/sequence_diagram.go b/d2layouts/d2sequence/sequence_diagram.go
index 0876d8568..a6a704cc2 100644
--- a/d2layouts/d2sequence/sequence_diagram.go
+++ b/d2layouts/d2sequence/sequence_diagram.go
@@ -101,7 +101,9 @@ func newSequenceDiagram(objects []*d2graph.Object, messages []*d2graph.Edge) *se
sd.objectRank[actor] = rank
if actor.Width < MIN_ACTOR_WIDTH {
+ aspectRatio := actor.Height / actor.Width
actor.Width = MIN_ACTOR_WIDTH
+ actor.Height = math.Round(aspectRatio * actor.Width)
}
sd.maxActorHeight = math.Max(sd.maxActorHeight, actor.Height)
diff --git a/e2etests/testdata/stable/sequence_diagram_all_shapes/dagre/board.exp.json b/e2etests/testdata/stable/sequence_diagram_all_shapes/dagre/board.exp.json
index 73b2fad99..f06d31ed2 100644
--- a/e2etests/testdata/stable/sequence_diagram_all_shapes/dagre/board.exp.json
+++ b/e2etests/testdata/stable/sequence_diagram_all_shapes/dagre/board.exp.json
@@ -45,10 +45,10 @@
"type": "oval",
"pos": {
"x": 223,
- "y": 87
+ "y": 84
},
"width": 150,
- "height": 147,
+ "height": 150,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -212,10 +212,10 @@
"type": "cylinder",
"pos": {
"x": 1269,
- "y": 108
+ "y": 84
},
"width": 150,
- "height": 126,
+ "height": 150,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -251,10 +251,10 @@
"type": "diamond",
"pos": {
"x": 1489,
- "y": 108
+ "y": 85
},
"width": 150,
- "height": 126,
+ "height": 149,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -290,10 +290,10 @@
"type": "document",
"pos": {
"x": 1709,
- "y": 108
+ "y": 97
},
"width": 150,
- "height": 126,
+ "height": 137,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -368,10 +368,10 @@
"type": "image",
"pos": {
"x": 2181,
- "y": 85
+ "y": 63
},
"width": 150,
- "height": 128,
+ "height": 150,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -418,10 +418,10 @@
"type": "oval",
"pos": {
"x": 2401,
- "y": 108
+ "y": 97
},
"width": 150,
- "height": 126,
+ "height": 137,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -457,10 +457,10 @@
"type": "package",
"pos": {
"x": 2621,
- "y": 108
+ "y": 98
},
"width": 150,
- "height": 126,
+ "height": 136,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -730,10 +730,10 @@
"type": "stored_data",
"pos": {
"x": 4312,
- "y": 108
+ "y": 96
},
"width": 150,
- "height": 126,
+ "height": 138,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
diff --git a/e2etests/testdata/stable/sequence_diagram_all_shapes/dagre/sketch.exp.svg b/e2etests/testdata/stable/sequence_diagram_all_shapes/dagre/sketch.exp.svg
index 7e13b2b3a..8cf3cf52b 100644
--- a/e2etests/testdata/stable/sequence_diagram_all_shapes/dagre/sketch.exp.svg
+++ b/e2etests/testdata/stable/sequence_diagram_all_shapes/dagre/sketch.exp.svg
@@ -14,13 +14,13 @@ width="4942" height="2984" viewBox="-100 -50 4942 2984">a labelblabelsa class+
+a labelblabelsa class+
public() bool
void-
private() int
voidcloudyyyya := 5
b := a + 7
-fmt.Printf("%d", b)cyldiadocssix cornersa random iconoverpackdocs pagetoohard o saysinglepersona queuea squarea step at a timedatausersid
+fmt.Printf("%d", b)cyldiadocssix cornersa random iconoverpackdocs pagetoohard o saysinglepersona queuea squarea step at a timedatausersid
int
name
varchar
diff --git a/e2etests/testdata/stable/sequence_diagram_all_shapes/elk/board.exp.json b/e2etests/testdata/stable/sequence_diagram_all_shapes/elk/board.exp.json
index 73b2fad99..f06d31ed2 100644
--- a/e2etests/testdata/stable/sequence_diagram_all_shapes/elk/board.exp.json
+++ b/e2etests/testdata/stable/sequence_diagram_all_shapes/elk/board.exp.json
@@ -45,10 +45,10 @@
"type": "oval",
"pos": {
"x": 223,
- "y": 87
+ "y": 84
},
"width": 150,
- "height": 147,
+ "height": 150,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -212,10 +212,10 @@
"type": "cylinder",
"pos": {
"x": 1269,
- "y": 108
+ "y": 84
},
"width": 150,
- "height": 126,
+ "height": 150,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -251,10 +251,10 @@
"type": "diamond",
"pos": {
"x": 1489,
- "y": 108
+ "y": 85
},
"width": 150,
- "height": 126,
+ "height": 149,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -290,10 +290,10 @@
"type": "document",
"pos": {
"x": 1709,
- "y": 108
+ "y": 97
},
"width": 150,
- "height": 126,
+ "height": 137,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -368,10 +368,10 @@
"type": "image",
"pos": {
"x": 2181,
- "y": 85
+ "y": 63
},
"width": 150,
- "height": 128,
+ "height": 150,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -418,10 +418,10 @@
"type": "oval",
"pos": {
"x": 2401,
- "y": 108
+ "y": 97
},
"width": 150,
- "height": 126,
+ "height": 137,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -457,10 +457,10 @@
"type": "package",
"pos": {
"x": 2621,
- "y": 108
+ "y": 98
},
"width": 150,
- "height": 126,
+ "height": 136,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -730,10 +730,10 @@
"type": "stored_data",
"pos": {
"x": 4312,
- "y": 108
+ "y": 96
},
"width": 150,
- "height": 126,
+ "height": 138,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
diff --git a/e2etests/testdata/stable/sequence_diagram_all_shapes/elk/sketch.exp.svg b/e2etests/testdata/stable/sequence_diagram_all_shapes/elk/sketch.exp.svg
index 7e13b2b3a..8cf3cf52b 100644
--- a/e2etests/testdata/stable/sequence_diagram_all_shapes/elk/sketch.exp.svg
+++ b/e2etests/testdata/stable/sequence_diagram_all_shapes/elk/sketch.exp.svg
@@ -14,13 +14,13 @@ width="4942" height="2984" viewBox="-100 -50 4942 2984">a labelblabelsa class+
+a labelblabelsa class+
public() bool
void-
private() int
voidcloudyyyya := 5
b := a + 7
-fmt.Printf("%d", b)cyldiadocssix cornersa random iconoverpackdocs pagetoohard o saysinglepersona queuea squarea step at a timedatausersid
+fmt.Printf("%d", b)cyldiadocssix cornersa random iconoverpackdocs pagetoohard o saysinglepersona queuea squarea step at a timedatausersid
int
name
varchar
diff --git a/e2etests/testdata/stable/sequence_diagram_groups/dagre/board.exp.json b/e2etests/testdata/stable/sequence_diagram_groups/dagre/board.exp.json
index 251a8aed9..9a6740045 100644
--- a/e2etests/testdata/stable/sequence_diagram_groups/dagre/board.exp.json
+++ b/e2etests/testdata/stable/sequence_diagram_groups/dagre/board.exp.json
@@ -6,10 +6,10 @@
"type": "",
"pos": {
"x": 0,
- "y": 50
+ "y": 52
},
"width": 150,
- "height": 126,
+ "height": 167,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -45,10 +45,10 @@
"type": "",
"pos": {
"x": 220,
- "y": 50
+ "y": 52
},
"width": 150,
- "height": 126,
+ "height": 167,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -87,7 +87,7 @@
"y": 50
},
"width": 150,
- "height": 126,
+ "height": 169,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -123,10 +123,10 @@
"type": "",
"pos": {
"x": 660,
- "y": 50
+ "y": 52
},
"width": 150,
- "height": 126,
+ "height": 167,
"opacity": 1,
"strokeDash": 0,
"strokeWidth": 2,
@@ -162,7 +162,7 @@
"type": "",
"pos": {
"x": 25,
- "y": 396
+ "y": 439
},
"width": 320,
"height": 80,
@@ -200,7 +200,7 @@
"type": "",
"pos": {
"x": 245,
- "y": 526
+ "y": 569
},
"width": 320,
"height": 730,
@@ -238,7 +238,7 @@
"type": "",
"pos": {
"x": 245,
- "y": 786
+ "y": 829
},
"width": 320,
"height": 80,
@@ -276,7 +276,7 @@
"type": "",
"pos": {
"x": 245,
- "y": 1306
+ "y": 1349
},
"width": 453,
"height": 466,
@@ -314,7 +314,7 @@
"type": "rectangle",
"pos": {
"x": 382,
- "y": 1476
+ "y": 1519
},
"width": 266,
"height": 126,
@@ -353,7 +353,7 @@
"type": "",
"pos": {
"x": 601,
- "y": 1822
+ "y": 1865
},
"width": 268,
"height": 206,
@@ -391,7 +391,7 @@
"type": "rectangle",
"pos": {
"x": 651,
- "y": 1862
+ "y": 1905
},
"width": 168,
"height": 126,
@@ -430,7 +430,7 @@
"type": "rectangle",
"pos": {
"x": 289,
- "y": 940
+ "y": 983
},
"width": 12,
"height": 292,
@@ -468,7 +468,7 @@
"type": "rectangle",
"pos": {
"x": 509,
- "y": 940
+ "y": 983
},
"width": 12,
"height": 292,
@@ -506,7 +506,7 @@
"type": "rectangle",
"pos": {
"x": 285,
- "y": 1070
+ "y": 1113
},
"width": 20,
"height": 80,
@@ -568,11 +568,11 @@
"route": [
{
"x": 75,
- "y": 306
+ "y": 349
},
{
"x": 295,
- "y": 306
+ "y": 349
}
],
"animated": false,
@@ -607,11 +607,11 @@
"route": [
{
"x": 75,
- "y": 436
+ "y": 479
},
{
"x": 295,
- "y": 436
+ "y": 479
}
],
"animated": false,
@@ -646,11 +646,11 @@
"route": [
{
"x": 295,
- "y": 566
+ "y": 609
},
{
"x": 515,
- "y": 566
+ "y": 609
}
],
"animated": false,
@@ -685,11 +685,11 @@
"route": [
{
"x": 515,
- "y": 696
+ "y": 739
},
{
"x": 295,
- "y": 696
+ "y": 739
}
],
"animated": false,
@@ -724,11 +724,11 @@
"route": [
{
"x": 515,
- "y": 826
+ "y": 869
},
{
"x": 295,
- "y": 826
+ "y": 869
}
],
"animated": false,
@@ -763,11 +763,11 @@
"route": [
{
"x": 301,
- "y": 956
+ "y": 999
},
{
"x": 509,
- "y": 956
+ "y": 999
}
],
"animated": false,
@@ -802,11 +802,11 @@
"route": [
{
"x": 305,
- "y": 1086
+ "y": 1129
},
{
"x": 509,
- "y": 1086
+ "y": 1129
}
],
"animated": false,
@@ -841,11 +841,11 @@
"route": [
{
"x": 509,
- "y": 1216
+ "y": 1259
},
{
"x": 301,
- "y": 1216
+ "y": 1259
}
],
"animated": false,
@@ -880,11 +880,11 @@
"route": [
{
"x": 295,
- "y": 1346
+ "y": 1389
},
{
"x": 515,
- "y": 1346
+ "y": 1389
}
],
"animated": false,
@@ -919,11 +919,11 @@
"route": [
{
"x": 515,
- "y": 1732
+ "y": 1775
},
{
"x": 295,
- "y": 1732
+ "y": 1775
}
],
"animated": false,
@@ -958,11 +958,11 @@
"route": [
{
"x": 75,
- "y": 176
+ "y": 219
},
{
"x": 75,
- "y": 2118
+ "y": 2161
}
],
"animated": false,
@@ -997,11 +997,11 @@
"route": [
{
"x": 295,
- "y": 176
+ "y": 219
},
{
"x": 295,
- "y": 2118
+ "y": 2161
}
],
"animated": false,
@@ -1036,11 +1036,11 @@
"route": [
{
"x": 515,
- "y": 176
+ "y": 219
},
{
"x": 515,
- "y": 2118
+ "y": 2161
}
],
"animated": false,
@@ -1075,11 +1075,11 @@
"route": [
{
"x": 735,
- "y": 176
+ "y": 219
},
{
"x": 735,
- "y": 2118
+ "y": 2161
}
],
"animated": false,
diff --git a/e2etests/testdata/stable/sequence_diagram_groups/dagre/sketch.exp.svg b/e2etests/testdata/stable/sequence_diagram_groups/dagre/sketch.exp.svg
index 507bae4f8..b569a7a6e 100644
--- a/e2etests/testdata/stable/sequence_diagram_groups/dagre/sketch.exp.svg
+++ b/e2etests/testdata/stable/sequence_diagram_groups/dagre/sketch.exp.svg
@@ -2,7 +2,7 @@