D2 Layouts

D2 allows me to generate diagrams from the same source file using different layouts

It comes with two built-in layout engines :

Dagre is the default :

Dagre

Other one is ELK This needs to be specified explicitly as :

D2_LAYOUT=elk d2 in.d2 out.svg

and here is the output

ELK