I use kiel in SCION-SCXML’s SCHVIZ visualization library to automatically layout complex hierarchical state machine diagrams. It is excellent software, and I recommend it.
Example: https://jsbin.com/hegiyuk/edit?output
https://gitlab.com/scion-scxml/scion https://gitlab.com/scion-scxml/schviz