Search code examples
javascriptsunburst-diagraminfovis

JIT Infovis sunburst node contract/expand


I am rendering a sunburst diagram using the Infovis javascript toolkit.

I would like to have all nodes above a certain level be collapsed so that they can be expanded selectively.

I am using:

 if(node.data.class == "level1" )
              {
                sb.op.contract(node,{hideLabels: true});
              }

This does not work.


Solution

  • If the level to collapse is 1:

        onBeforePlotNode: function(node)
               { 
        if(node._depth > 0)
        {sb.op.contract(node);}
    }