I am using d3 library to draw system service maps.
This is my code https://jsfiddle.net/buinam3112/xsadpr1y/4/
This is my data:
{
"name": "root",
"children": [
{
"name": "group 1",
"children": [
{
"name": "child 1",
"children": [
{
"name": "name 1"
},
{
"name": "name 2"
}
]
}
]
},
{
"name": "group 2",
"children": [
{
"name": "child 2",
"children": [
{
"name": "name 3"
},
{
"name": "name 4"
}
]
}
]
}
]
}
My json data is constantly updated with type value, how can my chart automatically update node color based on type value?