var ws; var sData = [], gData = []; var lastTime = 0; var svg = [], path, line; var gDims = { left: 40, right: 30, top: 30, bottom: 30, outerWidth: 600, outerHeight: 400, domain: "0.5", }; gDims.width = gDims.outerWidth - gDims.left - gDims.right; gDims.height = gDims.outerHeight - gDims.top - gDims.bottom; mRecv = function(){ msg = ws.rQshiftStr(ws.rQlen()); //console.log(msg); // readings = msg.split("\n").slice(1,-2).map(function(i){return Number.parseInt(i)}); readings = msg.split("\n"); console.log("***" + readings.slice(0,3).join(", ") + "***"); if (!(readings[0] == "START")) { throw("Expecting 'START'; found '" + readings[0] +"'") } readings = readings.slice(1,-2); lastTime = parseInt(readings.shift()); readings.shift(); // console.log(readings.join(", ")); for (i=0;i