how to create a flowchart in javascript