Please take a look to this simple jsfiddle: http://jsfiddle.net/perikut/9qUVW/2/ (sorry if using Firefox, I don't know why it doesn't look good...)
In our object can we use another word than 'children' to indicate where extract data from? (all examples I see follow this data structure, see below). Where should we indicate that?
I consider my code quite deficient (see the jsfiddle), as I am forced to declare two times the 'group' parameter in order to show/hide childrens from a group/parent.
There would be no way to directly select group1's children nodes and apply animations over? I want a much more complex data structure in the future, so I need to know this kind of basics before.
Current data structure:
data = {
name:'root',
group:'no_group',
children:[
{
group: 'group1',
children:[
{ group:'group1',name:'a1',value:10,color:'red' },
{ group:'group1',name:'a2',value:40,color:'lightcoral' }
]
}
, { .... }