<HTML VERSION="2.0">
<HEAD>
<TITLE>Output Formats</TITLE>
+<style>
+.jsontable {
+ border: 1px solid black;
+ background-color: beige;
+}
+</style>
+<script src="http://www.w3schools.com/lib/w3data.js"></script>
</HEAD>
<BODY BGCOLOR=white>
<A NAME="top"></A>
<BR><A NAME=a:jpeg HREF=#d:jpeg>jpeg</A>
<BR><A NAME=a:jpe HREF=#d:jpe>jpe</A>
</TD><TD>JPEG</TD> </TR>
+ <TR><TD ALIGN=CENTER><A NAME=a:json HREF=#d:json>json</A>
+<BR><A NAME=a:json0 HREF=#d:json0>json0</A>
+<BR><A NAME=a:dot_json HREF=#d:dot_json>dot_json</A>
+<BR><A NAME=a:xdot_json HREF=#d:xdot_json>xdot_json</A>
+</TD><TD>Dot graph represented in JSON format</TD> </TR>
<TR><TD ALIGN=CENTER><A NAME=a:pct HREF=#d:pct>pct</A>
<BR><A NAME=a:pict HREF=#d:pict>pict</A>
</TD><TD>PICT</TD> </TR>
,<DT><A NAME=d:jpe HREF=#a:jpe><STRONG>jpe</STRONG></A>
<DD>Output JPEG compressed image files.
+<DT><A NAME=d:json HREF=#a:json><STRONG>json</STRONG></A>
+,<DT><A NAME=d:json0 HREF=#a:json0><STRONG>json0</STRONG></A>
+,<DT><A NAME=d:dot_json HREF=#a:dot_json><STRONG>dot_json</STRONG></A>
+,<DT><A NAME=d:xdot_json HREF=#a:xdot_json><STRONG>xdot_json</STRONG></A>
+<DD>These formats produce a JSON output encoding the DOT language.
+Using <B>json0</B> produces output in JSON format that contains the
+same information produced by <A HREF=#d:dot>-Tdot</A>.
+Using <B>json</B> produces output in JSON format that contains the
+same information produced by <A HREF=#d:xdot>-Txdot</A>.
+Both of these assume the graph has been processed by one of the layout
+algorithms.
+The <B>dot_json</B> and <B>xdot_json</B> also produce JSON output similar to
+to <B>json0</B> and <B>json</B>, respectively, except they only use the
+content of the graph on input. In particular, they do not assume that the
+graph has been processed by any layout algorithm, and the only xdot information
+appearing in the output was in the original input file.
+<P>
+The output produced by these follows the json schema shown below.
+Note that the <b>objects</b> array has all of the subgraphs first,
+followed by all of the nodes. The <b>_gvid</b> value is the index of
+the subgraph or node in the <b>objects</b> array. This also holds
+true for the edges in the <b>objects</b> array. Note that this format
+allows clustered graphs, where edges can connect clusters as well as nodes.
+<div w3-include-html="schema.html"></div>
+<script>
+w3IncludeHTML();
+</script>
+
+
<DT><A NAME=d:pct HREF=#a:pct><STRONG>pct</STRONG></A>
,<DT><A NAME=d:pict HREF=#a:pict><STRONG>pict</STRONG></A>
<DD>Output in the Apple PICT file format.
--- /dev/null
+<table class="jsontable"><tr><th>description</th><td>JSON representation of a graph encoding xdot attributes</td></tr><tr><th>title</th><td>Graphviz JSON</td></tr><tr><th>required</th><td><ul><li>name</li><li>directed</li><li>strict</li><li>_subgraph_cnt</li></ul></td></tr><tr><th>definitions</th><td><table class="jsontable"><tr><th>drawops</th><td><table class="jsontable"><tr><th>items</th><td><table class="jsontable"><tr><th>oneOf</th><td><table class="jsontable"><tr><th>$ref</th></tr><tr><td>#/definitions/ellipse</td></tr><tr><td>#/definitions/polygon</td></tr><tr><td>#/definitions/polyline</td></tr><tr><td>#/definitions/bspline</td></tr><tr><td>#/definitions/text</td></tr><tr><td>#/definitions/font_style</td></tr><tr><td>#/definitions/drawcolor</td></tr><tr><td>#/definitions/font</td></tr><tr><td>#/definitions/style</td></tr></table></td></tr></table></td></tr><tr><th>type</th><td>array</td></tr></table></td></tr><tr><th>style</th><td><table class="jsontable"><tr><th>required</th><td><ul><li>op</li><li>style</li></ul></td></tr><tr><th>type</th><td>object</td></tr><tr><th>properties</th><td><table class="jsontable"><tr><th>style</th><td><table class="jsontable"><tr><th>type</th><td>string</td></tr></table></td></tr><tr><th>op</th><td><table class="jsontable"><tr><th>pattern</th><td>S</td></tr><tr><th>type</th><td>string</td></tr></table></td></tr></table></td></tr></table></td></tr><tr><th>font_style</th><td><table class="jsontable"><tr><th>required</th><td><ul><li>op</li><li>fontchar</li></ul></td></tr><tr><th>type</th><td>object</td></tr><tr><th>properties</th><td><table class="jsontable"><tr><th>op</th><td><table class="jsontable"><tr><th>pattern</th><td>t</td></tr><tr><th>type</th><td>string</td></tr></table></td></tr><tr><th>fontchar</th><td><table class="jsontable"><tr><th>minimum</th><td>0</td></tr><tr><th>type</th><td>integer</td></tr><tr><th>maximum</th><td>127</td></tr></table></td></tr></table></td></tr></table></td></tr><tr><th>polygon</th><td><table class="jsontable"><tr><th>required</th><td><ul><li>op</li><li>points</li></ul></td></tr><tr><th>type</th><td>object</td></tr><tr><th>properties</th><td><table class="jsontable"><tr><th>points</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/pointlist</td></tr></table></td></tr><tr><th>op</th><td><table class="jsontable"><tr><th>pattern</th><td>[pP]</td></tr><tr><th>type</th><td>string</td></tr></table></td></tr></table></td></tr></table></td></tr><tr><th>metanode</th><td><table class="jsontable"><tr><th>required</th><td><ul><li>_gvid</li><li>name</li></ul></td></tr><tr><th>type</th><td>object</td></tr><tr><th>properties</th><td><table class="jsontable"><tr><th>_draw_</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/drawops</td></tr></table></td></tr><tr><th>name</th><td><table class="jsontable"><tr><th>type</th><td>string</td></tr><tr><th>description</th><td>The node or subgraph name</td></tr></table></td></tr><tr><th>_ldraw_</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/drawops</td></tr></table></td></tr><tr><th>_gvid</th><td><table class="jsontable"><tr><th>type</th><td>integer</td></tr></table></td></tr><tr><th>subgraphs</th><td><table class="jsontable"><tr><th>items</th><td><table class="jsontable"><tr><th>type</th><td>integer</td></tr></table></td></tr><tr><th>type</th><td>array</td></tr><tr><th>description</th><td>index of a child subgraph</td></tr></table></td></tr><tr><th>edges</th><td><table class="jsontable"><tr><th>items</th><td><table class="jsontable"><tr><th>type</th><td>integer</td></tr></table></td></tr><tr><th>type</th><td>array</td></tr><tr><th>description</th><td>index of an edge in this subgraph</td></tr></table></td></tr><tr><th>additionalProperties</th><td><table class="jsontable"><tr><th>type</th><td>string</td></tr></table></td></tr><tr><th>nodes</th><td><table class="jsontable"><tr><th>items</th><td><table class="jsontable"><tr><th>type</th><td>integer</td></tr></table></td></tr><tr><th>type</th><td>array</td></tr><tr><th>description</th><td>index of a node in this subgraph</td></tr></table></td></tr></table></td></tr><tr><th>title</th><td>node or subgraph</td></tr></table></td></tr><tr><th>color</th><td><table class="jsontable"><tr><th>pattern</th><td>(#[0-9a-f]*)|(#[0-9a-f]{8})</td></tr><tr><th>type</th><td>string</td></tr></table></td></tr><tr><th>text</th><td><table class="jsontable"><tr><th>required</th><td><ul><li>op</li><li>pt</li><li>align</li><li>text</li><li>width</li></ul></td></tr><tr><th>type</th><td>object</td></tr><tr><th>properties</th><td><table class="jsontable"><tr><th>text</th><td><table class="jsontable"><tr><th>type</th><td>string</td></tr></table></td></tr><tr><th>align</th><td><table class="jsontable"><tr><th>pattern</th><td>[lcr]</td></tr><tr><th>type</th><td>string</td></tr></table></td></tr><tr><th>op</th><td><table class="jsontable"><tr><th>pattern</th><td>T</td></tr><tr><th>type</th><td>string</td></tr></table></td></tr><tr><th>pt</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/point</td></tr></table></td></tr><tr><th>width</th><td><table class="jsontable"><tr><th>type</th><td>number</td></tr></table></td></tr></table></td></tr></table></td></tr><tr><th>point</th><td><table class="jsontable"><tr><th>minItems</th><td>2</td></tr><tr><th>items</th><td><table class="jsontable"><tr><th>type</th><td>number</td></tr></table></td></tr><tr><th>type</th><td>array</td></tr><tr><th>maxItems</th><td>2</td></tr></table></td></tr><tr><th>stop</th><td><table class="jsontable"><tr><th>required</th><td><ul><li>frac</li><li>color</li></ul></td></tr><tr><th>type</th><td>object</td></tr><tr><th>properties</th><td><table class="jsontable"><tr><th>color</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/color</td></tr></table></td></tr><tr><th>frac</th><td><table class="jsontable"><tr><th>type</th><td>number</td></tr></table></td></tr></table></td></tr></table></td></tr><tr><th>drawcolor</th><td><table class="jsontable"><tr><th>required</th><td><ul><li>op</li><li>grad</li></ul></td></tr><tr><th>type</th><td>object</td></tr><tr><th>properties</th><td><table class="jsontable"><tr><th>p0</th><td><table class="jsontable"><tr><th>oneOf</th><td><table class="jsontable"><tr><th>$ref</th></tr><tr><td>#/definitions/point</td></tr><tr><td>#/definitions/point3</td></tr></table></td></tr></table></td></tr><tr><th>p1</th><td><table class="jsontable"><tr><th>oneOf</th><td><table class="jsontable"><tr><th>$ref</th></tr><tr><td>#/definitions/point</td></tr><tr><td>#/definitions/point3</td></tr></table></td></tr></table></td></tr><tr><th>color</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/color</td></tr></table></td></tr><tr><th>stops</th><td><table class="jsontable"><tr><th>items</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/stop</td></tr></table></td></tr><tr><th>type</th><td>array</td></tr></table></td></tr><tr><th>grad</th><td><table class="jsontable"><tr><th>enum</th><td><ul><li>none</li><li>linear</li><li>radial</li></ul></td></tr><tr><th>type</th><td>string</td></tr></table></td></tr><tr><th>op</th><td><table class="jsontable"><tr><th>pattern</th><td>[cC]</td></tr><tr><th>type</th><td>string</td></tr></table></td></tr></table></td></tr></table></td></tr><tr><th>ellipse</th><td><table class="jsontable"><tr><th>required</th><td><ul><li>op</li><li>rect</li></ul></td></tr><tr><th>type</th><td>object</td></tr><tr><th>properties</th><td><table class="jsontable"><tr><th>rect</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/rectangle</td></tr></table></td></tr><tr><th>op</th><td><table class="jsontable"><tr><th>pattern</th><td>[eE]</td></tr><tr><th>type</th><td>string</td></tr></table></td></tr></table></td></tr></table></td></tr><tr><th>bspline</th><td><table class="jsontable"><tr><th>required</th><td><ul><li>op</li><li>points</li></ul></td></tr><tr><th>type</th><td>object</td></tr><tr><th>properties</th><td><table class="jsontable"><tr><th>points</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/pointlist</td></tr></table></td></tr><tr><th>op</th><td><table class="jsontable"><tr><th>pattern</th><td>[bB]</td></tr><tr><th>type</th><td>string</td></tr></table></td></tr></table></td></tr></table></td></tr><tr><th>edge</th><td><table class="jsontable"><tr><th>required</th><td><ul><li>_gvid</li><li>tail</li><li>head</li></ul></td></tr><tr><th>type</th><td>object</td></tr><tr><th>properties</th><td><table class="jsontable"><tr><th>_hldraw_</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/drawops</td></tr></table></td></tr><tr><th>_tdraw_</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/drawops</td></tr></table></td></tr><tr><th>_draw_</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/drawops</td></tr></table></td></tr><tr><th>_ldraw_</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/drawops</td></tr></table></td></tr><tr><th>_gvid</th><td><table class="jsontable"><tr><th>type</th><td>integer</td></tr></table></td></tr><tr><th>tail</th><td><table class="jsontable"><tr><th>type</th><td>integer</td></tr><tr><th>description</th><td>_gvid of tail node</td></tr></table></td></tr><tr><th>_tldraw_</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/drawops</td></tr></table></td></tr><tr><th>_hdraw_</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/drawops</td></tr></table></td></tr><tr><th>additionalProperties</th><td><table class="jsontable"><tr><th>type</th><td>string</td></tr></table></td></tr><tr><th>head</th><td><table class="jsontable"><tr><th>type</th><td>integer</td></tr><tr><th>description</th><td>_gvid of tail head</td></tr></table></td></tr></table></td></tr><tr><th>title</th><td>edge</td></tr></table></td></tr><tr><th>polyline</th><td><table class="jsontable"><tr><th>required</th><td><ul><li>op</li><li>points</li></ul></td></tr><tr><th>type</th><td>object</td></tr><tr><th>properties</th><td><table class="jsontable"><tr><th>points</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/pointlist</td></tr></table></td></tr><tr><th>op</th><td><table class="jsontable"><tr><th>pattern</th><td>L</td></tr><tr><th>type</th><td>string</td></tr></table></td></tr></table></td></tr></table></td></tr><tr><th>font</th><td><table class="jsontable"><tr><th>required</th><td><ul><li>op</li><li>size</li><li>face</li></ul></td></tr><tr><th>type</th><td>object</td></tr><tr><th>properties</th><td><table class="jsontable"><tr><th>size</th><td><table class="jsontable"><tr><th>minimum</th><td>0</td></tr><tr><th>type</th><td>number</td></tr></table></td></tr><tr><th>op</th><td><table class="jsontable"><tr><th>pattern</th><td>F</td></tr><tr><th>type</th><td>string</td></tr></table></td></tr><tr><th>face</th><td><table class="jsontable"><tr><th>type</th><td>string</td></tr></table></td></tr></table></td></tr></table></td></tr><tr><th>point3</th><td><table class="jsontable"><tr><th>minItems</th><td>3</td></tr><tr><th>items</th><td><table class="jsontable"><tr><th>type</th><td>number</td></tr></table></td></tr><tr><th>type</th><td>array</td></tr><tr><th>maxItems</th><td>3</td></tr></table></td></tr><tr><th>rectangle</th><td><table class="jsontable"><tr><th>minItems</th><td>4</td></tr><tr><th>items</th><td><table class="jsontable"><tr><th>type</th><td>number</td></tr></table></td></tr><tr><th>type</th><td>array</td></tr><tr><th>maxItems</th><td>4</td></tr></table></td></tr><tr><th>pointlist</th><td><table class="jsontable"><tr><th>items</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/point</td></tr></table></td></tr><tr><th>type</th><td>array</td></tr></table></td></tr></table></td></tr><tr><th>type</th><td>object</td></tr><tr><th>properties</th><td><table class="jsontable"><tr><th>directed</th><td><table class="jsontable"><tr><th>type</th><td>boolean</td></tr><tr><th>description</th><td>True if the graph is directed</td></tr></table></td></tr><tr><th>_draw_</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/drawops</td></tr></table></td></tr><tr><th>name</th><td><table class="jsontable"><tr><th>type</th><td>string</td></tr><tr><th>description</th><td>The graph name</td></tr></table></td></tr><tr><th>objects</th><td><table class="jsontable"><tr><th>items</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/metanode</td></tr></table></td></tr><tr><th>type</th><td>array</td></tr><tr><th>description</th><td>The graph's subgraphs followed by the graph's nodes</td></tr></table></td></tr><tr><th>_ldraw_</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/drawops</td></tr></table></td></tr><tr><th>strict</th><td><table class="jsontable"><tr><th>type</th><td>boolean</td></tr><tr><th>description</th><td>True if the graph is strict</td></tr></table></td></tr><tr><th>edges</th><td><table class="jsontable"><tr><th>items</th><td><table class="jsontable"><tr><th>$ref</th><td>#/definitions/edge</td></tr></table></td></tr><tr><th>type</th><td>array</td></tr></table></td></tr><tr><th>additionalProperties</th><td><table class="jsontable"><tr><th>type</th><td>string</td></tr></table></td></tr><tr><th>_subgraph_cnt</th><td><table class="jsontable"><tr><th>type</th><td>integer</td></tr><tr><th>description</th><td>Number of subgraphs in the graph</td></tr></table></td></tr></table></td></tr></table>
\ No newline at end of file
#
# Generator for on-line documentation.
#
-# Required tools: cc, dot, awk, ksh, yacc, gs.
+# Required tools: cc, dot, awk, ksh, yacc, gs, python.
# gs and awk are used in ps_to_jpg.sh
# dot is used in mkarrows.sh, mkshapes.sh, mkstyles.sh, mktapers.sh, mksplines.sh
# ps_to_png.sh and other make rules rely on netpbm tools
# and ps2raster, which is part of the GMT library.
+#
+# python is used to run jconvert.py, which converts the json schema
+# graphviz_json_schema.json to html. This also relies on the python
+# package json2html.
#
# The main product are 7 web pages:
# arrows.html - arrow_grammar
GIF = $(SGIF) $(AGIF) $(MGIF) $(A2GIF) $(XGIF)
DOTS = html2.gv html3.gv html4.gv tee.gv
HTML = attrs.html colors.html command.html lang.html output.html shapes.html \
- arrows.html
+ arrows.html schema.html
INSTALL_FILES = $(HTML) $(DOTS) $(SGIF) $(AGIF) $(A2GIF) $(MGIF) $(XGIF) $(MJPG) $(MPNG)
.SUFFIXES: .gv .gif .dot .png
cat colors.n >> colors.html
rm -rf colortmp
-output.html : output.1 output.2 outputs mkoutput.sh plugins.png
+output.html : output.1 output.2 outputs mkoutput.sh plugins.png jconvert.py
cat output.1 > output.html
+ ./jconvert.py graphviz_json_schema.json schema.html
./mkoutput.sh < outputs >> output.html
cat output.2 >> output.html
"description": "True if the graph is strict"
},
"_subgraph_cnt": {
- "type": "integer"
+ "type": "integer",
+ "description": "Number of subgraphs in the graph"
},
"objects": {
"type": "array",
- "items": { "$ref": "#/definitions/metanode" }
+ "items": { "$ref": "#/definitions/metanode" },
+ "description": "The graph's subgraphs followed by the graph's nodes"
},
"edges": {
"type": "array",
# storing the formats long name and description in the fullname
# and desc arrays, respectively, indexed by the format name.
# The initial line of an item has the format :name:long name
+#
+# Lines beginning with '#' are treated as comments, unless the
+# following character is '<', in which case, it is assumed the
+# remainder of the line contains a filename, whose contents will
+# be read into the generared html file.
OLDIFS="$IFS"
IFS=
while read line
do
c=${line:0:1}
if [[ $c == '#' ]]
- then continue
+ then
+ if [[ ${line:1:1} == '<' ]]
+ then
+ filename=${line:2}
+ filename=${filename##*( )}
+ filename=${filename%%*( )}
+ while read incline
+ do
+ txt="$txt${incline}\n"
+ done < $filename
+ else
+ continue
+ fi
elif [[ $c == ':' ]]
then
if [[ -n "$name" ]]
<HTML VERSION="2.0">
<HEAD>
<TITLE>Output Formats</TITLE>
+<style>
+.jsontable {
+ border: 1px solid black;
+ background-color: beige;
+}
+</style>
+<script src="http://www.w3schools.com/lib/w3data.js"></script>
</HEAD>
<BODY BGCOLOR=white>
<A NAME="top"></A>
:pov:POV-Ray markup language (prototype)
Scene-description language for 3D modelling for the
<A HREF="http://www.povray.org/">Persistence of Vision Raytracer</A>.
+:json/json0/dot_json/xdot_json:Dot graph represented in JSON format
+These formats produce a JSON output encoding the DOT language.
+Using <B>json0</B> produces output in JSON format that contains the
+same information produced by <A HREF=#d:dot>-Tdot</A>.
+Using <B>json</B> produces output in JSON format that contains the
+same information produced by <A HREF=#d:xdot>-Txdot</A>.
+Both of these assume the graph has been processed by one of the layout
+algorithms.
+The <B>dot_json</B> and <B>xdot_json</B> also produce JSON output similar to
+to <B>json0</B> and <B>json</B>, respectively, except they only use the
+content of the graph on input. In particular, they do not assume that the
+graph has been processed by any layout algorithm, and the only xdot information
+appearing in the output was in the original input file.
+<P>
+The output produced by these follows the json schema shown below.
+Note that the <b>objects</b> array has all of the subgraphs first,
+followed by all of the nodes. The <b>_gvid</b> value is the index of
+the subgraph or node in the <b>objects</b> array. This also holds
+true for the edges in the <b>objects</b> array. Note that this format
+allows clustered graphs, where edges can connect clusters as well as nodes.
+<div w3-include-html="schema.html"></div>
+<script>
+w3IncludeHTML();
+</script>
+
:png:Portable Network Graphics format
Produces output in the PNG (Portable Network Graphics) format.
<P>