asiripanich / emdash

An e-mission deployer's dashboard. See https://github.com/e-mission/e-mission-docs.
https://emdash.amarin.dev
Other
6 stars 3 forks source link

Checkinout table #34

Closed allenmichael099 closed 3 years ago

allenmichael099 commented 3 years ago

Made the a table tab to display bike checkins as a serparate tab from participants and trips.

From my commit:

shankari commented 3 years ago

Seems like it should all work. Hopefully R has a way to retrieve keys by name (e.g. the equivalent of data[t["name"]]). I'm not sure if the data_r$t["name"] would work 😄

asiripanich commented 3 years ago

Seems like it should all work. Hopefully R has a way to retrieve keys by name (e.g. the equivalent of data[t["name"]]). I'm not sure if the data_r$t["name"] would work 😄

Yes, that works in R as well data_r$t[["name"]].

asiripanich commented 3 years ago

@allenmichael099 Once I merge #32 to master, could you please pull new commits from master to this branch? Thanks

allenmichael099 commented 3 years ago

After merging, I ran into an issue related to tidy_cleaned_trips and am currently looking into it. My first error was: Warning: Error in setorderv: some columns are not in the data.table: data.end_fmt_time

allenmichael099 commented 3 years ago

So the difference is within query_cleaned_trips: my working version said analysis/cleaned_trip, but after I merged it said analysis confirmed_trip, which returned a null data frame %>% null data table %>% couldn't use setorder. I'm not sure whether or not this has to do with differences between test-data and the actual data set.

There also is an issue just before generate trajectories so that when generate_trajectories is called, tidied_trips is missing 'fmt_time_utc', which gives: Warning: Error in eval: object 'fmt_time_utc' not found

shankari commented 3 years ago

@allenmichael099 aha! As part of https://github.com/asiripanich/emdash/pull/23 I switched to reading confirmed_trip instead of cleaned_trip I also updated the test database

Screen Shot 2021-06-08 at 4 03 34 PM

You need to update your test mongodb and then everything should work 👍 This will also display mode_confirm, purpose_confirm etc in the trip table

allenmichael099 commented 3 years ago

@shankari Got it, thanks! I changed cleaned trip back to confirmed trip and downloaded the new test data. Everything looks like it works now

shankari commented 3 years ago

@asiripanich I am going to merge this into a local branch for deployment now

shankari commented 3 years ago

This works great barring the sync between the table and the plot. I even enabled the commented out "Polar Bear" table and it worked just fine.

shankari commented 3 years ago

Looked at the table with the end user today, and everything is fine except that the timestamp is in milliseconds. We should really handle that in the dashboard instead of forcing the user to convert manually.

There are two ways in which we can do this:

In both cases, we need to decide how to specify the timezone for the conversion

One option is to have the phone send up the formatted time and the timezone, similar to the current background sensed entries. This would require no further customization on the dashboard.

shankari commented 3 years ago

Timezones are tricky to work with. The classic solution for time display is that you store everything as a ts and convert at the presentation layer, before displaying to the user. BUT when you display to the user, which timezone should you use?

shankari commented 3 years ago

This is only really applicable to app-generated supplementary data. Not sure how common a use case that is, and how people are going to want to use it in the future. Let's not overengineer. If @allenmichael099 can get the formatted time in the timezone of the computer along with automatically converting all ts columns, that is good enough for now.

If we need to send fmt_time from the app, we can migrate the server side data later.