Skip to content

Commit

Permalink
feat: adding reference image options, S3 images missing
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Nov 1, 2024
1 parent d1f1080 commit 93a09cb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/aind_qc_portal/panel/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from aind_data_schema.base import AwareDatetimeWithDefault
from datetime import datetime
import html
import pandas as pd

from aind_qc_portal.panel.custom_metrics import CustomMetricValue
from aind_qc_portal.utils import md_style
Expand Down Expand Up @@ -96,6 +97,10 @@ def panel(self):
elif "s3" in self._data.reference:
self.reference_img = pn.widgets.StaticText(value=f"s3 reference: {self._data.reference}")

elif "png" in self._data.reference:
# this is
self.reference_img = pn.pane.Image(self._data.reference, sizing_mode='scale_width', max_width=1200)

elif self._data.reference == "ecephys-drift-map":
self.reference_img = ""

Expand Down Expand Up @@ -136,6 +141,10 @@ def metric_panel(self):
value_widget = pn.widgets.FloatInput(name=name)
elif isinstance(value, int):
value_widget = pn.widgets.IntInput(name=name)
elif isinstance(value, list):
df = pd.DataFrame({'values': value})
value_widget = pn.pane.DataFrame(df)
auto_value = True
elif isinstance(value, dict):
try:
custom_value = CustomMetricValue(value, self._set_value, self._set_status)
Expand Down

0 comments on commit 93a09cb

Please sign in to comment.