From 9ec68d246da61fe1d89247f93925d8d0c051763b Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 28 Sep 2023 13:33:51 -0700 Subject: [PATCH] update test --- .../testdata/files/grid_edge_across_cell.d2 | 18 +- .../dagre/board.exp.json | 544 ++++++++++++++++-- .../dagre/sketch.exp.svg | 179 +++--- 3 files changed, 620 insertions(+), 121 deletions(-) diff --git a/e2etests/testdata/files/grid_edge_across_cell.d2 b/e2etests/testdata/files/grid_edge_across_cell.d2 index d99bdde5e..c7599b9b5 100644 --- a/e2etests/testdata/files/grid_edge_across_cell.d2 +++ b/e2etests/testdata/files/grid_edge_across_cell.d2 @@ -1,3 +1,17 @@ -grid-columns: 2 +classes.red.style.stroke: red +grid: { + grid-columns: 2 + grid-gap: 10 -1.a -> 2.b + cell 1.a -> cell 2.b -> cell 3.c.d: { + class: red + } + + cell 3: { + c -> e + c.d -> f.g + } + cell 3.f.g -> cell 1.a: { + class: red + } +} diff --git a/e2etests/testdata/stable/grid_edge_across_cell/dagre/board.exp.json b/e2etests/testdata/stable/grid_edge_across_cell/dagre/board.exp.json index 9c201e061..3b915476a 100644 --- a/e2etests/testdata/stable/grid_edge_across_cell/dagre/board.exp.json +++ b/e2etests/testdata/stable/grid_edge_across_cell/dagre/board.exp.json @@ -4,14 +4,14 @@ "fontFamily": "SourceSansPro", "shapes": [ { - "id": "1", + "id": "grid", "type": "rectangle", "pos": { "x": 0, - "y": 41 + "y": 0 }, - "width": 113, - "height": 126, + "width": 424, + "height": 550, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -30,7 +30,7 @@ "fields": null, "methods": null, "columns": null, - "label": "1", + "label": "grid", "fontSize": 28, "fontFamily": "DEFAULT", "language": "", @@ -38,18 +38,59 @@ "italic": false, "bold": false, "underline": false, - "labelWidth": 11, + "labelWidth": 44, "labelHeight": 36, - "labelPosition": "OUTSIDE_TOP_CENTER", + "labelPosition": "INSIDE_TOP_CENTER", "zIndex": 0, "level": 1 }, { - "id": "1.a", + "id": "grid.cell 1", "type": "rectangle", "pos": { - "x": 30, - "y": 71 + "x": 10, + "y": 82 + }, + "width": 113, + "height": 206, + "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": "cell 1", + "fontSize": 24, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 50, + "labelHeight": 31, + "labelPosition": "OUTSIDE_TOP_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "grid.cell 1.a", + "type": "rectangle", + "pos": { + "x": 40, + "y": 112 }, "width": 53, "height": 66, @@ -57,7 +98,7 @@ "strokeDash": 0, "strokeWidth": 2, "borderRadius": 0, - "fill": "B5", + "fill": "B6", "stroke": "B1", "shadow": false, "3d": false, @@ -83,22 +124,22 @@ "labelHeight": 21, "labelPosition": "INSIDE_MIDDLE_CENTER", "zIndex": 0, - "level": 2 + "level": 3 }, { - "id": "2", + "id": "grid.cell 2", "type": "rectangle", "pos": { - "x": 153, - "y": 41 + "x": 10, + "y": 334 }, "width": 113, - "height": 126, + "height": 206, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, "borderRadius": 0, - "fill": "B4", + "fill": "B5", "stroke": "B1", "shadow": false, "3d": false, @@ -112,26 +153,26 @@ "fields": null, "methods": null, "columns": null, - "label": "2", - "fontSize": 28, + "label": "cell 2", + "fontSize": 24, "fontFamily": "DEFAULT", "language": "", "color": "N1", "italic": false, "bold": false, "underline": false, - "labelWidth": 12, - "labelHeight": 36, + "labelWidth": 50, + "labelHeight": 31, "labelPosition": "OUTSIDE_TOP_CENTER", "zIndex": 0, - "level": 1 + "level": 2 }, { - "id": "2.b", + "id": "grid.cell 2.b", "type": "rectangle", "pos": { - "x": 183, - "y": 71 + "x": 40, + "y": 364 }, "width": 53, "height": 66, @@ -139,7 +180,7 @@ "strokeDash": 0, "strokeWidth": 2, "borderRadius": 0, - "fill": "B5", + "fill": "B6", "stroke": "B1", "shadow": false, "3d": false, @@ -165,15 +206,343 @@ "labelHeight": 21, "labelPosition": "INSIDE_MIDDLE_CENTER", "zIndex": 0, + "level": 3 + }, + { + "id": "grid.cell 3", + "type": "rectangle", + "pos": { + "x": 133, + "y": 82 + }, + "width": 280, + "height": 458, + "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": "cell 3", + "fontSize": 24, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 50, + "labelHeight": 31, + "labelPosition": "OUTSIDE_TOP_CENTER", + "zIndex": 0, "level": 2 + }, + { + "id": "grid.cell 3.c", + "type": "rectangle", + "pos": { + "x": 163, + "y": 118 + }, + "width": 154, + "height": 126, + "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": "grid.cell 3.c.d", + "type": "rectangle", + "pos": { + "x": 233, + "y": 148 + }, + "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 + }, + { + "id": "grid.cell 3.e", + "type": "rectangle", + "pos": { + "x": 166, + "y": 414 + }, + "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": "e", + "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": "grid.cell 3.f", + "type": "rectangle", + "pos": { + "x": 269, + "y": 384 + }, + "width": 114, + "height": 126, + "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": "f", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 7, + "labelHeight": 26, + "labelPosition": "OUTSIDE_TOP_CENTER", + "zIndex": 0, + "level": 3 + }, + { + "id": "grid.cell 3.f.g", + "type": "rectangle", + "pos": { + "x": 299, + "y": 414 + }, + "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": "g", + "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": [ { - "id": "(1.a -> 2.b)[0]", - "src": "1.a", + "id": "grid.(cell 1.a -> cell 2.b)[0]", + "classes": [ + "red" + ], + "src": "grid.cell 1.a", "srcArrow": "none", - "dst": "2.b", + "dst": "grid.cell 2.b", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "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": 66.5, + "y": 178 + }, + { + "x": 66.5, + "y": 364 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "grid.(cell 2.b -> cell 3.c.d)[0]", + "classes": [ + "red" + ], + "src": "grid.cell 2.b", + "srcArrow": "none", + "dst": "grid.cell 3.c.d", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "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": 93.25, + "y": 367 + }, + { + "x": 233.25, + "y": 211 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "grid.cell 3.(c -> e)[0]", + "src": "grid.cell 3.c", + "srcArrow": "none", + "dst": "grid.cell 3.e", "dstArrow": "triangle", "opacity": 1, "strokeDash": 0, @@ -194,12 +563,121 @@ "labelPercentage": 0, "route": [ { - "x": 83.5, - "y": 104 + "x": 193, + "y": 244 }, { - "x": 183.5, - "y": 104 + "x": 193, + "y": 300 + }, + { + "x": 193, + "y": 374 + }, + { + "x": 193, + "y": 414 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "grid.cell 3.(c.d -> f.g)[0]", + "src": "grid.cell 3.c.d", + "srcArrow": "none", + "dst": "grid.cell 3.f.g", + "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": 286.5, + "y": 214 + }, + { + "x": 318.5, + "y": 254 + }, + { + "x": 326.5, + "y": 274 + }, + { + "x": 326.5, + "y": 289 + }, + { + "x": 326.5, + "y": 304 + }, + { + "x": 326.5, + "y": 374 + }, + { + "x": 326.5, + "y": 414 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "grid.(cell 3.f.g -> cell 1.a)[0]", + "classes": [ + "red" + ], + "src": "grid.cell 3.f.g", + "srcArrow": "none", + "dst": "grid.cell 1.a", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "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": 299.5, + "y": 416 + }, + { + "x": 92.5, + "y": 176 } ], "animated": false, diff --git a/e2etests/testdata/stable/grid_edge_across_cell/dagre/sketch.exp.svg b/e2etests/testdata/stable/grid_edge_across_cell/dagre/sketch.exp.svg index 2c1311ed6..4791b970c 100644 --- a/e2etests/testdata/stable/grid_edge_across_cell/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/grid_edge_across_cell/dagre/sketch.exp.svg @@ -1,17 +1,17 @@ -12ab - - - - - + .d2-3812021295 .fill-N1{fill:#0A0F25;} + .d2-3812021295 .fill-N2{fill:#676C7E;} + .d2-3812021295 .fill-N3{fill:#9499AB;} + .d2-3812021295 .fill-N4{fill:#CFD2DD;} + .d2-3812021295 .fill-N5{fill:#DEE1EB;} + .d2-3812021295 .fill-N6{fill:#EEF1F8;} + .d2-3812021295 .fill-N7{fill:#FFFFFF;} + .d2-3812021295 .fill-B1{fill:#0D32B2;} + .d2-3812021295 .fill-B2{fill:#0D32B2;} + .d2-3812021295 .fill-B3{fill:#E3E9FD;} + .d2-3812021295 .fill-B4{fill:#E3E9FD;} + .d2-3812021295 .fill-B5{fill:#EDF0FD;} + .d2-3812021295 .fill-B6{fill:#F7F8FE;} + .d2-3812021295 .fill-AA2{fill:#4A6FF3;} + .d2-3812021295 .fill-AA4{fill:#EDF0FD;} + .d2-3812021295 .fill-AA5{fill:#F7F8FE;} + .d2-3812021295 .fill-AB4{fill:#EDF0FD;} + .d2-3812021295 .fill-AB5{fill:#F7F8FE;} + .d2-3812021295 .stroke-N1{stroke:#0A0F25;} + .d2-3812021295 .stroke-N2{stroke:#676C7E;} + .d2-3812021295 .stroke-N3{stroke:#9499AB;} + .d2-3812021295 .stroke-N4{stroke:#CFD2DD;} + .d2-3812021295 .stroke-N5{stroke:#DEE1EB;} + .d2-3812021295 .stroke-N6{stroke:#EEF1F8;} + .d2-3812021295 .stroke-N7{stroke:#FFFFFF;} + .d2-3812021295 .stroke-B1{stroke:#0D32B2;} + .d2-3812021295 .stroke-B2{stroke:#0D32B2;} + .d2-3812021295 .stroke-B3{stroke:#E3E9FD;} + .d2-3812021295 .stroke-B4{stroke:#E3E9FD;} + .d2-3812021295 .stroke-B5{stroke:#EDF0FD;} + .d2-3812021295 .stroke-B6{stroke:#F7F8FE;} + .d2-3812021295 .stroke-AA2{stroke:#4A6FF3;} + .d2-3812021295 .stroke-AA4{stroke:#EDF0FD;} + .d2-3812021295 .stroke-AA5{stroke:#F7F8FE;} + .d2-3812021295 .stroke-AB4{stroke:#EDF0FD;} + .d2-3812021295 .stroke-AB5{stroke:#F7F8FE;} + .d2-3812021295 .background-color-N1{background-color:#0A0F25;} + .d2-3812021295 .background-color-N2{background-color:#676C7E;} + .d2-3812021295 .background-color-N3{background-color:#9499AB;} + .d2-3812021295 .background-color-N4{background-color:#CFD2DD;} + .d2-3812021295 .background-color-N5{background-color:#DEE1EB;} + .d2-3812021295 .background-color-N6{background-color:#EEF1F8;} + .d2-3812021295 .background-color-N7{background-color:#FFFFFF;} + .d2-3812021295 .background-color-B1{background-color:#0D32B2;} + .d2-3812021295 .background-color-B2{background-color:#0D32B2;} + .d2-3812021295 .background-color-B3{background-color:#E3E9FD;} + .d2-3812021295 .background-color-B4{background-color:#E3E9FD;} + .d2-3812021295 .background-color-B5{background-color:#EDF0FD;} + .d2-3812021295 .background-color-B6{background-color:#F7F8FE;} + .d2-3812021295 .background-color-AA2{background-color:#4A6FF3;} + .d2-3812021295 .background-color-AA4{background-color:#EDF0FD;} + .d2-3812021295 .background-color-AA5{background-color:#F7F8FE;} + .d2-3812021295 .background-color-AB4{background-color:#EDF0FD;} + .d2-3812021295 .background-color-AB5{background-color:#F7F8FE;} + .d2-3812021295 .color-N1{color:#0A0F25;} + .d2-3812021295 .color-N2{color:#676C7E;} + .d2-3812021295 .color-N3{color:#9499AB;} + .d2-3812021295 .color-N4{color:#CFD2DD;} + .d2-3812021295 .color-N5{color:#DEE1EB;} + .d2-3812021295 .color-N6{color:#EEF1F8;} + .d2-3812021295 .color-N7{color:#FFFFFF;} + .d2-3812021295 .color-B1{color:#0D32B2;} + .d2-3812021295 .color-B2{color:#0D32B2;} + .d2-3812021295 .color-B3{color:#E3E9FD;} + .d2-3812021295 .color-B4{color:#E3E9FD;} + .d2-3812021295 .color-B5{color:#EDF0FD;} + .d2-3812021295 .color-B6{color:#F7F8FE;} + .d2-3812021295 .color-AA2{color:#4A6FF3;} + .d2-3812021295 .color-AA4{color:#EDF0FD;} + .d2-3812021295 .color-AA5{color:#F7F8FE;} + .d2-3812021295 .color-AB4{color:#EDF0FD;} + .d2-3812021295 .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}]]>gridcell 1cell 2cell 3abcefdg + + + + + + + + + + + + \ No newline at end of file