Quick Brown Letters

We work out again the sample character adjacency graph mentioned in Graphviz Tips Remembered.

"the quick brown fox jumped over the lazy dogs back"

http://hsc.fed.wiki/assets/scripts/import-foreign-json.html HEIGHT 240

Add code here to extract nodes and relations from _json_ and add them to _graph_. Remember node ids in _nids_.

const t = ch => 'aeiou'.includes(ch) ? 'Vowel' : [" ","\n"].includes(ch) ? 'Space' : 'Consonant'

const n = i => { if (nids[json[i]] == undefined) { nids[json[i]] = graph.addNode(t(json[i]), {name:json[i]}) } return nids[json[i]] }

for (let i = 0; i<json.length-1; i++) { graph.addRel('',n(i),n(i+1)) }