Skip to content

Instantly share code, notes, and snippets.

@aziis98
Last active November 12, 2017 02:29
Show Gist options
  • Select an option

  • Save aziis98/05746aee2826d2c2c37b7b09a650cb47 to your computer and use it in GitHub Desktop.

Select an option

Save aziis98/05746aee2826d2c2c37b7b09a650cb47 to your computer and use it in GitHub Desktop.
Inventing a json graph standard for some future tests

My JSON Graph Standard

There are two main fields:

  • "nodes" contains a list of all nodes
  • "connections" contains a list of all the connections between the nodes

Nodes

Nodes must have an "id", a "type" and store extra information in a "value" field.

Connections

Connections must have a "from" and a "to" field to indicate the id of the node of the connection relative start and end. Other informations about the connection must go in the "value" field.

TODO

  • ElectronJS based JSON graph file viewer.
  • A more compact file format to save a bit of space.
  • Fix compact file format to include data owners.
{
"nodes": [
{
"id": "d320jf24rm",
"type": "text",
"value": [
{
"owner": "JsonGraphViewer",
"x": 121,
"y": 153
},
{
"owner": "Foo",
"text": "Testo di prova"
}
]
},
{
"id": "uv29uh83fd",
"type": "screen",
"value": [
{
"x": 284,
"y": 385
},
{
"width": 1200,
"height": 800
}
]
}
],
"connections": [
{ "from": "d320jf24rm", "to": "uv29uh83fd", "value": [{ "owner": "foo", "from": "text-output", "to": "input-1" }] }
]
}
text #d320jf24rm [
{
"x": 121,
"y": 153
},
{
"text": "Testo di prova"
}
]
screen #uv29uh83fd [
{
"x": 284,
"y": 385
},
{
"width": 1200,
"height": 800
}
]
#d320jf24rm -> #uv29uh83fd [
{ "custom-from": "text-output", "my-to": "input-1" }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment