This script outputs the exact same chart as the one in
another post, but it takes a JSON source instead of the outline source. This is useful only if you have an automated way to create JSON. If you plan to hand-type it, you'd be better off with the script in
this other post instead.
Here is sample output from this script. You can customize the appearance by changing the properties at the top of the script that start with "SETTINGS_":
The script expects a JSON file where each JSON object represents a node. Each object has (up to) two properties: "itemName" which is the label of the node, and (if the node has children) "itemChildren" which contains the children of the node. Child nodes can have children of their own.
The script expects the file to be on your Desktop, and by default it needs to be named "drawtree.json" but you can change that in the settings at the top of the script.\
Here is the JSON that produces the chart above:
[
{
"itemName": "Rock/Pop",
"itemChildren":
[
{"itemName": "Roots",
"itemChildren":
[
{"itemName": "Cajun/Zydeco"},
{"itemName": "Tex Mex"},
{"itemName": "Swamp Pop"}
]
},
{"itemName": "Singer-Songwriter"},
{"itemName": "Classic Rock",
"itemChildren":
[
{"itemName": "AOR"}
]
},
{"itemName": "Art & Progressive Rock",
"itemChildren":
[
{"itemName": "Rock Opera"},
{"itemName": "New Prog"},
{"itemName": "Krautrock"}
]
},
{"itemName": "Blues & Boogie Rock",
"itemChildren":
[
{"itemName": "Boogie Rock"},
{"itemName": "Southern Rock"}
]
},
{"itemName": "Glam"},
{"itemName": "Hard Rock",
"itemChildren":
[
{"itemName": "Post-Grunge"},
{"itemName": "Instrumental Guitar Rock"},
{"itemName": "Acid Rock"}
]
},
{"itemName": "Instrumental Rock"},
{"itemName": "Pop",
"itemChildren":
[
{"itemName": "Dance Pop"},
{"itemName": "Teen Beat"},
{"itemName": "Teen Idols"}
]
},
{"itemName": "Jam Rock"},
{"itemName": "Latin Pop"},
{"itemName": "Country Rock"},
{"itemName": "Funk Rock"},
{"itemName": "Metal",
"itemChildren":
[
{"itemName": "Progressive Metal"},
{"itemName": "Thrash/Speed Metal"},
{"itemName": "Stoner Rock"},
{"itemName": "Grindcore"},
{"itemName": "Doom Metal"},
{"itemName": "Pop Metal"},
{"itemName": "New Wave of British Heavy Metal"},
{"itemName": "Black Metal"},
{"itemName": "Death Metal"},
{"itemName": "Funk Metal"},
{"itemName": "Industrial Metal"},
{"itemName": "Christian Metal"},
{"itemName": "Rapcore"},
{"itemName": "Alt Metal"},
{"itemName": "Metalcore"}
]
},
{"itemName": "Folk-Rock",
"itemChildren":
[
{"itemName": "Political Rock"},
{"itemName": "Celtic Rock"}
]
},
{"itemName": "Adult Alternative"},
{"itemName": "Adult Contemporary",
"itemChildren":
[
{"itemName": "Blue-Eyed Soul"},
{"itemName": "Modern Folk"},
{"itemName": "Lite Rock"},
{"itemName": "Jazz Rock"}
]
}
]
}
]
IMPORTANT: this script requires the application "JSON Helper." This application is free in the Apple App Store, available under the Apple menu. (Search for "helper" and it's one of the first results.)
Script after the jump: