generate a diagram based on input file