Parcourir la source

work on adding class diagrams to documentation

Eren Yilmaz il y a 6 ans
Parent
commit
39dc93ef9a
2 fichiers modifiés avec 43 ajouts et 35 suppressions
  1. 17 35
      doc/chapter/2architecture.tex
  2. 26 0
      doc/img/graph.json

+ 17 - 35
doc/chapter/2architecture.tex

@@ -18,7 +18,14 @@ The structure is as follows:
     \item An edge has the attributes that are displayed in table~\ref{table:edge-attributes}.
     \item An edge has the attributes that are displayed in table~\ref{table:edge-attributes}.
 \end{itemize}
 \end{itemize}
 For parsing the JSON file the JSON-java library~\cite{leary_json-java:_2018} is used.
 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}.
+The internal representation of graphs is further explained in the section~\ref{sec:model}.
+\begin{figure}[tp]
+    \centering
+    \includegraphics[width=\linewidth]{img/IO.pdf}
+    \caption{Class diagram of the IO package, containing utilities for reading and writing graphs.}
+    \label{fig:io}
+\end{figure}
 
 
 \centering
 \centering
 \begin{longtable}{|p{1.8cm}|p{2cm}|p{1.8cm}|p{8.5cm}|}
 \begin{longtable}{|p{1.8cm}|p{2cm}|p{1.8cm}|p{8.5cm}|}
@@ -31,8 +38,8 @@ For parsing the JSON file the JSON-java library~\cite{leary_json-java:_2018} is
     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. \\\hline
     layers & list of lists of nodes & yes & The layers of nodes inside this node (Hierarchy). \\\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
     edges & list of edges & yes & The edges between nodes whose parent node is this node. \\\hline
-\caption{Node Attributes}
-\label{table:node-attributes}
+    \caption{Node Attributes}
+    \label{table:node-attributes}
 \end{longtable}
 \end{longtable}
 
 
 \begin{longtable}{|p{1.8cm}|p{2cm}|p{1.8cm}|p{8.5cm}|}
 \begin{longtable}{|p{1.8cm}|p{2cm}|p{1.8cm}|p{8.5cm}|}
@@ -42,8 +49,8 @@ For parsing the JSON file the JSON-java library~\cite{leary_json-java:_2018} is
     Must be a node with the same parent node as the node specified by the \enquote{target} attribute. \\\hline
     Must be a node with the same parent node as the node specified by the \enquote{target} attribute. \\\hline
     target & string & no & The name of the target of this edge.
     target & string & no & The name of the target of this edge.
     Must be a node with the same parent node as the node specified by the \enquote{source} attribute. \\\hline
     Must be a node with the same parent node as the node specified by the \enquote{source} attribute. \\\hline
-\caption{Edge Attributes}
-\label{table:edge-attributes}
+    \caption{Edge Attributes}
+    \label{table:edge-attributes}
 \end{longtable}
 \end{longtable}
 \raggedright
 \raggedright
 
 
@@ -55,40 +62,15 @@ For parsing the JSON file the JSON-java library~\cite{leary_json-java:_2018} is
 %\end{figure}
 %\end{figure}
 
 
 \begin{figure}
 \begin{figure}
-    \begin{lstlisting}[language=json,emph={}]
-    {
-       "layers":[
-          [
-             {
-                "name":"n2",
-                "width":10,
-                "height":10
-             },
-             {
-                "name":"n1",
-                "width":10,
-                "height":10,
-                "layers":[
-                   [
-                      {
-                         "name":"n2",
-                         "width":10,
-                         "height":10
-                      }
-                   ]
-                ]
-             }
-          ]
-       ],
-       "name":"n0"
-    }
-    \end{lstlisting}
+    \begin{lstinputlisting}[language=json,emph={}]{img/graph.json}
+    \end{lstinputlisting}
     \caption[Example Input File]{Example Input file that is understood by \appname.}
     \caption[Example Input File]{Example Input file that is understood by \appname.}
     \label{fig:json-example}
     \label{fig:json-example}
 \end{figure}
 \end{figure}
 
 
-\section{Internal graph representation}\label{sec:internalGraphRepresentation}
-\TODO{some class diagram}
+\section{Internal graph representation, \enquote{Model}}\label{sec:model}
+One feature that is important to us, is to be able to work with hierarchical graphs (cf. chapter~\ref{ch:progress}).
+
 
 
 \section{TODO: More Class Diagrams}\label{sec:classDiagrams}
 \section{TODO: More Class Diagrams}\label{sec:classDiagrams}
 \TODO{maybe even into appendix}
 \TODO{maybe even into appendix}

+ 26 - 0
doc/img/graph.json

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