Here are my hand-made tools to generate those stuff: https://github.com/h8liu/e8tools
Javascript version (I actually wrote this first for go std lib): https://github.com/h8liu/dagvis