transform graph to dot