use viewbox to locate graph(still need to imporve)
modify func to generate svg by edges instead of generate full graph