| 7 | from the presentation in Spectrum.js and SerialChart.js |
| 8 | */ |
| 9 | export function reformatData(xvec,yarray,yindex,step){ |
| 10 | // This creates data arrays of the form [{x:100,y:23.44},{x:100,y:23.44},...] |
| 11 | // Uses a step size of step (so it can decimate the data) |
| 12 | var data = []; |
| 13 | for(var k = 0; k < xvec.length; k=k+step){ |
| 14 | data.push({ x: xvec[k], |
| 15 | y: yarray[k][yindex]}) |
| 16 | } |
| 17 | return data; |
| 18 | } |
| 19 | |
| 20 | export function reformatDataVec(xvec,yvec){ |
| 21 | // This creates data arrays of the form [{x:100,y:23.44},{x:100,y:23.44},...] |