diff --git a/src/spikeinterface/core/basesorting.py b/src/spikeinterface/core/basesorting.py
index 4e3551e290..fc0d5ba0d5 100644
--- a/src/spikeinterface/core/basesorting.py
+++ b/src/spikeinterface/core/basesorting.py
@@ -39,6 +39,32 @@ def __repr__(self):
txt += "\n file_path: {}".format(self._kwargs["file_path"])
return txt
+ def _repr_html_(self):
+ common_style = "margin-left: 10px;"
+ border_style = "border:1px solid #ddd; padding:10px;"
+
+ html_header = f"
{self.__repr__()}
"
+
+ html_unit_ids = f" Unit IDs
"
+ html_unit_ids += f"{self.unit_ids}
"
+
+ html_annotations = f" Annotations
"
+ for key, value in self._annotations.items():
+ html_annotations += f"- {key} : {value}
"
+ html_annotations += f"
"
+
+ html_unit_properties = (
+ f"Unit Properties
"
+ )
+ for key, value in self._properties.items():
+ # Add a further indent for each property
+ value_formatted = np.asarray(value)
+ html_unit_properties += f"{key}
{value_formatted} "
+ html_unit_properties += "
"
+
+ html_repr = html_header + html_unit_ids + html_annotations + html_unit_properties
+ return html_repr
+
@property
def unit_ids(self):
return self._main_ids