Extra: implement a functionality which pretty-prints JAAL data.
Purpose: the developer can see the JAAL data structure more easily. The complexity of the actual, machine-generated JAAL data can be inspected.
What we want: an output similar to the manually-written JAAL test datas, such as jaal-dijkstra-student.json.
Requirements:
- monospace font
- indentation: 2 spaces
- 80 characters per line
- SVG data only as string:
SVG (%d bytes), where %d is the length of the SVG code in bytes.
Note: there might be JSON pretty-printing libraries already. Also see JSON.stringify.
This could be just logged into the browser console.
Nice to have, not required:
- a modal window or box with scrollbars which shows the JAAL data
- JSON syntax highlighting
- rule: if a JSON entry is an array which has no nested objects and it fits on the current line after indentation, print it on a single line.
Example:
{
"id": "edge3",
"node": ["nodeB", "nodeE"],
"tag": "4",
"style": "unselected"
},
The node entry is on a single line.
Extra: implement a functionality which pretty-prints JAAL data.
Purpose: the developer can see the JAAL data structure more easily. The complexity of the actual, machine-generated JAAL data can be inspected.
What we want: an output similar to the manually-written JAAL test datas, such as jaal-dijkstra-student.json.
Requirements:
SVG (%d bytes), where%dis the length of the SVG code in bytes.Note: there might be JSON pretty-printing libraries already. Also see JSON.stringify.
This could be just logged into the browser console.
Nice to have, not required:
Example:
The
nodeentry is on a single line.