Skip to content
This repository has been archived by the owner on Mar 13, 2019. It is now read-only.

Commit

Permalink
General bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
josecolella committed Jun 24, 2014
1 parent 4afae71 commit 0115cea
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
13 changes: 12 additions & 1 deletion visualization/static/visualization/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,18 @@ var saveFileAsPrompt = function(extension) {
closeClassName: 'alert-vex-close',
callback: function(filename) {
console.log(filename);
exportFile[extension](filename);
var regex = /(\w+\d*)(\.[a-zA-Z]+)?/;
var checkFilename = regex.exec($.trim(filename));
var cleanfilename;
//Check for incorrect filename and add appropiate extension if needed
if (checkFilename[2] === undefined && checkFilename[1] !== undefined) {
cleanfilename = $.trim(checkFilename[1]) + "."+ extension;
exportFile[extension](cleanfilename);
} else {
exportFile[extension]($.trim(filename));
}



}
});
Expand Down
12 changes: 12 additions & 0 deletions visualization/static/visualization/js/visualize.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ var visualize = {
});
}

visualize.exportData(group.all(), visualize.config.x, visualize.config.y, 'barPlot');


var groupByValue = function(d) {
return d.value;
Expand Down Expand Up @@ -150,6 +152,7 @@ var visualize = {
});
}

visualize.exportData(group.all(), visualize.config.x, visualize.config.y, 'boxPlot');

var groupByValue = function(d) {
return d.value;
Expand Down Expand Up @@ -201,6 +204,7 @@ var visualize = {
});
}

visualize.exportData(group.all(), visualize.config.x, visualize.config.y, 'histogram');

var groupByValue = function(d) {
return d.value;
Expand Down Expand Up @@ -254,6 +258,8 @@ var visualize = {
});
}

visualize.exportData(group.all(), visualize.config.x, visualize.config.y, 'linePlot');


var groupByValue = function(d) {
return d.value;
Expand Down Expand Up @@ -311,6 +317,8 @@ var visualize = {
}


visualize.exportData(group.all(), visualize.config.x, visualize.config.y, 'scatter');

var groupByValue = function(d) {
return d.value;
};
Expand Down Expand Up @@ -380,6 +388,10 @@ var visualize = {
}


visualize.exportData(group.all(), visualize.config.x, visualize.config.y, 'stackedArea');



var groupByValue = function(d) {
return d.value;
};
Expand Down
2 changes: 2 additions & 0 deletions visualization/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ def exportView(request, filename):
else:
response = HttpResponseRedirect(reverse('index'))

return response


def exportSVG(request, filename, svg):
"""
Expand Down

0 comments on commit 0115cea

Please sign in to comment.