From 8f013ba2e4d1e5f54d8ac16a815cfbdc3d759079 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 23 Feb 2023 10:38:17 -0800 Subject: [PATCH 01/25] add container_label_edge_adjustment todo test --- .../dagre/board.exp.json | 268 ++++++++++++++++++ .../dagre/sketch.exp.svg | 50 ++++ .../elk/board.exp.json | 250 ++++++++++++++++ .../elk/sketch.exp.svg | 50 ++++ e2etests/todo_test.go | 6 + 5 files changed, 624 insertions(+) create mode 100644 e2etests/testdata/todo/container_label_edge_adjustment/dagre/board.exp.json create mode 100644 e2etests/testdata/todo/container_label_edge_adjustment/dagre/sketch.exp.svg create mode 100644 e2etests/testdata/todo/container_label_edge_adjustment/elk/board.exp.json create mode 100644 e2etests/testdata/todo/container_label_edge_adjustment/elk/sketch.exp.svg diff --git a/e2etests/testdata/todo/container_label_edge_adjustment/dagre/board.exp.json b/e2etests/testdata/todo/container_label_edge_adjustment/dagre/board.exp.json new file mode 100644 index 000000000..b02dc9feb --- /dev/null +++ b/e2etests/testdata/todo/container_label_edge_adjustment/dagre/board.exp.json @@ -0,0 +1,268 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 40, + "y": 0 + }, + "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": "a", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "b", + "type": "rectangle", + "pos": { + "x": 0, + "y": 207 + }, + "width": 133, + "height": 125, + "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.c", + "type": "rectangle", + "pos": { + "x": 40, + "y": 236 + }, + "width": 53, + "height": 66, + "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": "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": 2 + }, + { + "id": "d", + "type": "rectangle", + "pos": { + "x": 40, + "y": 432 + }, + "width": 54, + "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": "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": 1 + } + ], + "connections": [ + { + "id": "(a -> b.c)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "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": 66 + }, + { + "x": 66.5, + "y": 106 + }, + { + "x": 66.5, + "y": 180.1 + }, + { + "x": 66.5, + "y": 236.5 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(b.c -> d)[0]", + "src": "b.c", + "srcArrow": "none", + "srcLabel": "", + "dst": "d", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "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": 302.5 + }, + { + "x": 66.5, + "y": 326.1 + }, + { + "x": 66.5, + "y": 392 + }, + { + "x": 66.5, + "y": 432 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/todo/container_label_edge_adjustment/dagre/sketch.exp.svg b/e2etests/testdata/todo/container_label_edge_adjustment/dagre/sketch.exp.svg new file mode 100644 index 000000000..9bffbf424 --- /dev/null +++ b/e2etests/testdata/todo/container_label_edge_adjustment/dagre/sketch.exp.svg @@ -0,0 +1,50 @@ +abdc + + + \ No newline at end of file diff --git a/e2etests/testdata/todo/container_label_edge_adjustment/elk/board.exp.json b/e2etests/testdata/todo/container_label_edge_adjustment/elk/board.exp.json new file mode 100644 index 000000000..862d7a6fc --- /dev/null +++ b/e2etests/testdata/todo/container_label_edge_adjustment/elk/board.exp.json @@ -0,0 +1,250 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 62, + "y": 12 + }, + "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": "a", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "b", + "type": "rectangle", + "pos": { + "x": 12, + "y": 153 + }, + "width": 153, + "height": 166, + "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.c", + "type": "rectangle", + "pos": { + "x": 62, + "y": 203 + }, + "width": 53, + "height": 66, + "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": "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": 2 + }, + { + "id": "d", + "type": "rectangle", + "pos": { + "x": 61, + "y": 394 + }, + "width": 54, + "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": "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": 1 + } + ], + "connections": [ + { + "id": "(a -> b.c)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 88.5, + "y": 78 + }, + { + "x": 88.5, + "y": 203 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(b.c -> d)[0]", + "src": "b.c", + "srcArrow": "none", + "srcLabel": "", + "dst": "d", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 88.5, + "y": 269 + }, + { + "x": 88.5, + "y": 394 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/todo/container_label_edge_adjustment/elk/sketch.exp.svg b/e2etests/testdata/todo/container_label_edge_adjustment/elk/sketch.exp.svg new file mode 100644 index 000000000..70a9551c7 --- /dev/null +++ b/e2etests/testdata/todo/container_label_edge_adjustment/elk/sketch.exp.svg @@ -0,0 +1,50 @@ +abdc + + + \ No newline at end of file diff --git a/e2etests/todo_test.go b/e2etests/todo_test.go index 17903edbd..6bcb70b34 100644 --- a/e2etests/todo_test.go +++ b/e2etests/todo_test.go @@ -220,6 +220,12 @@ Office chatter: { a } } +`, + }, + { + name: "container_label_edge_adjustment", + script: ` +a -> b.c -> d `, }, } From b124262c76783831089c2de7fa246470ac1c7351 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 23 Feb 2023 11:08:54 -0800 Subject: [PATCH 02/25] update test --- .../dagre/board.exp.json | 311 ++++++++++++++++-- .../dagre/sketch.exp.svg | 6 +- .../elk/board.exp.json | 310 +++++++++++++++-- .../elk/sketch.exp.svg | 6 +- e2etests/todo_test.go | 14 +- 5 files changed, 595 insertions(+), 52 deletions(-) diff --git a/e2etests/testdata/todo/container_label_edge_adjustment/dagre/board.exp.json b/e2etests/testdata/todo/container_label_edge_adjustment/dagre/board.exp.json index b02dc9feb..8b2d7cfb0 100644 --- a/e2etests/testdata/todo/container_label_edge_adjustment/dagre/board.exp.json +++ b/e2etests/testdata/todo/container_label_edge_adjustment/dagre/board.exp.json @@ -6,7 +6,7 @@ "id": "a", "type": "rectangle", "pos": { - "x": 40, + "x": 14, "y": 0 }, "width": 53, @@ -45,18 +45,18 @@ }, { "id": "b", - "type": "rectangle", + "type": "cloud", "pos": { "x": 0, "y": 207 }, - "width": 133, + "width": 397, "height": 125, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, "borderRadius": 0, - "fill": "B4", + "fill": "N7", "stroke": "B1", "shadow": false, "3d": false, @@ -70,7 +70,7 @@ "fields": null, "methods": null, "columns": null, - "label": "b", + "label": "a container label", "fontSize": 28, "fontFamily": "DEFAULT", "language": "", @@ -78,7 +78,7 @@ "italic": false, "bold": false, "underline": false, - "labelWidth": 13, + "labelWidth": 195, "labelHeight": 36, "labelPosition": "OUTSIDE_TOP_CENTER", "zIndex": 0, @@ -88,7 +88,7 @@ "id": "b.c", "type": "rectangle", "pos": { - "x": 40, + "x": 183, "y": 236 }, "width": 53, @@ -129,7 +129,7 @@ "id": "d", "type": "rectangle", "pos": { - "x": 40, + "x": 182, "y": 432 }, "width": 54, @@ -165,6 +165,129 @@ "labelPosition": "INSIDE_MIDDLE_CENTER", "zIndex": 0, "level": 1 + }, + { + "id": "e", + "type": "rectangle", + "pos": { + "x": 127, + "y": 0 + }, + "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": 1 + }, + { + "id": "f", + "type": "rectangle", + "pos": { + "x": 240, + "y": 0 + }, + "width": 51, + "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": "f", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 6, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "g", + "type": "rectangle", + "pos": { + "x": 351, + "y": 0 + }, + "width": 54, + "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": "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": 1 } ], "connections": [ @@ -174,11 +297,11 @@ "srcArrow": "none", "srcLabel": "", "dst": "b.c", - "dstArrow": "triangle", + "dstArrow": "filled-diamond", "dstLabel": "", "opacity": 1, "strokeDash": 0, - "strokeWidth": 2, + "strokeWidth": 8, "stroke": "B1", "label": "", "fontSize": 16, @@ -194,20 +317,20 @@ "labelPercentage": 0, "route": [ { - "x": 66.5, + "x": 40, "y": 66 }, { - "x": 66.5, + "x": 40, "y": 106 }, { - "x": 66.5, - "y": 180.1 + "x": 68.5, + "y": 184.09704142011833 }, { - "x": 66.5, - "y": 236.5 + "x": 182.5, + "y": 256.4852071005917 } ], "isCurve": true, @@ -222,11 +345,11 @@ "srcArrow": "none", "srcLabel": "", "dst": "d", - "dstArrow": "triangle", + "dstArrow": "filled-diamond", "dstLabel": "", "opacity": 1, "strokeDash": 0, - "strokeWidth": 2, + "strokeWidth": 8, "stroke": "B1", "label": "", "fontSize": 16, @@ -242,19 +365,19 @@ "labelPercentage": 0, "route": [ { - "x": 66.5, + "x": 209, "y": 302.5 }, { - "x": 66.5, + "x": 209, "y": 326.1 }, { - "x": 66.5, + "x": 209, "y": 392 }, { - "x": 66.5, + "x": 209, "y": 432 } ], @@ -263,6 +386,150 @@ "tooltip": "", "icon": null, "zIndex": 0 + }, + { + "id": "(e -> b.c)[0]", + "src": "e", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.c", + "dstArrow": "filled-diamond", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 8, + "stroke": "B1", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 153, + "y": 66 + }, + { + "x": 153, + "y": 106 + }, + { + "x": 159.8, + "y": 180.1 + }, + { + "x": 187, + "y": 236.5 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(f -> b)[0]", + "src": "f", + "srcArrow": "none", + "srcLabel": "", + "dst": "b", + "dstArrow": "filled-diamond", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 8, + "stroke": "red", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 265, + "y": 66 + }, + { + "x": 265, + "y": 106 + }, + { + "x": 265, + "y": 135.2 + }, + { + "x": 265, + "y": 212 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(g -> b)[0]", + "src": "g", + "srcArrow": "none", + "srcLabel": "", + "dst": "b", + "dstArrow": "filled-diamond", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 8, + "stroke": "B1", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 377.5, + "y": 66 + }, + { + "x": 377.5, + "y": 106 + }, + { + "x": 377.6, + "y": 145.2 + }, + { + "x": 378, + "y": 262 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 } ] } diff --git a/e2etests/testdata/todo/container_label_edge_adjustment/dagre/sketch.exp.svg b/e2etests/testdata/todo/container_label_edge_adjustment/dagre/sketch.exp.svg index 9bffbf424..dea3419a2 100644 --- a/e2etests/testdata/todo/container_label_edge_adjustment/dagre/sketch.exp.svg +++ b/e2etests/testdata/todo/container_label_edge_adjustment/dagre/sketch.exp.svg @@ -1,4 +1,4 @@ - \ No newline at end of file diff --git a/e2etests/testdata/todo/container_label_edge_adjustment/elk/board.exp.json b/e2etests/testdata/todo/container_label_edge_adjustment/elk/board.exp.json index 862d7a6fc..c124141e8 100644 --- a/e2etests/testdata/todo/container_label_edge_adjustment/elk/board.exp.json +++ b/e2etests/testdata/todo/container_label_edge_adjustment/elk/board.exp.json @@ -6,7 +6,7 @@ "id": "a", "type": "rectangle", "pos": { - "x": 62, + "x": 12, "y": 12 }, "width": 53, @@ -45,18 +45,18 @@ }, { "id": "b", - "type": "rectangle", + "type": "cloud", "pos": { - "x": 12, - "y": 153 + "x": 26, + "y": 213 }, - "width": 153, + "width": 155, "height": 166, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, "borderRadius": 0, - "fill": "B4", + "fill": "N7", "stroke": "B1", "shadow": false, "3d": false, @@ -70,7 +70,7 @@ "fields": null, "methods": null, "columns": null, - "label": "b", + "label": "a container label", "fontSize": 28, "fontFamily": "DEFAULT", "language": "", @@ -78,7 +78,7 @@ "italic": false, "bold": false, "underline": false, - "labelWidth": 13, + "labelWidth": 195, "labelHeight": 36, "labelPosition": "INSIDE_TOP_CENTER", "zIndex": 0, @@ -88,8 +88,8 @@ "id": "b.c", "type": "rectangle", "pos": { - "x": 62, - "y": 203 + "x": 76, + "y": 263 }, "width": 53, "height": 66, @@ -129,8 +129,8 @@ "id": "d", "type": "rectangle", "pos": { - "x": 61, - "y": 394 + "x": 75, + "y": 454 }, "width": 54, "height": 66, @@ -165,6 +165,129 @@ "labelPosition": "INSIDE_MIDDLE_CENTER", "zIndex": 0, "level": 1 + }, + { + "id": "e", + "type": "rectangle", + "pos": { + "x": 85, + "y": 12 + }, + "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": 1 + }, + { + "id": "f", + "type": "rectangle", + "pos": { + "x": 158, + "y": 12 + }, + "width": 51, + "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": "f", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 6, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "g", + "type": "rectangle", + "pos": { + "x": 229, + "y": 12 + }, + "width": 54, + "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": "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": 1 } ], "connections": [ @@ -174,11 +297,11 @@ "srcArrow": "none", "srcLabel": "", "dst": "b.c", - "dstArrow": "triangle", + "dstArrow": "filled-diamond", "dstLabel": "", "opacity": 1, "strokeDash": 0, - "strokeWidth": 2, + "strokeWidth": 8, "stroke": "B1", "label": "", "fontSize": 16, @@ -194,12 +317,20 @@ "labelPercentage": 0, "route": [ { - "x": 88.5, + "x": 38.5, "y": 78 }, { - "x": 88.5, - "y": 203 + "x": 38.5, + "y": 118 + }, + { + "x": 93.83333333333333, + "y": 118 + }, + { + "x": 93.83333333333333, + "y": 263 } ], "animated": false, @@ -213,11 +344,11 @@ "srcArrow": "none", "srcLabel": "", "dst": "d", - "dstArrow": "triangle", + "dstArrow": "filled-diamond", "dstLabel": "", "opacity": 1, "strokeDash": 0, - "strokeWidth": 2, + "strokeWidth": 8, "stroke": "B1", "label": "", "fontSize": 16, @@ -233,12 +364,145 @@ "labelPercentage": 0, "route": [ { - "x": 88.5, - "y": 269 + "x": 102.66666666666666, + "y": 329 }, { - "x": 88.5, - "y": 394 + "x": 102.66666666666666, + "y": 454 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(e -> b.c)[0]", + "src": "e", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.c", + "dstArrow": "filled-diamond", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 8, + "stroke": "B1", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 111.5, + "y": 78 + }, + { + "x": 111.5, + "y": 263 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(f -> b)[0]", + "src": "f", + "srcArrow": "none", + "srcLabel": "", + "dst": "b", + "dstArrow": "filled-diamond", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 8, + "stroke": "red", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 183.5, + "y": 78 + }, + { + "x": 183.5, + "y": 118 + }, + { + "x": 121.5, + "y": 118 + }, + { + "x": 122, + "y": 213 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(g -> b)[0]", + "src": "g", + "srcArrow": "none", + "srcLabel": "", + "dst": "b", + "dstArrow": "filled-diamond", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 8, + "stroke": "B1", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 256, + "y": 78 + }, + { + "x": 256, + "y": 168 + }, + { + "x": 131.5, + "y": 168 + }, + { + "x": 131, + "y": 218 } ], "animated": false, diff --git a/e2etests/testdata/todo/container_label_edge_adjustment/elk/sketch.exp.svg b/e2etests/testdata/todo/container_label_edge_adjustment/elk/sketch.exp.svg index 70a9551c7..934011400 100644 --- a/e2etests/testdata/todo/container_label_edge_adjustment/elk/sketch.exp.svg +++ b/e2etests/testdata/todo/container_label_edge_adjustment/elk/sketch.exp.svg @@ -1,4 +1,4 @@ - \ No newline at end of file diff --git a/e2etests/todo_test.go b/e2etests/todo_test.go index 6bcb70b34..70cf11785 100644 --- a/e2etests/todo_test.go +++ b/e2etests/todo_test.go @@ -225,7 +225,19 @@ Office chatter: { { name: "container_label_edge_adjustment", script: ` -a -> b.c -> d +a -> b.c -> d: {style.stroke-width: 8; target-arrowhead.shape: diamond; target-arrowhead.style.filled: true} +b.shape: cloud +e -> b.c: {style.stroke-width: 8; target-arrowhead.shape: diamond; target-arrowhead.style.filled: true} +f -> b: { + style: { + stroke: red + stroke-width: 8 + } + target-arrowhead.shape: diamond + target-arrowhead.style.filled: true +} +g -> b: {style.stroke-width: 8; target-arrowhead.shape: diamond; target-arrowhead.style.filled: true} +b: a container label `, }, } From e3ac2a41706d293ea7c251cc13ca0e7ec97d9b89 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 23 Feb 2023 11:32:23 -0800 Subject: [PATCH 03/25] move container edge back if it runs into the container's label --- d2layouts/d2dagrelayout/layout.go | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/d2layouts/d2dagrelayout/layout.go b/d2layouts/d2dagrelayout/layout.go index d46da1e7c..51bb18d62 100644 --- a/d2layouts/d2dagrelayout/layout.go +++ b/d2layouts/d2dagrelayout/layout.go @@ -425,7 +425,27 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err // trace the edge to the specific shape's border points[startIndex] = shape.TraceToShapeBorder(srcShape, start, points[startIndex+1]) - points[endIndex] = shape.TraceToShapeBorder(dstShape, end, points[endIndex-1]) + + // if an edge to a container runs into its label, stop the edge at the label instead + overlapsContainerLabel := false + if edge.Dst.IsContainer() && edge.Dst.Attributes.Label.Value != "" { + // assumes LabelPosition, LabelWidth, LabelHeight are all set if there is a label + labelWidth := float64(*edge.Dst.LabelWidth) + labelHeight := float64(*edge.Dst.LabelHeight) + labelTL := label.Position(*edge.Dst.LabelPosition). + GetPointOnBox(edge.Dst.Box, label.PADDING, labelWidth, labelHeight) + + endingSegment := geo.Segment{Start: points[endIndex-1], End: points[endIndex]} + labelBox := geo.NewBox(labelTL, labelWidth, labelHeight) + if intersections := labelBox.Intersections(endingSegment); len(intersections) > 0 { + overlapsContainerLabel = true + // move ending segment to label intersection point + points[endIndex] = intersections[0] + } + } + if !overlapsContainerLabel { + points[endIndex] = shape.TraceToShapeBorder(dstShape, end, points[endIndex-1]) + } points = points[startIndex : endIndex+1] // build a curved path from the dagre route From c86da5e1001c08d2925468a9c0196cfba814ba47 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 23 Feb 2023 11:33:29 -0800 Subject: [PATCH 04/25] update test --- .../todo/container_label_edge_adjustment/dagre/board.exp.json | 4 ++-- .../todo/container_label_edge_adjustment/dagre/sketch.exp.svg | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/e2etests/testdata/todo/container_label_edge_adjustment/dagre/board.exp.json b/e2etests/testdata/todo/container_label_edge_adjustment/dagre/board.exp.json index 8b2d7cfb0..b07c4e59e 100644 --- a/e2etests/testdata/todo/container_label_edge_adjustment/dagre/board.exp.json +++ b/e2etests/testdata/todo/container_label_edge_adjustment/dagre/board.exp.json @@ -470,11 +470,11 @@ }, { "x": 265, - "y": 135.2 + "y": 126 }, { "x": 265, - "y": 212 + "y": 166 } ], "isCurve": true, diff --git a/e2etests/testdata/todo/container_label_edge_adjustment/dagre/sketch.exp.svg b/e2etests/testdata/todo/container_label_edge_adjustment/dagre/sketch.exp.svg index dea3419a2..eef6f80c8 100644 --- a/e2etests/testdata/todo/container_label_edge_adjustment/dagre/sketch.exp.svg +++ b/e2etests/testdata/todo/container_label_edge_adjustment/dagre/sketch.exp.svg @@ -44,7 +44,7 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]>aa container labeldefgc +]]>aa container labeldefgc \ No newline at end of file From 60b7865fd39424ea387f82376a7cbad3319db1ec Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 23 Feb 2023 11:42:39 -0800 Subject: [PATCH 05/25] update tests --- .../regression/overlapping-edge-label/dagre/board.exp.json | 4 ++-- .../regression/overlapping-edge-label/dagre/sketch.exp.svg | 4 ++-- e2etests/testdata/stable/direction/dagre/board.exp.json | 4 ++-- e2etests/testdata/stable/direction/dagre/sketch.exp.svg | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/e2etests/testdata/regression/overlapping-edge-label/dagre/board.exp.json b/e2etests/testdata/regression/overlapping-edge-label/dagre/board.exp.json index 4a30d438f..09a8de6d8 100644 --- a/e2etests/testdata/regression/overlapping-edge-label/dagre/board.exp.json +++ b/e2etests/testdata/regression/overlapping-edge-label/dagre/board.exp.json @@ -545,11 +545,11 @@ }, { "x": 217, - "y": 246.9 + "y": 238.7 }, { "x": 217, - "y": 328.5 + "y": 287.5 } ], "isCurve": true, diff --git a/e2etests/testdata/regression/overlapping-edge-label/dagre/sketch.exp.svg b/e2etests/testdata/regression/overlapping-edge-label/dagre/sketch.exp.svg index b6c7ee69f..a0bbd2cf2 100644 --- a/e2etests/testdata/regression/overlapping-edge-label/dagre/sketch.exp.svg +++ b/e2etests/testdata/regression/overlapping-edge-label/dagre/sketch.exp.svg @@ -51,10 +51,10 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]>Kubernetesopensvck8s-master1k8s-master2k8s-master3k8s-worker1k8s-worker2k8s-worker3VM1VM2 keycloakheptapodharborvault +]]>Kubernetesopensvck8s-master1k8s-master2k8s-master3k8s-worker1k8s-worker2k8s-worker3VM1VM2 keycloakheptapodharborvault - + \ No newline at end of file diff --git a/e2etests/testdata/stable/direction/dagre/board.exp.json b/e2etests/testdata/stable/direction/dagre/board.exp.json index da7c82b71..ab8a866e7 100644 --- a/e2etests/testdata/stable/direction/dagre/board.exp.json +++ b/e2etests/testdata/stable/direction/dagre/board.exp.json @@ -837,11 +837,11 @@ }, { "x": 97, - "y": 369.7 + "y": 362.5 }, { "x": 97, - "y": 438.5 + "y": 402.5 } ], "isCurve": true, diff --git a/e2etests/testdata/stable/direction/dagre/sketch.exp.svg b/e2etests/testdata/stable/direction/dagre/sketch.exp.svg index 51e859c8a..8de5a8bbf 100644 --- a/e2etests/testdata/stable/direction/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/direction/dagre/sketch.exp.svg @@ -44,7 +44,7 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]>abcde12345abcde +]]>abcde12345abcde \ No newline at end of file From 3584bf0e58d8180f2fbf856af2fb8c5eaeec1469 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 23 Feb 2023 11:45:58 -0800 Subject: [PATCH 06/25] changelog --- ci/release/changelogs/next.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index ce336a3d5..d80a287fd 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -11,6 +11,7 @@ - CLI reports when a feature is incompatible with layout engine, instead of silently ignoring. [#845](https://github.com/terrastruct/d2/pull/845) - `near` key set to direct parent or ancestor throws an appropriate error message. [#851](https://github.com/terrastruct/d2/pull/851) - Dimensions and positions are able to be set from API. [#853](https://github.com/terrastruct/d2/pull/853) +- Improves label legibility for dagre containers by stopping container edges early if they would run into the label. [#880](https://github.com/terrastruct/d2/pull/880) #### Bugfixes ⛑️ From daadca15cd04a239a14afa044ffa5962361a8298 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 23 Feb 2023 12:41:42 -0800 Subject: [PATCH 07/25] pad label box, avoid short segments --- d2layouts/d2dagrelayout/layout.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/d2layouts/d2dagrelayout/layout.go b/d2layouts/d2dagrelayout/layout.go index 51bb18d62..a1b279d83 100644 --- a/d2layouts/d2dagrelayout/layout.go +++ b/d2layouts/d2dagrelayout/layout.go @@ -437,10 +437,19 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err endingSegment := geo.Segment{Start: points[endIndex-1], End: points[endIndex]} labelBox := geo.NewBox(labelTL, labelWidth, labelHeight) + // add left/right padding to box + labelBox.TopLeft.X -= label.PADDING + labelBox.Width += 2 * label.PADDING if intersections := labelBox.Intersections(endingSegment); len(intersections) > 0 { overlapsContainerLabel = true // move ending segment to label intersection point points[endIndex] = intersections[0] + endingSegment.End = intersections[0] + // if the segment becomes too short, just merge it with the previous segment + if endIndex-1 > 0 && endingSegment.Length() < MIN_SEGMENT_LEN { + points[endIndex-1] = points[endIndex] + endIndex-- + } } } if !overlapsContainerLabel { From fa686952cd7b0cf72d1f1a8137b1e86034b6dfcf Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 23 Feb 2023 13:02:28 -0800 Subject: [PATCH 08/25] update tests --- .../regression/dagre_broken_arrowhead/dagre/board.exp.json | 4 ++-- .../regression/dagre_broken_arrowhead/dagre/sketch.exp.svg | 2 +- e2etests/testdata/stable/direction/dagre/board.exp.json | 4 ++-- e2etests/testdata/stable/direction/dagre/sketch.exp.svg | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/e2etests/testdata/regression/dagre_broken_arrowhead/dagre/board.exp.json b/e2etests/testdata/regression/dagre_broken_arrowhead/dagre/board.exp.json index 46f9a77c0..1c875fbb8 100644 --- a/e2etests/testdata/regression/dagre_broken_arrowhead/dagre/board.exp.json +++ b/e2etests/testdata/regression/dagre_broken_arrowhead/dagre/board.exp.json @@ -333,11 +333,11 @@ }, { "x": 179, - "y": 326.4 + "y": 248 }, { "x": 179, - "y": 356 + "y": 320 } ], "isCurve": true, diff --git a/e2etests/testdata/regression/dagre_broken_arrowhead/dagre/sketch.exp.svg b/e2etests/testdata/regression/dagre_broken_arrowhead/dagre/sketch.exp.svg index 09df89c52..7e1f2e0a4 100644 --- a/e2etests/testdata/regression/dagre_broken_arrowhead/dagre/sketch.exp.svg +++ b/e2etests/testdata/regression/dagre_broken_arrowhead/dagre/sketch.exp.svg @@ -51,7 +51,7 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]>abc12d line 1line 2line 3line 4 +]]>abc12d line 1line 2line 3line 4 \ No newline at end of file diff --git a/e2etests/testdata/stable/direction/dagre/board.exp.json b/e2etests/testdata/stable/direction/dagre/board.exp.json index ab8a866e7..9ebda9816 100644 --- a/e2etests/testdata/stable/direction/dagre/board.exp.json +++ b/e2etests/testdata/stable/direction/dagre/board.exp.json @@ -654,11 +654,11 @@ }, { "x": 140.25, - "y": 134.2 + "y": 126 }, { "x": 140.25, - "y": 207 + "y": 166 } ], "isCurve": true, diff --git a/e2etests/testdata/stable/direction/dagre/sketch.exp.svg b/e2etests/testdata/stable/direction/dagre/sketch.exp.svg index 8de5a8bbf..d71065442 100644 --- a/e2etests/testdata/stable/direction/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/direction/dagre/sketch.exp.svg @@ -44,7 +44,7 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]>abcde12345abcde +]]>abcde12345abcde \ No newline at end of file From 9108023f5977562db07c7c81812ed2e1129daeb0 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Thu, 23 Feb 2023 14:14:21 -0800 Subject: [PATCH 09/25] Update next.md --- ci/release/changelogs/next.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index ce336a3d5..d069b7b22 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -1,3 +1,7 @@ +Sketch mode's subtle hand-drawn texture adapts to background colors. +sketch + + #### Features 🚀 - Dark theme support! See [https://d2lang.com/tour/themes](https://d2lang.com/tour/themes).[#613](https://github.com/terrastruct/d2/pull/613) @@ -6,6 +10,7 @@ #### Improvements 🧹 +- Sketch mode's subtle hand-drawn texture adapts to background colors. [#613](https://github.com/terrastruct/d2/pull/613) - Cleaner watch mode logs without timestamps. [#830](https://github.com/terrastruct/d2/pull/830) - Remove duplicate success logs in watch mode. [#830](https://github.com/terrastruct/d2/pull/830) - CLI reports when a feature is incompatible with layout engine, instead of silently ignoring. [#845](https://github.com/terrastruct/d2/pull/845) From cea18eaf216b3eea2dcaa9194fda3b0838ecc239 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Thu, 23 Feb 2023 14:14:39 -0800 Subject: [PATCH 10/25] Update next.md --- ci/release/changelogs/next.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index d069b7b22..da2797bf4 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -1,4 +1,5 @@ Sketch mode's subtle hand-drawn texture adapts to background colors. + sketch From e1b407ea522d9b31fb9df39d5814dc8b4a1e8ad2 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Thu, 23 Feb 2023 14:42:56 -0800 Subject: [PATCH 11/25] use more accurate icon bounding --- d2target/d2target.go | 14 ++++++++++---- .../stable/icon-containers/dagre/sketch.exp.svg | 6 +++--- .../todo/container_icon_label/dagre/sketch.exp.svg | 6 +++--- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/d2target/d2target.go b/d2target/d2target.go index 942cef08a..cc445d674 100644 --- a/d2target/d2target.go +++ b/d2target/d2target.go @@ -91,10 +91,16 @@ func (diagram Diagram) BoundingBox() (topLeft, bottomRight Point) { contentBox := geo.NewBox(geo.NewPoint(0, 0), float64(targetShape.Width), float64(targetShape.Height)) s := shape.NewShape(targetShape.Type, contentBox) size := GetIconSize(s.GetInnerBox(), targetShape.IconPosition) - y1 = go2.Min(y1, targetShape.Pos.Y-label.PADDING-size) - x1 = go2.Min(x1, targetShape.Pos.X-label.PADDING-size) - y2 = go2.Max(y2, targetShape.Pos.Y+label.PADDING+size) - x2 = go2.Max(x2, targetShape.Pos.X+label.PADDING+size) + + if strings.HasPrefix(targetShape.IconPosition, "OUTSIDE_TOP") { + y1 = go2.Min(y1, targetShape.Pos.Y-label.PADDING-size) + } else if strings.HasPrefix(targetShape.IconPosition, "OUTSIDE_BOTTOM") { + y2 = go2.Max(y2, targetShape.Pos.Y+label.PADDING+size) + } else if strings.HasPrefix(targetShape.IconPosition, "OUTSIDE_LEFT") { + x1 = go2.Min(x1, targetShape.Pos.X-label.PADDING-size) + } else if strings.HasPrefix(targetShape.IconPosition, "OUTSIDE_RIGHT") { + x2 = go2.Max(x2, targetShape.Pos.X+label.PADDING+size) + } } if targetShape.Label != "" { diff --git a/e2etests/testdata/stable/icon-containers/dagre/sketch.exp.svg b/e2etests/testdata/stable/icon-containers/dagre/sketch.exp.svg index 3a88dfa9a..d60d3200b 100644 --- a/e2etests/testdata/stable/icon-containers/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/icon-containers/dagre/sketch.exp.svg @@ -1,4 +1,4 @@ - \ No newline at end of file diff --git a/e2etests/testdata/todo/container_icon_label/dagre/sketch.exp.svg b/e2etests/testdata/todo/container_icon_label/dagre/sketch.exp.svg index a9679267f..8f5544666 100644 --- a/e2etests/testdata/todo/container_icon_label/dagre/sketch.exp.svg +++ b/e2etests/testdata/todo/container_icon_label/dagre/sketch.exp.svg @@ -1,4 +1,4 @@ - \ No newline at end of file From 7701673c5145b6af42e6a69e285dc995e5d33cfd Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 23 Feb 2023 14:43:47 -0800 Subject: [PATCH 12/25] add container_label_edge_adjustment2 test --- .../dagre/board.exp.json | 179 ++++++++++++++++++ .../dagre/sketch.exp.svg | 57 ++++++ .../elk/board.exp.json | 170 +++++++++++++++++ .../elk/sketch.exp.svg | 57 ++++++ e2etests/todo_test.go | 13 ++ 5 files changed, 476 insertions(+) create mode 100644 e2etests/testdata/todo/container_label_edge_adjustment2/dagre/board.exp.json create mode 100644 e2etests/testdata/todo/container_label_edge_adjustment2/dagre/sketch.exp.svg create mode 100644 e2etests/testdata/todo/container_label_edge_adjustment2/elk/board.exp.json create mode 100644 e2etests/testdata/todo/container_label_edge_adjustment2/elk/sketch.exp.svg diff --git a/e2etests/testdata/todo/container_label_edge_adjustment2/dagre/board.exp.json b/e2etests/testdata/todo/container_label_edge_adjustment2/dagre/board.exp.json new file mode 100644 index 000000000..1a04e2f81 --- /dev/null +++ b/e2etests/testdata/todo/container_label_edge_adjustment2/dagre/board.exp.json @@ -0,0 +1,179 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "x", + "type": "rectangle", + "pos": { + "x": 40, + "y": 0 + }, + "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": "x", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "y", + "type": "rectangle", + "pos": { + "x": 0, + "y": 207 + }, + "width": 132, + "height": 125, + "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": "bar", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 38, + "labelHeight": 36, + "labelPosition": "OUTSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "y.z", + "type": "rectangle", + "pos": { + "x": 40, + "y": 236 + }, + "width": 52, + "height": 66, + "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": "z", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 7, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + } + ], + "connections": [ + { + "id": "(x -> y)[0]", + "src": "x", + "srcArrow": "none", + "srcLabel": "", + "dst": "y", + "dstArrow": "filled-diamond", + "dstLabel": "foo", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 66, + "y": 66 + }, + { + "x": 66, + "y": 106 + }, + { + "x": 66, + "y": 134.2 + }, + { + "x": 66, + "y": 207 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/todo/container_label_edge_adjustment2/dagre/sketch.exp.svg b/e2etests/testdata/todo/container_label_edge_adjustment2/dagre/sketch.exp.svg new file mode 100644 index 000000000..0aeb4d9cf --- /dev/null +++ b/e2etests/testdata/todo/container_label_edge_adjustment2/dagre/sketch.exp.svg @@ -0,0 +1,57 @@ +xbarz foo + + + \ No newline at end of file diff --git a/e2etests/testdata/todo/container_label_edge_adjustment2/elk/board.exp.json b/e2etests/testdata/todo/container_label_edge_adjustment2/elk/board.exp.json new file mode 100644 index 000000000..219d55620 --- /dev/null +++ b/e2etests/testdata/todo/container_label_edge_adjustment2/elk/board.exp.json @@ -0,0 +1,170 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "x", + "type": "rectangle", + "pos": { + "x": 61, + "y": 12 + }, + "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": "x", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "y", + "type": "rectangle", + "pos": { + "x": 12, + "y": 148 + }, + "width": 152, + "height": 166, + "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": "bar", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 38, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "y.z", + "type": "rectangle", + "pos": { + "x": 62, + "y": 198 + }, + "width": 52, + "height": 66, + "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": "z", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 7, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + } + ], + "connections": [ + { + "id": "(x -> y)[0]", + "src": "x", + "srcArrow": "none", + "srcLabel": "", + "dst": "y", + "dstArrow": "filled-diamond", + "dstLabel": "foo", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 88, + "y": 78 + }, + { + "x": 88, + "y": 148 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/todo/container_label_edge_adjustment2/elk/sketch.exp.svg b/e2etests/testdata/todo/container_label_edge_adjustment2/elk/sketch.exp.svg new file mode 100644 index 000000000..af97bacba --- /dev/null +++ b/e2etests/testdata/todo/container_label_edge_adjustment2/elk/sketch.exp.svg @@ -0,0 +1,57 @@ +xbarz foo + + + \ No newline at end of file diff --git a/e2etests/todo_test.go b/e2etests/todo_test.go index 70cf11785..24b52e03d 100644 --- a/e2etests/todo_test.go +++ b/e2etests/todo_test.go @@ -238,6 +238,19 @@ f -> b: { } g -> b: {style.stroke-width: 8; target-arrowhead.shape: diamond; target-arrowhead.style.filled: true} b: a container label +`, + }, + { + name: "container_label_edge_adjustment2", + script: ` +x -> y: { + target-arrowhead: foo { + shape: diamond + style.filled: true + } +} + +y: bar {z} `, }, } From 0db09d5a53ee99e75fc511d12e9a7ce20c68e031 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 23 Feb 2023 14:44:49 -0800 Subject: [PATCH 13/25] update test --- .../container_label_edge_adjustment2/dagre/board.exp.json | 4 ++-- .../container_label_edge_adjustment2/dagre/sketch.exp.svg | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/e2etests/testdata/todo/container_label_edge_adjustment2/dagre/board.exp.json b/e2etests/testdata/todo/container_label_edge_adjustment2/dagre/board.exp.json index 1a04e2f81..d4f3880c9 100644 --- a/e2etests/testdata/todo/container_label_edge_adjustment2/dagre/board.exp.json +++ b/e2etests/testdata/todo/container_label_edge_adjustment2/dagre/board.exp.json @@ -162,11 +162,11 @@ }, { "x": 66, - "y": 134.2 + "y": 126 }, { "x": 66, - "y": 207 + "y": 166 } ], "isCurve": true, diff --git a/e2etests/testdata/todo/container_label_edge_adjustment2/dagre/sketch.exp.svg b/e2etests/testdata/todo/container_label_edge_adjustment2/dagre/sketch.exp.svg index 0aeb4d9cf..76828dacf 100644 --- a/e2etests/testdata/todo/container_label_edge_adjustment2/dagre/sketch.exp.svg +++ b/e2etests/testdata/todo/container_label_edge_adjustment2/dagre/sketch.exp.svg @@ -51,7 +51,7 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]>xbarz foo +]]>xbarz foo \ No newline at end of file From 4fcf91d52673fb1c43c1d7545afc046f2b6880e5 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Thu, 23 Feb 2023 16:20:20 -0800 Subject: [PATCH 14/25] Update next.md --- ci/release/changelogs/next.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 11102d489..629197229 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -1,28 +1,40 @@ -Sketch mode's subtle hand-drawn texture adapts to background colors. +Dark mode support has landed! Thanks to https://github.com/vfosnar for such a substaintial first-time contribution to D2. Only one dark theme option accompanies the support, so if you have a dark theme you like, please feel free to submit into D2! + +https://user-images.githubusercontent.com/3120367/221057628-e474b040-4ecb-4177-bb81-a04c95a4648f.mp4 + +D2 is now usable in non-Latin languages (and emojis!), as the font-measuring accounts for multi-byte characters. Thanks https://github.com/bo-ku-ra for keeping this top of mind. + +D2 0.2.0 vs 0.2.1: + +japanese + +Sketch mode's subtle hand-drawn texture adapts to background colors. Previously the streaks were too subtle on lighter backgrounds and too prominent on darker ones. sketch +This release also fixes a number of non-trivial layout bugs made in v0.2.0, and has better error messages. #### Features 🚀 -- Dark theme support! See [https://d2lang.com/tour/themes](https://d2lang.com/tour/themes).[#613](https://github.com/terrastruct/d2/pull/613) +- Dark theme support! See [https://d2lang.com/tour/themes](https://d2lang.com/tour/themes). [#613](https://github.com/terrastruct/d2/pull/613) - Many non-Latin languages (e.g. Chinese, Japanese, Korean) are usable now that multi-byte characters are measured correctly. [#817](https://github.com/terrastruct/d2/pull/817) - Dimensions can be set on containers (layout engine dependent). [#845](https://github.com/terrastruct/d2/pull/845) #### Improvements 🧹 - Sketch mode's subtle hand-drawn texture adapts to background colors. [#613](https://github.com/terrastruct/d2/pull/613) +- Improves label legibility for dagre containers by stopping container edges early if they would run into the label. [#880](https://github.com/terrastruct/d2/pull/880) - Cleaner watch mode logs without timestamps. [#830](https://github.com/terrastruct/d2/pull/830) - Remove duplicate success logs in watch mode. [#830](https://github.com/terrastruct/d2/pull/830) - CLI reports when a feature is incompatible with layout engine, instead of silently ignoring. [#845](https://github.com/terrastruct/d2/pull/845) - `near` key set to direct parent or ancestor throws an appropriate error message. [#851](https://github.com/terrastruct/d2/pull/851) - Dimensions and positions are able to be set from API. [#853](https://github.com/terrastruct/d2/pull/853) -- Improves label legibility for dagre containers by stopping container edges early if they would run into the label. [#880](https://github.com/terrastruct/d2/pull/880) #### Bugfixes ⛑️ - Fixes edge case where layouts with dagre show a connection from the bottom side of shapes being slightly disconnected from the shape. [#820](https://github.com/terrastruct/d2/pull/820) - Bounding boxes weren't accounting for icons placed on the boundaries. [#879](https://github.com/terrastruct/d2/pull/879) +- Sequence diagrams using special characters in object IDs could cause rendering bugs. [#856](https://github.com/terrastruct/d2/issues/856) - Fixes rare compiler bug when using underscores in edges to create objects across containers. [#824](https://github.com/terrastruct/d2/pull/824) - Fixes rare possibility of rendered connections being hidden or cut off. [#828](https://github.com/terrastruct/d2/pull/828) - Creating nested children within `sql_table` and `class` shapes are now prevented (caused confusion when accidentally done). [#834](https://github.com/terrastruct/d2/pull/834) From 6a1b975e39c348f4fc21f68c54a5365a2b2c6073 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Thu, 23 Feb 2023 16:27:01 -0800 Subject: [PATCH 15/25] Update next.md --- ci/release/changelogs/next.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 629197229..f1620aaf5 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -16,7 +16,7 @@ This release also fixes a number of non-trivial layout bugs made in v0.2.0, and #### Features 🚀 -- Dark theme support! See [https://d2lang.com/tour/themes](https://d2lang.com/tour/themes). [#613](https://github.com/terrastruct/d2/pull/613) +- Dark theme support! See [docs](https://d2lang.com/tour/themes#dark-theme). [#613](https://github.com/terrastruct/d2/pull/613) - Many non-Latin languages (e.g. Chinese, Japanese, Korean) are usable now that multi-byte characters are measured correctly. [#817](https://github.com/terrastruct/d2/pull/817) - Dimensions can be set on containers (layout engine dependent). [#845](https://github.com/terrastruct/d2/pull/845) From 994ec12c3495484ca3cc1d8efa53994fcabcaf2a Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Thu, 23 Feb 2023 16:42:27 -0800 Subject: [PATCH 16/25] [ci-base] fmt --- ci/release/changelogs/next.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index f1620aaf5..fb59b7f9a 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -12,7 +12,7 @@ Sketch mode's subtle hand-drawn texture adapts to background colors. Previously sketch -This release also fixes a number of non-trivial layout bugs made in v0.2.0, and has better error messages. +This release also fixes a number of non-trivial layout bugs made in v0.2.0, and has better error messages. #### Features 🚀 From 0fe1c6d0cf36433279792db3089e9de61ee1593e Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Thu, 23 Feb 2023 17:15:29 -0800 Subject: [PATCH 17/25] fix color codes --- lib/color/color.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/color/color.go b/lib/color/color.go index 230bba259..10355a0d8 100644 --- a/lib/color/color.go +++ b/lib/color/color.go @@ -41,8 +41,10 @@ func Darken(colorString string) (string, error) { case colorString[0:2] == "AB": switch colorString[2] { - case '4', '5': + case '4': return AB4, nil + case '5': + return AB5, nil } case colorString[0] == 'N': @@ -135,7 +137,7 @@ const ( // Alternative colors B AB4 = "AB4" - AB5 = "AB4" + AB5 = "AB5" // Special Empty = "" From a330b35fc53d541f908835184fcda5887b3ad5dd Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Thu, 23 Feb 2023 17:20:15 -0800 Subject: [PATCH 18/25] tests --- .../diagram_wider_than_tooltip/sketch.exp.svg | 2 +- .../appendix/testdata/links/sketch.exp.svg | 2 +- .../testdata/links_dark/sketch.exp.svg | 2 +- .../tooltip_wider_than_diagram/sketch.exp.svg | 2 +- .../testdata/all_shapes/dark_theme.exp.svg | 2 +- .../testdata/animated/dark_theme.exp.svg | 2 +- .../testdata/arrowheads/dark_theme.exp.svg | 2 +- .../testdata/basic/dark_theme.exp.svg | 2 +- .../child_to_child/dark_theme.exp.svg | 2 +- .../testdata/class/dark_theme.exp.svg | 2 +- .../connection_label/dark_theme.exp.svg | 2 +- .../testdata/opacity/dark_theme.exp.svg | 2 +- .../testdata/overlay/dark_theme.exp.svg | 2 +- .../testdata/sql_tables/dark_theme.exp.svg | 2 +- .../testdata/twitter/dark_theme.exp.svg | 2 +- e2etests/regression_test.go | 24 +- .../measured/empty-class/dagre/sketch.exp.svg | 2 +- .../measured/empty-shape/dagre/sketch.exp.svg | 2 +- .../empty-sql_table/dagre/sketch.exp.svg | 2 +- .../ampersand-escape/dagre/sketch.exp.svg | 2 +- .../ampersand-escape/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre-disconnect/dagre/sketch.exp.svg | 2 +- .../dagre-disconnect/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../dagre_broken_arrowhead/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre_special_ids/dagre/sketch.exp.svg | 2 +- .../dagre_special_ids/elk/sketch.exp.svg | 2 +- .../elk_alignment/dagre/sketch.exp.svg | 2 +- .../elk_alignment/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../elk_loop_panic/dagre/sketch.exp.svg | 2 +- .../elk_loop_panic/elk/sketch.exp.svg | 2 +- .../regression/elk_order/dagre/sketch.exp.svg | 2 +- .../regression/elk_order/elk/sketch.exp.svg | 2 +- .../empty_class_height/dagre/sketch.exp.svg | 2 +- .../empty_class_height/elk/sketch.exp.svg | 2 +- .../empty_sequence/dagre/sketch.exp.svg | 2 +- .../empty_sequence/elk/sketch.exp.svg | 2 +- .../just-width/dagre/sketch.exp.svg | 2 +- .../regression/just-width/elk/sketch.exp.svg | 2 +- .../md_h1_li_li/dagre/sketch.exp.svg | 2 +- .../regression/md_h1_li_li/elk/sketch.exp.svg | 2 +- .../nested_steps/dagre/board.exp.json | 309 ++++++++++++++++++ .../nested_steps/dagre/sketch.exp.svg | 50 +++ .../nested_steps/elk/board.exp.json | 291 +++++++++++++++++ .../nested_steps/elk/sketch.exp.svg | 50 +++ .../regression/no-lexer/dagre/sketch.exp.svg | 2 +- .../regression/no-lexer/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../opacity-on-label/dagre/sketch.exp.svg | 2 +- .../opacity-on-label/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../overlapping-edge-label/elk/sketch.exp.svg | 2 +- .../query_param_escape/dagre/sketch.exp.svg | 2 +- .../query_param_escape/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../sql_table_overflow/dagre/sketch.exp.svg | 2 +- .../sql_table_overflow/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../sanity/1_to_2/dagre/sketch.exp.svg | 2 +- .../testdata/sanity/1_to_2/elk/sketch.exp.svg | 2 +- .../sanity/basic/dagre/sketch.exp.svg | 2 +- .../testdata/sanity/basic/elk/sketch.exp.svg | 2 +- .../child_to_child/dagre/sketch.exp.svg | 2 +- .../sanity/child_to_child/elk/sketch.exp.svg | 2 +- .../connection_label/dagre/sketch.exp.svg | 2 +- .../connection_label/elk/sketch.exp.svg | 2 +- .../sanity/empty/dagre/sketch.exp.svg | 2 +- .../testdata/sanity/empty/elk/sketch.exp.svg | 2 +- .../stable/all_shapes/dagre/sketch.exp.svg | 2 +- .../stable/all_shapes/elk/sketch.exp.svg | 2 +- .../all_shapes_multiple/dagre/sketch.exp.svg | 2 +- .../all_shapes_multiple/elk/sketch.exp.svg | 2 +- .../all_shapes_shadow/dagre/sketch.exp.svg | 2 +- .../all_shapes_shadow/elk/sketch.exp.svg | 2 +- .../stable/animated/dagre/sketch.exp.svg | 2 +- .../stable/animated/elk/sketch.exp.svg | 2 +- .../arrowhead_adjustment/dagre/sketch.exp.svg | 2 +- .../arrowhead_adjustment/elk/sketch.exp.svg | 2 +- .../arrowhead_labels/dagre/sketch.exp.svg | 2 +- .../arrowhead_labels/elk/sketch.exp.svg | 2 +- .../stable/binary_tree/dagre/sketch.exp.svg | 2 +- .../stable/binary_tree/elk/sketch.exp.svg | 2 +- .../stable/border-radius/dagre/sketch.exp.svg | 2 +- .../stable/border-radius/elk/sketch.exp.svg | 2 +- .../stable/chaos2/dagre/sketch.exp.svg | 2 +- .../testdata/stable/chaos2/elk/sketch.exp.svg | 2 +- .../circle_arrowhead/dagre/sketch.exp.svg | 2 +- .../circle_arrowhead/elk/sketch.exp.svg | 2 +- .../circular_dependency/dagre/sketch.exp.svg | 2 +- .../circular_dependency/elk/sketch.exp.svg | 2 +- .../stable/class/dagre/sketch.exp.svg | 2 +- .../testdata/stable/class/elk/sketch.exp.svg | 2 +- .../stable/code_snippet/dagre/sketch.exp.svg | 2 +- .../stable/code_snippet/elk/sketch.exp.svg | 2 +- .../complex-layers/dagre/sketch.exp.svg | 2 +- .../stable/complex-layers/elk/sketch.exp.svg | 2 +- .../connected_container/dagre/sketch.exp.svg | 2 +- .../connected_container/elk/sketch.exp.svg | 2 +- .../constant_near_stress/dagre/sketch.exp.svg | 2 +- .../constant_near_stress/elk/sketch.exp.svg | 2 +- .../constant_near_title/dagre/sketch.exp.svg | 2 +- .../constant_near_title/elk/sketch.exp.svg | 2 +- .../container_edges/dagre/sketch.exp.svg | 2 +- .../stable/container_edges/elk/sketch.exp.svg | 2 +- .../crow_foot_arrowhead/dagre/sketch.exp.svg | 2 +- .../crow_foot_arrowhead/elk/sketch.exp.svg | 2 +- .../stable/dense/dagre/sketch.exp.svg | 2 +- .../testdata/stable/dense/elk/sketch.exp.svg | 2 +- .../different_subgraphs/dagre/sketch.exp.svg | 2 +- .../different_subgraphs/elk/sketch.exp.svg | 2 +- .../stable/direction/dagre/sketch.exp.svg | 2 +- .../stable/direction/elk/sketch.exp.svg | 2 +- .../stable/font_colors/dagre/sketch.exp.svg | 2 +- .../stable/font_colors/elk/sketch.exp.svg | 2 +- .../stable/font_sizes/dagre/sketch.exp.svg | 2 +- .../stable/font_sizes/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../giant_markdown_test/dagre/sketch.exp.svg | 2 +- .../giant_markdown_test/elk/sketch.exp.svg | 2 +- .../testdata/stable/hr/dagre/sketch.exp.svg | 2 +- .../testdata/stable/hr/elk/sketch.exp.svg | 2 +- .../icon-containers/dagre/sketch.exp.svg | 2 +- .../stable/icon-containers/elk/sketch.exp.svg | 2 +- .../stable/icon-label/dagre/sketch.exp.svg | 2 +- .../stable/icon-label/elk/sketch.exp.svg | 2 +- .../stable/images/dagre/sketch.exp.svg | 2 +- .../testdata/stable/images/elk/sketch.exp.svg | 2 +- .../stable/investigate/dagre/sketch.exp.svg | 2 +- .../stable/investigate/elk/sketch.exp.svg | 2 +- .../stable/large_arch/dagre/sketch.exp.svg | 2 +- .../stable/large_arch/elk/sketch.exp.svg | 2 +- .../stable/latex/dagre/sketch.exp.svg | 2 +- .../testdata/stable/latex/elk/sketch.exp.svg | 2 +- .../testdata/stable/li1/dagre/sketch.exp.svg | 2 +- .../testdata/stable/li1/elk/sketch.exp.svg | 2 +- .../testdata/stable/li2/dagre/sketch.exp.svg | 2 +- .../testdata/stable/li2/elk/sketch.exp.svg | 2 +- .../testdata/stable/li3/dagre/sketch.exp.svg | 2 +- .../testdata/stable/li3/elk/sketch.exp.svg | 2 +- .../testdata/stable/li4/dagre/sketch.exp.svg | 2 +- .../testdata/stable/li4/elk/sketch.exp.svg | 2 +- .../stable/links/dagre/sketch.exp.svg | 2 +- .../testdata/stable/links/elk/sketch.exp.svg | 2 +- .../stable/lone_h1/dagre/sketch.exp.svg | 2 +- .../stable/lone_h1/elk/sketch.exp.svg | 2 +- .../stable/markdown/dagre/sketch.exp.svg | 2 +- .../stable/markdown/elk/sketch.exp.svg | 2 +- .../markdown_stroke_fill/dagre/sketch.exp.svg | 2 +- .../markdown_stroke_fill/elk/sketch.exp.svg | 2 +- .../md_2space_newline/dagre/sketch.exp.svg | 2 +- .../md_2space_newline/elk/sketch.exp.svg | 2 +- .../md_backslash_newline/dagre/sketch.exp.svg | 2 +- .../md_backslash_newline/elk/sketch.exp.svg | 2 +- .../md_code_block_fenced/dagre/sketch.exp.svg | 2 +- .../md_code_block_fenced/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../md_code_block_indented/elk/sketch.exp.svg | 2 +- .../md_code_inline/dagre/sketch.exp.svg | 2 +- .../stable/md_code_inline/elk/sketch.exp.svg | 2 +- .../multiline_text/dagre/sketch.exp.svg | 2 +- .../stable/multiline_text/elk/sketch.exp.svg | 2 +- .../multiple_trees/dagre/sketch.exp.svg | 2 +- .../stable/multiple_trees/elk/sketch.exp.svg | 2 +- .../stable/n22_e32/dagre/sketch.exp.svg | 2 +- .../stable/n22_e32/elk/sketch.exp.svg | 2 +- .../stable/near-alone/dagre/sketch.exp.svg | 2 +- .../stable/near-alone/elk/sketch.exp.svg | 2 +- .../number_connections/dagre/sketch.exp.svg | 2 +- .../number_connections/elk/sketch.exp.svg | 2 +- .../one_container_loop/dagre/sketch.exp.svg | 2 +- .../one_container_loop/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../stable/ovals/dagre/sketch.exp.svg | 2 +- .../testdata/stable/ovals/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../testdata/stable/p/dagre/sketch.exp.svg | 2 +- e2etests/testdata/stable/p/elk/sketch.exp.svg | 2 +- .../stable/people/dagre/sketch.exp.svg | 2 +- .../testdata/stable/people/elk/sketch.exp.svg | 2 +- .../testdata/stable/pre/dagre/sketch.exp.svg | 2 +- .../testdata/stable/pre/elk/sketch.exp.svg | 2 +- .../self-referencing/dagre/sketch.exp.svg | 2 +- .../self-referencing/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../sequence_diagram_note/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../sequence_diagram_real/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../sequence_diagram_span/elk/sketch.exp.svg | 2 +- .../sequence_diagrams/dagre/sketch.exp.svg | 2 +- .../sequence_diagrams/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../stable/sql_tables/dagre/sketch.exp.svg | 2 +- .../stable/sql_tables/elk/sketch.exp.svg | 2 +- .../stable/square_3d/dagre/sketch.exp.svg | 2 +- .../stable/square_3d/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../stable/stylish/dagre/sketch.exp.svg | 2 +- .../stable/stylish/elk/sketch.exp.svg | 2 +- .../text_font_sizes/dagre/sketch.exp.svg | 2 +- .../stable/text_font_sizes/elk/sketch.exp.svg | 2 +- .../stable/tooltips/dagre/sketch.exp.svg | 2 +- .../stable/tooltips/elk/sketch.exp.svg | 2 +- .../transparent_3d/dagre/sketch.exp.svg | 2 +- .../stable/transparent_3d/elk/sketch.exp.svg | 2 +- .../unnamed_only_height/dagre/sketch.exp.svg | 2 +- .../unnamed_only_height/elk/sketch.exp.svg | 2 +- .../unnamed_only_width/dagre/sketch.exp.svg | 2 +- .../unnamed_only_width/elk/sketch.exp.svg | 2 +- .../stable/us_map/dagre/sketch.exp.svg | 2 +- .../testdata/stable/us_map/elk/sketch.exp.svg | 2 +- .../container_icon_label/dagre/sketch.exp.svg | 2 +- .../container_icon_label/elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../elk/sketch.exp.svg | 2 +- .../dagre/sketch.exp.svg | 2 +- .../shape_set_width_height/elk/sketch.exp.svg | 2 +- .../unicode/chinese/dagre/sketch.exp.svg | 2 +- .../unicode/chinese/elk/sketch.exp.svg | 2 +- .../unicode/emojis/dagre/sketch.exp.svg | 2 +- .../unicode/emojis/elk/sketch.exp.svg | 2 +- .../japanese-basic/dagre/sketch.exp.svg | 2 +- .../unicode/japanese-basic/elk/sketch.exp.svg | 2 +- .../japanese-full/dagre/sketch.exp.svg | 2 +- .../unicode/japanese-full/elk/sketch.exp.svg | 2 +- .../japanese-mixed/dagre/sketch.exp.svg | 2 +- .../unicode/japanese-mixed/elk/sketch.exp.svg | 2 +- .../unicode/korean/dagre/sketch.exp.svg | 2 +- .../unicode/korean/elk/sketch.exp.svg | 2 +- .../mixed-language-2/dagre/sketch.exp.svg | 2 +- .../mixed-language-2/elk/sketch.exp.svg | 2 +- .../mixed-language/dagre/sketch.exp.svg | 2 +- .../unicode/mixed-language/elk/sketch.exp.svg | 2 +- .../unicode/with-style/dagre/sketch.exp.svg | 2 +- .../unicode/with-style/elk/sketch.exp.svg | 2 +- 285 files changed, 1003 insertions(+), 281 deletions(-) create mode 100644 e2etests/testdata/regression/nested_steps/dagre/board.exp.json create mode 100644 e2etests/testdata/regression/nested_steps/dagre/sketch.exp.svg create mode 100644 e2etests/testdata/regression/nested_steps/elk/board.exp.json create mode 100644 e2etests/testdata/regression/nested_steps/elk/sketch.exp.svg diff --git a/d2renderers/d2svg/appendix/testdata/diagram_wider_than_tooltip/sketch.exp.svg b/d2renderers/d2svg/appendix/testdata/diagram_wider_than_tooltip/sketch.exp.svg index d84d008be..2a700a79b 100644 --- a/d2renderers/d2svg/appendix/testdata/diagram_wider_than_tooltip/sketch.exp.svg +++ b/d2renderers/d2svg/appendix/testdata/diagram_wider_than_tooltip/sketch.exp.svg @@ -27,7 +27,7 @@ mix-blend-mode: multiply; opacity: 0.5; } -.fill-N1{fill:#0A0F25;}.fill-N2{fill:#676C7E;}.fill-N3{fill:#9499AB;}.fill-N4{fill:#CFD2DD;}.fill-N5{fill:#DEE1EB;}.fill-N6{fill:#EEF1F8;}.fill-N7{fill:#FFFFFF;}.fill-B1{fill:#0D32B2;}.fill-B2{fill:#0D32B2;}.fill-B3{fill:#E3E9FD;}.fill-B4{fill:#E3E9FD;}.fill-B5{fill:#EDF0FD;}.fill-B6{fill:#F7F8FE;}.fill-AA2{fill:#4A6FF3;}.fill-AA4{fill:#EDF0FD;}.fill-AA5{fill:#F7F8FE;}.fill-AB4{fill:#EDF0FD;}.fill-AB5{fill:#F7F8FE;}.stroke-N1{stroke:#0A0F25;}.stroke-N2{stroke:#676C7E;}.stroke-N3{stroke:#9499AB;}.stroke-N4{stroke:#CFD2DD;}.stroke-N5{stroke:#DEE1EB;}.stroke-N6{stroke:#EEF1F8;}.stroke-N7{stroke:#FFFFFF;}.stroke-B1{stroke:#0D32B2;}.stroke-B2{stroke:#0D32B2;}.stroke-B3{stroke:#E3E9FD;}.stroke-B4{stroke:#E3E9FD;}.stroke-B5{stroke:#EDF0FD;}.stroke-B6{stroke:#F7F8FE;}.stroke-AA2{stroke:#4A6FF3;}.stroke-AA4{stroke:#EDF0FD;}.stroke-AA5{stroke:#F7F8FE;}.stroke-AB4{stroke:#EDF0FD;}.stroke-AB5{stroke:#F7F8FE;}.background-color-N1{background-color:#0A0F25;}.background-color-N2{background-color:#676C7E;}.background-color-N3{background-color:#9499AB;}.background-color-N4{background-color:#CFD2DD;}.background-color-N5{background-color:#DEE1EB;}.background-color-N6{background-color:#EEF1F8;}.background-color-N7{background-color:#FFFFFF;}.background-color-B1{background-color:#0D32B2;}.background-color-B2{background-color:#0D32B2;}.background-color-B3{background-color:#E3E9FD;}.background-color-B4{background-color:#E3E9FD;}.background-color-B5{background-color:#EDF0FD;}.background-color-B6{background-color:#F7F8FE;}.background-color-AA2{background-color:#4A6FF3;}.background-color-AA4{background-color:#EDF0FD;}.background-color-AA5{background-color:#F7F8FE;}.background-color-AB4{background-color:#EDF0FD;}.background-color-AB5{background-color:#F7F8FE;}.color-N1{color:#0A0F25;}.color-N2{color:#676C7E;}.color-N3{color:#9499AB;}.color-N4{color:#CFD2DD;}.color-N5{color:#DEE1EB;}.color-N6{color:#EEF1F8;}.color-N7{color:#FFFFFF;}.color-B1{color:#0D32B2;}.color-B2{color:#0D32B2;}.color-B3{color:#E3E9FD;}.color-B4{color:#E3E9FD;}.color-B5{color:#EDF0FD;}.color-B6{color:#F7F8FE;}.color-AA2{color:#4A6FF3;}.color-AA4{color:#EDF0FD;}.color-AA5{color:#F7F8FE;}.color-AB4{color:#EDF0FD;}.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-AB4{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}]]>acdab + + + \ No newline at end of file diff --git a/e2etests/testdata/regression/nested_steps/elk/board.exp.json b/e2etests/testdata/regression/nested_steps/elk/board.exp.json new file mode 100644 index 000000000..9dd9ae425 --- /dev/null +++ b/e2etests/testdata/regression/nested_steps/elk/board.exp.json @@ -0,0 +1,291 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 12, + "y": 12 + }, + "width": 193, + "height": 372, + "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.a", + "type": "step", + "pos": { + "x": 62, + "y": 62 + }, + "width": 93, + "height": 101, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "AB5", + "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": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "a.b", + "type": "step", + "pos": { + "x": 62, + "y": 233 + }, + "width": 93, + "height": 101, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "AB5", + "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": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 8, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "c", + "type": "step", + "pos": { + "x": 225, + "y": 283 + }, + "width": 93, + "height": 101, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "AB4", + "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": 1 + }, + { + "id": "d", + "type": "step", + "pos": { + "x": 224, + "y": 454 + }, + "width": 94, + "height": 101, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "AB4", + "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": 1 + } + ], + "connections": [ + { + "id": "a.(a -> b)[0]", + "src": "a.a", + "srcArrow": "none", + "srcLabel": "", + "dst": "a.b", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 108, + "y": 163 + }, + { + "x": 108, + "y": 233 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(c -> d)[0]", + "src": "c", + "srcArrow": "none", + "srcLabel": "", + "dst": "d", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 271, + "y": 384 + }, + { + "x": 271, + "y": 454 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/regression/nested_steps/elk/sketch.exp.svg b/e2etests/testdata/regression/nested_steps/elk/sketch.exp.svg new file mode 100644 index 000000000..49888dd16 --- /dev/null +++ b/e2etests/testdata/regression/nested_steps/elk/sketch.exp.svg @@ -0,0 +1,50 @@ +acdab + + + \ No newline at end of file diff --git a/e2etests/testdata/regression/no-lexer/dagre/sketch.exp.svg b/e2etests/testdata/regression/no-lexer/dagre/sketch.exp.svg index 23ade7766..f2ec06ef5 100644 --- a/e2etests/testdata/regression/no-lexer/dagre/sketch.exp.svg +++ b/e2etests/testdata/regression/no-lexer/dagre/sketch.exp.svg @@ -17,7 +17,7 @@ mix-blend-mode: multiply; opacity: 0.5; } -.fill-N1{fill:#0A0F25;}.fill-N2{fill:#676C7E;}.fill-N3{fill:#9499AB;}.fill-N4{fill:#CFD2DD;}.fill-N5{fill:#DEE1EB;}.fill-N6{fill:#EEF1F8;}.fill-N7{fill:#FFFFFF;}.fill-B1{fill:#0D32B2;}.fill-B2{fill:#0D32B2;}.fill-B3{fill:#E3E9FD;}.fill-B4{fill:#E3E9FD;}.fill-B5{fill:#EDF0FD;}.fill-B6{fill:#F7F8FE;}.fill-AA2{fill:#4A6FF3;}.fill-AA4{fill:#EDF0FD;}.fill-AA5{fill:#F7F8FE;}.fill-AB4{fill:#EDF0FD;}.fill-AB5{fill:#F7F8FE;}.stroke-N1{stroke:#0A0F25;}.stroke-N2{stroke:#676C7E;}.stroke-N3{stroke:#9499AB;}.stroke-N4{stroke:#CFD2DD;}.stroke-N5{stroke:#DEE1EB;}.stroke-N6{stroke:#EEF1F8;}.stroke-N7{stroke:#FFFFFF;}.stroke-B1{stroke:#0D32B2;}.stroke-B2{stroke:#0D32B2;}.stroke-B3{stroke:#E3E9FD;}.stroke-B4{stroke:#E3E9FD;}.stroke-B5{stroke:#EDF0FD;}.stroke-B6{stroke:#F7F8FE;}.stroke-AA2{stroke:#4A6FF3;}.stroke-AA4{stroke:#EDF0FD;}.stroke-AA5{stroke:#F7F8FE;}.stroke-AB4{stroke:#EDF0FD;}.stroke-AB5{stroke:#F7F8FE;}.background-color-N1{background-color:#0A0F25;}.background-color-N2{background-color:#676C7E;}.background-color-N3{background-color:#9499AB;}.background-color-N4{background-color:#CFD2DD;}.background-color-N5{background-color:#DEE1EB;}.background-color-N6{background-color:#EEF1F8;}.background-color-N7{background-color:#FFFFFF;}.background-color-B1{background-color:#0D32B2;}.background-color-B2{background-color:#0D32B2;}.background-color-B3{background-color:#E3E9FD;}.background-color-B4{background-color:#E3E9FD;}.background-color-B5{background-color:#EDF0FD;}.background-color-B6{background-color:#F7F8FE;}.background-color-AA2{background-color:#4A6FF3;}.background-color-AA4{background-color:#EDF0FD;}.background-color-AA5{background-color:#F7F8FE;}.background-color-AB4{background-color:#EDF0FD;}.background-color-AB5{background-color:#F7F8FE;}.color-N1{color:#0A0F25;}.color-N2{color:#676C7E;}.color-N3{color:#9499AB;}.color-N4{color:#CFD2DD;}.color-N5{color:#DEE1EB;}.color-N6{color:#EEF1F8;}.color-N7{color:#FFFFFF;}.color-B1{color:#0D32B2;}.color-B2{color:#0D32B2;}.color-B3{color:#E3E9FD;}.color-B4{color:#E3E9FD;}.color-B5{color:#EDF0FD;}.color-B6{color:#F7F8FE;}.color-AA2{color:#4A6FF3;}.color-AA4{color:#EDF0FD;}.color-AA5{color:#F7F8FE;}.color-AB4{color:#EDF0FD;}.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-AB4{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}]]>customerissuerstore1Like starbucks or somethingacquirer2I'm not sure what this isnetworkcustomer bankstore bankinitial transactionpayment processor behind the scenessimplified 1 banana please$10 dollarsthinking: wow, inflationchecks bank accountSavings: $11I can do that, here's my cardRun this cardProcess to card issuerProcess this payment$10 debit$10 creditAn error in judgement is about to occur +]]>customerissuerstore1Like starbucks or somethingacquirer2I'm not sure what this isnetworkcustomer bankstore bankinitial transactionpayment processor behind the scenessimplified 1 banana please$10 dollarsthinking: wow, inflationchecks bank accountSavings: $11I can do that, here's my cardRun this cardProcess to card issuerProcess this payment$10 debit$10 creditAn error in judgement is about to occur diff --git a/d2renderers/d2svg/dark_theme/testdata/twitter/dark_theme.exp.svg b/d2renderers/d2svg/dark_theme/testdata/twitter/dark_theme.exp.svg index 99c56c87a..71f8e83df 100644 --- a/d2renderers/d2svg/dark_theme/testdata/twitter/dark_theme.exp.svg +++ b/d2renderers/d2svg/dark_theme/testdata/twitter/dark_theme.exp.svg @@ -793,7 +793,7 @@ .md .contains-task-list:dir(rtl) .task-list-item-checkbox { margin: 0 -1.6em 0.25em 0.2em; } -People discovery serviceAd mixerOnboarding serviceTwitter Frontend WebIphoneAndroidTimelineScorerHome RankerTimeline ServiceHome mixerManhattanGizmoduckSocial graphTweety PiePrediction ServiceHome ScorerManhattanMemcacheFetchFeatureScoringPrediction Service...etc

