Skip to content

Pretty-print JAAL #6

@atilantera

Description

@atilantera

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    UIuser interface & usability

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions