Open JGreenlee opened 8 months ago
While implementing this, we are going to transition from server-side computation to client-side computation for user metrics.
In the current version on master
, all metrics are computed on the server and organized by date. The in-app Dashboard tab fetches the metrics from the server for the selected date range.
Transitioning to client-side computation for user metrics has a few advantages:
One caveat is that these advantages apply only for the user's metrics. Aggregate metrics (used for group comparisons, summaries for whole cohort, etc) will still need to be computed on the server. I still think that this client-side computation is worth it for the UX because it allows us to show the most pertinent information upfront (which is the user's own metrics). It gives us flexibility to potentially lazy-load aggregate metrics while the user is already looking at their own metrics.
The steps I think are needed to this to happen for GPG:
e-mission-common
, passing the timeline data as input. User metrics will no longer be fetched from the server, but aggregate metrics will stay the samee-mission-common
) and make the dashboard configurableAt a later point in time, or gradually:
e-mission-common
similarly for aggregate metricsI have completed the first step on https://github.com/e-mission/e-mission-phone/pull/1138
In the current version of the app, the Dashboard tab is completely hidden if
survey_info
.trip-labels
is set toENKETO
. This is largely because we couldn't compute carbon footprint without aMODE
input.However, the DFC fermata project will use Bluetooth sensing to detect mode. This means we will be able to show the carbon footprint even without user input. We also want to show other metrics, including new sections for survey response rate, and potentially user engagement / gamification
I think we should expand the
metrics
field of the dynamic config. It already has one fieldinclude_test_users
. I propose adding a sub-field "phone_dashboard" that contains options that control the UI.sections
A list of sections to show in the dashboard UI. They will appear in the specified order from top to bottom. Options are
footprint
,active_travel
,summary
,engagement
,surveys
. Whichever sections are omitted will not be shown in the UI. Default:["footprint", "active_travel", "summary"]
footprint_options
.unlabeled_uncertainty
Whether to show the uncertainty on the carbon footprint charts. Programs using MODE / PURPOSE labels will need this
true
. Programs using Bluetooth sensing can set thisfalse
. Default:true
active_travel_options
.modes_list
Which modes to consider as "active" for the purpose of calculating "active minutes". Default:
["walk", "bike"]
summary_options
.metrics_list
A list of metrics for which to show a graph and descriptives summarizing the metric by mode. Options are
distance
,count
,duration
. (mean_speed
used to also be one but it was removed because the computations were wrong. We can add it back if we fix it) Default:["distance", "count", "duration"]
engagement_options
.leaderboard_metric
What metric to use as the basis for the leaderboard. (I am not sure yet how this will be represented, but maybe something like
["distance", "e_car"]
to rank participants on miles driven in an EV. But if we do incentives based on survey response % instead, it will look different)@jiji14 and I will work together on implementing this