diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go
index 358a4799e..dcdc0f8e7 100644
--- a/e2etests/stable_test.go
+++ b/e2etests/stable_test.go
@@ -2761,6 +2761,7 @@ scenarios: {
loadFromFile(t, "multiple_offset"),
loadFromFile(t, "multiple_offset_left"),
loadFromFile(t, "multiple_box_selection"),
+ loadFromFile(t, "outside_bottom_labels"),
}
runa(t, tcs)
diff --git a/e2etests/testdata/files/outside_bottom_labels.d2 b/e2etests/testdata/files/outside_bottom_labels.d2
new file mode 100644
index 000000000..620a4d6f7
--- /dev/null
+++ b/e2etests/testdata/files/outside_bottom_labels.d2
@@ -0,0 +1,15 @@
+p1: Daphne Snickerdoodle {
+ shape: person
+}
+p2: Prudence McSnortle {
+ shape: person
+}
+p3: Polly Pizzazzle {
+ shape: person
+}
+p1 -> p3
+p2 -> p3
+p1 -> p3
+p2 -> p3
+p3 -> p2
+p3 -> p1
diff --git a/e2etests/testdata/stable/outside_bottom_labels/dagre/board.exp.json b/e2etests/testdata/stable/outside_bottom_labels/dagre/board.exp.json
new file mode 100644
index 000000000..5f01bab22
--- /dev/null
+++ b/e2etests/testdata/stable/outside_bottom_labels/dagre/board.exp.json
@@ -0,0 +1,454 @@
+{
+ "name": "",
+ "isFolderOnly": false,
+ "fontFamily": "SourceSansPro",
+ "shapes": [
+ {
+ "id": "p1",
+ "type": "person",
+ "pos": {
+ "x": 0,
+ "y": 0
+ },
+ "width": 174,
+ "height": 116,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 0,
+ "fill": "B3",
+ "stroke": "B1",
+ "shadow": false,
+ "3d": false,
+ "multiple": false,
+ "double-border": false,
+ "tooltip": "",
+ "link": "",
+ "icon": null,
+ "iconPosition": "",
+ "blend": false,
+ "fields": null,
+ "methods": null,
+ "columns": null,
+ "label": "Daphne Snickerdoodle",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 159,
+ "labelHeight": 21,
+ "labelPosition": "OUTSIDE_BOTTOM_CENTER",
+ "zIndex": 0,
+ "level": 1
+ },
+ {
+ "id": "p2",
+ "type": "person",
+ "pos": {
+ "x": 9,
+ "y": 447
+ },
+ "width": 157,
+ "height": 105,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 0,
+ "fill": "B3",
+ "stroke": "B1",
+ "shadow": false,
+ "3d": false,
+ "multiple": false,
+ "double-border": false,
+ "tooltip": "",
+ "link": "",
+ "icon": null,
+ "iconPosition": "",
+ "blend": false,
+ "fields": null,
+ "methods": null,
+ "columns": null,
+ "label": "Prudence McSnortle",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 142,
+ "labelHeight": 21,
+ "labelPosition": "OUTSIDE_BOTTOM_CENTER",
+ "zIndex": 0,
+ "level": 1
+ },
+ {
+ "id": "p3",
+ "type": "person",
+ "pos": {
+ "x": 28,
+ "y": 242
+ },
+ "width": 118,
+ "height": 79,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 0,
+ "fill": "B3",
+ "stroke": "B1",
+ "shadow": false,
+ "3d": false,
+ "multiple": false,
+ "double-border": false,
+ "tooltip": "",
+ "link": "",
+ "icon": null,
+ "iconPosition": "",
+ "blend": false,
+ "fields": null,
+ "methods": null,
+ "columns": null,
+ "label": "Polly Pizzazzle",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 103,
+ "labelHeight": 21,
+ "labelPosition": "OUTSIDE_BOTTOM_CENTER",
+ "zIndex": 0,
+ "level": 1
+ }
+ ],
+ "connections": [
+ {
+ "id": "(p1 -> p3)[0]",
+ "src": "p1",
+ "srcArrow": "none",
+ "dst": "p3",
+ "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": 80,
+ "y": 116
+ },
+ {
+ "x": 69.5999984741211,
+ "y": 176.8000030517578
+ },
+ {
+ "x": 69,
+ "y": 202.1999969482422
+ },
+ {
+ "x": 77,
+ "y": 243
+ }
+ ],
+ "isCurve": true,
+ "animated": false,
+ "tooltip": "",
+ "icon": null,
+ "zIndex": 0
+ },
+ {
+ "id": "(p2 -> p3)[0]",
+ "src": "p2",
+ "srcArrow": "none",
+ "dst": "p3",
+ "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": 87,
+ "y": 447
+ },
+ {
+ "x": 87,
+ "y": 407
+ },
+ {
+ "x": 87,
+ "y": 381.79998779296875
+ },
+ {
+ "x": 87,
+ "y": 321
+ }
+ ],
+ "isCurve": true,
+ "animated": false,
+ "tooltip": "",
+ "icon": null,
+ "zIndex": 0
+ },
+ {
+ "id": "(p1 -> p3)[1]",
+ "src": "p1",
+ "srcArrow": "none",
+ "dst": "p3",
+ "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": 87,
+ "y": 116
+ },
+ {
+ "x": 87,
+ "y": 176.8000030517578
+ },
+ {
+ "x": 87,
+ "y": 202
+ },
+ {
+ "x": 87,
+ "y": 242
+ }
+ ],
+ "isCurve": true,
+ "animated": false,
+ "tooltip": "",
+ "icon": null,
+ "zIndex": 0
+ },
+ {
+ "id": "(p2 -> p3)[1]",
+ "src": "p2",
+ "srcArrow": "none",
+ "dst": "p3",
+ "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": 98,
+ "y": 448
+ },
+ {
+ "x": 105.19999694824219,
+ "y": 407.20001220703125
+ },
+ {
+ "x": 104,
+ "y": 381.79998779296875
+ },
+ {
+ "x": 92,
+ "y": 321
+ }
+ ],
+ "isCurve": true,
+ "animated": false,
+ "tooltip": "",
+ "icon": null,
+ "zIndex": 0
+ },
+ {
+ "id": "(p3 -> p2)[0]",
+ "src": "p3",
+ "srcArrow": "none",
+ "dst": "p2",
+ "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": 82,
+ "y": 321
+ },
+ {
+ "x": 70,
+ "y": 381.79998779296875
+ },
+ {
+ "x": 68.80000305175781,
+ "y": 407.20001220703125
+ },
+ {
+ "x": 76,
+ "y": 448
+ }
+ ],
+ "isCurve": true,
+ "animated": false,
+ "tooltip": "",
+ "icon": null,
+ "zIndex": 0
+ },
+ {
+ "id": "(p3 -> p1)[0]",
+ "src": "p3",
+ "srcArrow": "none",
+ "dst": "p1",
+ "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": 97,
+ "y": 243
+ },
+ {
+ "x": 105,
+ "y": 202.1999969482422
+ },
+ {
+ "x": 104.4000015258789,
+ "y": 176.8000030517578
+ },
+ {
+ "x": 94,
+ "y": 116
+ }
+ ],
+ "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
+ }
+}
diff --git a/e2etests/testdata/stable/outside_bottom_labels/dagre/sketch.exp.svg b/e2etests/testdata/stable/outside_bottom_labels/dagre/sketch.exp.svg
new file mode 100644
index 000000000..fdd5e27f2
--- /dev/null
+++ b/e2etests/testdata/stable/outside_bottom_labels/dagre/sketch.exp.svg
@@ -0,0 +1,95 @@
+
\ No newline at end of file
diff --git a/e2etests/testdata/stable/outside_bottom_labels/elk/board.exp.json b/e2etests/testdata/stable/outside_bottom_labels/elk/board.exp.json
new file mode 100644
index 000000000..ed078a0cf
--- /dev/null
+++ b/e2etests/testdata/stable/outside_bottom_labels/elk/board.exp.json
@@ -0,0 +1,448 @@
+{
+ "name": "",
+ "isFolderOnly": false,
+ "fontFamily": "SourceSansPro",
+ "shapes": [
+ {
+ "id": "p1",
+ "type": "person",
+ "pos": {
+ "x": 12,
+ "y": 12
+ },
+ "width": 174,
+ "height": 116,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 0,
+ "fill": "B3",
+ "stroke": "B1",
+ "shadow": false,
+ "3d": false,
+ "multiple": false,
+ "double-border": false,
+ "tooltip": "",
+ "link": "",
+ "icon": null,
+ "iconPosition": "",
+ "blend": false,
+ "fields": null,
+ "methods": null,
+ "columns": null,
+ "label": "Daphne Snickerdoodle",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 159,
+ "labelHeight": 21,
+ "labelPosition": "OUTSIDE_BOTTOM_CENTER",
+ "zIndex": 0,
+ "level": 1
+ },
+ {
+ "id": "p2",
+ "type": "person",
+ "pos": {
+ "x": 206,
+ "y": 23
+ },
+ "width": 157,
+ "height": 105,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 0,
+ "fill": "B3",
+ "stroke": "B1",
+ "shadow": false,
+ "3d": false,
+ "multiple": false,
+ "double-border": false,
+ "tooltip": "",
+ "link": "",
+ "icon": null,
+ "iconPosition": "",
+ "blend": false,
+ "fields": null,
+ "methods": null,
+ "columns": null,
+ "label": "Prudence McSnortle",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 142,
+ "labelHeight": 21,
+ "labelPosition": "OUTSIDE_BOTTOM_CENTER",
+ "zIndex": 0,
+ "level": 1
+ },
+ {
+ "id": "p3",
+ "type": "person",
+ "pos": {
+ "x": 113,
+ "y": 334
+ },
+ "width": 160,
+ "height": 79,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 0,
+ "fill": "B3",
+ "stroke": "B1",
+ "shadow": false,
+ "3d": false,
+ "multiple": false,
+ "double-border": false,
+ "tooltip": "",
+ "link": "",
+ "icon": null,
+ "iconPosition": "",
+ "blend": false,
+ "fields": null,
+ "methods": null,
+ "columns": null,
+ "label": "Polly Pizzazzle",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 103,
+ "labelHeight": 21,
+ "labelPosition": "OUTSIDE_BOTTOM_CENTER",
+ "zIndex": 0,
+ "level": 1
+ }
+ ],
+ "connections": [
+ {
+ "id": "(p1 -> p3)[0]",
+ "src": "p1",
+ "srcArrow": "none",
+ "dst": "p3",
+ "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": 55,
+ "y": 128
+ },
+ {
+ "x": 55.5,
+ "y": 294
+ },
+ {
+ "x": 136.73199462890625,
+ "y": 294
+ },
+ {
+ "x": 137,
+ "y": 354
+ }
+ ],
+ "animated": false,
+ "tooltip": "",
+ "icon": null,
+ "zIndex": 0
+ },
+ {
+ "id": "(p2 -> p3)[0]",
+ "src": "p2",
+ "srcArrow": "none",
+ "dst": "p3",
+ "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": 245,
+ "y": 128
+ },
+ {
+ "x": 245.25,
+ "y": 194
+ },
+ {
+ "x": 205.30299377441406,
+ "y": 194
+ },
+ {
+ "x": 205,
+ "y": 334
+ }
+ ],
+ "animated": false,
+ "tooltip": "",
+ "icon": null,
+ "zIndex": 0
+ },
+ {
+ "id": "(p1 -> p3)[1]",
+ "src": "p1",
+ "srcArrow": "none",
+ "dst": "p3",
+ "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": 99,
+ "y": 128
+ },
+ {
+ "x": 99,
+ "y": 244
+ },
+ {
+ "x": 159.58900451660156,
+ "y": 244
+ },
+ {
+ "x": 160,
+ "y": 339
+ }
+ ],
+ "animated": false,
+ "tooltip": "",
+ "icon": null,
+ "zIndex": 0
+ },
+ {
+ "id": "(p2 -> p3)[1]",
+ "src": "p2",
+ "srcArrow": "none",
+ "dst": "p3",
+ "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": 284,
+ "y": 128
+ },
+ {
+ "x": 284.5,
+ "y": 244
+ },
+ {
+ "x": 228.16000366210938,
+ "y": 244
+ },
+ {
+ "x": 228,
+ "y": 339
+ }
+ ],
+ "animated": false,
+ "tooltip": "",
+ "icon": null,
+ "zIndex": 0
+ },
+ {
+ "id": "(p3 -> p2)[0]",
+ "src": "p3",
+ "srcArrow": "none",
+ "dst": "p2",
+ "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": 251,
+ "y": 353
+ },
+ {
+ "x": 251.01699829101562,
+ "y": 294
+ },
+ {
+ "x": 323.75,
+ "y": 294
+ },
+ {
+ "x": 324,
+ "y": 128
+ }
+ ],
+ "animated": false,
+ "tooltip": "",
+ "icon": null,
+ "zIndex": 0
+ },
+ {
+ "id": "(p3 -> p1)[0]",
+ "src": "p3",
+ "srcArrow": "none",
+ "dst": "p1",
+ "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": 182,
+ "y": 335
+ },
+ {
+ "x": 182.4459991455078,
+ "y": 194
+ },
+ {
+ "x": 142.5,
+ "y": 194
+ },
+ {
+ "x": 142,
+ "y": 128
+ }
+ ],
+ "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
+ }
+}
diff --git a/e2etests/testdata/stable/outside_bottom_labels/elk/sketch.exp.svg b/e2etests/testdata/stable/outside_bottom_labels/elk/sketch.exp.svg
new file mode 100644
index 000000000..3833ea5eb
--- /dev/null
+++ b/e2etests/testdata/stable/outside_bottom_labels/elk/sketch.exp.svg
@@ -0,0 +1,95 @@
+Daphne SnickerdoodlePrudence McSnortlePolly Pizzazzle
+
+
+
\ No newline at end of file