     hasDataset: (id) ->
         return false unless @datasets[id]?
 
-    # TODO redraws.
+    # redraws.
     center: (params...) ->
         start = new Date(params[0])
         end = new Date(params[1])
         [ start, end ] = [ end, start ] if end < start
 
-        @options.zoom.scale((@options.domain.end - @options.domain.start) / (end - start))
+        diff = end - start
+        if start < @options.domain.start
+            start = @options.domain.start
+            newEnd = new Date(start.getTime() + diff)
+            end = if newEnd < @options.domain.end then newEnd else @options.domain.end
+        if end > @options.domain.end
+            end = @options.domain.end
+            newStart = new Date(end.getTime() - diff)
+            start = if newStart > @options.domain.start then newStart else @options.domain.start
+
+        @options.zoom.scale((@options.display.end - @options.display.start) / (end - start))
         @options.zoom.translate([ @options.zoom.translate()[0] - @scales.x(start), 0 ])
-
         @redraw()
 
         true

        @brush = d3.svg.brush()
            .x(@scales.x)
            .on('brushstart', =>
                @options.lastZoom = {
                    scale: @options.zoom.scale(),
                    translate: [
                        @options.zoom.translate()[0],
                        @options.zoom.translate()[1],
                    ]
                }

                @options.zoom.on('zoom', null)
            )
            .on('brushend', =>
                @options.zoom
                    .scale(@options.lastZoom.scale)
                    .translate(@options.lastZoom.translate)
                    .on('zoom', => @redraw)

                # Check for selection limit and reduce to correct size
                if @options.selectionLimit > 0
                    @svg.selectAll('.brush')
                        .attr({fill: "#333"})
                    s = @brush.extent()
                    if (s[1]-s[0])/1000 >= @options.selectionLimit
                        tmpdate = new Date(@brush.extent()[0].getTime() + @options.selectionLimit * 1000)
                        @brush.extent([@brush.extent()[0], tmpdate])
                        d3.select(@element).select('g.brush').call(@brush)

                @element.dispatchEvent(
                    new CustomEvent('selectionChanged', {
                        detail: {

                    else if not (record[1] instanceof Date)
                        record = [ record[0], record[0] ].concat(record[1..])

                    finalRecords.push(record)
            else
                # TODO: perform check of records
                finalPaths = records
