Browse Source

update JSON specification

Eren Yilmaz 6 years ago
parent
commit
e0c92cf22f
4 changed files with 43 additions and 30 deletions
  1. 7 4
      doc/chapter/2architecture.tex
  2. 0 26
      doc/img/graph.json
  3. 0 0
      doc/src/.keep
  4. 36 0
      doc/src/graph.json

+ 7 - 4
doc/chapter/2architecture.tex

@@ -20,6 +20,8 @@ The structure is as follows:
     \item The object in the JSON file is a node.
     \item A node has the attributes that are displayed in table~\ref{table:node-attributes}.
     \item An edge has the attributes that are displayed in table~\ref{table:edge-attributes}.
+    \item Any additional attributes not listed here are ignored.
+    For example they can be used as comment fields, to make the file more readable.
 \end{itemize}
 For parsing the JSON file the JSON-java library~\cite{leary_json-java:_2018} is used.
 The classes for reading and writing those JSON files are displayed in figure~\ref{fig:io}.
@@ -31,9 +33,11 @@ The internal representation of graphs is further explained in the section~\ref{s
     Attribute & Type & Optional & Explanation \\\hline\hline
     name & string & yes & If not omitted, this must be unique for a given parent node. \\\hline
     width & integer & yes & The minimum width of the node.
-    The node can be wider if it contains other nodes that need more space. \\\hline
+    The node can be wider if it contains other nodes that need more space or smaller if the layout does not fit on the screen.
+    Default 40.\\\hline
     height & integer & yes & The minimum height of the node.
-    The node can be higher if it contains other nodes that need more space. \\\hline
+    The node can be higher if it contains other nodes that need more space or smaller if the layout does not fit on the screen.
+    Default 40.\\\hline
     dummy & boolean & yes & Iff this is set to yes, then the node is a dummy node. \\\hline
     layers & list of lists of nodes & yes & The layers of nodes inside this node (Hierarchy). \\\hline
     edges & list of edges & yes & The edges between nodes whose parent node is this node. \\\hline
@@ -67,9 +71,8 @@ The internal representation of graphs is further explained in the section~\ref{s
 %    \label{fig:iff}
 %\end{figure}
 
-\TODO{Kante in beispielJSON}
 \begin{figure}
-    \begin{lstinputlisting}[language=json,emph={}]{img/graph.json}
+    \begin{lstinputlisting}[language=json,emph={}]{src/graph.json}
     \end{lstinputlisting}
     \caption[Example Input File]{Example Input file that is understood by \appname.}
     \label{fig:json-example}

+ 0 - 26
doc/img/graph.json

@@ -1,26 +0,0 @@
-{
-   "layers":[
-      [
-         {
-            "name":"n2",
-            "width":10,
-            "height":10
-         },
-         {
-            "name":"n1",
-            "width":10,
-            "height":10,
-            "layers":[
-               [
-                  {
-                     "name":"n2",
-                     "width":10,
-                     "height":10
-                  }
-               ]
-            ]
-         }
-      ]
-   ],
-   "name":"n0"
-}

+ 0 - 0
doc/src/.keep


+ 36 - 0
doc/src/graph.json

@@ -0,0 +1,36 @@
+{
+  "layers": [
+    [
+      {
+        "width": 10,
+        "height": 10
+      },
+      {
+        "name": "n1",
+        "width": 10,
+        "height": 10,
+        "layers": [
+          [
+            {
+              "name": "n2",
+              "width": 10,
+              "height": 10
+            }
+          ]
+        ]
+      }
+    ],
+    [
+      {
+        "name": "n2"
+      }
+    ]
+  ],
+  "edges": [
+    {
+      "source": "n1",
+      "target": "n2"
+    }
+  ],
+  "name": "n0"
+}