From 64f63d2201e799c3fe4f1bb437f72720f89b851d Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 8 Jun 2023 13:45:06 -0700 Subject: [PATCH 01/10] add outiside bottom labels test --- e2etests/stable_test.go | 1 + .../testdata/files/outside_bottom_labels.d2 | 15 + .../dagre/board.exp.json | 454 ++++++++++++++++++ .../dagre/sketch.exp.svg | 95 ++++ .../outside_bottom_labels/elk/board.exp.json | 448 +++++++++++++++++ .../outside_bottom_labels/elk/sketch.exp.svg | 95 ++++ 6 files changed, 1108 insertions(+) create mode 100644 e2etests/testdata/files/outside_bottom_labels.d2 create mode 100644 e2etests/testdata/stable/outside_bottom_labels/dagre/board.exp.json create mode 100644 e2etests/testdata/stable/outside_bottom_labels/dagre/sketch.exp.svg create mode 100644 e2etests/testdata/stable/outside_bottom_labels/elk/board.exp.json create mode 100644 e2etests/testdata/stable/outside_bottom_labels/elk/sketch.exp.svg diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go index 358a4799e..dcdc0f8e7 100644 --- a/e2etests/stable_test.go +++ b/e2etests/stable_test.go @@ -2761,6 +2761,7 @@ scenarios: { loadFromFile(t, "multiple_offset"), loadFromFile(t, "multiple_offset_left"), loadFromFile(t, "multiple_box_selection"), + loadFromFile(t, "outside_bottom_labels"), } runa(t, tcs) diff --git a/e2etests/testdata/files/outside_bottom_labels.d2 b/e2etests/testdata/files/outside_bottom_labels.d2 new file mode 100644 index 000000000..620a4d6f7 --- /dev/null +++ b/e2etests/testdata/files/outside_bottom_labels.d2 @@ -0,0 +1,15 @@ +p1: Daphne Snickerdoodle { + shape: person +} +p2: Prudence McSnortle { + shape: person +} +p3: Polly Pizzazzle { + shape: person +} +p1 -> p3 +p2 -> p3 +p1 -> p3 +p2 -> p3 +p3 -> p2 +p3 -> p1 diff --git a/e2etests/testdata/stable/outside_bottom_labels/dagre/board.exp.json b/e2etests/testdata/stable/outside_bottom_labels/dagre/board.exp.json new file mode 100644 index 000000000..5f01bab22 --- /dev/null +++ b/e2etests/testdata/stable/outside_bottom_labels/dagre/board.exp.json @@ -0,0 +1,454 @@ +{ + "name": "", + "isFolderOnly": false, + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "p1", + "type": "person", + "pos": { + "x": 0, + "y": 0 + }, + "width": 174, + "height": 116, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B3", + "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": "Daphne Snickerdoodle", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 159, + "labelHeight": 21, + "labelPosition": "OUTSIDE_BOTTOM_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "p2", + "type": "person", + "pos": { + "x": 9, + "y": 447 + }, + "width": 157, + "height": 105, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B3", + "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": "Prudence McSnortle", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 142, + "labelHeight": 21, + "labelPosition": "OUTSIDE_BOTTOM_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "p3", + "type": "person", + "pos": { + "x": 28, + "y": 242 + }, + "width": 118, + "height": 79, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B3", + "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": "Polly Pizzazzle", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 103, + "labelHeight": 21, + "labelPosition": "OUTSIDE_BOTTOM_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [ + { + "id": "(p1 -> p3)[0]", + "src": "p1", + "srcArrow": "none", + "dst": "p3", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 80, + "y": 116 + }, + { + "x": 69.5999984741211, + "y": 176.8000030517578 + }, + { + "x": 69, + "y": 202.1999969482422 + }, + { + "x": 77, + "y": 243 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(p2 -> p3)[0]", + "src": "p2", + "srcArrow": "none", + "dst": "p3", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 87, + "y": 447 + }, + { + "x": 87, + "y": 407 + }, + { + "x": 87, + "y": 381.79998779296875 + }, + { + "x": 87, + "y": 321 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(p1 -> p3)[1]", + "src": "p1", + "srcArrow": "none", + "dst": "p3", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 87, + "y": 116 + }, + { + "x": 87, + "y": 176.8000030517578 + }, + { + "x": 87, + "y": 202 + }, + { + "x": 87, + "y": 242 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(p2 -> p3)[1]", + "src": "p2", + "srcArrow": "none", + "dst": "p3", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 98, + "y": 448 + }, + { + "x": 105.19999694824219, + "y": 407.20001220703125 + }, + { + "x": 104, + "y": 381.79998779296875 + }, + { + "x": 92, + "y": 321 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(p3 -> p2)[0]", + "src": "p3", + "srcArrow": "none", + "dst": "p2", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 82, + "y": 321 + }, + { + "x": 70, + "y": 381.79998779296875 + }, + { + "x": 68.80000305175781, + "y": 407.20001220703125 + }, + { + "x": 76, + "y": 448 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(p3 -> p1)[0]", + "src": "p3", + "srcArrow": "none", + "dst": "p1", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 97, + "y": 243 + }, + { + "x": 105, + "y": 202.1999969482422 + }, + { + "x": 104.4000015258789, + "y": 176.8000030517578 + }, + { + "x": 94, + "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": "", + "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/stable/outside_bottom_labels/dagre/sketch.exp.svg b/e2etests/testdata/stable/outside_bottom_labels/dagre/sketch.exp.svg new file mode 100644 index 000000000..fdd5e27f2 --- /dev/null +++ b/e2etests/testdata/stable/outside_bottom_labels/dagre/sketch.exp.svg @@ -0,0 +1,95 @@ +Daphne SnickerdoodlePrudence McSnortlePolly Pizzazzle + + + \ No newline at end of file diff --git a/e2etests/testdata/stable/outside_bottom_labels/elk/board.exp.json b/e2etests/testdata/stable/outside_bottom_labels/elk/board.exp.json new file mode 100644 index 000000000..ed078a0cf --- /dev/null +++ b/e2etests/testdata/stable/outside_bottom_labels/elk/board.exp.json @@ -0,0 +1,448 @@ +{ + "name": "", + "isFolderOnly": false, + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "p1", + "type": "person", + "pos": { + "x": 12, + "y": 12 + }, + "width": 174, + "height": 116, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B3", + "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": "Daphne Snickerdoodle", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 159, + "labelHeight": 21, + "labelPosition": "OUTSIDE_BOTTOM_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "p2", + "type": "person", + "pos": { + "x": 206, + "y": 23 + }, + "width": 157, + "height": 105, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B3", + "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": "Prudence McSnortle", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 142, + "labelHeight": 21, + "labelPosition": "OUTSIDE_BOTTOM_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "p3", + "type": "person", + "pos": { + "x": 113, + "y": 334 + }, + "width": 160, + "height": 79, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "B3", + "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": "Polly Pizzazzle", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 103, + "labelHeight": 21, + "labelPosition": "OUTSIDE_BOTTOM_CENTER", + "zIndex": 0, + "level": 1 + } + ], + "connections": [ + { + "id": "(p1 -> p3)[0]", + "src": "p1", + "srcArrow": "none", + "dst": "p3", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 55, + "y": 128 + }, + { + "x": 55.5, + "y": 294 + }, + { + "x": 136.73199462890625, + "y": 294 + }, + { + "x": 137, + "y": 354 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(p2 -> p3)[0]", + "src": "p2", + "srcArrow": "none", + "dst": "p3", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 245, + "y": 128 + }, + { + "x": 245.25, + "y": 194 + }, + { + "x": 205.30299377441406, + "y": 194 + }, + { + "x": 205, + "y": 334 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(p1 -> p3)[1]", + "src": "p1", + "srcArrow": "none", + "dst": "p3", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 99, + "y": 128 + }, + { + "x": 99, + "y": 244 + }, + { + "x": 159.58900451660156, + "y": 244 + }, + { + "x": 160, + "y": 339 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(p2 -> p3)[1]", + "src": "p2", + "srcArrow": "none", + "dst": "p3", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 284, + "y": 128 + }, + { + "x": 284.5, + "y": 244 + }, + { + "x": 228.16000366210938, + "y": 244 + }, + { + "x": 228, + "y": 339 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(p3 -> p2)[0]", + "src": "p3", + "srcArrow": "none", + "dst": "p2", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 251, + "y": 353 + }, + { + "x": 251.01699829101562, + "y": 294 + }, + { + "x": 323.75, + "y": 294 + }, + { + "x": 324, + "y": 128 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(p3 -> p1)[0]", + "src": "p3", + "srcArrow": "none", + "dst": "p1", + "dstArrow": "triangle", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 182, + "y": 335 + }, + { + "x": 182.4459991455078, + "y": 194 + }, + { + "x": 142.5, + "y": 194 + }, + { + "x": 142, + "y": 128 + } + ], + "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": "", + "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/stable/outside_bottom_labels/elk/sketch.exp.svg b/e2etests/testdata/stable/outside_bottom_labels/elk/sketch.exp.svg new file mode 100644 index 000000000..3833ea5eb --- /dev/null +++ b/e2etests/testdata/stable/outside_bottom_labels/elk/sketch.exp.svg @@ -0,0 +1,95 @@ +Daphne SnickerdoodlePrudence McSnortlePolly Pizzazzle + + + \ No newline at end of file From 35fd624ead7cd8ab91d3d06103dcfeeddaa375a7 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 8 Jun 2023 13:50:29 -0700 Subject: [PATCH 02/10] trace to outside labels --- d2layouts/d2dagrelayout/layout.go | 46 ++++++++++++++++--------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/d2layouts/d2dagrelayout/layout.go b/d2layouts/d2dagrelayout/layout.go index 97734237d..6a89729d3 100644 --- a/d2layouts/d2dagrelayout/layout.go +++ b/d2layouts/d2dagrelayout/layout.go @@ -495,33 +495,35 @@ 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]) - // 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.Label.Value != "" && !dstShape.Is(shape.TEXT_TYPE) { + // if an edge runs into an outside label, stop the edge at the label instead + overlapsOutsideLabel := false + if edge.Dst.Label.Value != "" && !dstShape.Is(shape.TEXT_TYPE) { // assumes LabelPosition, LabelWidth, LabelHeight are all set if there is a label - labelWidth := float64(edge.Dst.LabelDimensions.Width) - labelHeight := float64(edge.Dst.LabelDimensions.Height) - labelTL := label.Position(*edge.Dst.LabelPosition). - GetPointOnBox(edge.Dst.Box, label.PADDING, labelWidth, labelHeight) + labelPosition := label.Position(*edge.Dst.LabelPosition) + if labelPosition.IsOutside() { + labelWidth := float64(edge.Dst.LabelDimensions.Width) + labelHeight := float64(edge.Dst.LabelDimensions.Height) + labelTL := 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) - // 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-- + 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 { + overlapsOutsideLabel = 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 { + if !overlapsOutsideLabel { points[endIndex] = shape.TraceToShapeBorder(dstShape, end, points[endIndex-1]) } points = points[startIndex : endIndex+1] From 3cef43cc348b28a51153ee13d5d2a370f1b54929 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 8 Jun 2023 13:55:50 -0700 Subject: [PATCH 03/10] also trace with edge source --- d2layouts/d2dagrelayout/layout.go | 35 ++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/d2layouts/d2dagrelayout/layout.go b/d2layouts/d2dagrelayout/layout.go index 6a89729d3..22ae8a0cc 100644 --- a/d2layouts/d2dagrelayout/layout.go +++ b/d2layouts/d2dagrelayout/layout.go @@ -492,11 +492,40 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err srcShape := edge.Src.ToShape() dstShape := edge.Dst.ToShape() - // trace the edge to the specific shape's border - points[startIndex] = shape.TraceToShapeBorder(srcShape, start, points[startIndex+1]) - // if an edge runs into an outside label, stop the edge at the label instead overlapsOutsideLabel := false + if edge.Src.Label.Value != "" && !srcShape.Is(shape.TEXT_TYPE) { + // assumes LabelPosition, LabelWidth, LabelHeight are all set if there is a label + labelPosition := label.Position(*edge.Src.LabelPosition) + if labelPosition.IsOutside() { + labelWidth := float64(edge.Src.LabelDimensions.Width) + labelHeight := float64(edge.Src.LabelDimensions.Height) + labelTL := labelPosition.GetPointOnBox(edge.Src.Box, label.PADDING, labelWidth, labelHeight) + + startingSegment := geo.Segment{Start: points[startIndex+1], End: points[startIndex]} + 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(startingSegment); len(intersections) > 0 { + overlapsOutsideLabel = true + // move starting segment to label intersection point + points[startIndex] = intersections[0] + startingSegment.End = intersections[0] + // if the segment becomes too short, just merge it with the next segment + if startIndex < len(points) && startingSegment.Length() < MIN_SEGMENT_LEN { + points[startIndex+1] = points[startIndex] + startIndex++ + } + } + } + } + if !overlapsOutsideLabel { + // trace the edge to the specific shape's border + points[startIndex] = shape.TraceToShapeBorder(srcShape, start, points[startIndex+1]) + } + + overlapsOutsideLabel = false if edge.Dst.Label.Value != "" && !dstShape.Is(shape.TEXT_TYPE) { // assumes LabelPosition, LabelWidth, LabelHeight are all set if there is a label labelPosition := label.Position(*edge.Dst.LabelPosition) From f9a55e6acd26b0b8df62e7a62b5abe5b354d5a66 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 8 Jun 2023 13:56:39 -0700 Subject: [PATCH 04/10] update test --- .../dagre/board.exp.json | 40 ++--- .../dagre/sketch.exp.svg | 152 +++++++++--------- 2 files changed, 96 insertions(+), 96 deletions(-) diff --git a/e2etests/testdata/stable/outside_bottom_labels/dagre/board.exp.json b/e2etests/testdata/stable/outside_bottom_labels/dagre/board.exp.json index 5f01bab22..0b07ba894 100644 --- a/e2etests/testdata/stable/outside_bottom_labels/dagre/board.exp.json +++ b/e2etests/testdata/stable/outside_bottom_labels/dagre/board.exp.json @@ -153,12 +153,12 @@ "labelPercentage": 0, "route": [ { - "x": 80, - "y": 116 + "x": 75, + "y": 142 }, { - "x": 69.5999984741211, - "y": 176.8000030517578 + "x": 68.5999984741211, + "y": 182 }, { "x": 69, @@ -209,11 +209,11 @@ }, { "x": 87, - "y": 381.79998779296875 + "y": 387 }, { "x": 87, - "y": 321 + "y": 347 } ], "isCurve": true, @@ -248,11 +248,11 @@ "route": [ { "x": 87, - "y": 116 + "y": 142 }, { "x": 87, - "y": 176.8000030517578 + "y": 182 }, { "x": 87, @@ -302,12 +302,12 @@ "y": 407.20001220703125 }, { - "x": 104, - "y": 381.79998779296875 + "x": 105, + "y": 387 }, { - "x": 92, - "y": 321 + "x": 97, + "y": 347 } ], "isCurve": true, @@ -341,12 +341,12 @@ "labelPercentage": 0, "route": [ { - "x": 82, - "y": 321 + "x": 77, + "y": 347 }, { - "x": 70, - "y": 381.79998779296875 + "x": 69, + "y": 387 }, { "x": 68.80000305175781, @@ -396,12 +396,12 @@ "y": 202.1999969482422 }, { - "x": 104.4000015258789, - "y": 176.8000030517578 + "x": 105.4000015258789, + "y": 182 }, { - "x": 94, - "y": 116 + "x": 99, + "y": 142 } ], "isCurve": true, diff --git a/e2etests/testdata/stable/outside_bottom_labels/dagre/sketch.exp.svg b/e2etests/testdata/stable/outside_bottom_labels/dagre/sketch.exp.svg index fdd5e27f2..6c1c1d12f 100644 --- a/e2etests/testdata/stable/outside_bottom_labels/dagre/sketch.exp.svg +++ b/e2etests/testdata/stable/outside_bottom_labels/dagre/sketch.exp.svg @@ -1,9 +1,9 @@ -Daphne SnickerdoodlePrudence McSnortlePolly Pizzazzle + .d2-3340817268 .fill-N1{fill:#0A0F25;} + .d2-3340817268 .fill-N2{fill:#676C7E;} + .d2-3340817268 .fill-N3{fill:#9499AB;} + .d2-3340817268 .fill-N4{fill:#CFD2DD;} + .d2-3340817268 .fill-N5{fill:#DEE1EB;} + .d2-3340817268 .fill-N6{fill:#EEF1F8;} + .d2-3340817268 .fill-N7{fill:#FFFFFF;} + .d2-3340817268 .fill-B1{fill:#0D32B2;} + .d2-3340817268 .fill-B2{fill:#0D32B2;} + .d2-3340817268 .fill-B3{fill:#E3E9FD;} + .d2-3340817268 .fill-B4{fill:#E3E9FD;} + .d2-3340817268 .fill-B5{fill:#EDF0FD;} + .d2-3340817268 .fill-B6{fill:#F7F8FE;} + .d2-3340817268 .fill-AA2{fill:#4A6FF3;} + .d2-3340817268 .fill-AA4{fill:#EDF0FD;} + .d2-3340817268 .fill-AA5{fill:#F7F8FE;} + .d2-3340817268 .fill-AB4{fill:#EDF0FD;} + .d2-3340817268 .fill-AB5{fill:#F7F8FE;} + .d2-3340817268 .stroke-N1{stroke:#0A0F25;} + .d2-3340817268 .stroke-N2{stroke:#676C7E;} + .d2-3340817268 .stroke-N3{stroke:#9499AB;} + .d2-3340817268 .stroke-N4{stroke:#CFD2DD;} + .d2-3340817268 .stroke-N5{stroke:#DEE1EB;} + .d2-3340817268 .stroke-N6{stroke:#EEF1F8;} + .d2-3340817268 .stroke-N7{stroke:#FFFFFF;} + .d2-3340817268 .stroke-B1{stroke:#0D32B2;} + .d2-3340817268 .stroke-B2{stroke:#0D32B2;} + .d2-3340817268 .stroke-B3{stroke:#E3E9FD;} + .d2-3340817268 .stroke-B4{stroke:#E3E9FD;} + .d2-3340817268 .stroke-B5{stroke:#EDF0FD;} + .d2-3340817268 .stroke-B6{stroke:#F7F8FE;} + .d2-3340817268 .stroke-AA2{stroke:#4A6FF3;} + .d2-3340817268 .stroke-AA4{stroke:#EDF0FD;} + .d2-3340817268 .stroke-AA5{stroke:#F7F8FE;} + .d2-3340817268 .stroke-AB4{stroke:#EDF0FD;} + .d2-3340817268 .stroke-AB5{stroke:#F7F8FE;} + .d2-3340817268 .background-color-N1{background-color:#0A0F25;} + .d2-3340817268 .background-color-N2{background-color:#676C7E;} + .d2-3340817268 .background-color-N3{background-color:#9499AB;} + .d2-3340817268 .background-color-N4{background-color:#CFD2DD;} + .d2-3340817268 .background-color-N5{background-color:#DEE1EB;} + .d2-3340817268 .background-color-N6{background-color:#EEF1F8;} + .d2-3340817268 .background-color-N7{background-color:#FFFFFF;} + .d2-3340817268 .background-color-B1{background-color:#0D32B2;} + .d2-3340817268 .background-color-B2{background-color:#0D32B2;} + .d2-3340817268 .background-color-B3{background-color:#E3E9FD;} + .d2-3340817268 .background-color-B4{background-color:#E3E9FD;} + .d2-3340817268 .background-color-B5{background-color:#EDF0FD;} + .d2-3340817268 .background-color-B6{background-color:#F7F8FE;} + .d2-3340817268 .background-color-AA2{background-color:#4A6FF3;} + .d2-3340817268 .background-color-AA4{background-color:#EDF0FD;} + .d2-3340817268 .background-color-AA5{background-color:#F7F8FE;} + .d2-3340817268 .background-color-AB4{background-color:#EDF0FD;} + .d2-3340817268 .background-color-AB5{background-color:#F7F8FE;} + .d2-3340817268 .color-N1{color:#0A0F25;} + .d2-3340817268 .color-N2{color:#676C7E;} + .d2-3340817268 .color-N3{color:#9499AB;} + .d2-3340817268 .color-N4{color:#CFD2DD;} + .d2-3340817268 .color-N5{color:#DEE1EB;} + .d2-3340817268 .color-N6{color:#EEF1F8;} + .d2-3340817268 .color-N7{color:#FFFFFF;} + .d2-3340817268 .color-B1{color:#0D32B2;} + .d2-3340817268 .color-B2{color:#0D32B2;} + .d2-3340817268 .color-B3{color:#E3E9FD;} + .d2-3340817268 .color-B4{color:#E3E9FD;} + .d2-3340817268 .color-B5{color:#EDF0FD;} + .d2-3340817268 .color-B6{color:#F7F8FE;} + .d2-3340817268 .color-AA2{color:#4A6FF3;} + .d2-3340817268 .color-AA4{color:#EDF0FD;} + .d2-3340817268 .color-AA5{color:#F7F8FE;} + .d2-3340817268 .color-AB4{color:#EDF0FD;} + .d2-3340817268 .color-AB5{color:#F7F8FE;}.appendix text.text{fill:#0A0F25}.md{--color-fg-default:#0A0F25;--color-fg-muted:#676C7E;--color-fg-subtle:#9499AB;--color-canvas-default:#FFFFFF;--color-canvas-subtle:#EEF1F8;--color-border-default:#0D32B2;--color-border-muted:#0D32B2;--color-neutral-muted:#EEF1F8;--color-accent-fg:#0D32B2;--color-accent-emphasis:#0D32B2;--color-attention-subtle:#676C7E;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>Daphne SnickerdoodlePrudence McSnortlePolly Pizzazzle \ No newline at end of file From fe52f1a65970ee0e8ae81e45687247780f883e95 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 8 Jun 2023 14:00:32 -0700 Subject: [PATCH 05/10] check shape type --- d2layouts/d2dagrelayout/layout.go | 94 +++++++++++++++++-------------- 1 file changed, 52 insertions(+), 42 deletions(-) diff --git a/d2layouts/d2dagrelayout/layout.go b/d2layouts/d2dagrelayout/layout.go index 22ae8a0cc..da59d0ec6 100644 --- a/d2layouts/d2dagrelayout/layout.go +++ b/d2layouts/d2dagrelayout/layout.go @@ -494,28 +494,33 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err // if an edge runs into an outside label, stop the edge at the label instead overlapsOutsideLabel := false - if edge.Src.Label.Value != "" && !srcShape.Is(shape.TEXT_TYPE) { - // assumes LabelPosition, LabelWidth, LabelHeight are all set if there is a label - labelPosition := label.Position(*edge.Src.LabelPosition) - if labelPosition.IsOutside() { - labelWidth := float64(edge.Src.LabelDimensions.Width) - labelHeight := float64(edge.Src.LabelDimensions.Height) - labelTL := labelPosition.GetPointOnBox(edge.Src.Box, label.PADDING, labelWidth, labelHeight) + switch srcShape.GetType() { + case shape.TEXT_TYPE, shape.TABLE_TYPE, shape.CLASS_TYPE, shape.CODE_TYPE: + // labels aren't actually labels + default: + if edge.Src.Label.Value != "" { + // assumes LabelPosition, LabelWidth, LabelHeight are all set if there is a label + labelPosition := label.Position(*edge.Src.LabelPosition) + if labelPosition.IsOutside() { + labelWidth := float64(edge.Src.LabelDimensions.Width) + labelHeight := float64(edge.Src.LabelDimensions.Height) + labelTL := labelPosition.GetPointOnBox(edge.Src.Box, label.PADDING, labelWidth, labelHeight) - startingSegment := geo.Segment{Start: points[startIndex+1], End: points[startIndex]} - 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(startingSegment); len(intersections) > 0 { - overlapsOutsideLabel = true - // move starting segment to label intersection point - points[startIndex] = intersections[0] - startingSegment.End = intersections[0] - // if the segment becomes too short, just merge it with the next segment - if startIndex < len(points) && startingSegment.Length() < MIN_SEGMENT_LEN { - points[startIndex+1] = points[startIndex] - startIndex++ + startingSegment := geo.Segment{Start: points[startIndex+1], End: points[startIndex]} + 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(startingSegment); len(intersections) > 0 { + overlapsOutsideLabel = true + // move starting segment to label intersection point + points[startIndex] = intersections[0] + startingSegment.End = intersections[0] + // if the segment becomes too short, just merge it with the next segment + if startIndex < len(points) && startingSegment.Length() < MIN_SEGMENT_LEN { + points[startIndex+1] = points[startIndex] + startIndex++ + } } } } @@ -526,28 +531,33 @@ func Layout(ctx context.Context, g *d2graph.Graph, opts *ConfigurableOpts) (err } overlapsOutsideLabel = false - if edge.Dst.Label.Value != "" && !dstShape.Is(shape.TEXT_TYPE) { - // assumes LabelPosition, LabelWidth, LabelHeight are all set if there is a label - labelPosition := label.Position(*edge.Dst.LabelPosition) - if labelPosition.IsOutside() { - labelWidth := float64(edge.Dst.LabelDimensions.Width) - labelHeight := float64(edge.Dst.LabelDimensions.Height) - labelTL := labelPosition.GetPointOnBox(edge.Dst.Box, label.PADDING, labelWidth, labelHeight) + switch dstShape.GetType() { + case shape.TEXT_TYPE, shape.TABLE_TYPE, shape.CLASS_TYPE, shape.CODE_TYPE: + // labels aren't actually labels + default: + if edge.Dst.Label.Value != "" { + // assumes LabelPosition, LabelWidth, LabelHeight are all set if there is a label + labelPosition := label.Position(*edge.Dst.LabelPosition) + if labelPosition.IsOutside() { + labelWidth := float64(edge.Dst.LabelDimensions.Width) + labelHeight := float64(edge.Dst.LabelDimensions.Height) + labelTL := 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) - // add left/right padding to box - labelBox.TopLeft.X -= label.PADDING - labelBox.Width += 2 * label.PADDING - if intersections := labelBox.Intersections(endingSegment); len(intersections) > 0 { - overlapsOutsideLabel = 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-- + 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 { + overlapsOutsideLabel = 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-- + } } } } From 4dfd5d960d613cbf730177dbee3ad5ced3c444ad Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 8 Jun 2023 14:02:52 -0700 Subject: [PATCH 06/10] update tests --- .../dagre/board.exp.json | 16 +- .../dagre/sketch.exp.svg | 576 +++++++++--------- .../themes/origami/dagre/board.exp.json | 8 +- .../themes/origami/dagre/sketch.exp.svg | 168 ++--- .../themes/terminal/dagre/board.exp.json | 16 +- .../themes/terminal/dagre/sketch.exp.svg | 570 ++++++++--------- 6 files changed, 677 insertions(+), 677 deletions(-) diff --git a/e2etests/testdata/themes/dark_terrastruct_flagship/dagre/board.exp.json b/e2etests/testdata/themes/dark_terrastruct_flagship/dagre/board.exp.json index 8eb19cc74..6443dd135 100644 --- a/e2etests/testdata/themes/dark_terrastruct_flagship/dagre/board.exp.json +++ b/e2etests/testdata/themes/dark_terrastruct_flagship/dagre/board.exp.json @@ -1049,12 +1049,12 @@ "labelPercentage": 0, "route": [ { - "x": 155, - "y": 169 + "x": 163.5, + "y": 194.5 }, { - "x": 198.60000610351562, - "y": 303 + "x": 200.3000030517578, + "y": 308.1000061035156 }, { "x": 209.5, @@ -1096,12 +1096,12 @@ "labelPercentage": 0, "route": [ { - "x": 134, - "y": 169 + "x": 124.75, + "y": 194.5 }, { - "x": 86.5999984741211, - "y": 303 + "x": 84.75, + "y": 308.1000061035156 }, { "x": 74.75, diff --git a/e2etests/testdata/themes/dark_terrastruct_flagship/dagre/sketch.exp.svg b/e2etests/testdata/themes/dark_terrastruct_flagship/dagre/sketch.exp.svg index 7319b24a4..b9c6e937d 100644 --- a/e2etests/testdata/themes/dark_terrastruct_flagship/dagre/sketch.exp.svg +++ b/e2etests/testdata/themes/dark_terrastruct_flagship/dagre/sketch.exp.svg @@ -1,41 +1,41 @@ -networkuserapi serverlogsusersidintnamestringemailstringpasswordstringlast_logindatetimeproducts+idint+pricedecimal+skustring+namestring

A tale

@@ -908,14 +908,14 @@     city2 := City{Name: "CityB", Population: 1200000}     tellTale(city1, city2) -}Cell Toweronline portaldata processorsatellitesTRANSMITTERuistorage sendsendsendphone logsmake call accessdisplaypersist +}Cell Toweronline portaldata processorsatellitesTRANSMITTERuistorage sendsendsendphone logsmake call accessdisplaypersist - - + + \ No newline at end of file diff --git a/e2etests/testdata/themes/origami/dagre/board.exp.json b/e2etests/testdata/themes/origami/dagre/board.exp.json index ebc2188fe..00460a587 100644 --- a/e2etests/testdata/themes/origami/dagre/board.exp.json +++ b/e2etests/testdata/themes/origami/dagre/board.exp.json @@ -775,12 +775,12 @@ "labelPercentage": 0, "route": [ { - "x": 127, - "y": 87 + "x": 111.75, + "y": 112.5 }, { - "x": 85.1989974975586, - "y": 156.1999969482422 + "x": 82.1500015258789, + "y": 161.3000030517578 }, { "x": 74.75, diff --git a/e2etests/testdata/themes/origami/dagre/sketch.exp.svg b/e2etests/testdata/themes/origami/dagre/sketch.exp.svg index c9cbd8e53..20c2895fc 100644 --- a/e2etests/testdata/themes/origami/dagre/sketch.exp.svg +++ b/e2etests/testdata/themes/origami/dagre/sketch.exp.svg @@ -1,23 +1,23 @@ -Daphne SnickerdoodlePrudence McSnortlePolly Pizzazzle + .d2-3041694875 .fill-N1{fill:#0A0F25;} + .d2-3041694875 .fill-N2{fill:#676C7E;} + .d2-3041694875 .fill-N3{fill:#9499AB;} + .d2-3041694875 .fill-N4{fill:#CFD2DD;} + .d2-3041694875 .fill-N5{fill:#DEE1EB;} + .d2-3041694875 .fill-N6{fill:#EEF1F8;} + .d2-3041694875 .fill-N7{fill:#FFFFFF;} + .d2-3041694875 .fill-B1{fill:#0D32B2;} + .d2-3041694875 .fill-B2{fill:#0D32B2;} + .d2-3041694875 .fill-B3{fill:#E3E9FD;} + .d2-3041694875 .fill-B4{fill:#E3E9FD;} + .d2-3041694875 .fill-B5{fill:#EDF0FD;} + .d2-3041694875 .fill-B6{fill:#F7F8FE;} + .d2-3041694875 .fill-AA2{fill:#4A6FF3;} + .d2-3041694875 .fill-AA4{fill:#EDF0FD;} + .d2-3041694875 .fill-AA5{fill:#F7F8FE;} + .d2-3041694875 .fill-AB4{fill:#EDF0FD;} + .d2-3041694875 .fill-AB5{fill:#F7F8FE;} + .d2-3041694875 .stroke-N1{stroke:#0A0F25;} + .d2-3041694875 .stroke-N2{stroke:#676C7E;} + .d2-3041694875 .stroke-N3{stroke:#9499AB;} + .d2-3041694875 .stroke-N4{stroke:#CFD2DD;} + .d2-3041694875 .stroke-N5{stroke:#DEE1EB;} + .d2-3041694875 .stroke-N6{stroke:#EEF1F8;} + .d2-3041694875 .stroke-N7{stroke:#FFFFFF;} + .d2-3041694875 .stroke-B1{stroke:#0D32B2;} + .d2-3041694875 .stroke-B2{stroke:#0D32B2;} + .d2-3041694875 .stroke-B3{stroke:#E3E9FD;} + .d2-3041694875 .stroke-B4{stroke:#E3E9FD;} + .d2-3041694875 .stroke-B5{stroke:#EDF0FD;} + .d2-3041694875 .stroke-B6{stroke:#F7F8FE;} + .d2-3041694875 .stroke-AA2{stroke:#4A6FF3;} + .d2-3041694875 .stroke-AA4{stroke:#EDF0FD;} + .d2-3041694875 .stroke-AA5{stroke:#F7F8FE;} + .d2-3041694875 .stroke-AB4{stroke:#EDF0FD;} + .d2-3041694875 .stroke-AB5{stroke:#F7F8FE;} + .d2-3041694875 .background-color-N1{background-color:#0A0F25;} + .d2-3041694875 .background-color-N2{background-color:#676C7E;} + .d2-3041694875 .background-color-N3{background-color:#9499AB;} + .d2-3041694875 .background-color-N4{background-color:#CFD2DD;} + .d2-3041694875 .background-color-N5{background-color:#DEE1EB;} + .d2-3041694875 .background-color-N6{background-color:#EEF1F8;} + .d2-3041694875 .background-color-N7{background-color:#FFFFFF;} + .d2-3041694875 .background-color-B1{background-color:#0D32B2;} + .d2-3041694875 .background-color-B2{background-color:#0D32B2;} + .d2-3041694875 .background-color-B3{background-color:#E3E9FD;} + .d2-3041694875 .background-color-B4{background-color:#E3E9FD;} + .d2-3041694875 .background-color-B5{background-color:#EDF0FD;} + .d2-3041694875 .background-color-B6{background-color:#F7F8FE;} + .d2-3041694875 .background-color-AA2{background-color:#4A6FF3;} + .d2-3041694875 .background-color-AA4{background-color:#EDF0FD;} + .d2-3041694875 .background-color-AA5{background-color:#F7F8FE;} + .d2-3041694875 .background-color-AB4{background-color:#EDF0FD;} + .d2-3041694875 .background-color-AB5{background-color:#F7F8FE;} + .d2-3041694875 .color-N1{color:#0A0F25;} + .d2-3041694875 .color-N2{color:#676C7E;} + .d2-3041694875 .color-N3{color:#9499AB;} + .d2-3041694875 .color-N4{color:#CFD2DD;} + .d2-3041694875 .color-N5{color:#DEE1EB;} + .d2-3041694875 .color-N6{color:#EEF1F8;} + .d2-3041694875 .color-N7{color:#FFFFFF;} + .d2-3041694875 .color-B1{color:#0D32B2;} + .d2-3041694875 .color-B2{color:#0D32B2;} + .d2-3041694875 .color-B3{color:#E3E9FD;} + .d2-3041694875 .color-B4{color:#E3E9FD;} + .d2-3041694875 .color-B5{color:#EDF0FD;} + .d2-3041694875 .color-B6{color:#F7F8FE;} + .d2-3041694875 .color-AA2{color:#4A6FF3;} + .d2-3041694875 .color-AA4{color:#EDF0FD;} + .d2-3041694875 .color-AA5{color:#F7F8FE;} + .d2-3041694875 .color-AB4{color:#EDF0FD;} + .d2-3041694875 .color-AB5{color:#F7F8FE;}.appendix text.text{fill:#0A0F25}.md{--color-fg-default:#0A0F25;--color-fg-muted:#676C7E;--color-fg-subtle:#9499AB;--color-canvas-default:#FFFFFF;--color-canvas-subtle:#EEF1F8;--color-border-default:#0D32B2;--color-border-muted:#0D32B2;--color-neutral-muted:#EEF1F8;--color-accent-fg:#0D32B2;--color-accent-emphasis:#0D32B2;--color-attention-subtle:#676C7E;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]>Daphne SnickerdoodlePrudence McSnortlePolly Pizzazzle \ No newline at end of file diff --git a/e2etests/testdata/themes/origami/elk/board.exp.json b/e2etests/testdata/themes/origami/elk/board.exp.json index dd03f897d..afc225702 100644 --- a/e2etests/testdata/themes/origami/elk/board.exp.json +++ b/e2etests/testdata/themes/origami/elk/board.exp.json @@ -681,8 +681,8 @@ "labelPercentage": 0, "route": [ { - "x": 291, - "y": 99 + "x": 290.6659851074219, + "y": 125 }, { "x": 290.6659851074219, @@ -727,7 +727,7 @@ "route": [ { "x": 334, - "y": 99 + "y": 125 }, { "x": 334, diff --git a/e2etests/testdata/themes/origami/elk/sketch.exp.svg b/e2etests/testdata/themes/origami/elk/sketch.exp.svg index 822ac8184..dcbe1f6fb 100644 --- a/e2etests/testdata/themes/origami/elk/sketch.exp.svg +++ b/e2etests/testdata/themes/origami/elk/sketch.exp.svg @@ -1,23 +1,23 @@ -