Skip to content

Commit

Permalink
fix: typo, Date -> Acquisition Time
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Feb 14, 2025
1 parent 3d831d8 commit c89f3cb
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/aind_qc_portal/projects/project_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,15 @@ def history_panel(self):
# Calculate the time range to show on the x axis
(min_range, max_range, range_unit, format) = df_timestamp_range(data[["timestamp"]])

print(data.columns)

chart = (
alt.Chart(self.dataset.data)
alt.Chart(data)
.mark_bar()
.encode(
x=alt.X(
"Date:T",
title="Time",
"Acquisition Time:T",
title="Acquisition Time",
scale=alt.Scale(domain=[min_range, max_range]),
axis=alt.Axis(format=format, tickCount=range_unit),
),
Expand All @@ -96,7 +98,7 @@ def history_panel(self):
alt.Tooltip("Subject ID:N", title="Subject ID"),
alt.Tooltip("name:Q", title="Asset name"),
alt.Tooltip("session_type:Q", title="Session Type"),
alt.Tooltip("Date:T", title="Date"),
alt.Tooltip("Acquisition Time:T", title="Acquisition Time"),
],
color=alt.condition(
self.brush,
Expand Down Expand Up @@ -132,20 +134,20 @@ def selection_history_panel(self, selection):
else:
if selection.get("Subject ID") is not None:
data = data[data["Subject ID"].isin(selection["Subject ID"])]
if selection.get("Date") is not None:
min_range = datetime.fromtimestamp(selection["Date"][0] / 1000)
max_range = datetime.fromtimestamp(selection["Date"][1] / 1000)
if selection.get("Acquisition Time") is not None:
min_range = datetime.fromtimestamp(selection["Acquisition Time"][0] / 1000)
max_range = datetime.fromtimestamp(selection["Acquisition Time"][1] / 1000)
(range_unit, format) = range_unit_format(
datetime.fromtimestamp(selection["Date"][1] / 1000)
- datetime.fromtimestamp(selection["Date"][0] / 1000)
datetime.fromtimestamp(selection["Acquisition Time"][1] / 1000)
- datetime.fromtimestamp(selection["Acquisition Time"][0] / 1000)
)

chart = (
alt.Chart(data)
.mark_bar()
.encode(
x=alt.X(
"Date:T",
"Acquisition Time:T",
title="Time",
scale=alt.Scale(domain=[min_range, max_range]),
axis=alt.Axis(format=format, tickCount=range_unit),
Expand All @@ -155,7 +157,7 @@ def selection_history_panel(self, selection):
alt.Tooltip("Subject ID:N", title="Subject ID"),
alt.Tooltip("name:Q", title="Asset name"),
alt.Tooltip("session_type:Q", title="Session Type"),
alt.Tooltip("Date:T", title="Date"),
alt.Tooltip("Acquisition Time:T", title="Acquisition Time"),
],
color=alt.Color("Subject ID:N"),
href=alt.Href("qc_link:N"),
Expand Down

0 comments on commit c89f3cb

Please sign in to comment.