title: How do I draw a graph or tree structure in JavaScript?
body: <p>I need to be able to draw graphs like the following in JavaScript:</p>
  
  <p><img src="https://i.stack.imgur.com/F0uyt.jpg" alt="crazy graph picture"></p>
  
  <p>I know about the <a href="http://raphaeljs.com/" rel="noreferrer">Raphael</a> library, but it's only for drawing arbitrary shapes. </p>
  
  <p>I have a few predefined node types (the colored nodes on the image) and text nearby/inside every node.  This library doesn't seem to handle that case. How do I do this in JavaScript? If this has been accomplished already by another library, how can I use that library to solve this problem?</p>