NOTE: Depreciated code.
The idea here is to make an extremely simple graphing tool that is quickly run on most browsers. This takes advantage of HTML5 and may not be supported everywhere hence the format should be as fail safe as possible.
The code:
0001 { 0002 "x" : [ 0003 "1", "2", "4", "5", "6", "7", "8", "9", "10" 0004 ], 0005 "y" : [ 0006 "2", "3", "7", "11", "13", "17", "19", "23", "27" 0007 ], 0008 "join" : "true" 0009 }
Is translated to (browser permitting):
Note how it skipped the missing element and it’s joined.
Another example would be using words:
0010 { 0011 "x" : [ 0012 "Dog", "Cat", "Mouse", "Cheetah", "Wolf" 0013 ], 0014 "y" : [ 0015 "23", "18", "7", "47", "48" 0016 ], 0017 "bold" : "true" 0018 }
Is translated to (browser permitting) in bold:
And lastly, large amounts of data:
0019 { 0020 "x" : [ 0021 "183", "-980", "204", "322", "-530", "335", "691", "-216", "879", "648", "-602", "-737", "607", "-571", "225", "72", "744", "-518" 0022 ], 0023 "y" : [ 0024 "648", "-602", "-737", "607", "571", "-225", "72", "-744", "-518", "-183", "980", "204", "322", "530", "-335", "-691", "-216", "-879" 0025 ], 0026 "display-text" : "false", 0027 "width" : "250", 0028 "height" : "200", 0029 "title" : "Random Numbers" 0030 }
Is translated to (browser permitting) without text and half the size:
"width"
- The width of the graph"height"
- The height of the graph"border"
- The border size of the graph"join"
- Joins the tops of the graph to represent more bar shapes or a line graph if "true"
"bold"
- Makes lines bold if "true"
"display-text"
- Makes text disappear if "false"
"title"
- The title of the graph