From 74f1efdd47dd8d38afbfe0de6fc154735616ff25 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Wed, 29 Mar 2023 16:37:40 -0700 Subject: [PATCH 1/4] add bold_edge_label test --- e2etests/regression_test.go | 10 + .../bold_edge_label/dagre/board.exp.json | 270 ++++++++++++++++++ .../bold_edge_label/dagre/sketch.exp.svg | 103 +++++++ .../bold_edge_label/elk/board.exp.json | 252 ++++++++++++++++ .../bold_edge_label/elk/sketch.exp.svg | 103 +++++++ 5 files changed, 738 insertions(+) create mode 100644 e2etests/testdata/regression/bold_edge_label/dagre/board.exp.json create mode 100644 e2etests/testdata/regression/bold_edge_label/dagre/sketch.exp.svg create mode 100644 e2etests/testdata/regression/bold_edge_label/elk/board.exp.json create mode 100644 e2etests/testdata/regression/bold_edge_label/elk/sketch.exp.svg diff --git a/e2etests/regression_test.go b/e2etests/regression_test.go index 1d47c95e6..fd60724c5 100644 --- a/e2etests/regression_test.go +++ b/e2etests/regression_test.go @@ -646,6 +646,16 @@ l3c2.c -> l4.c3.c`, name: "link_with_ampersand", script: `a.link: https://calendar.google.com/calendar/u/0/r?tab=mc&pli=1`, }, + { + name: "bold_edge_label", + script: ` +direction: right +x -> y: sync +y -> z: sync { + style.bold: true +} +`, + }, } runa(t, tcs) diff --git a/e2etests/testdata/regression/bold_edge_label/dagre/board.exp.json b/e2etests/testdata/regression/bold_edge_label/dagre/board.exp.json new file mode 100644 index 000000000..9768f82a3 --- /dev/null +++ b/e2etests/testdata/regression/bold_edge_label/dagre/board.exp.json @@ -0,0 +1,270 @@ +{ + "name": "", + "isFolderOnly": false, + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "x", + "type": "rectangle", + "pos": { + "x": 0, + "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": 184, + "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": "y", + "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 + }, + { + "id": "z", + "type": "rectangle", + "pos": { + "x": 369, + "y": 0 + }, + "width": 52, + "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": "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": 1 + } + ], + "connections": [ + { + "id": "(x -> y)[0]", + "src": "x", + "srcArrow": "none", + "srcLabel": "", + "dst": "y", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "sync", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 31, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 53, + "y": 33 + }, + { + "x": 105.4, + "y": 33 + }, + { + "x": 131.7, + "y": 33 + }, + { + "x": 184.5, + "y": 33 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(y -> z)[0]", + "src": "y", + "srcArrow": "none", + "srcLabel": "", + "dst": "z", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "sync", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": true, + "underline": false, + "labelWidth": 31, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 238, + "y": 33 + }, + { + "x": 290.4, + "y": 33 + }, + { + "x": 316.7, + "y": 33 + }, + { + "x": 369.5, + "y": 33 + } + ], + "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/regression/bold_edge_label/dagre/sketch.exp.svg b/e2etests/testdata/regression/bold_edge_label/dagre/sketch.exp.svg new file mode 100644 index 000000000..f75802b5a --- /dev/null +++ b/e2etests/testdata/regression/bold_edge_label/dagre/sketch.exp.svg @@ -0,0 +1,103 @@ +xyz syncsync + + + + \ No newline at end of file diff --git a/e2etests/testdata/regression/bold_edge_label/elk/board.exp.json b/e2etests/testdata/regression/bold_edge_label/elk/board.exp.json new file mode 100644 index 000000000..6f235bb13 --- /dev/null +++ b/e2etests/testdata/regression/bold_edge_label/elk/board.exp.json @@ -0,0 +1,252 @@ +{ + "name": "", + "isFolderOnly": false, + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "x", + "type": "rectangle", + "pos": { + "x": 12, + "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": 236, + "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": "y", + "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 + }, + { + "id": "z", + "type": "rectangle", + "pos": { + "x": 461, + "y": 12 + }, + "width": 52, + "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": "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": 1 + } + ], + "connections": [ + { + "id": "(x -> y)[0]", + "src": "x", + "srcArrow": "none", + "srcLabel": "", + "dst": "y", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "sync", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 31, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 65, + "y": 45 + }, + { + "x": 236, + "y": 45 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(y -> z)[0]", + "src": "y", + "srcArrow": "none", + "srcLabel": "", + "dst": "z", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "sync", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": true, + "underline": false, + "labelWidth": 31, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 290, + "y": 45 + }, + { + "x": 461, + "y": 45 + } + ], + "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/regression/bold_edge_label/elk/sketch.exp.svg b/e2etests/testdata/regression/bold_edge_label/elk/sketch.exp.svg new file mode 100644 index 000000000..49004da91 --- /dev/null +++ b/e2etests/testdata/regression/bold_edge_label/elk/sketch.exp.svg @@ -0,0 +1,103 @@ +xyz syncsync + + + + \ No newline at end of file From 4e2821de52a5e9e7f7aa570f43ef7735de3e54c4 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Wed, 29 Mar 2023 16:36:30 -0700 Subject: [PATCH 2/4] consider bold edge labels --- d2graph/d2graph.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go index 54c658a21..34bc96d42 100644 --- a/d2graph/d2graph.go +++ b/d2graph/d2graph.go @@ -1032,10 +1032,14 @@ func (e *Edge) Text() *d2target.MText { if e.Attributes.Style.FontSize != nil { fontSize, _ = strconv.Atoi(e.Attributes.Style.FontSize.Value) } + isBold := false + if e.Attributes.Style.Bold != nil { + isBold, _ = strconv.ParseBool(e.Attributes.Style.Bold.Value) + } return &d2target.MText{ Text: e.Attributes.Label.Value, FontSize: fontSize, - IsBold: false, + IsBold: isBold, IsItalic: true, Dimensions: e.LabelDimensions, From d59773399dab5d1e45564db90d095cd9e7319409 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Wed, 29 Mar 2023 16:39:03 -0700 Subject: [PATCH 3/4] update test --- .../bold_edge_label/dagre/board.exp.json | 10 +- .../bold_edge_label/dagre/sketch.exp.svg | 162 +++++++++--------- .../bold_edge_label/elk/board.exp.json | 6 +- .../bold_edge_label/elk/sketch.exp.svg | 162 +++++++++--------- 4 files changed, 170 insertions(+), 170 deletions(-) diff --git a/e2etests/testdata/regression/bold_edge_label/dagre/board.exp.json b/e2etests/testdata/regression/bold_edge_label/dagre/board.exp.json index 9768f82a3..1f413bf33 100644 --- a/e2etests/testdata/regression/bold_edge_label/dagre/board.exp.json +++ b/e2etests/testdata/regression/bold_edge_label/dagre/board.exp.json @@ -89,7 +89,7 @@ "id": "z", "type": "rectangle", "pos": { - "x": 369, + "x": 371, "y": 0 }, "width": 52, @@ -198,7 +198,7 @@ "italic": true, "bold": true, "underline": false, - "labelWidth": 31, + "labelWidth": 33, "labelHeight": 21, "labelPosition": "INSIDE_MIDDLE_CENTER", "labelPercentage": 0, @@ -208,15 +208,15 @@ "y": 33 }, { - "x": 290.4, + "x": 291.2, "y": 33 }, { - "x": 316.7, + "x": 317.9, "y": 33 }, { - "x": 369.5, + "x": 371.5, "y": 33 } ], diff --git a/e2etests/testdata/regression/bold_edge_label/dagre/sketch.exp.svg b/e2etests/testdata/regression/bold_edge_label/dagre/sketch.exp.svg index f75802b5a..9a598934d 100644 --- a/e2etests/testdata/regression/bold_edge_label/dagre/sketch.exp.svg +++ b/e2etests/testdata/regression/bold_edge_label/dagre/sketch.exp.svg @@ -1,16 +1,16 @@ -xyz syncsync - + .d2-2734330532 .fill-N1{fill:#0A0F25;} + .d2-2734330532 .fill-N2{fill:#676C7E;} + .d2-2734330532 .fill-N3{fill:#9499AB;} + .d2-2734330532 .fill-N4{fill:#CFD2DD;} + .d2-2734330532 .fill-N5{fill:#DEE1EB;} + .d2-2734330532 .fill-N6{fill:#EEF1F8;} + .d2-2734330532 .fill-N7{fill:#FFFFFF;} + .d2-2734330532 .fill-B1{fill:#0D32B2;} + .d2-2734330532 .fill-B2{fill:#0D32B2;} + .d2-2734330532 .fill-B3{fill:#E3E9FD;} + .d2-2734330532 .fill-B4{fill:#E3E9FD;} + .d2-2734330532 .fill-B5{fill:#EDF0FD;} + .d2-2734330532 .fill-B6{fill:#F7F8FE;} + .d2-2734330532 .fill-AA2{fill:#4A6FF3;} + .d2-2734330532 .fill-AA4{fill:#EDF0FD;} + .d2-2734330532 .fill-AA5{fill:#F7F8FE;} + .d2-2734330532 .fill-AB4{fill:#EDF0FD;} + .d2-2734330532 .fill-AB5{fill:#F7F8FE;} + .d2-2734330532 .stroke-N1{stroke:#0A0F25;} + .d2-2734330532 .stroke-N2{stroke:#676C7E;} + .d2-2734330532 .stroke-N3{stroke:#9499AB;} + .d2-2734330532 .stroke-N4{stroke:#CFD2DD;} + .d2-2734330532 .stroke-N5{stroke:#DEE1EB;} + .d2-2734330532 .stroke-N6{stroke:#EEF1F8;} + .d2-2734330532 .stroke-N7{stroke:#FFFFFF;} + .d2-2734330532 .stroke-B1{stroke:#0D32B2;} + .d2-2734330532 .stroke-B2{stroke:#0D32B2;} + .d2-2734330532 .stroke-B3{stroke:#E3E9FD;} + .d2-2734330532 .stroke-B4{stroke:#E3E9FD;} + .d2-2734330532 .stroke-B5{stroke:#EDF0FD;} + .d2-2734330532 .stroke-B6{stroke:#F7F8FE;} + .d2-2734330532 .stroke-AA2{stroke:#4A6FF3;} + .d2-2734330532 .stroke-AA4{stroke:#EDF0FD;} + .d2-2734330532 .stroke-AA5{stroke:#F7F8FE;} + .d2-2734330532 .stroke-AB4{stroke:#EDF0FD;} + .d2-2734330532 .stroke-AB5{stroke:#F7F8FE;} + .d2-2734330532 .background-color-N1{background-color:#0A0F25;} + .d2-2734330532 .background-color-N2{background-color:#676C7E;} + .d2-2734330532 .background-color-N3{background-color:#9499AB;} + .d2-2734330532 .background-color-N4{background-color:#CFD2DD;} + .d2-2734330532 .background-color-N5{background-color:#DEE1EB;} + .d2-2734330532 .background-color-N6{background-color:#EEF1F8;} + .d2-2734330532 .background-color-N7{background-color:#FFFFFF;} + .d2-2734330532 .background-color-B1{background-color:#0D32B2;} + .d2-2734330532 .background-color-B2{background-color:#0D32B2;} + .d2-2734330532 .background-color-B3{background-color:#E3E9FD;} + .d2-2734330532 .background-color-B4{background-color:#E3E9FD;} + .d2-2734330532 .background-color-B5{background-color:#EDF0FD;} + .d2-2734330532 .background-color-B6{background-color:#F7F8FE;} + .d2-2734330532 .background-color-AA2{background-color:#4A6FF3;} + .d2-2734330532 .background-color-AA4{background-color:#EDF0FD;} + .d2-2734330532 .background-color-AA5{background-color:#F7F8FE;} + .d2-2734330532 .background-color-AB4{background-color:#EDF0FD;} + .d2-2734330532 .background-color-AB5{background-color:#F7F8FE;} + .d2-2734330532 .color-N1{color:#0A0F25;} + .d2-2734330532 .color-N2{color:#676C7E;} + .d2-2734330532 .color-N3{color:#9499AB;} + .d2-2734330532 .color-N4{color:#CFD2DD;} + .d2-2734330532 .color-N5{color:#DEE1EB;} + .d2-2734330532 .color-N6{color:#EEF1F8;} + .d2-2734330532 .color-N7{color:#FFFFFF;} + .d2-2734330532 .color-B1{color:#0D32B2;} + .d2-2734330532 .color-B2{color:#0D32B2;} + .d2-2734330532 .color-B3{color:#E3E9FD;} + .d2-2734330532 .color-B4{color:#E3E9FD;} + .d2-2734330532 .color-B5{color:#EDF0FD;} + .d2-2734330532 .color-B6{color:#F7F8FE;} + .d2-2734330532 .color-AA2{color:#4A6FF3;} + .d2-2734330532 .color-AA4{color:#EDF0FD;} + .d2-2734330532 .color-AA5{color:#F7F8FE;} + .d2-2734330532 .color-AB4{color:#EDF0FD;} + .d2-2734330532 .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}]]>xyz syncsync + - + \ No newline at end of file diff --git a/e2etests/testdata/regression/bold_edge_label/elk/board.exp.json b/e2etests/testdata/regression/bold_edge_label/elk/board.exp.json index 6f235bb13..7ecaafa2e 100644 --- a/e2etests/testdata/regression/bold_edge_label/elk/board.exp.json +++ b/e2etests/testdata/regression/bold_edge_label/elk/board.exp.json @@ -89,7 +89,7 @@ "id": "z", "type": "rectangle", "pos": { - "x": 461, + "x": 463, "y": 12 }, "width": 52, @@ -189,7 +189,7 @@ "italic": true, "bold": true, "underline": false, - "labelWidth": 31, + "labelWidth": 33, "labelHeight": 21, "labelPosition": "INSIDE_MIDDLE_CENTER", "labelPercentage": 0, @@ -199,7 +199,7 @@ "y": 45 }, { - "x": 461, + "x": 463, "y": 45 } ], diff --git a/e2etests/testdata/regression/bold_edge_label/elk/sketch.exp.svg b/e2etests/testdata/regression/bold_edge_label/elk/sketch.exp.svg index 49004da91..19efc8b10 100644 --- a/e2etests/testdata/regression/bold_edge_label/elk/sketch.exp.svg +++ b/e2etests/testdata/regression/bold_edge_label/elk/sketch.exp.svg @@ -1,16 +1,16 @@ -xyz syncsync - + .d2-2338416351 .fill-N1{fill:#0A0F25;} + .d2-2338416351 .fill-N2{fill:#676C7E;} + .d2-2338416351 .fill-N3{fill:#9499AB;} + .d2-2338416351 .fill-N4{fill:#CFD2DD;} + .d2-2338416351 .fill-N5{fill:#DEE1EB;} + .d2-2338416351 .fill-N6{fill:#EEF1F8;} + .d2-2338416351 .fill-N7{fill:#FFFFFF;} + .d2-2338416351 .fill-B1{fill:#0D32B2;} + .d2-2338416351 .fill-B2{fill:#0D32B2;} + .d2-2338416351 .fill-B3{fill:#E3E9FD;} + .d2-2338416351 .fill-B4{fill:#E3E9FD;} + .d2-2338416351 .fill-B5{fill:#EDF0FD;} + .d2-2338416351 .fill-B6{fill:#F7F8FE;} + .d2-2338416351 .fill-AA2{fill:#4A6FF3;} + .d2-2338416351 .fill-AA4{fill:#EDF0FD;} + .d2-2338416351 .fill-AA5{fill:#F7F8FE;} + .d2-2338416351 .fill-AB4{fill:#EDF0FD;} + .d2-2338416351 .fill-AB5{fill:#F7F8FE;} + .d2-2338416351 .stroke-N1{stroke:#0A0F25;} + .d2-2338416351 .stroke-N2{stroke:#676C7E;} + .d2-2338416351 .stroke-N3{stroke:#9499AB;} + .d2-2338416351 .stroke-N4{stroke:#CFD2DD;} + .d2-2338416351 .stroke-N5{stroke:#DEE1EB;} + .d2-2338416351 .stroke-N6{stroke:#EEF1F8;} + .d2-2338416351 .stroke-N7{stroke:#FFFFFF;} + .d2-2338416351 .stroke-B1{stroke:#0D32B2;} + .d2-2338416351 .stroke-B2{stroke:#0D32B2;} + .d2-2338416351 .stroke-B3{stroke:#E3E9FD;} + .d2-2338416351 .stroke-B4{stroke:#E3E9FD;} + .d2-2338416351 .stroke-B5{stroke:#EDF0FD;} + .d2-2338416351 .stroke-B6{stroke:#F7F8FE;} + .d2-2338416351 .stroke-AA2{stroke:#4A6FF3;} + .d2-2338416351 .stroke-AA4{stroke:#EDF0FD;} + .d2-2338416351 .stroke-AA5{stroke:#F7F8FE;} + .d2-2338416351 .stroke-AB4{stroke:#EDF0FD;} + .d2-2338416351 .stroke-AB5{stroke:#F7F8FE;} + .d2-2338416351 .background-color-N1{background-color:#0A0F25;} + .d2-2338416351 .background-color-N2{background-color:#676C7E;} + .d2-2338416351 .background-color-N3{background-color:#9499AB;} + .d2-2338416351 .background-color-N4{background-color:#CFD2DD;} + .d2-2338416351 .background-color-N5{background-color:#DEE1EB;} + .d2-2338416351 .background-color-N6{background-color:#EEF1F8;} + .d2-2338416351 .background-color-N7{background-color:#FFFFFF;} + .d2-2338416351 .background-color-B1{background-color:#0D32B2;} + .d2-2338416351 .background-color-B2{background-color:#0D32B2;} + .d2-2338416351 .background-color-B3{background-color:#E3E9FD;} + .d2-2338416351 .background-color-B4{background-color:#E3E9FD;} + .d2-2338416351 .background-color-B5{background-color:#EDF0FD;} + .d2-2338416351 .background-color-B6{background-color:#F7F8FE;} + .d2-2338416351 .background-color-AA2{background-color:#4A6FF3;} + .d2-2338416351 .background-color-AA4{background-color:#EDF0FD;} + .d2-2338416351 .background-color-AA5{background-color:#F7F8FE;} + .d2-2338416351 .background-color-AB4{background-color:#EDF0FD;} + .d2-2338416351 .background-color-AB5{background-color:#F7F8FE;} + .d2-2338416351 .color-N1{color:#0A0F25;} + .d2-2338416351 .color-N2{color:#676C7E;} + .d2-2338416351 .color-N3{color:#9499AB;} + .d2-2338416351 .color-N4{color:#CFD2DD;} + .d2-2338416351 .color-N5{color:#DEE1EB;} + .d2-2338416351 .color-N6{color:#EEF1F8;} + .d2-2338416351 .color-N7{color:#FFFFFF;} + .d2-2338416351 .color-B1{color:#0D32B2;} + .d2-2338416351 .color-B2{color:#0D32B2;} + .d2-2338416351 .color-B3{color:#E3E9FD;} + .d2-2338416351 .color-B4{color:#E3E9FD;} + .d2-2338416351 .color-B5{color:#EDF0FD;} + .d2-2338416351 .color-B6{color:#F7F8FE;} + .d2-2338416351 .color-AA2{color:#4A6FF3;} + .d2-2338416351 .color-AA4{color:#EDF0FD;} + .d2-2338416351 .color-AA5{color:#F7F8FE;} + .d2-2338416351 .color-AB4{color:#EDF0FD;} + .d2-2338416351 .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}]]>xyz syncsync + - + \ No newline at end of file From 505207aa23d49033fb2dd146ac515cdf392c3636 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Wed, 29 Mar 2023 16:45:41 -0700 Subject: [PATCH 4/4] 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 a7c04cccd..d6954393a 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -11,3 +11,4 @@ #### Bugfixes ⛑️ - prevent an object's `near` from targeting a text near a constant. [#1100](https://github.com/terrastruct/d2/pull/1100) +- fixes inaccurate bold edge label padding. [#1108](https://github.com/terrastruct/d2/pull/1108)