diff --git a/d2renderers/d2sketch/sketch_test.go b/d2renderers/d2sketch/sketch_test.go index ba733435a..e5e39d728 100644 --- a/d2renderers/d2sketch/sketch_test.go +++ b/d2renderers/d2sketch/sketch_test.go @@ -49,6 +49,132 @@ func TestSketch(t *testing.T) { script: `a -> b: hello `, }, + { + name: "crows feet", + script: `a1 <-> b1: { + style.stroke-width: 1 + source-arrowhead: { + shape: cf-many + } + target-arrowhead: { + shape: cf-many + } +} +a2 <-> b2: { + style.stroke-width: 3 + source-arrowhead: { + shape: cf-many + } + target-arrowhead: { + shape: cf-many + } +} +a3 <-> b3: { + style.stroke-width: 6 + source-arrowhead: { + shape: cf-many + } + target-arrowhead: { + shape: cf-many + } +} + +c1 <-> d1: { + style.stroke-width: 1 + source-arrowhead: { + shape: cf-many-required + } + target-arrowhead: { + shape: cf-many-required + } +} +c2 <-> d2: { + style.stroke-width: 3 + source-arrowhead: { + shape: cf-many-required + } + target-arrowhead: { + shape: cf-many-required + } +} +c3 <-> d3: { + style.stroke-width: 6 + source-arrowhead: { + shape: cf-many-required + } + target-arrowhead: { + shape: cf-many-required + } +} + +e1 <-> f1: { + style.stroke-width: 1 + source-arrowhead: { + shape: cf-one + } + target-arrowhead: { + shape: cf-one + } +} +e2 <-> f2: { + style.stroke-width: 3 + source-arrowhead: { + shape: cf-one + } + target-arrowhead: { + shape: cf-one + } +} +e3 <-> f3: { + style.stroke-width: 6 + source-arrowhead: { + shape: cf-one + } + target-arrowhead: { + shape: cf-one + } +} + +g1 <-> h1: { + style.stroke-width: 1 + source-arrowhead: { + shape: cf-one-required + } + target-arrowhead: { + shape: cf-one-required + } +} +g2 <-> h2: { + style.stroke-width: 3 + source-arrowhead: { + shape: cf-one-required + } + target-arrowhead: { + shape: cf-one-required + } +} +g3 <-> h3: { + style.stroke-width: 6 + source-arrowhead: { + shape: cf-one-required + } + target-arrowhead: { + shape: cf-one-required + } +} + +c <-> d <-> f: { + style.stroke-width: 1 + style.stroke: "orange" + source-arrowhead: { + shape: cf-many-required + } + target-arrowhead: { + shape: cf-one + } +} + `, + }, { name: "twitter", script: `timeline mixer: "" { diff --git a/d2renderers/d2sketch/testdata/crows_feet/sketch.exp.svg b/d2renderers/d2sketch/testdata/crows_feet/sketch.exp.svg new file mode 100644 index 000000000..724203e2b --- /dev/null +++ b/d2renderers/d2sketch/testdata/crows_feet/sketch.exp.svg @@ -0,0 +1,64 @@ + + + + + + +a1b1a2b2a3b3c1d1c2d2c3d3e1f1e2f2e3f3g1h1g2h2g3h3cdf + + + \ No newline at end of file