diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go
index 80cd086c2..d843aaf25 100644
--- a/e2etests/stable_test.go
+++ b/e2etests/stable_test.go
@@ -30,6 +30,13 @@ func testStable(t *testing.T) {
a -> b
c -> d
}
+
+ a: {
+ near: top-center
+ b: {
+ c
+ }
+ }
`,
},
{
diff --git a/e2etests/testdata/stable/near_keys_for_container/dagre/board.exp.json b/e2etests/testdata/stable/near_keys_for_container/dagre/board.exp.json
index a2fe1b328..b8cdf7a2e 100644
--- a/e2etests/testdata/stable/near_keys_for_container/dagre/board.exp.json
+++ b/e2etests/testdata/stable/near_keys_for_container/dagre/board.exp.json
@@ -208,12 +208,135 @@
"zIndex": 0,
"level": 2
},
+ {
+ "id": "a",
+ "type": "rectangle",
+ "pos": {
+ "x": -86,
+ "y": -245
+ },
+ "width": 173,
+ "height": 225,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 0,
+ "fill": "B4",
+ "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": "a",
+ "fontSize": 28,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": false,
+ "underline": false,
+ "labelWidth": 12,
+ "labelHeight": 36,
+ "labelPosition": "OUTSIDE_TOP_CENTER",
+ "zIndex": 0,
+ "level": 1
+ },
+ {
+ "id": "a.b",
+ "type": "rectangle",
+ "pos": {
+ "x": -66,
+ "y": -179
+ },
+ "width": 133,
+ "height": 130,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 0,
+ "fill": "B5",
+ "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": "b",
+ "fontSize": 24,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": false,
+ "underline": false,
+ "labelWidth": 12,
+ "labelHeight": 31,
+ "labelPosition": "OUTSIDE_TOP_CENTER",
+ "zIndex": 0,
+ "level": 2
+ },
+ {
+ "id": "a.b.c",
+ "type": "rectangle",
+ "pos": {
+ "x": -26,
+ "y": -147
+ },
+ "width": 53,
+ "height": 66,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 0,
+ "fill": "B6",
+ "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": "c",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 8,
+ "labelHeight": 21,
+ "labelPosition": "INSIDE_MIDDLE_CENTER",
+ "zIndex": 0,
+ "level": 3
+ },
{
"id": "x",
"type": "rectangle",
"pos": {
"x": -390,
- "y": -261
+ "y": -526
},
"width": 247,
"height": 291,
@@ -254,7 +377,7 @@
"type": "rectangle",
"pos": {
"x": -350,
- "y": -232
+ "y": -497
},
"width": 53,
"height": 66,
@@ -295,7 +418,7 @@
"type": "rectangle",
"pos": {
"x": -350,
- "y": -66
+ "y": -331
},
"width": 53,
"height": 66,
@@ -336,7 +459,7 @@
"type": "rectangle",
"pos": {
"x": -236,
- "y": -232
+ "y": -497
},
"width": 53,
"height": 66,
@@ -377,7 +500,7 @@
"type": "rectangle",
"pos": {
"x": -237,
- "y": -66
+ "y": -331
},
"width": 54,
"height": 66,
@@ -418,7 +541,7 @@
"type": "rectangle",
"pos": {
"x": 143,
- "y": -261
+ "y": -526
},
"width": 247,
"height": 291,
@@ -459,7 +582,7 @@
"type": "rectangle",
"pos": {
"x": 183,
- "y": -232
+ "y": -497
},
"width": 53,
"height": 66,
@@ -500,7 +623,7 @@
"type": "rectangle",
"pos": {
"x": 183,
- "y": -66
+ "y": -331
},
"width": 53,
"height": 66,
@@ -541,7 +664,7 @@
"type": "rectangle",
"pos": {
"x": 297,
- "y": -232
+ "y": -497
},
"width": 53,
"height": 66,
@@ -582,7 +705,7 @@
"type": "rectangle",
"pos": {
"x": 296,
- "y": -66
+ "y": -331
},
"width": 54,
"height": 66,
@@ -746,19 +869,19 @@
"route": [
{
"x": -324,
- "y": -166
+ "y": -431
},
{
"x": -324,
- "y": -126
+ "y": -391
},
{
"x": -324,
- "y": -106
+ "y": -371
},
{
"x": -324,
- "y": -66
+ "y": -331
}
],
"isCurve": true,
@@ -795,19 +918,19 @@
"route": [
{
"x": -210.5,
- "y": -166
+ "y": -431
},
{
"x": -210.5,
- "y": -126
+ "y": -391
},
{
"x": -210.5,
- "y": -106
+ "y": -371
},
{
"x": -210.5,
- "y": -66
+ "y": -331
}
],
"isCurve": true,
@@ -844,19 +967,19 @@
"route": [
{
"x": 210,
- "y": -166
+ "y": -431
},
{
"x": 210,
- "y": -126
+ "y": -391
},
{
"x": 210,
- "y": -106
+ "y": -371
},
{
"x": 210,
- "y": -66
+ "y": -331
}
],
"isCurve": true,
@@ -893,19 +1016,19 @@
"route": [
{
"x": 323.5,
- "y": -166
+ "y": -431
},
{
"x": 323.5,
- "y": -126
+ "y": -391
},
{
"x": 323.5,
- "y": -106
+ "y": -371
},
{
"x": 323.5,
- "y": -66
+ "y": -331
}
],
"isCurve": true,
diff --git a/e2etests/testdata/stable/near_keys_for_container/dagre/sketch.exp.svg b/e2etests/testdata/stable/near_keys_for_container/dagre/sketch.exp.svg
index 7d789cef0..d45f9472d 100644
--- a/e2etests/testdata/stable/near_keys_for_container/dagre/sketch.exp.svg
+++ b/e2etests/testdata/stable/near_keys_for_container/dagre/sketch.exp.svg
@@ -1,16 +1,16 @@
-
\ No newline at end of file
diff --git a/e2etests/testdata/stable/near_keys_for_container/elk/board.exp.json b/e2etests/testdata/stable/near_keys_for_container/elk/board.exp.json
index 3d4d70132..cd6e34370 100644
--- a/e2etests/testdata/stable/near_keys_for_container/elk/board.exp.json
+++ b/e2etests/testdata/stable/near_keys_for_container/elk/board.exp.json
@@ -208,12 +208,135 @@
"zIndex": 0,
"level": 2
},
+ {
+ "id": "a",
+ "type": "rectangle",
+ "pos": {
+ "x": -126,
+ "y": -286
+ },
+ "width": 253,
+ "height": 266,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 0,
+ "fill": "B4",
+ "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": "a",
+ "fontSize": 28,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": false,
+ "underline": false,
+ "labelWidth": 12,
+ "labelHeight": 36,
+ "labelPosition": "INSIDE_TOP_CENTER",
+ "zIndex": 0,
+ "level": 1
+ },
+ {
+ "id": "a.b",
+ "type": "rectangle",
+ "pos": {
+ "x": -76,
+ "y": -236
+ },
+ "width": 153,
+ "height": 166,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 0,
+ "fill": "B5",
+ "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": "b",
+ "fontSize": 24,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": false,
+ "underline": false,
+ "labelWidth": 12,
+ "labelHeight": 31,
+ "labelPosition": "INSIDE_TOP_CENTER",
+ "zIndex": 0,
+ "level": 2
+ },
+ {
+ "id": "a.b.c",
+ "type": "rectangle",
+ "pos": {
+ "x": -26,
+ "y": -186
+ },
+ "width": 53,
+ "height": 66,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 0,
+ "fill": "B6",
+ "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": "c",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 8,
+ "labelHeight": 21,
+ "labelPosition": "INSIDE_MIDDLE_CENTER",
+ "zIndex": 0,
+ "level": 3
+ },
{
"id": "x",
"type": "rectangle",
"pos": {
- "x": -360,
- "y": -252
+ "x": -373,
+ "y": -558
},
"width": 227,
"height": 302,
@@ -253,8 +376,8 @@
"id": "x.a",
"type": "rectangle",
"pos": {
- "x": -310,
- "y": -202
+ "x": -323,
+ "y": -508
},
"width": 53,
"height": 66,
@@ -294,8 +417,8 @@
"id": "x.b",
"type": "rectangle",
"pos": {
- "x": -310,
- "y": -66
+ "x": -323,
+ "y": -372
},
"width": 53,
"height": 66,
@@ -335,8 +458,8 @@
"id": "x.c",
"type": "rectangle",
"pos": {
- "x": -237,
- "y": -202
+ "x": -250,
+ "y": -508
},
"width": 53,
"height": 66,
@@ -376,8 +499,8 @@
"id": "x.d",
"type": "rectangle",
"pos": {
- "x": -237,
- "y": -66
+ "x": -250,
+ "y": -372
},
"width": 54,
"height": 66,
@@ -417,8 +540,8 @@
"id": "y",
"type": "rectangle",
"pos": {
- "x": 133,
- "y": -252
+ "x": 146,
+ "y": -558
},
"width": 227,
"height": 302,
@@ -458,8 +581,8 @@
"id": "y.a",
"type": "rectangle",
"pos": {
- "x": 183,
- "y": -202
+ "x": 196,
+ "y": -508
},
"width": 53,
"height": 66,
@@ -499,8 +622,8 @@
"id": "y.b",
"type": "rectangle",
"pos": {
- "x": 183,
- "y": -66
+ "x": 196,
+ "y": -372
},
"width": 53,
"height": 66,
@@ -540,8 +663,8 @@
"id": "y.c",
"type": "rectangle",
"pos": {
- "x": 257,
- "y": -202
+ "x": 270,
+ "y": -508
},
"width": 53,
"height": 66,
@@ -581,8 +704,8 @@
"id": "y.d",
"type": "rectangle",
"pos": {
- "x": 256,
- "y": -66
+ "x": 269,
+ "y": -372
},
"width": 54,
"height": 66,
@@ -727,12 +850,12 @@
"labelPercentage": 0,
"route": [
{
- "x": -284,
- "y": -136
+ "x": -297,
+ "y": -442
},
{
- "x": -284,
- "y": -66
+ "x": -297,
+ "y": -372
}
],
"animated": false,
@@ -767,12 +890,12 @@
"labelPercentage": 0,
"route": [
{
- "x": -210.5,
- "y": -136
+ "x": -223.5,
+ "y": -442
},
{
- "x": -210.5,
- "y": -66
+ "x": -223.5,
+ "y": -372
}
],
"animated": false,
@@ -807,12 +930,12 @@
"labelPercentage": 0,
"route": [
{
- "x": 210,
- "y": -136
+ "x": 223,
+ "y": -442
},
{
- "x": 210,
- "y": -66
+ "x": 223,
+ "y": -372
}
],
"animated": false,
@@ -847,12 +970,12 @@
"labelPercentage": 0,
"route": [
{
- "x": 283.5,
- "y": -136
+ "x": 296.5,
+ "y": -442
},
{
- "x": 283.5,
- "y": -66
+ "x": 296.5,
+ "y": -372
}
],
"animated": false,
diff --git a/e2etests/testdata/stable/near_keys_for_container/elk/sketch.exp.svg b/e2etests/testdata/stable/near_keys_for_container/elk/sketch.exp.svg
index bc3c2fa80..697c8220e 100644
--- a/e2etests/testdata/stable/near_keys_for_container/elk/sketch.exp.svg
+++ b/e2etests/testdata/stable/near_keys_for_container/elk/sketch.exp.svg
@@ -1,16 +1,16 @@
-zxyabcdabcdabcd
-
+ .d2-857458616 .fill-N1{fill:#0A0F25;}
+ .d2-857458616 .fill-N2{fill:#676C7E;}
+ .d2-857458616 .fill-N3{fill:#9499AB;}
+ .d2-857458616 .fill-N4{fill:#CFD2DD;}
+ .d2-857458616 .fill-N5{fill:#DEE1EB;}
+ .d2-857458616 .fill-N6{fill:#EEF1F8;}
+ .d2-857458616 .fill-N7{fill:#FFFFFF;}
+ .d2-857458616 .fill-B1{fill:#0D32B2;}
+ .d2-857458616 .fill-B2{fill:#0D32B2;}
+ .d2-857458616 .fill-B3{fill:#E3E9FD;}
+ .d2-857458616 .fill-B4{fill:#E3E9FD;}
+ .d2-857458616 .fill-B5{fill:#EDF0FD;}
+ .d2-857458616 .fill-B6{fill:#F7F8FE;}
+ .d2-857458616 .fill-AA2{fill:#4A6FF3;}
+ .d2-857458616 .fill-AA4{fill:#EDF0FD;}
+ .d2-857458616 .fill-AA5{fill:#F7F8FE;}
+ .d2-857458616 .fill-AB4{fill:#EDF0FD;}
+ .d2-857458616 .fill-AB5{fill:#F7F8FE;}
+ .d2-857458616 .stroke-N1{stroke:#0A0F25;}
+ .d2-857458616 .stroke-N2{stroke:#676C7E;}
+ .d2-857458616 .stroke-N3{stroke:#9499AB;}
+ .d2-857458616 .stroke-N4{stroke:#CFD2DD;}
+ .d2-857458616 .stroke-N5{stroke:#DEE1EB;}
+ .d2-857458616 .stroke-N6{stroke:#EEF1F8;}
+ .d2-857458616 .stroke-N7{stroke:#FFFFFF;}
+ .d2-857458616 .stroke-B1{stroke:#0D32B2;}
+ .d2-857458616 .stroke-B2{stroke:#0D32B2;}
+ .d2-857458616 .stroke-B3{stroke:#E3E9FD;}
+ .d2-857458616 .stroke-B4{stroke:#E3E9FD;}
+ .d2-857458616 .stroke-B5{stroke:#EDF0FD;}
+ .d2-857458616 .stroke-B6{stroke:#F7F8FE;}
+ .d2-857458616 .stroke-AA2{stroke:#4A6FF3;}
+ .d2-857458616 .stroke-AA4{stroke:#EDF0FD;}
+ .d2-857458616 .stroke-AA5{stroke:#F7F8FE;}
+ .d2-857458616 .stroke-AB4{stroke:#EDF0FD;}
+ .d2-857458616 .stroke-AB5{stroke:#F7F8FE;}
+ .d2-857458616 .background-color-N1{background-color:#0A0F25;}
+ .d2-857458616 .background-color-N2{background-color:#676C7E;}
+ .d2-857458616 .background-color-N3{background-color:#9499AB;}
+ .d2-857458616 .background-color-N4{background-color:#CFD2DD;}
+ .d2-857458616 .background-color-N5{background-color:#DEE1EB;}
+ .d2-857458616 .background-color-N6{background-color:#EEF1F8;}
+ .d2-857458616 .background-color-N7{background-color:#FFFFFF;}
+ .d2-857458616 .background-color-B1{background-color:#0D32B2;}
+ .d2-857458616 .background-color-B2{background-color:#0D32B2;}
+ .d2-857458616 .background-color-B3{background-color:#E3E9FD;}
+ .d2-857458616 .background-color-B4{background-color:#E3E9FD;}
+ .d2-857458616 .background-color-B5{background-color:#EDF0FD;}
+ .d2-857458616 .background-color-B6{background-color:#F7F8FE;}
+ .d2-857458616 .background-color-AA2{background-color:#4A6FF3;}
+ .d2-857458616 .background-color-AA4{background-color:#EDF0FD;}
+ .d2-857458616 .background-color-AA5{background-color:#F7F8FE;}
+ .d2-857458616 .background-color-AB4{background-color:#EDF0FD;}
+ .d2-857458616 .background-color-AB5{background-color:#F7F8FE;}
+ .d2-857458616 .color-N1{color:#0A0F25;}
+ .d2-857458616 .color-N2{color:#676C7E;}
+ .d2-857458616 .color-N3{color:#9499AB;}
+ .d2-857458616 .color-N4{color:#CFD2DD;}
+ .d2-857458616 .color-N5{color:#DEE1EB;}
+ .d2-857458616 .color-N6{color:#EEF1F8;}
+ .d2-857458616 .color-N7{color:#FFFFFF;}
+ .d2-857458616 .color-B1{color:#0D32B2;}
+ .d2-857458616 .color-B2{color:#0D32B2;}
+ .d2-857458616 .color-B3{color:#E3E9FD;}
+ .d2-857458616 .color-B4{color:#E3E9FD;}
+ .d2-857458616 .color-B5{color:#EDF0FD;}
+ .d2-857458616 .color-B6{color:#F7F8FE;}
+ .d2-857458616 .color-AA2{color:#4A6FF3;}
+ .d2-857458616 .color-AA4{color:#EDF0FD;}
+ .d2-857458616 .color-AA5{color:#F7F8FE;}
+ .d2-857458616 .color-AB4{color:#EDF0FD;}
+ .d2-857458616 .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}]]>zaxyabcdbabcdabcdc
+
\ No newline at end of file