Skip to content

Commit

Permalink
yet more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Scheidegger committed Mar 20, 2013
1 parent a793edc commit 253ff8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 33 deletions.
33 changes: 0 additions & 33 deletions htdocs/main.js
@@ -1,36 +1,3 @@
var interpreter = {
'plot': function(cmd) {
rclient.capture_answers(cmd.ps.length, function(result) {
rclient.post_div(create_scatterplot.apply(result));
});
for (var i=0; i<cmd.ps.length; ++i) {
rclient.send(cmd.ps[i], rclient.wrap_command);
}
},
'logout': function(cmd) {
$.cookies.set('user', null);
$.cookies.set('sessid', null);
window.location.href = '/login.html';
}
};

function interpret_command(command)
{
if (command[0] === '@') {
var cmd = parser.parse(command);
interpreter[cmd.id](cmd);
} else {
// rclient.log(command);
rclient.send(command, rclient.markdown_wrap_command);
}
}

function transpose(ar) {
return _.map(_.range(ar[0].length), function(i) {
return _.map(ar, function(lst) { return lst[i]; });
});
}

function main_init() {
rclient = RClient.create({
debug: false,
Expand Down
6 changes: 6 additions & 0 deletions htdocs/shell_tab.js
Expand Up @@ -29,6 +29,12 @@ var shell = (function() {


function handle_scatterplot(data) {
function transpose(ar) {
return _.map(_.range(ar[0].length), function(i) {
return _.map(ar, function(lst) { return lst[i]; });
});
}

var opts = {
x: function(d) { return d[0]; },
y: function(d) { return d[1]; }
Expand Down

0 comments on commit 253ff8d

Please sign in to comment.