spack graph

graph command gives the graphical representation of package dependencies.

spack graph mysql

To create pdf of graph, we can use

spack graph --dot mysql | dot -Tpdf > dependencies.pdf