code: function(node, opt) {
        var viz = this.viz;
        if(node.collapsed || !node.anySubnode($.lambda(true))) return;
        opt = $.merge(this.options, viz.config, opt || {}, {
          'modes': ['node-property:alpha:span', 'linear']
        });
        node.collapsed = true;
        (function subn(n) {
          n.eachSubnode(function(ch) {
            ch.ignore = true;
            ch.setData('alpha', 0, opt.type == 'animate'? 'end' : 'current');
            subn(ch);
          });
        })(node);
        if(opt.type == 'animate') {
          viz.compute('end');
          if(viz.rotated) {
            viz.rotate(viz.rotated, 'none', {
              'property':'end'
            });
          }
          (function subn(n) {
            n.eachSubnode(function(ch) {
              ch.setPos(node.getPos('end'), 'end');
              subn(ch);
            });
          })(node);
          viz.fx.animate(opt);
        } else if(opt.type == 'replot'){
          viz.refresh();
        }
      }
docs: /*
  Method: contract
  
  Collapses the subtree of the given node. The node will have a _collapsed=true_ property.
  
  Parameters:
  
  node - (object) A <Graph.Node>.
  opt - (object) An object containing options described below
  type - (string) Whether to 'replot' or 'animate' the contraction.
  
  There are also a number of Animation options. For more information see <Options.Fx>.
  
  Example:
  (start code js)
  var viz = new $jit.Viz(options);
  viz.op.contract(node, {
  type: 'animate',
  duration: 1000,
  hideLabels: true,
  transition: $jit.Trans.Quart.easeOut
  });
  (end code)