Closed corand closed 8 years ago
Hi! I think that it is technically possible. Though I tried to make it work with the FileReader api, but I failed, and I didn't have much time to investigate. It would be an awesome feature.
Thanks, I will also have a look at it. Nice job!
I made it https://github.com/khertan/ForRunners/commit/b323bf787c658cb94f538402cb5723df60693e05 But readAsArrayBuffer return an array buffer so i changed getArrayBuffer(buffer) in binary.js to return buffer ... ;p
But some changes was required .... first using browserify : $ browserify easy-fit.js --standalone easy-fit > easy-fit.bundle.js
Looking good!
Here is a working example of the simplified version of @khertan
`
</html>`
@khertan @corand Awesome! Thanks for your investigation :)
Hi, late to the show I guess,
I had a look at this, but browserify doesn't work with ES6 module import and export. I understand that I could transpile it to ES5 with babel (though I don't know how to do that). Just wondering if there was any other solution?
I suppose I could manually copy and paste the modules into the main js file, but that seems a bit counter-productive. (Though I'll probably have a go for now.)
Gordon
Hi @gfmoore, thanks for the interest! I’ll try my best to answer this but it’s been a while (we will have a TypeScript version coming up some day with @jimmykane). What stack are you using on the front end?
Hey, thanks for the response. Don't worry about it as now I've simply grabbed all four js files, removed imports, exports, wrote a function to replace the Buffer usage (only the one that makes a string from the array of int (bytes) and it works client side. Not perhaps elegant, not perhaps very modular, but it's a hack and allows me to do what I want. I posted the code in a comment on the backfit site https://github.com/backfit/backfit/issues/6
It's a hack! (I'm just using JS, jQuery, jStat and D3 for developing some personal apps (cycling, Karoo v1) and just wanted to grab my data quickly. For some strange reason the Karoo dashboard does not do anything with the data it grabs, but does allow download of data in a FIT file. I'm not paying Strava for the analysis...
Ta.
@gfmoore Cool! Glad this way works for you. Never had to transpile stuff outside of pipelines like Grunt which make it easy.
Is it possible to load the .fit file clientside? as an array buffer or something like that.
http://www.javascripture.com/FileReader