You could have an ide that uses tags to build a diagram, e.g.
<diagram>
<line length="2.0" angle="90.0" startx="0.5" starty="3.8" colour="0A9F2C">
<oval width="2.5" height="3.1" centrex="10.2" centrey="0.5" angle="0.0">
</diagram>
This would be built in to the code then.
<diagram>
<line length="2.0" angle="90.0" startx="0.5" starty="3.8" colour="0A9F2C">
<oval width="2.5" height="3.1" centrex="10.2" centrey="0.5" angle="0.0">
</diagram>
This would be built in to the code then.