diff --git a/d2target/d2target.go b/d2target/d2target.go
index b1039cb4c..962701525 100644
--- a/d2target/d2target.go
+++ b/d2target/d2target.go
@@ -190,6 +190,9 @@ func (s Shape) CSSStyle() string {
dashSize, gapSize := svg.GetStrokeDashAttributes(float64(s.StrokeWidth), s.StrokeDash)
out += fmt.Sprintf(`stroke-dasharray:%f,%f;`, dashSize, gapSize)
}
+ if s.BorderRadius != 0 {
+ out += fmt.Sprintf(`rx:%d;`, s.BorderRadius)
+ }
return out
}
diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go
index 7ec142f3a..90ce50f94 100644
--- a/e2etests/stable_test.go
+++ b/e2etests/stable_test.go
@@ -1829,6 +1829,17 @@ y: {
z: {
near: center-left
}
+`,
+ },
+ {
+ name: "border-radius",
+ script: `
+x: {
+ style.border-radius: 4
+}
+y: {
+ style.border-radius: 10
+}
`,
},
}
diff --git a/e2etests/testdata/stable/border-radius/dagre/board.exp.json b/e2etests/testdata/stable/border-radius/dagre/board.exp.json
new file mode 100644
index 000000000..1d4906a55
--- /dev/null
+++ b/e2etests/testdata/stable/border-radius/dagre/board.exp.json
@@ -0,0 +1,87 @@
+{
+ "name": "",
+ "fontFamily": "SourceSansPro",
+ "shapes": [
+ {
+ "id": "x",
+ "type": "",
+ "pos": {
+ "x": 0,
+ "y": 0
+ },
+ "width": 113,
+ "height": 126,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 4,
+ "fill": "#F7F8FE",
+ "stroke": "#0D32B2",
+ "shadow": false,
+ "3d": false,
+ "multiple": false,
+ "tooltip": "",
+ "link": "",
+ "icon": null,
+ "iconPosition": "",
+ "blend": false,
+ "fields": null,
+ "methods": null,
+ "columns": null,
+ "label": "x",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "#0A0F25",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 13,
+ "labelHeight": 26,
+ "labelPosition": "INSIDE_MIDDLE_CENTER",
+ "zIndex": 0,
+ "level": 1
+ },
+ {
+ "id": "y",
+ "type": "",
+ "pos": {
+ "x": 173,
+ "y": 0
+ },
+ "width": 114,
+ "height": 126,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 10,
+ "fill": "#F7F8FE",
+ "stroke": "#0D32B2",
+ "shadow": false,
+ "3d": false,
+ "multiple": false,
+ "tooltip": "",
+ "link": "",
+ "icon": null,
+ "iconPosition": "",
+ "blend": false,
+ "fields": null,
+ "methods": null,
+ "columns": null,
+ "label": "y",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "#0A0F25",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 14,
+ "labelHeight": 26,
+ "labelPosition": "INSIDE_MIDDLE_CENTER",
+ "zIndex": 0,
+ "level": 1
+ }
+ ],
+ "connections": []
+}
diff --git a/e2etests/testdata/stable/border-radius/dagre/sketch.exp.svg b/e2etests/testdata/stable/border-radius/dagre/sketch.exp.svg
new file mode 100644
index 000000000..565682b2e
--- /dev/null
+++ b/e2etests/testdata/stable/border-radius/dagre/sketch.exp.svg
@@ -0,0 +1,52 @@
+
+
\ No newline at end of file
diff --git a/e2etests/testdata/stable/border-radius/elk/board.exp.json b/e2etests/testdata/stable/border-radius/elk/board.exp.json
new file mode 100644
index 000000000..7b8a7b2e6
--- /dev/null
+++ b/e2etests/testdata/stable/border-radius/elk/board.exp.json
@@ -0,0 +1,87 @@
+{
+ "name": "",
+ "fontFamily": "SourceSansPro",
+ "shapes": [
+ {
+ "id": "x",
+ "type": "",
+ "pos": {
+ "x": 12,
+ "y": 12
+ },
+ "width": 113,
+ "height": 126,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 4,
+ "fill": "#F7F8FE",
+ "stroke": "#0D32B2",
+ "shadow": false,
+ "3d": false,
+ "multiple": false,
+ "tooltip": "",
+ "link": "",
+ "icon": null,
+ "iconPosition": "",
+ "blend": false,
+ "fields": null,
+ "methods": null,
+ "columns": null,
+ "label": "x",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "#0A0F25",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 13,
+ "labelHeight": 26,
+ "labelPosition": "INSIDE_MIDDLE_CENTER",
+ "zIndex": 0,
+ "level": 1
+ },
+ {
+ "id": "y",
+ "type": "",
+ "pos": {
+ "x": 145,
+ "y": 12
+ },
+ "width": 114,
+ "height": 126,
+ "opacity": 1,
+ "strokeDash": 0,
+ "strokeWidth": 2,
+ "borderRadius": 10,
+ "fill": "#F7F8FE",
+ "stroke": "#0D32B2",
+ "shadow": false,
+ "3d": false,
+ "multiple": false,
+ "tooltip": "",
+ "link": "",
+ "icon": null,
+ "iconPosition": "",
+ "blend": false,
+ "fields": null,
+ "methods": null,
+ "columns": null,
+ "label": "y",
+ "fontSize": 16,
+ "fontFamily": "DEFAULT",
+ "language": "",
+ "color": "#0A0F25",
+ "italic": false,
+ "bold": true,
+ "underline": false,
+ "labelWidth": 14,
+ "labelHeight": 26,
+ "labelPosition": "INSIDE_MIDDLE_CENTER",
+ "zIndex": 0,
+ "level": 1
+ }
+ ],
+ "connections": []
+}
diff --git a/e2etests/testdata/stable/border-radius/elk/sketch.exp.svg b/e2etests/testdata/stable/border-radius/elk/sketch.exp.svg
new file mode 100644
index 000000000..d64f2999d
--- /dev/null
+++ b/e2etests/testdata/stable/border-radius/elk/sketch.exp.svg
@@ -0,0 +1,52 @@
+
+
\ No newline at end of file