function newTrace(traceIn) {
        traceType = Lib.coerce(traceIn, {}, plotAttributes, 'type');
        var traceOut = {type: traceType, _template: null};
        if(traceType in traceCounts) {
            typeTemplates = dataTemplate[traceType];
            // cycle through traces in the template set for this type
            var typei = traceCounts[traceType] % typeTemplates.length;
            traceCounts[traceType]++;
            traceOut._template = typeTemplates[typei];
        } else {
            // TODO: anything we should do for types missing from the template?
            // try to apply some other type? Or just bail as we do here?
            // Actually I think yes, we should apply other types; would be nice
            // if all scatter* could inherit from each other, and if histogram
            // could inherit from bar, etc... but how to specify this? And do we
            // compose them, or if a type is present require it to be complete?
            // Actually this could apply to layout too - 3D annotations
            // inheriting from 2D, axes of different types inheriting from each
            // other...
        }
        return traceOut;
    }
traceTemplater: logic for matching traces to trace templates

@param {object} dataTemplate: collection of {traceType: [{template}, ...]}
    ie each type the template applies to contains a list of template objects,
    to be provided cyclically to data traces of that type.

@returns {object}: {newTrace}, a function:
    newTrace(traceIn): that takes the input traceIn, coerces its type, then
        uses that type to find the next template to apply. returns the output
        traceOut with template attached, ready to continue supplyDefaults.