d2
d2 copied to clipboard
vars notation
why is this not allowed?
no plobrem
vars: {
d2-config: {
layout-engine: elk
}
}
a
error
"vars" must be the last part of the key
vars.d2-config.layout-engine: elk
a
"vars" must be the last part of the key
this message causes more confusion.
foo.vars: {
bar
}
https://play.d2lang.com/?script=SsvP1ytLLCq2Uqjm5VJQSEos4uWq5eUCBAAA__8%3D&
I have the same issue. Trying to use the Go API oracle to set vars but getting this error.
it's not allowed because i don't want to give the impression this is allowed
vars: {
a: 1
}
x1: ${a}
vars.a: 2
x1: ${a}
these will both be 2. As d2 is a declarative language, variable reassignment is not a feature.