Skip to content

Commit

Permalink
Achieving ASYNC explore
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Dec 23, 2015
1 parent 527bc14 commit e7ccbef
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
2 changes: 1 addition & 1 deletion panoramix/static/panoramix.css
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ legend {
max-width: 350px;
}
img.loading {
width: 30px;
width: 40px;
}

.dashboard a i {
Expand Down
35 changes: 15 additions & 20 deletions panoramix/static/panoramix.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,21 @@ var px = (function() {
dttm += 10;
$('#timer').text(Math.round(dttm/10)/100 + " sec");
}
var qrystr = '';
slice = {
jsonEndpoint: function() {
var parser = document.createElement('a');
parser.href = data.json_endpoint;
console.log(parser);
// Shallow copy
var form_data = jQuery.extend({}, data.form_data);
for (var k in form_data){
if (form_data[k]==null){
delete form_data[k];
}
}
form_data['json'] = true;
if (dashboard !== undefined){
for (var f in dashboard.filters) {
if (slice_id !== f){
form_data['extra_filters'] = JSON.stringify(dashboard.filters)
}
}
qrystr = parser.search + "&extra_filters=" + JSON.stringify(dashboard.filters);
console.log(qrystr);
}
form_data['flt_op_0'] = '';
form_data['flt_eq_0'] = '';
form_data['flt_col_0'] = '';
var parser = document.createElement('a');
parser.href = data.json_endpoint;
var endpoint = parser.pathname + '?' + $.param(form_data, true);
else {
qrystr = '?' + $('#query').serialize();
}
var endpoint = parser.pathname + qrystr + "&json=true";
return endpoint;
},
done: function (data) {
Expand All @@ -49,8 +41,8 @@ var px = (function() {
if(data !== undefined)
$("#query_container").html(data.query);
$('#timer').removeClass('btn-warning');
$('span.query').removeClass('disabled');
$('#timer').addClass('btn-success');
$('span.query').removeClass('disabled');
},
error: function (msg) {
clearInterval(timer);
Expand All @@ -70,7 +62,10 @@ var px = (function() {
token.find("img.loading").show();
container.hide();
container.html('');
dttm = 0;
timer = setInterval(stopwatch, 10);
$('#timer').removeClass('btn-danger btn-success');
$('#timer').addClass('btn-warning');
viz.render();
},
resize: function() {
Expand Down Expand Up @@ -194,7 +189,7 @@ var px = (function() {
.attr("name", function() {return "flt_eq_" + i;});
i++;
});
$("#query").submit();
slice.render();
}

$("#plus").click(add_filter);
Expand Down

0 comments on commit e7ccbef

Please sign in to comment.