From 684441382026928d5571168cc49cb12e85af88cf Mon Sep 17 00:00:00 2001 From: donglixiaoche Date: Fri, 24 Mar 2023 13:23:19 +0800 Subject: [PATCH] chore: new testcase --- e2etests/stable_test.go | 8 + .../dagre/board.exp.json | 164 ++++++++++++++++++ .../dagre/sketch.exp.svg | 160 ++++++++--------- .../elk/board.exp.json | 164 ++++++++++++++++++ .../elk/sketch.exp.svg | 160 ++++++++--------- 5 files changed, 496 insertions(+), 160 deletions(-) diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go index 5b8594221..3a2bd4ae4 100644 --- a/e2etests/stable_test.go +++ b/e2etests/stable_test.go @@ -37,6 +37,14 @@ func testStable(t *testing.T) { c } } + b: { + near: bottom-right + a: { + c: { + d + } + } + } `, }, { 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 6778de2cd..e1f0d9e31 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 @@ -740,6 +740,170 @@ "labelPosition": "INSIDE_MIDDLE_CENTER", "zIndex": 0, "level": 2 + }, + { + "id": "b", + "type": "rectangle", + "pos": { + "x": 143, + "y": -16 + }, + "width": 214, + "height": 325, + "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": "b", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 13, + "labelHeight": 36, + "labelPosition": "OUTSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "b.a", + "type": "rectangle", + "pos": { + "x": 163, + "y": 49 + }, + "width": 174, + "height": 230, + "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": "a", + "fontSize": 24, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 10, + "labelHeight": 31, + "labelPosition": "OUTSIDE_TOP_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "b.a.c", + "type": "rectangle", + "pos": { + "x": 183, + "y": 112 + }, + "width": 134, + "height": 135, + "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": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 9, + "labelHeight": 26, + "labelPosition": "OUTSIDE_TOP_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "b.a.c.d", + "type": "rectangle", + "pos": { + "x": 223, + "y": 147 + }, + "width": 54, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N7", + "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": "d", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 9, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 4 } ], "connections": [ 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 0d96c0adc..05ae752d1 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 @@ -zaxyabcdbabcdabcdc - + .d2-1451290290 .fill-N1{fill:#0A0F25;} + .d2-1451290290 .fill-N2{fill:#676C7E;} + .d2-1451290290 .fill-N3{fill:#9499AB;} + .d2-1451290290 .fill-N4{fill:#CFD2DD;} + .d2-1451290290 .fill-N5{fill:#DEE1EB;} + .d2-1451290290 .fill-N6{fill:#EEF1F8;} + .d2-1451290290 .fill-N7{fill:#FFFFFF;} + .d2-1451290290 .fill-B1{fill:#0D32B2;} + .d2-1451290290 .fill-B2{fill:#0D32B2;} + .d2-1451290290 .fill-B3{fill:#E3E9FD;} + .d2-1451290290 .fill-B4{fill:#E3E9FD;} + .d2-1451290290 .fill-B5{fill:#EDF0FD;} + .d2-1451290290 .fill-B6{fill:#F7F8FE;} + .d2-1451290290 .fill-AA2{fill:#4A6FF3;} + .d2-1451290290 .fill-AA4{fill:#EDF0FD;} + .d2-1451290290 .fill-AA5{fill:#F7F8FE;} + .d2-1451290290 .fill-AB4{fill:#EDF0FD;} + .d2-1451290290 .fill-AB5{fill:#F7F8FE;} + .d2-1451290290 .stroke-N1{stroke:#0A0F25;} + .d2-1451290290 .stroke-N2{stroke:#676C7E;} + .d2-1451290290 .stroke-N3{stroke:#9499AB;} + .d2-1451290290 .stroke-N4{stroke:#CFD2DD;} + .d2-1451290290 .stroke-N5{stroke:#DEE1EB;} + .d2-1451290290 .stroke-N6{stroke:#EEF1F8;} + .d2-1451290290 .stroke-N7{stroke:#FFFFFF;} + .d2-1451290290 .stroke-B1{stroke:#0D32B2;} + .d2-1451290290 .stroke-B2{stroke:#0D32B2;} + .d2-1451290290 .stroke-B3{stroke:#E3E9FD;} + .d2-1451290290 .stroke-B4{stroke:#E3E9FD;} + .d2-1451290290 .stroke-B5{stroke:#EDF0FD;} + .d2-1451290290 .stroke-B6{stroke:#F7F8FE;} + .d2-1451290290 .stroke-AA2{stroke:#4A6FF3;} + .d2-1451290290 .stroke-AA4{stroke:#EDF0FD;} + .d2-1451290290 .stroke-AA5{stroke:#F7F8FE;} + .d2-1451290290 .stroke-AB4{stroke:#EDF0FD;} + .d2-1451290290 .stroke-AB5{stroke:#F7F8FE;} + .d2-1451290290 .background-color-N1{background-color:#0A0F25;} + .d2-1451290290 .background-color-N2{background-color:#676C7E;} + .d2-1451290290 .background-color-N3{background-color:#9499AB;} + .d2-1451290290 .background-color-N4{background-color:#CFD2DD;} + .d2-1451290290 .background-color-N5{background-color:#DEE1EB;} + .d2-1451290290 .background-color-N6{background-color:#EEF1F8;} + .d2-1451290290 .background-color-N7{background-color:#FFFFFF;} + .d2-1451290290 .background-color-B1{background-color:#0D32B2;} + .d2-1451290290 .background-color-B2{background-color:#0D32B2;} + .d2-1451290290 .background-color-B3{background-color:#E3E9FD;} + .d2-1451290290 .background-color-B4{background-color:#E3E9FD;} + .d2-1451290290 .background-color-B5{background-color:#EDF0FD;} + .d2-1451290290 .background-color-B6{background-color:#F7F8FE;} + .d2-1451290290 .background-color-AA2{background-color:#4A6FF3;} + .d2-1451290290 .background-color-AA4{background-color:#EDF0FD;} + .d2-1451290290 .background-color-AA5{background-color:#F7F8FE;} + .d2-1451290290 .background-color-AB4{background-color:#EDF0FD;} + .d2-1451290290 .background-color-AB5{background-color:#F7F8FE;} + .d2-1451290290 .color-N1{color:#0A0F25;} + .d2-1451290290 .color-N2{color:#676C7E;} + .d2-1451290290 .color-N3{color:#9499AB;} + .d2-1451290290 .color-N4{color:#CFD2DD;} + .d2-1451290290 .color-N5{color:#DEE1EB;} + .d2-1451290290 .color-N6{color:#EEF1F8;} + .d2-1451290290 .color-N7{color:#FFFFFF;} + .d2-1451290290 .color-B1{color:#0D32B2;} + .d2-1451290290 .color-B2{color:#0D32B2;} + .d2-1451290290 .color-B3{color:#E3E9FD;} + .d2-1451290290 .color-B4{color:#E3E9FD;} + .d2-1451290290 .color-B5{color:#EDF0FD;} + .d2-1451290290 .color-B6{color:#F7F8FE;} + .d2-1451290290 .color-AA2{color:#4A6FF3;} + .d2-1451290290 .color-AA4{color:#EDF0FD;} + .d2-1451290290 .color-AA5{color:#F7F8FE;} + .d2-1451290290 .color-AB4{color:#EDF0FD;} + .d2-1451290290 .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}]]>zaxybabcdbabcdabcdaccd + \ 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 cb21b8a5d..1027c67a3 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 @@ -740,6 +740,170 @@ "labelPosition": "INSIDE_MIDDLE_CENTER", "zIndex": 0, "level": 2 + }, + { + "id": "b", + "type": "rectangle", + "pos": { + "x": 146, + "y": -16 + }, + "width": 354, + "height": 366, + "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": "b", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 13, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "b.a", + "type": "rectangle", + "pos": { + "x": 196, + "y": 34 + }, + "width": 254, + "height": 266, + "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": "a", + "fontSize": 24, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 10, + "labelHeight": 31, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "b.a.c", + "type": "rectangle", + "pos": { + "x": 246, + "y": 84 + }, + "width": 154, + "height": 166, + "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": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 9, + "labelHeight": 26, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "b.a.c.d", + "type": "rectangle", + "pos": { + "x": 296, + "y": 134 + }, + "width": 54, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N7", + "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": "d", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 9, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 4 } ], "connections": [ 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 2e3dc5e36..2a478c8b1 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 @@ -zaxyabcdbabcdabcdc - + .d2-2717952357 .fill-N1{fill:#0A0F25;} + .d2-2717952357 .fill-N2{fill:#676C7E;} + .d2-2717952357 .fill-N3{fill:#9499AB;} + .d2-2717952357 .fill-N4{fill:#CFD2DD;} + .d2-2717952357 .fill-N5{fill:#DEE1EB;} + .d2-2717952357 .fill-N6{fill:#EEF1F8;} + .d2-2717952357 .fill-N7{fill:#FFFFFF;} + .d2-2717952357 .fill-B1{fill:#0D32B2;} + .d2-2717952357 .fill-B2{fill:#0D32B2;} + .d2-2717952357 .fill-B3{fill:#E3E9FD;} + .d2-2717952357 .fill-B4{fill:#E3E9FD;} + .d2-2717952357 .fill-B5{fill:#EDF0FD;} + .d2-2717952357 .fill-B6{fill:#F7F8FE;} + .d2-2717952357 .fill-AA2{fill:#4A6FF3;} + .d2-2717952357 .fill-AA4{fill:#EDF0FD;} + .d2-2717952357 .fill-AA5{fill:#F7F8FE;} + .d2-2717952357 .fill-AB4{fill:#EDF0FD;} + .d2-2717952357 .fill-AB5{fill:#F7F8FE;} + .d2-2717952357 .stroke-N1{stroke:#0A0F25;} + .d2-2717952357 .stroke-N2{stroke:#676C7E;} + .d2-2717952357 .stroke-N3{stroke:#9499AB;} + .d2-2717952357 .stroke-N4{stroke:#CFD2DD;} + .d2-2717952357 .stroke-N5{stroke:#DEE1EB;} + .d2-2717952357 .stroke-N6{stroke:#EEF1F8;} + .d2-2717952357 .stroke-N7{stroke:#FFFFFF;} + .d2-2717952357 .stroke-B1{stroke:#0D32B2;} + .d2-2717952357 .stroke-B2{stroke:#0D32B2;} + .d2-2717952357 .stroke-B3{stroke:#E3E9FD;} + .d2-2717952357 .stroke-B4{stroke:#E3E9FD;} + .d2-2717952357 .stroke-B5{stroke:#EDF0FD;} + .d2-2717952357 .stroke-B6{stroke:#F7F8FE;} + .d2-2717952357 .stroke-AA2{stroke:#4A6FF3;} + .d2-2717952357 .stroke-AA4{stroke:#EDF0FD;} + .d2-2717952357 .stroke-AA5{stroke:#F7F8FE;} + .d2-2717952357 .stroke-AB4{stroke:#EDF0FD;} + .d2-2717952357 .stroke-AB5{stroke:#F7F8FE;} + .d2-2717952357 .background-color-N1{background-color:#0A0F25;} + .d2-2717952357 .background-color-N2{background-color:#676C7E;} + .d2-2717952357 .background-color-N3{background-color:#9499AB;} + .d2-2717952357 .background-color-N4{background-color:#CFD2DD;} + .d2-2717952357 .background-color-N5{background-color:#DEE1EB;} + .d2-2717952357 .background-color-N6{background-color:#EEF1F8;} + .d2-2717952357 .background-color-N7{background-color:#FFFFFF;} + .d2-2717952357 .background-color-B1{background-color:#0D32B2;} + .d2-2717952357 .background-color-B2{background-color:#0D32B2;} + .d2-2717952357 .background-color-B3{background-color:#E3E9FD;} + .d2-2717952357 .background-color-B4{background-color:#E3E9FD;} + .d2-2717952357 .background-color-B5{background-color:#EDF0FD;} + .d2-2717952357 .background-color-B6{background-color:#F7F8FE;} + .d2-2717952357 .background-color-AA2{background-color:#4A6FF3;} + .d2-2717952357 .background-color-AA4{background-color:#EDF0FD;} + .d2-2717952357 .background-color-AA5{background-color:#F7F8FE;} + .d2-2717952357 .background-color-AB4{background-color:#EDF0FD;} + .d2-2717952357 .background-color-AB5{background-color:#F7F8FE;} + .d2-2717952357 .color-N1{color:#0A0F25;} + .d2-2717952357 .color-N2{color:#676C7E;} + .d2-2717952357 .color-N3{color:#9499AB;} + .d2-2717952357 .color-N4{color:#CFD2DD;} + .d2-2717952357 .color-N5{color:#DEE1EB;} + .d2-2717952357 .color-N6{color:#EEF1F8;} + .d2-2717952357 .color-N7{color:#FFFFFF;} + .d2-2717952357 .color-B1{color:#0D32B2;} + .d2-2717952357 .color-B2{color:#0D32B2;} + .d2-2717952357 .color-B3{color:#E3E9FD;} + .d2-2717952357 .color-B4{color:#E3E9FD;} + .d2-2717952357 .color-B5{color:#EDF0FD;} + .d2-2717952357 .color-B6{color:#F7F8FE;} + .d2-2717952357 .color-AA2{color:#4A6FF3;} + .d2-2717952357 .color-AA4{color:#EDF0FD;} + .d2-2717952357 .color-AA5{color:#F7F8FE;} + .d2-2717952357 .color-AB4{color:#EDF0FD;} + .d2-2717952357 .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}]]>zaxybabcdbabcdabcdaccd + \ No newline at end of file