lib/gen-dot.js
function handle_chain(elem, names) {
		// Make sure the chain does something
		if (elem.fns.length === 0) {
			return [[], hash_name_get({name : '__empty__'}), hash_name_get({name : '__empty__'})];
		}

		var builder = [];
		var node1 = _dot_inner(elem.fns[0].fn, false, names);
		var first = node1;
		var node2;

		for (var i = 1; i < elem.fns.length; ++i) {
			Array.prototype.push.apply(builder, node1[0]);
			node2 = _dot_inner(elem.fns[i].fn, false, names);
			builder.push(node1[2]+' -> '+node2[1]+';');
			node1 = node2;
		}

		Array.prototype.push.apply(builder, node1[0]);
		return [builder, first[1], node2[2]];
	}
function handle_chain(elem, names) {
		// Make sure the chain does something
		if (elem.fns.length === 0) {
			return [[], hash_name_get({name : '__empty__'}), hash_name_get({name : '__empty__'})];
		}

		var builder = [];
		var node1 = _dot_inner(elem.fns[0].fn, false, names);
		var first = node1;
		var node2;

		for (var i = 1; i < elem.fns.length; ++i) {
			Array.prototype.push.apply(builder, node1[0]);
			node2 = _dot_inner(elem.fns[i].fn, false, names);
			builder.push(node1[2]+' -> '+node2[1]+';');
			node1 = node2;
		}

		Array.prototype.push.apply(builder, node1[0]);
		return [builder, first[1], node2[2]];
	}
function handle_chain ( elem , names ) { // Make sure the chain does something if ( elem . fns . length === 0 ) { return [ [ ] , hash_name_get ( { name : '__empty__' } ) , hash_name_get ( { name : '__empty__' } ) ] ; } var builder = [ ] ; var node1 = _dot_inner ( elem . fns [ 0 ] . fn , false , names ) ; var first = node1 ; var node2 ; for ( var i = 1 ; i < elem . fns . length ; ++ i ) { Array . prototype . push . apply ( builder , node1 [ 0 ] ) ; node2 = _dot_inner ( elem . fns [ i ] . fn , false , names ) ; builder . push ( node1 [ 2 ] + ' -> ' + node2 [ 1 ] + ';' ) ; node1 = node2 ; } Array . prototype . push . apply ( builder , node1 [ 0 ] ) ; return [ builder , first [ 1 ] , node2 [ 2 ] ] ; }
Handle a serial chain of function, which just pushes each node with an
edge to the next node in the chain
@param elem The chain to pull elements from
@param names The hash table of names that we've seen
@return Standard triple of [strings, first element, last element]
Handle a serial chain of function which just pushes each node with an edge to the next node in the chain