Timeline mixer

+People discovery serviceAd mixerOnboarding serviceTwitter Frontend WebIphoneAndroidTimelineScorerHome RankerTimeline ServiceHome mixerManhattanGizmoduckSocial graphTweety PiePrediction ServiceHome ScorerManhattanMemcacheFetchFeatureScoringPrediction Service...etc

Timeline mixer

  • Inject ads, who-to-follow, onboarding
  • Conversation module
  • @@ -801,7 +801,7 @@
  • Tweat deduplication
  • Served data logging
-
GraphQLFederated Strato Column

Tweet/user content hydration, visibility filtering

+
GraphQLFederated Strato Column

Tweet/user content hydration, visibility filtering

TLS-API (being deprecated)CrMixerEarlyBirdUtagSpaceCommunities iPhone webHTTP AndroidThrift RPC Candidate FetchFeature HydrationCandidate sources diff --git a/d2themes/element.go b/d2themes/element.go index 2d015801c..5cb7b49c3 100644 --- a/d2themes/element.go +++ b/d2themes/element.go @@ -96,6 +96,7 @@ func (el *ThemableElement) SetMaskUrl(url string) { func (el *ThemableElement) Render() string { out := "<" + el.tag + // href has to be at the top for the img bundler to detect tags correctly if len(el.Href) > 0 { out += fmt.Sprintf(` href="%s"`, el.Href) } diff --git a/e2etests/testdata/regression/elk_img_empty_label_panic/dagre/sketch.exp.svg b/e2etests/testdata/regression/elk_img_empty_label_panic/dagre/sketch.exp.svg index 9ac8b424a..6e4e7c84b 100644 --- a/e2etests/testdata/regression/elk_img_empty_label_panic/dagre/sketch.exp.svg +++ b/e2etests/testdata/regression/elk_img_empty_label_panic/dagre/sketch.exp.svg @@ -30,7 +30,7 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]> +]]> \ No newline at end of file diff --git a/e2etests/testdata/regression/elk_img_empty_label_panic/elk/sketch.exp.svg b/e2etests/testdata/regression/elk_img_empty_label_panic/elk/sketch.exp.svg index ac237de57..8f3b72af4 100644 --- a/e2etests/testdata/regression/elk_img_empty_label_panic/elk/sketch.exp.svg +++ b/e2etests/testdata/regression/elk_img_empty_label_panic/elk/sketch.exp.svg @@ -30,7 +30,7 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]> +]]> \ No newline at end of file diff --git a/e2etests/testdata/stable/images/dagre/sketch.exp.svg b/e2etests/testdata/stable/images/dagre/sketch.exp.svg index b91cbd931..02d602922 100644 --- a/e2etests/testdata/stable/images/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/images/dagre/sketch.exp.svg @@ -37,7 +37,7 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]>ab +]]>ab \ No newline at end of file diff --git a/e2etests/testdata/stable/images/elk/sketch.exp.svg b/e2etests/testdata/stable/images/elk/sketch.exp.svg index fd3c43173..39e581511 100644 --- a/e2etests/testdata/stable/images/elk/sketch.exp.svg +++ b/e2etests/testdata/stable/images/elk/sketch.exp.svg @@ -37,7 +37,7 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]>ab +]]>ab \ No newline at end of file diff --git a/e2etests/testdata/stable/overlapping_image_container_labels/dagre/sketch.exp.svg b/e2etests/testdata/stable/overlapping_image_container_labels/dagre/sketch.exp.svg index 476ae68dd..2d9d50075 100644 --- a/e2etests/testdata/stable/overlapping_image_container_labels/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/overlapping_image_container_labels/dagre/sketch.exp.svg @@ -51,7 +51,7 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]>rootcontainerrootleft2rightrootinnerrootinnerleft2rightleft2right to inner left2to inner rightto inner left2to inner rightto left2 container rootto right container root +]]>rootcontainerrootleft2rightrootinnerrootinnerleft2rightleft2right to inner left2to inner rightto inner left2to inner rightto left2 container rootto right container root diff --git a/e2etests/testdata/stable/overlapping_image_container_labels/elk/sketch.exp.svg b/e2etests/testdata/stable/overlapping_image_container_labels/elk/sketch.exp.svg index 72ddaaa60..5e4de85c2 100644 --- a/e2etests/testdata/stable/overlapping_image_container_labels/elk/sketch.exp.svg +++ b/e2etests/testdata/stable/overlapping_image_container_labels/elk/sketch.exp.svg @@ -51,7 +51,7 @@ svgEl.setAttribute("height", height * ratio - 16); } }); -]]>rootcontainerrootleft2rightrootinnerrootinnerleft2rightleft2right to inner left2to inner rightto inner left2to inner rightto left2 container rootto right container root +]]>rootcontainerrootleft2rightrootinnerrootinnerleft2rightleft2right to inner left2to inner rightto inner left2to inner rightto left2 container rootto right container root 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 e5991ad0a..090313fe6 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 @@ -67,7 +67,7 @@ }); ]]>a labelblabelsa class+public() boolvoid-private() intvoidcloudyyyy:= 5 := a + 7 -fmt.Printf("%d", b)cyldiadocssix cornersa random iconoverpackdocs pagetoohard o saysinglepersona queuea squarea step at a timedatausersidintnamevarchar result := callThisFunction(obj, 5) midthis sideother side +fmt.Printf("%d", b)cyldiadocssix cornersa random iconoverpackdocs pagetoohard o saysinglepersona queuea squarea step at a timedatausersidintnamevarchar result := callThisFunction(obj, 5) midthis sideother side 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 e5991ad0a..090313fe6 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 @@ -67,7 +67,7 @@ }); ]]>a labelblabelsa class+public() boolvoid-private() intvoidcloudyyyy:= 5 := a + 7 -fmt.Printf("%d", b)cyldiadocssix cornersa random iconoverpackdocs pagetoohard o saysinglepersona queuea squarea step at a timedatausersidintnamevarchar result := callThisFunction(obj, 5) midthis sideother side +fmt.Printf("%d", b)cyldiadocssix cornersa random iconoverpackdocs pagetoohard o saysinglepersona queuea squarea step at a timedatausersidintnamevarchar result := callThisFunction(obj, 5) midthis sideother side