var visualize = (function() {
    return (function(widget, name, reduce) {
        $.ajax({
            url: "/couchdb/" + name,
            type: 'get',
            data: { arguments: { group_level: (0+reduce) } },
            dataType: 'json',
            success: function(data) {
                adapter(data['rows']);
                var d = new Date();
                $("#last_update").html(d.toTimeString());
            }
        });
    });
})();

var visualize = (function() {
    return (function(widget, name, reduce) {
        var params = {};
        if (reduce) {
            params['group_level'] = 1;
        }
        else {
            params['reduce'] = false;
        }
        console.log(params);
        $.ajax({
            url: "/couchdb/" + name,
            type: 'get',
            data: { arguments: params},
            dataType: 'json',
            success: function(data) {
                adapter(data['rows']);
                var d = new Date();
                $("#last_update").html(d.toTimeString());
            }
        });
    });
})();

Fix query without reduce