Handler for showing mouse statistics for specified type and day.

def mouse(table, day=None):
    """Handler for showing mouse statistics for specified type and day."""
    where = (("day", day),) if day else ()
    events = db.fetch(table, where=where, order="day")
    for e in events: e["dt"] = datetime.datetime.fromtimestamp(e["stamp"])
    stats, positions, events = stats_mouse(events, table)
    days, input = db.fetch("counts", order="day", type=table), "mouse"
    return bottle.template("heatmap.tpl", locals(), conf=conf)