I also want to make a complex and composable diagram layout. The first hurdle is putting labels nicely, so text is not overlapped with anything. Since I use Fletcher, I can’t really use all of the CeTZ tricks that might help, until the new version is released. So I only have one viable option, is to measure everything prior, and then compose/generate a diagram by taking advantage of measured labels and stuff.
So at the very least, I think having an AST with critical info for laying things out is necessary. That is, unless you can smartly juggle with relative positioning/sizing in CeTZ.
Since Typst don’t have a canvas, it’s much more messy to pull it off with all the places and stuff. It also lacks all the advanced coordinate features, so native building blocks are just harder to work with. At least until you develop some sort of framework/basis, after which all blocks are more or less similar in behavior etc.