Convert json into tree structure using javascript, client side -


i want convert following json code have collected using requests tree structure

"rules": [{   "name": "rule1",   "isfirst": true,    "conditions": [{     "outcometrue": {       "gotorule": "rule2"     },     "outcomefalse": {       "changestatus": {         "gotorule": "26"       }     },     "outcomeerror": {       "changestatus": {         "gotorule": "27"       }     },   }], },{   "name": "rule2",   "isfirst": false,   "conditions": [{     "name": "history check idnumber",     "outcometrue": {         "gotorule": "27"     },     "outcomefalse": {       "gotorule": "rule3"     },     "outcomeerror": {       "gotorule": "26"     },    }], }] 

into this. normal graph this:

a tree graph structure

have @ d3.js' tree

live example

edit: example: d3.js tree diagram generated 'flat' data (uses array of objects)


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

xcode - Swift Playground - Files are not readable -

jboss7.x - JBoss AS 7.3 vs 7.4 and differences -