var cloumns = [
["", "", "", 287589],
["", "", "", 731786],
["", "", "", -4554],
["", "", "", -13556],
["", "", "", 6883],
["", "", "", 266137],
["", "", "", 113187],
["", "", "", 329072],
["", "", "", 614692],
["", "", "", 229967],
["", "", "", 66641],
["", "", "", 294351],
["", "", "", 52]
];
as in the previous array, how to convert it to this form:
var translateData = {
nodes: [
{
name: "",
nodes: [
{
name: "",
nodes: [
{
name: "",
value: 287589
},
{
name: "",
value: 731786
}
]
},
{
name: "",
nodes: [
{
name: "",
value: -4554
},
{
name: "",
value: -13556
}
]
}
]
}, {
name: "",
nodes: [
{
name: "",
nodes: [
{
name: "",
value: 287589
}
]
}
]
}
]
}