From c39a22682dead1e7d9ece46eb38edc374cbb7092 Mon Sep 17 00:00:00 2001
From: Daniel Suh <23denial@gmail.com>
Date: Fri, 17 May 2024 13:36:38 -0400
Subject: [PATCH 1/5] fix sketch circle
---
d2renderers/d2sketch/sketch.go | 7 +
e2etests/testdata/txtar.txt | 16 ++
.../dagre/board.exp.json | 186 ++++++++++++++++++
.../dagre/sketch.exp.svg | 104 ++++++++++
.../elk/board.exp.json | 177 +++++++++++++++++
.../elk/sketch.exp.svg | 104 ++++++++++
6 files changed, 594 insertions(+)
create mode 100644 e2etests/testdata/txtar/sketch-mode-circle-arrowhead/dagre/board.exp.json
create mode 100644 e2etests/testdata/txtar/sketch-mode-circle-arrowhead/dagre/sketch.exp.svg
create mode 100644 e2etests/testdata/txtar/sketch-mode-circle-arrowhead/elk/board.exp.json
create mode 100644 e2etests/testdata/txtar/sketch-mode-circle-arrowhead/elk/sketch.exp.svg
diff --git a/d2renderers/d2sketch/sketch.go b/d2renderers/d2sketch/sketch.go
index 38918c88b..ee984e8f1 100644
--- a/d2renderers/d2sketch/sketch.go
+++ b/d2renderers/d2sketch/sketch.go
@@ -802,6 +802,13 @@ func ArrowheadJS(r *Runner, arrowhead d2target.Arrowhead, stroke string, strokeW
stroke,
BG_COLOR,
)
+ case d2target.CircleArrowhead:
+ arrowJS = fmt.Sprintf(
+ `node = rc.circle(-2, 0, 8, { strokeWidth: %d, stroke: "%s", fill: "%s", fillStyle: "solid", fillWeight: 1, seed: 5 })`,
+ strokeWidth,
+ stroke,
+ BG_COLOR,
+ )
}
return
}
diff --git a/e2etests/testdata/txtar.txt b/e2etests/testdata/txtar.txt
index 60366a5a5..6ed66eb79 100644
--- a/e2etests/testdata/txtar.txt
+++ b/e2etests/testdata/txtar.txt
@@ -213,3 +213,19 @@ ok: {
}
dog1 -> dog3
}
+
+-- sketch-mode-circle-arrowhead --
+vars: {
+ d2-config: {
+ sketch: true
+ }
+}
+
+a
+b
+a <-> b: {
+ source-arrowhead: {
+ shape: circle
+ style.filled: false
+ }
+}
diff --git a/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/dagre/board.exp.json b/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/dagre/board.exp.json
new file mode 100644
index 000000000..4fecabf21
--- /dev/null
+++ b/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/dagre/board.exp.json
@@ -0,0 +1,186 @@
+{
+ "name": "",
+ "config": {
+ "sketch": true,
+ "themeID": null,
+ "darkThemeID": null,
+ "pad": null,
+ "center": null,
+ "layoutEngine": null
+ },
+ "isFolderOnly": false,
+ "fontFamily": "HandDrawn",
+ "shapes": [
+ {
+ "id": "a",
+ "type": "rectangle",
+ "pos": {
+ "x": 1,
+ "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": "a",
+ "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": "b",
+ "type": "rectangle",
+ "pos": {
+ "x": 0,
+ "y": 166
+ },
+ "width": 55,
+ "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": "b",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 10,
+ "labelHeight": 21,
+ "labelPosition": "INSIDE_MIDDLE_CENTER",
+ "zIndex": 0,
+ "level": 1
+ }
+ ],
+ "connections": [
+ {
+ "id": "(a <-> b)[0]",
+ "src": "a",
+ "srcArrow": "circle",
+ "dst": "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,
+ "route": [
+ {
+ "x": 27.5,
+ "y": 66
+ },
+ {
+ "x": 27.5,
+ "y": 106
+ },
+ {
+ "x": 27.5,
+ "y": 126
+ },
+ {
+ "x": 27.5,
+ "y": 166
+ }
+ ],
+ "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/txtar/sketch-mode-circle-arrowhead/dagre/sketch.exp.svg b/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/dagre/sketch.exp.svg
new file mode 100644
index 000000000..5ea080412
--- /dev/null
+++ b/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/dagre/sketch.exp.svg
@@ -0,0 +1,104 @@
+
\ No newline at end of file
diff --git a/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/elk/board.exp.json b/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/elk/board.exp.json
new file mode 100644
index 000000000..6608f9b0c
--- /dev/null
+++ b/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/elk/board.exp.json
@@ -0,0 +1,177 @@
+{
+ "name": "",
+ "config": {
+ "sketch": true,
+ "themeID": null,
+ "darkThemeID": null,
+ "pad": null,
+ "center": null,
+ "layoutEngine": null
+ },
+ "isFolderOnly": false,
+ "fontFamily": "HandDrawn",
+ "shapes": [
+ {
+ "id": "a",
+ "type": "rectangle",
+ "pos": {
+ "x": 12,
+ "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": "a",
+ "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": "b",
+ "type": "rectangle",
+ "pos": {
+ "x": 12,
+ "y": 148
+ },
+ "width": 55,
+ "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": "b",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "N1",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 10,
+ "labelHeight": 21,
+ "labelPosition": "INSIDE_MIDDLE_CENTER",
+ "zIndex": 0,
+ "level": 1
+ }
+ ],
+ "connections": [
+ {
+ "id": "(a <-> b)[0]",
+ "src": "a",
+ "srcArrow": "circle",
+ "dst": "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,
+ "route": [
+ {
+ "x": 39.5,
+ "y": 78
+ },
+ {
+ "x": 39.5,
+ "y": 148
+ }
+ ],
+ "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/txtar/sketch-mode-circle-arrowhead/elk/sketch.exp.svg b/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/elk/sketch.exp.svg
new file mode 100644
index 000000000..6fa094674
--- /dev/null
+++ b/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/elk/sketch.exp.svg
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
+ab
+
+
+
+
\ No newline at end of file
From cb70b523103fc0bfe8c5eea0f88586bf1dd6c2b8 Mon Sep 17 00:00:00 2001
From: Daniel Suh <23denial@gmail.com>
Date: Fri, 17 May 2024 13:42:26 -0400
Subject: [PATCH 2/5] added fix into bugfixes next.md
---
ci/release/changelogs/next.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md
index c81cdb0bd..d8ddc3af2 100644
--- a/ci/release/changelogs/next.md
+++ b/ci/release/changelogs/next.md
@@ -6,3 +6,4 @@
- Local relative icons are relative to the d2 file instead of CLI invoke path [#1924](https://github.com/terrastruct/d2/pull/1924)
- Custom label positions weren't being read when the width was smaller than the label [#1928](https://github.com/terrastruct/d2/pull/1928)
+- Using circle shape for arrowheads no longer removes all arrowheads along path
From 1ff3f87020f2a30f341639231479e29eb069ac48 Mon Sep 17 00:00:00 2001
From: Daniel Suh <63919918+23danielsuh@users.noreply.github.com>
Date: Fri, 17 May 2024 13:45:42 -0400
Subject: [PATCH 3/5] Update next.md
---
ci/release/changelogs/next.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md
index d8ddc3af2..d87830ad8 100644
--- a/ci/release/changelogs/next.md
+++ b/ci/release/changelogs/next.md
@@ -6,4 +6,4 @@
- Local relative icons are relative to the d2 file instead of CLI invoke path [#1924](https://github.com/terrastruct/d2/pull/1924)
- Custom label positions weren't being read when the width was smaller than the label [#1928](https://github.com/terrastruct/d2/pull/1928)
-- Using circle shape for arrowheads no longer removes all arrowheads along path
+- Using circle shape for arrowheads no longer removes all arrowheads along path [#1942](https://github.com/terrastruct/d2/pull/1942)
From e978d4772b763164171288ff9089beab43e799aa Mon Sep 17 00:00:00 2001
From: Daniel Suh <23denial@gmail.com>
Date: Sat, 18 May 2024 13:59:46 -0400
Subject: [PATCH 4/5] centers circle for sketch
---
ci/release/changelogs/next.md | 2 +-
d2renderers/d2sketch/sketch.go | 2 +-
e2etests/testdata/txtar.txt | 10 +
.../dagre/board.exp.json | 217 ++++++++++++++++++
.../dagre/sketch.exp.svg | 161 ++++++-------
.../elk/board.exp.json | 199 ++++++++++++++++
.../elk/sketch.exp.svg | 161 ++++++-------
7 files changed, 592 insertions(+), 160 deletions(-)
diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md
index c5a0c1d9f..78fb742e6 100644
--- a/ci/release/changelogs/next.md
+++ b/ci/release/changelogs/next.md
@@ -8,4 +8,4 @@
- Local relative icons are relative to the d2 file instead of CLI invoke path [#1924](https://github.com/terrastruct/d2/pull/1924)
- Custom label positions weren't being read when the width was smaller than the label [#1928](https://github.com/terrastruct/d2/pull/1928)
-- Using circle shape for arrowheads no longer removes all arrowheads along path [#1942](https://github.com/terrastruct/d2/pull/1942)
+- Using `shape: circle` for arrowheads no longer removes all arrowheads along path [#1942](https://github.com/terrastruct/d2/pull/1942)
diff --git a/d2renderers/d2sketch/sketch.go b/d2renderers/d2sketch/sketch.go
index ee984e8f1..3ab9e8c27 100644
--- a/d2renderers/d2sketch/sketch.go
+++ b/d2renderers/d2sketch/sketch.go
@@ -804,7 +804,7 @@ func ArrowheadJS(r *Runner, arrowhead d2target.Arrowhead, stroke string, strokeW
)
case d2target.CircleArrowhead:
arrowJS = fmt.Sprintf(
- `node = rc.circle(-2, 0, 8, { strokeWidth: %d, stroke: "%s", fill: "%s", fillStyle: "solid", fillWeight: 1, seed: 5 })`,
+ `node = rc.circle(-2, -1, 8, { strokeWidth: %d, stroke: "%s", fill: "%s", fillStyle: "solid", fillWeight: 1, seed: 5 })`,
strokeWidth,
stroke,
BG_COLOR,
diff --git a/e2etests/testdata/txtar.txt b/e2etests/testdata/txtar.txt
index 038853de6..882a24a78 100644
--- a/e2etests/testdata/txtar.txt
+++ b/e2etests/testdata/txtar.txt
@@ -248,3 +248,13 @@ a <-> b: {
}
}
+x
+y
+z
+x <-> y <-> z: {
+ source-arrowhead: {
+ shape: circle
+ style.filled: false
+ }
+ direction: right
+}
diff --git a/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/dagre/board.exp.json b/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/dagre/board.exp.json
index 4fecabf21..6e64ad35a 100644
--- a/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/dagre/board.exp.json
+++ b/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/dagre/board.exp.json
@@ -92,6 +92,129 @@
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
+ },
+ {
+ "id": "x",
+ "type": "rectangle",
+ "pos": {
+ "x": 115,
+ "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": "x",
+ "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": "y",
+ "type": "rectangle",
+ "pos": {
+ "x": 115,
+ "y": 166
+ },
+ "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": 116,
+ "y": 332
+ },
+ "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": "z",
+ "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
}
],
"connections": [
@@ -141,6 +264,100 @@
"tooltip": "",
"icon": null,
"zIndex": 0
+ },
+ {
+ "id": "(x <-> y)[0]",
+ "src": "x",
+ "srcArrow": "circle",
+ "dst": "y",
+ "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": 142,
+ "y": 66
+ },
+ {
+ "x": 142,
+ "y": 106
+ },
+ {
+ "x": 142,
+ "y": 126
+ },
+ {
+ "x": 142,
+ "y": 166
+ }
+ ],
+ "isCurve": true,
+ "animated": false,
+ "tooltip": "",
+ "icon": null,
+ "zIndex": 0
+ },
+ {
+ "id": "(y <-> z)[0]",
+ "src": "y",
+ "srcArrow": "circle",
+ "dst": "z",
+ "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": 142,
+ "y": 232
+ },
+ {
+ "x": 142,
+ "y": 272
+ },
+ {
+ "x": 142,
+ "y": 292
+ },
+ {
+ "x": 142,
+ "y": 332
+ }
+ ],
+ "isCurve": true,
+ "animated": false,
+ "tooltip": "",
+ "icon": null,
+ "zIndex": 0
}
],
"root": {
diff --git a/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/dagre/sketch.exp.svg b/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/dagre/sketch.exp.svg
index 5ea080412..cc3a74131 100644
--- a/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/dagre/sketch.exp.svg
+++ b/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/dagre/sketch.exp.svg
@@ -1,10 +1,10 @@
-
+ .d2-2958031725 .fill-N1{fill:#0A0F25;}
+ .d2-2958031725 .fill-N2{fill:#676C7E;}
+ .d2-2958031725 .fill-N3{fill:#9499AB;}
+ .d2-2958031725 .fill-N4{fill:#CFD2DD;}
+ .d2-2958031725 .fill-N5{fill:#DEE1EB;}
+ .d2-2958031725 .fill-N6{fill:#EEF1F8;}
+ .d2-2958031725 .fill-N7{fill:#FFFFFF;}
+ .d2-2958031725 .fill-B1{fill:#0D32B2;}
+ .d2-2958031725 .fill-B2{fill:#0D32B2;}
+ .d2-2958031725 .fill-B3{fill:#E3E9FD;}
+ .d2-2958031725 .fill-B4{fill:#E3E9FD;}
+ .d2-2958031725 .fill-B5{fill:#EDF0FD;}
+ .d2-2958031725 .fill-B6{fill:#F7F8FE;}
+ .d2-2958031725 .fill-AA2{fill:#4A6FF3;}
+ .d2-2958031725 .fill-AA4{fill:#EDF0FD;}
+ .d2-2958031725 .fill-AA5{fill:#F7F8FE;}
+ .d2-2958031725 .fill-AB4{fill:#EDF0FD;}
+ .d2-2958031725 .fill-AB5{fill:#F7F8FE;}
+ .d2-2958031725 .stroke-N1{stroke:#0A0F25;}
+ .d2-2958031725 .stroke-N2{stroke:#676C7E;}
+ .d2-2958031725 .stroke-N3{stroke:#9499AB;}
+ .d2-2958031725 .stroke-N4{stroke:#CFD2DD;}
+ .d2-2958031725 .stroke-N5{stroke:#DEE1EB;}
+ .d2-2958031725 .stroke-N6{stroke:#EEF1F8;}
+ .d2-2958031725 .stroke-N7{stroke:#FFFFFF;}
+ .d2-2958031725 .stroke-B1{stroke:#0D32B2;}
+ .d2-2958031725 .stroke-B2{stroke:#0D32B2;}
+ .d2-2958031725 .stroke-B3{stroke:#E3E9FD;}
+ .d2-2958031725 .stroke-B4{stroke:#E3E9FD;}
+ .d2-2958031725 .stroke-B5{stroke:#EDF0FD;}
+ .d2-2958031725 .stroke-B6{stroke:#F7F8FE;}
+ .d2-2958031725 .stroke-AA2{stroke:#4A6FF3;}
+ .d2-2958031725 .stroke-AA4{stroke:#EDF0FD;}
+ .d2-2958031725 .stroke-AA5{stroke:#F7F8FE;}
+ .d2-2958031725 .stroke-AB4{stroke:#EDF0FD;}
+ .d2-2958031725 .stroke-AB5{stroke:#F7F8FE;}
+ .d2-2958031725 .background-color-N1{background-color:#0A0F25;}
+ .d2-2958031725 .background-color-N2{background-color:#676C7E;}
+ .d2-2958031725 .background-color-N3{background-color:#9499AB;}
+ .d2-2958031725 .background-color-N4{background-color:#CFD2DD;}
+ .d2-2958031725 .background-color-N5{background-color:#DEE1EB;}
+ .d2-2958031725 .background-color-N6{background-color:#EEF1F8;}
+ .d2-2958031725 .background-color-N7{background-color:#FFFFFF;}
+ .d2-2958031725 .background-color-B1{background-color:#0D32B2;}
+ .d2-2958031725 .background-color-B2{background-color:#0D32B2;}
+ .d2-2958031725 .background-color-B3{background-color:#E3E9FD;}
+ .d2-2958031725 .background-color-B4{background-color:#E3E9FD;}
+ .d2-2958031725 .background-color-B5{background-color:#EDF0FD;}
+ .d2-2958031725 .background-color-B6{background-color:#F7F8FE;}
+ .d2-2958031725 .background-color-AA2{background-color:#4A6FF3;}
+ .d2-2958031725 .background-color-AA4{background-color:#EDF0FD;}
+ .d2-2958031725 .background-color-AA5{background-color:#F7F8FE;}
+ .d2-2958031725 .background-color-AB4{background-color:#EDF0FD;}
+ .d2-2958031725 .background-color-AB5{background-color:#F7F8FE;}
+ .d2-2958031725 .color-N1{color:#0A0F25;}
+ .d2-2958031725 .color-N2{color:#676C7E;}
+ .d2-2958031725 .color-N3{color:#9499AB;}
+ .d2-2958031725 .color-N4{color:#CFD2DD;}
+ .d2-2958031725 .color-N5{color:#DEE1EB;}
+ .d2-2958031725 .color-N6{color:#EEF1F8;}
+ .d2-2958031725 .color-N7{color:#FFFFFF;}
+ .d2-2958031725 .color-B1{color:#0D32B2;}
+ .d2-2958031725 .color-B2{color:#0D32B2;}
+ .d2-2958031725 .color-B3{color:#E3E9FD;}
+ .d2-2958031725 .color-B4{color:#E3E9FD;}
+ .d2-2958031725 .color-B5{color:#EDF0FD;}
+ .d2-2958031725 .color-B6{color:#F7F8FE;}
+ .d2-2958031725 .color-AA2{color:#4A6FF3;}
+ .d2-2958031725 .color-AA4{color:#EDF0FD;}
+ .d2-2958031725 .color-AA5{color:#F7F8FE;}
+ .d2-2958031725 .color-AB4{color:#EDF0FD;}
+ .d2-2958031725 .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}]]>
@@ -97,8 +97,11 @@
-ab
-
+abxyz
+
+
+
+
\ No newline at end of file
diff --git a/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/elk/board.exp.json b/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/elk/board.exp.json
index 6608f9b0c..aeccd4631 100644
--- a/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/elk/board.exp.json
+++ b/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/elk/board.exp.json
@@ -92,6 +92,129 @@
"labelPosition": "INSIDE_MIDDLE_CENTER",
"zIndex": 0,
"level": 1
+ },
+ {
+ "id": "x",
+ "type": "rectangle",
+ "pos": {
+ "x": 87,
+ "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": "x",
+ "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": "y",
+ "type": "rectangle",
+ "pos": {
+ "x": 87,
+ "y": 148
+ },
+ "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": 87,
+ "y": 284
+ },
+ "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": "z",
+ "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
}
],
"connections": [
@@ -132,6 +255,82 @@
"tooltip": "",
"icon": null,
"zIndex": 0
+ },
+ {
+ "id": "(x <-> y)[0]",
+ "src": "x",
+ "srcArrow": "circle",
+ "dst": "y",
+ "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": 114,
+ "y": 78
+ },
+ {
+ "x": 114,
+ "y": 148
+ }
+ ],
+ "animated": false,
+ "tooltip": "",
+ "icon": null,
+ "zIndex": 0
+ },
+ {
+ "id": "(y <-> z)[0]",
+ "src": "y",
+ "srcArrow": "circle",
+ "dst": "z",
+ "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": 114,
+ "y": 214
+ },
+ {
+ "x": 114,
+ "y": 284
+ }
+ ],
+ "animated": false,
+ "tooltip": "",
+ "icon": null,
+ "zIndex": 0
}
],
"root": {
diff --git a/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/elk/sketch.exp.svg b/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/elk/sketch.exp.svg
index 6fa094674..ccf71925b 100644
--- a/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/elk/sketch.exp.svg
+++ b/e2etests/testdata/txtar/sketch-mode-circle-arrowhead/elk/sketch.exp.svg
@@ -1,10 +1,10 @@
-
+ .d2-2407024038 .fill-N1{fill:#0A0F25;}
+ .d2-2407024038 .fill-N2{fill:#676C7E;}
+ .d2-2407024038 .fill-N3{fill:#9499AB;}
+ .d2-2407024038 .fill-N4{fill:#CFD2DD;}
+ .d2-2407024038 .fill-N5{fill:#DEE1EB;}
+ .d2-2407024038 .fill-N6{fill:#EEF1F8;}
+ .d2-2407024038 .fill-N7{fill:#FFFFFF;}
+ .d2-2407024038 .fill-B1{fill:#0D32B2;}
+ .d2-2407024038 .fill-B2{fill:#0D32B2;}
+ .d2-2407024038 .fill-B3{fill:#E3E9FD;}
+ .d2-2407024038 .fill-B4{fill:#E3E9FD;}
+ .d2-2407024038 .fill-B5{fill:#EDF0FD;}
+ .d2-2407024038 .fill-B6{fill:#F7F8FE;}
+ .d2-2407024038 .fill-AA2{fill:#4A6FF3;}
+ .d2-2407024038 .fill-AA4{fill:#EDF0FD;}
+ .d2-2407024038 .fill-AA5{fill:#F7F8FE;}
+ .d2-2407024038 .fill-AB4{fill:#EDF0FD;}
+ .d2-2407024038 .fill-AB5{fill:#F7F8FE;}
+ .d2-2407024038 .stroke-N1{stroke:#0A0F25;}
+ .d2-2407024038 .stroke-N2{stroke:#676C7E;}
+ .d2-2407024038 .stroke-N3{stroke:#9499AB;}
+ .d2-2407024038 .stroke-N4{stroke:#CFD2DD;}
+ .d2-2407024038 .stroke-N5{stroke:#DEE1EB;}
+ .d2-2407024038 .stroke-N6{stroke:#EEF1F8;}
+ .d2-2407024038 .stroke-N7{stroke:#FFFFFF;}
+ .d2-2407024038 .stroke-B1{stroke:#0D32B2;}
+ .d2-2407024038 .stroke-B2{stroke:#0D32B2;}
+ .d2-2407024038 .stroke-B3{stroke:#E3E9FD;}
+ .d2-2407024038 .stroke-B4{stroke:#E3E9FD;}
+ .d2-2407024038 .stroke-B5{stroke:#EDF0FD;}
+ .d2-2407024038 .stroke-B6{stroke:#F7F8FE;}
+ .d2-2407024038 .stroke-AA2{stroke:#4A6FF3;}
+ .d2-2407024038 .stroke-AA4{stroke:#EDF0FD;}
+ .d2-2407024038 .stroke-AA5{stroke:#F7F8FE;}
+ .d2-2407024038 .stroke-AB4{stroke:#EDF0FD;}
+ .d2-2407024038 .stroke-AB5{stroke:#F7F8FE;}
+ .d2-2407024038 .background-color-N1{background-color:#0A0F25;}
+ .d2-2407024038 .background-color-N2{background-color:#676C7E;}
+ .d2-2407024038 .background-color-N3{background-color:#9499AB;}
+ .d2-2407024038 .background-color-N4{background-color:#CFD2DD;}
+ .d2-2407024038 .background-color-N5{background-color:#DEE1EB;}
+ .d2-2407024038 .background-color-N6{background-color:#EEF1F8;}
+ .d2-2407024038 .background-color-N7{background-color:#FFFFFF;}
+ .d2-2407024038 .background-color-B1{background-color:#0D32B2;}
+ .d2-2407024038 .background-color-B2{background-color:#0D32B2;}
+ .d2-2407024038 .background-color-B3{background-color:#E3E9FD;}
+ .d2-2407024038 .background-color-B4{background-color:#E3E9FD;}
+ .d2-2407024038 .background-color-B5{background-color:#EDF0FD;}
+ .d2-2407024038 .background-color-B6{background-color:#F7F8FE;}
+ .d2-2407024038 .background-color-AA2{background-color:#4A6FF3;}
+ .d2-2407024038 .background-color-AA4{background-color:#EDF0FD;}
+ .d2-2407024038 .background-color-AA5{background-color:#F7F8FE;}
+ .d2-2407024038 .background-color-AB4{background-color:#EDF0FD;}
+ .d2-2407024038 .background-color-AB5{background-color:#F7F8FE;}
+ .d2-2407024038 .color-N1{color:#0A0F25;}
+ .d2-2407024038 .color-N2{color:#676C7E;}
+ .d2-2407024038 .color-N3{color:#9499AB;}
+ .d2-2407024038 .color-N4{color:#CFD2DD;}
+ .d2-2407024038 .color-N5{color:#DEE1EB;}
+ .d2-2407024038 .color-N6{color:#EEF1F8;}
+ .d2-2407024038 .color-N7{color:#FFFFFF;}
+ .d2-2407024038 .color-B1{color:#0D32B2;}
+ .d2-2407024038 .color-B2{color:#0D32B2;}
+ .d2-2407024038 .color-B3{color:#E3E9FD;}
+ .d2-2407024038 .color-B4{color:#E3E9FD;}
+ .d2-2407024038 .color-B5{color:#EDF0FD;}
+ .d2-2407024038 .color-B6{color:#F7F8FE;}
+ .d2-2407024038 .color-AA2{color:#4A6FF3;}
+ .d2-2407024038 .color-AA4{color:#EDF0FD;}
+ .d2-2407024038 .color-AA5{color:#F7F8FE;}
+ .d2-2407024038 .color-AB4{color:#EDF0FD;}
+ .d2-2407024038 .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}]]>
@@ -97,8 +97,11 @@
-ab
-
+abxyz
+
+
+
+
\ No newline at end of file
From 207272790291238c2fe3be9abd3426a4541c2a29 Mon Sep 17 00:00:00 2001
From: Daniel Suh <23denial@gmail.com>
Date: Sat, 18 May 2024 20:11:08 -0400
Subject: [PATCH 5/5] add specification in next.md
---
ci/release/changelogs/next.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md
index 78fb742e6..0d237aa22 100644
--- a/ci/release/changelogs/next.md
+++ b/ci/release/changelogs/next.md
@@ -8,4 +8,4 @@
- Local relative icons are relative to the d2 file instead of CLI invoke path [#1924](https://github.com/terrastruct/d2/pull/1924)
- Custom label positions weren't being read when the width was smaller than the label [#1928](https://github.com/terrastruct/d2/pull/1928)
-- Using `shape: circle` for arrowheads no longer removes all arrowheads along path [#1942](https://github.com/terrastruct/d2/pull/1942)
+- Using `shape: circle` for arrowheads no longer removes all arrowheads along path in sketch mode [#1942](https://github.com/terrastruct/d2/pull/1942)