I think one advantage in GraphViz is the ability to output EPS. I use this often for embedding into PDF via XeLaTeX and Pandoc filters. I also saw that D2 offers some kind of LaTeX output, but was not able to dig into the docs there further.
I'm not familiar with EPS. Will investigate, ty. https://github.com/terrastruct/d2/issues/489