Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Data Save Functionality #14

Closed
kylemath opened this issue Nov 30, 2019 · 6 comments
Closed

Add Data Save Functionality #14

kylemath opened this issue Nov 30, 2019 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@kylemath
Copy link
Owner

buttons to save csv files

@kylemath kylemath added the enhancement New feature or request label Nov 30, 2019
@korymath
Copy link
Collaborator

korymath commented Dec 2, 2019

Here is the easy way to do it:
https://github.com/urish/eeg-explorer/blob/master/src/app/recorder/recorder.component.ts#L41

https://github.com/urish/eeg-explorer/blob/90d5b730a4331dcf40438959a23c7ece99551f04/src/app/recorder/recorder.component.ts#L41

This requires the whole data set to be stored in the browser.

The other option, and the one that might reduce latency, is to publish the data to a Pub/Sub service, or a server that is running to store the data asynchronously from the client code.

Store to bigtable: https://cloud.google.com/bigtable/docs/samples-nodejs-hello

@kylemath
Copy link
Owner Author

kylemath commented Dec 3, 2019

question becomes, what to record,
then the question becomes, let the user decide,
so have a chart of raw data
then a toggle for filter with input points for cutoffs
they can record at any time and record what is currently being plotted through the pipes

then we have spectra, that is probably a scroll down, but it is useful to watch the spectra and raw data coincidentally and view the changes as filters are introduced,

then the spectra has options to modify the parameters of the fft, and whatever is being shown can be recorded

Then we divide into 5 bins of frequency and show the bar graphs, those can be recorded

lets start with the first one, raw data

@korymath korymath self-assigned this Dec 5, 2019
@korymath
Copy link
Collaborator

korymath commented Dec 5, 2019

I will work on the minimum viable product of a client saving their data in the front end. We do not want to store THIER data on our servers, so we can keep it all client side for now.

@korymath korymath changed the title Data recording options Data Recording and Saving Dec 6, 2019
@korymath korymath changed the title Data Recording and Saving Add Data Save Functionality Dec 6, 2019
@korymath
Copy link
Collaborator

korymath commented Dec 6, 2019

Building a csv data array and then downloading with: https://www.npmjs.com/package/react-csv

@korymath
Copy link
Collaborator

StreamSaver: https://www.npmjs.com/package/streamsaver

window.onunload = () => {
  writableStream.abort()
  // also possible to call abort on the writer you got from `getWriter()`
  writer.abort()
}
 
window.onbeforeunload = evt => {
  if (!done) {
    evt.returnValue = `Are you sure you want to leave?`;
  }
}

@korymath
Copy link
Collaborator

This can be closed with the merging of #77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants