From 93a09cb5bd7ef162b8400fc588d6d6691c49955a Mon Sep 17 00:00:00 2001 From: Dan Birman Date: Fri, 1 Nov 2024 14:22:03 -0700 Subject: [PATCH] feat: adding reference image options, S3 images missing --- src/aind_qc_portal/panel/metric.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/aind_qc_portal/panel/metric.py b/src/aind_qc_portal/panel/metric.py index 80af23e..fc0886c 100644 --- a/src/aind_qc_portal/panel/metric.py +++ b/src/aind_qc_portal/panel/metric.py @@ -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 @@ -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 = "" @@ -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)