From b27235a4760cc7746cc5ea09fc3009b0c30686dd Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Mon, 3 Feb 2025 16:48:59 -0700 Subject: [PATCH 1/3] d2near: constant nears avoid edge routes --- d2layouts/d2near/layout.go | 11 + .../txtar/elk-title-near/dagre/board.exp.json | 503 ++++++++++++++++++ .../txtar/elk-title-near/dagre/sketch.exp.svg | 107 ++++ .../txtar/elk-title-near/elk/board.exp.json | 444 ++++++++++++++++ .../txtar/elk-title-near/elk/sketch.exp.svg | 107 ++++ e2etests/txtar.txt | 12 + 6 files changed, 1184 insertions(+) create mode 100644 e2etests/testdata/txtar/elk-title-near/dagre/board.exp.json create mode 100644 e2etests/testdata/txtar/elk-title-near/dagre/sketch.exp.svg create mode 100644 e2etests/testdata/txtar/elk-title-near/elk/board.exp.json create mode 100644 e2etests/testdata/txtar/elk-title-near/elk/sketch.exp.svg diff --git a/d2layouts/d2near/layout.go b/d2layouts/d2near/layout.go index cfe568d05..eedecd40d 100644 --- a/d2layouts/d2near/layout.go +++ b/d2layouts/d2near/layout.go @@ -190,6 +190,17 @@ func boundingBox(g *d2graph.Graph) (tl, br *geo.Point) { } } + for _, edge := range g.Edges { + if edge.Route != nil { + for _, point := range edge.Route { + x1 = math.Min(x1, point.X-pad/2) + y1 = math.Min(y1, point.Y-pad/2) + x2 = math.Max(x2, point.X+pad/2) + y2 = math.Max(y2, point.Y+pad/2) + } + } + } + if math.IsInf(x1, 1) && math.IsInf(x2, -1) { x1 = 0 x2 = 0 diff --git a/e2etests/testdata/txtar/elk-title-near/dagre/board.exp.json b/e2etests/testdata/txtar/elk-title-near/dagre/board.exp.json new file mode 100644 index 000000000..ba19475f6 --- /dev/null +++ b/e2etests/testdata/txtar/elk-title-near/dagre/board.exp.json @@ -0,0 +1,503 @@ +{ + "name": "", + "config": { + "sketch": false, + "themeID": 0, + "darkThemeID": null, + "pad": null, + "center": null, + "layoutEngine": null + }, + "isFolderOnly": false, + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "title", + "type": "rectangle", + "pos": { + "x": -121, + "y": -107 + }, + "width": 408, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B6", + "stroke": "B1", + "animated": false, + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "diagram title : Red-line hits 'near: top-center' in elk", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 363, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 10, + "y": 20 + }, + "width": 146, + "height": 292, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B4", + "stroke": "B1", + "animated": false, + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "a", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 12, + "labelHeight": 36, + "labelPosition": "OUTSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "a.a", + "type": "rectangle", + "pos": { + "x": 73, + "y": 50 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "stroke": "B1", + "animated": false, + "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": "rectangle", + "pos": { + "x": 40, + "y": 216 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "stroke": "B1", + "animated": false, + "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": "b", + "type": "rectangle", + "pos": { + "x": 43, + "y": 452 + }, + "width": 113, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B4", + "stroke": "B1", + "animated": false, + "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": 73, + "y": 482 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "stroke": "B1", + "animated": false, + "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 + } + ], + "connections": [ + { + "id": "a.(a -> b)[0]", + "src": "a.a", + "srcArrow": "none", + "dst": "a.b", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "link": "", + "route": [ + { + "x": 86.5, + "y": 116 + }, + { + "x": 70.5, + "y": 156 + }, + { + "x": 66.5, + "y": 176 + }, + { + "x": 66.5, + "y": 216 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(a.b -> b.c)[0]", + "src": "a.b", + "srcArrow": "none", + "dst": "b.c", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "link": "", + "route": [ + { + "x": 66.5, + "y": 282 + }, + { + "x": 66.5, + "y": 322 + }, + { + "x": 66.5, + "y": 342 + }, + { + "x": 66.5, + "y": 357 + }, + { + "x": 66.5, + "y": 372 + }, + { + "x": 70.5, + "y": 442 + }, + { + "x": 86.5, + "y": 482 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(b.c -> a.a)[0]", + "src": "b.c", + "srcArrow": "none", + "dst": "a.a", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "fill": "mistyrose", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "red", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "link": "", + "route": [ + { + "x": 113, + "y": 482 + }, + { + "x": 129, + "y": 442 + }, + { + "x": 133, + "y": 422 + }, + { + "x": 133, + "y": 407 + }, + { + "x": 133, + "y": 392 + }, + { + "x": 133, + "y": 372 + }, + { + "x": 133, + "y": 357 + }, + { + "x": 133, + "y": 342 + }, + { + "x": 133, + "y": 315.3999938964844 + }, + { + "x": 133, + "y": 290.5 + }, + { + "x": 133, + "y": 265.6000061035156 + }, + { + "x": 129, + "y": 156 + }, + { + "x": 113, + "y": 116 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ], + "root": { + "id": "", + "type": "", + "pos": { + "x": 0, + "y": 0 + }, + "width": 0, + "height": 0, + "opacity": 0, + "strokeDash": 0, + "strokeWidth": 0, + "borderRadius": 0, + "fill": "N7", + "stroke": "", + "animated": false, + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "zIndex": 0, + "level": 0 + } +} diff --git a/e2etests/testdata/txtar/elk-title-near/dagre/sketch.exp.svg b/e2etests/testdata/txtar/elk-title-near/dagre/sketch.exp.svg new file mode 100644 index 000000000..aeefbd124 --- /dev/null +++ b/e2etests/testdata/txtar/elk-title-near/dagre/sketch.exp.svg @@ -0,0 +1,107 @@ +diagram title : Red-line hits 'near: top-center' in elkababc + + + + + + + + \ No newline at end of file diff --git a/e2etests/testdata/txtar/elk-title-near/elk/board.exp.json b/e2etests/testdata/txtar/elk-title-near/elk/board.exp.json new file mode 100644 index 000000000..dc901df0c --- /dev/null +++ b/e2etests/testdata/txtar/elk-title-near/elk/board.exp.json @@ -0,0 +1,444 @@ +{ + "name": "", + "config": { + "sketch": false, + "themeID": 0, + "darkThemeID": null, + "pad": null, + "center": null, + "layoutEngine": null + }, + "isFolderOnly": false, + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "title", + "type": "rectangle", + "pos": { + "x": -100, + "y": -84 + }, + "width": 408, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B6", + "stroke": "B1", + "animated": false, + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "diagram title : Red-line hits 'near: top-center' in elk", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 363, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "a", + "type": "rectangle", + "pos": { + "x": 52, + "y": 57 + }, + "width": 153, + "height": 302, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B4", + "stroke": "B1", + "animated": false, + "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": "rectangle", + "pos": { + "x": 102, + "y": 107 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "stroke": "B1", + "animated": false, + "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": "rectangle", + "pos": { + "x": 102, + "y": 243 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "stroke": "B1", + "animated": false, + "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": "b", + "type": "rectangle", + "pos": { + "x": 52, + "y": 439 + }, + "width": 153, + "height": 166, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B4", + "stroke": "B1", + "animated": false, + "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": 102, + "y": 489 + }, + "width": 53, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B5", + "stroke": "B1", + "animated": false, + "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 + } + ], + "connections": [ + { + "id": "a.(a -> b)[0]", + "src": "a.a", + "srcArrow": "none", + "dst": "a.b", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "link": "", + "route": [ + { + "x": 128.5, + "y": 173 + }, + { + "x": 128.5, + "y": 243 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(a.b -> b.c)[0]", + "src": "a.b", + "srcArrow": "none", + "dst": "b.c", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "link": "", + "route": [ + { + "x": 128.5, + "y": 309 + }, + { + "x": 128.5, + "y": 489 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(b.c -> a.a)[0]", + "src": "b.c", + "srcArrow": "none", + "dst": "a.a", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "red", + "fill": "mistyrose", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "red", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "link": "", + "route": [ + { + "x": 128.5, + "y": 555 + }, + { + "x": 128.5, + "y": 650 + }, + { + "x": 12, + "y": 650 + }, + { + "x": 12, + "y": 12 + }, + { + "x": 128.5, + "y": 12 + }, + { + "x": 128.5, + "y": 107 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ], + "root": { + "id": "", + "type": "", + "pos": { + "x": 0, + "y": 0 + }, + "width": 0, + "height": 0, + "opacity": 0, + "strokeDash": 0, + "strokeWidth": 0, + "borderRadius": 0, + "fill": "N7", + "stroke": "", + "animated": false, + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "zIndex": 0, + "level": 0 + } +} diff --git a/e2etests/testdata/txtar/elk-title-near/elk/sketch.exp.svg b/e2etests/testdata/txtar/elk-title-near/elk/sketch.exp.svg new file mode 100644 index 000000000..9b5c267d3 --- /dev/null +++ b/e2etests/testdata/txtar/elk-title-near/elk/sketch.exp.svg @@ -0,0 +1,107 @@ +diagram title : Red-line hits 'near: top-center' in elkababc + + + + + + + + \ No newline at end of file diff --git a/e2etests/txtar.txt b/e2etests/txtar.txt index fae92f88b..46e7e9dfe 100644 --- a/e2etests/txtar.txt +++ b/e2etests/txtar.txt @@ -747,3 +747,15 @@ alice -> alice: "Self-messages" alice -> alice: "Self-messages" bob."In the eyes of my dog, I'm a man." + +-- elk-title-near -- +title: "diagram title : Red-line hits 'near: top-center' in elk" {near: top-center} +a: { + a -> b +} +b: { + c +} + +a.b -> b.c +b.c -> a.a: {style.font-color: red; style.stroke: red; style.fill: mistyrose} From 9cff0eeaa6133c934f54779314ed826df231ba87 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Mon, 3 Feb 2025 16:50:27 -0700 Subject: [PATCH 2/3] ta --- d2layouts/d2near/layout.go | 11 +- .../txtar/elk-title-near/elk/board.exp.json | 4 +- .../txtar/elk-title-near/elk/sketch.exp.svg | 162 +++++++++--------- 3 files changed, 90 insertions(+), 87 deletions(-) diff --git a/d2layouts/d2near/layout.go b/d2layouts/d2near/layout.go index eedecd40d..a08b43ff3 100644 --- a/d2layouts/d2near/layout.go +++ b/d2layouts/d2near/layout.go @@ -191,12 +191,15 @@ func boundingBox(g *d2graph.Graph) (tl, br *geo.Point) { } for _, edge := range g.Edges { + if edge.Src.OuterNearContainer() != nil || edge.Dst.OuterNearContainer() != nil { + continue + } if edge.Route != nil { for _, point := range edge.Route { - x1 = math.Min(x1, point.X-pad/2) - y1 = math.Min(y1, point.Y-pad/2) - x2 = math.Max(x2, point.X+pad/2) - y2 = math.Max(y2, point.Y+pad/2) + x1 = math.Min(x1, point.X) + y1 = math.Min(y1, point.Y) + x2 = math.Max(x2, point.X) + y2 = math.Max(y2, point.Y) } } } diff --git a/e2etests/testdata/txtar/elk-title-near/elk/board.exp.json b/e2etests/testdata/txtar/elk-title-near/elk/board.exp.json index dc901df0c..bcfd342a9 100644 --- a/e2etests/testdata/txtar/elk-title-near/elk/board.exp.json +++ b/e2etests/testdata/txtar/elk-title-near/elk/board.exp.json @@ -15,8 +15,8 @@ "id": "title", "type": "rectangle", "pos": { - "x": -100, - "y": -84 + "x": -95, + "y": -74 }, "width": 408, "height": 66, diff --git a/e2etests/testdata/txtar/elk-title-near/elk/sketch.exp.svg b/e2etests/testdata/txtar/elk-title-near/elk/sketch.exp.svg index 9b5c267d3..d1e841ac6 100644 --- a/e2etests/testdata/txtar/elk-title-near/elk/sketch.exp.svg +++ b/e2etests/testdata/txtar/elk-title-near/elk/sketch.exp.svg @@ -1,16 +1,16 @@ -diagram title : Red-line hits 'near: top-center' in elkababc - - + .d2-1173681419 .fill-N1{fill:#0A0F25;} + .d2-1173681419 .fill-N2{fill:#676C7E;} + .d2-1173681419 .fill-N3{fill:#9499AB;} + .d2-1173681419 .fill-N4{fill:#CFD2DD;} + .d2-1173681419 .fill-N5{fill:#DEE1EB;} + .d2-1173681419 .fill-N6{fill:#EEF1F8;} + .d2-1173681419 .fill-N7{fill:#FFFFFF;} + .d2-1173681419 .fill-B1{fill:#0D32B2;} + .d2-1173681419 .fill-B2{fill:#0D32B2;} + .d2-1173681419 .fill-B3{fill:#E3E9FD;} + .d2-1173681419 .fill-B4{fill:#E3E9FD;} + .d2-1173681419 .fill-B5{fill:#EDF0FD;} + .d2-1173681419 .fill-B6{fill:#F7F8FE;} + .d2-1173681419 .fill-AA2{fill:#4A6FF3;} + .d2-1173681419 .fill-AA4{fill:#EDF0FD;} + .d2-1173681419 .fill-AA5{fill:#F7F8FE;} + .d2-1173681419 .fill-AB4{fill:#EDF0FD;} + .d2-1173681419 .fill-AB5{fill:#F7F8FE;} + .d2-1173681419 .stroke-N1{stroke:#0A0F25;} + .d2-1173681419 .stroke-N2{stroke:#676C7E;} + .d2-1173681419 .stroke-N3{stroke:#9499AB;} + .d2-1173681419 .stroke-N4{stroke:#CFD2DD;} + .d2-1173681419 .stroke-N5{stroke:#DEE1EB;} + .d2-1173681419 .stroke-N6{stroke:#EEF1F8;} + .d2-1173681419 .stroke-N7{stroke:#FFFFFF;} + .d2-1173681419 .stroke-B1{stroke:#0D32B2;} + .d2-1173681419 .stroke-B2{stroke:#0D32B2;} + .d2-1173681419 .stroke-B3{stroke:#E3E9FD;} + .d2-1173681419 .stroke-B4{stroke:#E3E9FD;} + .d2-1173681419 .stroke-B5{stroke:#EDF0FD;} + .d2-1173681419 .stroke-B6{stroke:#F7F8FE;} + .d2-1173681419 .stroke-AA2{stroke:#4A6FF3;} + .d2-1173681419 .stroke-AA4{stroke:#EDF0FD;} + .d2-1173681419 .stroke-AA5{stroke:#F7F8FE;} + .d2-1173681419 .stroke-AB4{stroke:#EDF0FD;} + .d2-1173681419 .stroke-AB5{stroke:#F7F8FE;} + .d2-1173681419 .background-color-N1{background-color:#0A0F25;} + .d2-1173681419 .background-color-N2{background-color:#676C7E;} + .d2-1173681419 .background-color-N3{background-color:#9499AB;} + .d2-1173681419 .background-color-N4{background-color:#CFD2DD;} + .d2-1173681419 .background-color-N5{background-color:#DEE1EB;} + .d2-1173681419 .background-color-N6{background-color:#EEF1F8;} + .d2-1173681419 .background-color-N7{background-color:#FFFFFF;} + .d2-1173681419 .background-color-B1{background-color:#0D32B2;} + .d2-1173681419 .background-color-B2{background-color:#0D32B2;} + .d2-1173681419 .background-color-B3{background-color:#E3E9FD;} + .d2-1173681419 .background-color-B4{background-color:#E3E9FD;} + .d2-1173681419 .background-color-B5{background-color:#EDF0FD;} + .d2-1173681419 .background-color-B6{background-color:#F7F8FE;} + .d2-1173681419 .background-color-AA2{background-color:#4A6FF3;} + .d2-1173681419 .background-color-AA4{background-color:#EDF0FD;} + .d2-1173681419 .background-color-AA5{background-color:#F7F8FE;} + .d2-1173681419 .background-color-AB4{background-color:#EDF0FD;} + .d2-1173681419 .background-color-AB5{background-color:#F7F8FE;} + .d2-1173681419 .color-N1{color:#0A0F25;} + .d2-1173681419 .color-N2{color:#676C7E;} + .d2-1173681419 .color-N3{color:#9499AB;} + .d2-1173681419 .color-N4{color:#CFD2DD;} + .d2-1173681419 .color-N5{color:#DEE1EB;} + .d2-1173681419 .color-N6{color:#EEF1F8;} + .d2-1173681419 .color-N7{color:#FFFFFF;} + .d2-1173681419 .color-B1{color:#0D32B2;} + .d2-1173681419 .color-B2{color:#0D32B2;} + .d2-1173681419 .color-B3{color:#E3E9FD;} + .d2-1173681419 .color-B4{color:#E3E9FD;} + .d2-1173681419 .color-B5{color:#EDF0FD;} + .d2-1173681419 .color-B6{color:#F7F8FE;} + .d2-1173681419 .color-AA2{color:#4A6FF3;} + .d2-1173681419 .color-AA4{color:#EDF0FD;} + .d2-1173681419 .color-AA5{color:#F7F8FE;} + .d2-1173681419 .color-AB4{color:#EDF0FD;} + .d2-1173681419 .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-d2-1173681419);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker-d2-1173681419);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright-d2-1173681419);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright-d2-1173681419);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright-d2-1173681419);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright-d2-1173681419);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark-d2-1173681419);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright-d2-1173681419);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright-d2-1173681419);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright-d2-1173681419);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright-d2-1173681419);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker-d2-1173681419);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark-d2-1173681419);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal-d2-1173681419);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal-d2-1173681419);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright-d2-1173681419);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright-d2-1173681419);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright-d2-1173681419);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>diagram title : Red-line hits 'near: top-center' in elkababc + + From c210855985523e1c8172448b14ddd5eed2d2e90b Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Mon, 3 Feb 2025 17:04:10 -0700 Subject: [PATCH 3/3] next --- 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 acbd468c8..36069c7a1 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -20,6 +20,7 @@ - Compiler: reserved keywords with missing values error instead of silently doing nothing [#2251](https://github.com/terrastruct/d2/pull/2251) - Render: SVG outputs conform to stricter HTML standards, e.g. no duplicate ids [#2273](https://github.com/terrastruct/d2/issues/2273) - Themes: theme names are consistently cased [#2322](https://github.com/terrastruct/d2/pull/2322) +- Nears: constant nears avoid collision with edge routes [#2327](https://github.com/terrastruct/d2/pull/2327) #### Bugfixes ⛑️