Modified graph generator js