terrastruct / d2

D2 is a modern diagram scripting language that turns text to diagrams.
https://d2lang.com
Mozilla Public License 2.0
16.64k stars 418 forks source link

[Globs] err:connection missing destination #1987

Open bo-ku-ra opened 3 months ago

bo-ku-ra commented 3 months ago
1_1
1-1

*_*{style.fill:GREEN}
*-*{style.fill:RED} # err:connection missing destination

image

alixander commented 3 months ago

@bo-ku-ra you must target them.

Normal targeting is (a -> b)[0].style.fill..., so glob targeting all is (* -> *)[*].style.fill...

bo-ku-ra commented 3 months ago

@alixander i want "1-1" is RED by using glob.

"1-1"
*-*{style.fill:RED} # err:connection missing destination

image

alixander commented 3 months ago

oh, apologies i misunderstood.

I'm not sure if that should be allowed, but at the very least it shouldn't be parsing as a connection with just one dash

bo-ku-ra commented 3 months ago

every shape's labels must be captured by 'Globs'. i think so.