Cetz: fail to resolve coordinates "3"

My code:

#import "@preview/fletcher:0.5.8" as fletcher: diagram, node, edge
#import fletcher.shapes: rect, diamond, circle, brace
#diagram(
  let (x, y, z) = ((0, 0), (0, 1), (0, 2)),
  let (z1, z2, z3) = ((1.5, 0), (1.5, 1), (1.5, 2)),
  let (a) = ((3, 1)),
  let (o) = ((4.5, 1)),
  node(x, [$x$], stroke: 1pt, shape: circle),
  node(y, [$y$], stroke: 1pt, shape: circle),
  node(z, [$z$], stroke: 1pt, shape: circle),
  node(z1, [$z_1$], stroke: 1pt, shape: circle),
  node(z2, [$z_2$], stroke: 1pt, shape: circle),
  node(z3, [$z_3$], stroke: 1pt, shape: circle),
  node(a, [$a$], stroke: 1pt, shape: circle),
  node(o, [Output]),
  edge(x, z1, "->"),
  edge(x, z2, "->"),
  edge(x, z3, "->"),
  edge(y, z1, "->"),
  edge(y, z2, "->"),
  edge(y, z3, "->"),
  edge(z, z1, "->"),
  edge(z, z2, "->"),
  edge(z, z3, "->"),
  edge(z1, a, "->"),
  edge(z2, a, "->"),
  edge(z3, a, "->"),
  edge(a, o, "->"),
  node(enclose: (x, y, z), stroke: 1pt, shape: brace.with(label: [Input Layer])),
  node(enclose: (z1, z2, z3), stroke: 1pt, shape: brace.with(label: [Hidden Layer])),
  node(enclose: (a), stroke: 1pt, shape: brace.with(label: [Output Layer])),
)

I was met with the error as in the title. How do I fix it?

1 Like

enclose expects an array, you can simply add a comma to make a single element an array.
node(enclose: (a,), ...

1 Like