 
         #stack = d3.layout.stack()
         #.values((d) -> d.values)
-        draw = ->
-            data = res_data x.domain()
+        draw = -> res_data(x.domain()).done (data, opts) ->
+            opts ?= {}
+            area.interpolate opts.interpolate ? "linear"
+
             d.y0 = [] for d in data
             for ix in [0...data[0].y.length]
                 y0 = 0

        minlevel=1,
        maxlevel=30
        levelstep=1
        ) ->
    # Don't mangle the argument
    # TODO: Assumes grid-x

                    h.cache[level] = smooth(h.orig_y, level)
            h.y = h.cache[level][start...end]
            h.x = h.orig_x[start...end][...h.y.length]
        
        opts = {}
        opts.interpolate = switch
            when level <= binlevel then "step"
            when level <= splinelevel then "basis"
            else "linear"
        
        promise = $.Deferred()
        promise.resolve datac, opts
        return promise

    getter.extent = d3.extent datac[0].x
    getter.keys = (d.key for d in datac)
    return getter
