marleymarl / geotimeline

12 stars 10 forks source link

Add patientId to each row in the CSV along with the footprint #25

Closed marleymarl closed 4 years ago

marleymarl commented 4 years ago

When the CSV gets output right now it has the footprint data but doesn't have the patientId on each row because it's just using the this.state.footPrints array. For the CSV it needs to push in the patientId into each footPrint. Something like the function that was deleted previously but with an addition to push the patientId in like:

formatData = () => { let csvData = [ ["patientId", "date", "time", "latitude", "longitude"] ];

this.state.footPrints.forEach((footPrint) => {
  let newFootPrintArr = [];
  newFootPrintArr.push(this.state.patientId, footPrint.date, footPrint.time, footPrint.lat, footPrint.lng);
  csvData.push(newFootPrintArr);
});

return csvData;

}

V1shvesh commented 4 years ago

Picking up this issue :+1:

heldersepu commented 4 years ago

I think that all that needs to be done is replace: https://github.com/marleymarl/geotime/blob/a3860bc64163b4958861978f90bbb854b699f55c/src/MapContainer.js#L264

with:
data={dataSource}

marleymarl commented 4 years ago

Cool