/*
 * Utility classes and functions.
 *
 */

viz.util = {
    /*
     * Create a new object by merging the contents of s into t. The keys
     * in the resulting object will be a union of the keys in t and s. If a key
     * exists in both t and s, the value from s will be used.
     *
     */
    extend: function(t, s) {
        var r = {};
        var tkeys = d3.keys(t);
        var skeys = d3.keys(s);
        d3.merge([tkeys, skeys]).forEach(function(k) {
            if (k in skeys) {
                r[k] = s[k];
            } else {
                r[k] = t[k];
            }
        });
        return r;
    },
}

@@ -616,10 +616,484 @@
 %0A    %7D,%0A
+%0A    /*%0A     * Returns a D3 dash array specification based on a line type.%0A     *%0A     */%0A    lineType: function(t) %7B%0A        // TODO What should the default be?%0A        var lt = '';%0A        switch (t) %7B%0A            case %22dotted%22:%0A                lt = '1,1';%0A                break;%0A            case %22dashed%22:%0A                lt = '5,2';%0A                break;%0A            case %22solid%22:%0A                lt = '1,0';%0A                break;%0A        %7D%0A        return lt;%0A    %7D,%0A%0A
 %7D%0A

Add lineType function to util.