Q:
Can you tell me about Diagram!'s API/text file format?
A:
We don't have a formal API, although we now have a text file format. All the symbols are numbered and each object has a description. You can read or write to this text file to create or modify diagrams. We don't provide any tools for parsing or generating the files. We publish the file format in an Appendix to the Diagram! manual.
For example, I just made a diagram with one box and saved the file. Here is the DiagramText file inside the file wrapper:
#!DG_TEXT-Version-2
# D2 Version: Built by rob on Fri Jan 22 13:23:58 1993
windowOrigin 220.00 -6.00
viewOrigin 1.00 9.00
viewSize 775.00 595.00
visibleOrigin 0.00 0.00
showTools
snapToGrid
defaultFont "Helvetica"
defaultFontSize 12.00
printInfoFile "PrintInfo"
colorFile "Colors.clr"
symbol 2147483647
default
layer -1
shape "Rectangle"
location 20.00 20.00
size 60.00 30.00
framed
fillColor colorIndex 0
frameColor colorIndex 1
shadowColor colorIndex 2
lineWidth 1.00
filled
textPlacement top
end
symbol 1
layer 0
shape "Rectangle"
location 324.00 162.00
size 81.00 90.00
framed
fillColor colorIndex 0
frameColor colorIndex 1
shadowColor colorIndex 2
lineWidth 1.00
filled
textPlacement top
end
vertex 2147483645
default
layer -1
location 0.00 0.00
end
vertex 2147483644
default
layer -1
location 0.00 0.00
end
line 2147483646
default
from 2147483645
to 2147483644
2147483645
2147483644
layer -1
lineWidth 1.00
filled
frameColor colorIndex 1
fillColor colorIndex 0
end