diff --git a/src/visualization/overall_compliance_heatmap.py b/src/visualization/overall_compliance_heatmap.py index 5f2b879f..877ab0d2 100644 --- a/src/visualization/overall_compliance_heatmap.py +++ b/src/visualization/overall_compliance_heatmap.py @@ -40,16 +40,18 @@ def getOverallComplianceHeatmap(sensors_with_data, valid_sensed_hours, last_cert x=[date.replace("-", "/") for date in last_certain_dates] if expected_num_of_days != -1 else last_certain_dates, y=[pid + "." + label for pid, label in zip(sensors_with_data["pid"].to_list(), sensors_with_data["label"].to_list())], text=sensors_with_data[last_certain_dates].values, - hovertemplate="Date: %{x}
Participant: %{y}
Valid sensed hours: %{z}
Number of sensors with data: %{text}" if expected_num_of_days != -1 else "Date_idx: %{x}
Participant: %{y}
Valid sensed hours: %{z}
Number of sensors with data: %{text}", + hovertemplate="Date: %{x}
Participant: %{y}
Valid sensed hours: %{z}
Number of sensors with data: %{text}" if expected_num_of_days != -1 else "Day index: %{x}
Participant: %{y}
Valid sensed hours: %{z}
Number of sensors with data: %{text}", colorscale="Viridis", colorbar={"tick0": 0,"dtick": 1}, showscale=True)) if expected_num_of_days != -1: - plot.update_layout(title="Overall compliance heatmap for last " + str(expected_num_of_days) + " days.
Bin's color shows valid sensed hours for that day.
A valid hour has at least one row of any sensor in "+ str(min_bins_per_hour) +" out of " + str(int(60 / bin_size)) + " bins of " + str(bin_size) + " minutes") + plot.update_layout(title="Overall compliance heatmap for last " + str(expected_num_of_days) + " days.
Bin's color shows valid sensed hours for that day.
A valid hour has at least one row of any sensor in "+ str(min_bins_per_hour) +" out of " + str(int(60 / bin_size)) + " bins of " + str(bin_size) + " minutes.
You can hover over every day to see the number of sensors with data in that day.") else: - plot.update_layout(title="Overall compliance heatmap for all days.
Bin's color shows valid sensed hours for that day.
A valid hour has at least one row of any sensor in "+ str(min_bins_per_hour) +" out of " + str(int(60 / bin_size)) + " bins of " + str(bin_size) + " minutes") + plot.update_layout(title="Overall compliance heatmap for all days.
Bin's color shows valid sensed hours for that day.
A valid hour has at least one row of any sensor in "+ str(min_bins_per_hour) +" out of " + str(int(60 / bin_size)) + " bins of " + str(bin_size) + " minutes.
You can hover over every day to see the number of sensors with data in that day.") plot["layout"]["xaxis"].update(side="bottom") + plot["layout"].update(xaxis_title="Day indexes") + plot["layout"].update(margin=dict(t=160)) pio.write_html(plot, file=output_path, auto_open=False, include_plotlyjs="cdn")