Skip to content

Commit a89b219

Browse files
Fix pydocstyle. Fix css.
1 parent d633f33 commit a89b219

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

pylossless/dash/css_defaults.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919
DEFAULT_LAYOUT_XAXIS = {
2020
"zeroline": False,
2121
"showgrid": True,
22-
"title": "time (seconds)",
22+
"title": {"text": "time (seconds)", "font": {"color": "#ADB5BD"}},
2323
"gridcolor": "white",
2424
"fixedrange": True,
2525
"showline": True,
26-
"titlefont": dict(color="#ADB5BD"),
2726
"tickfont": dict(color="#ADB5BD"),
2827
"automargin": True,
2928
}
@@ -35,7 +34,7 @@
3534
"autorange": False, # 'reversed',
3635
"scaleratio": 0.5,
3736
"tickmode": "array",
38-
"titlefont": dict(color="#ADB5BD"),
37+
"title": {"font": {"color": "#ADB5BD"}},
3938
"tickfont": dict(color="#ADB5BD"),
4039
"fixedrange": True,
4140
"automargin": True,

pylossless/dash/qcannotations.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def __init__(self, onset, duration, description_str, layout):
6060
)
6161

6262
def to_dict(self):
63+
"""Return a dict representation of the EEGAnnotation object."""
6364
return {"_id": self._id, "_onset": self._onset,
6465
"_duration": self._duration, "_description": self._description,
6566
"_dash_description": self._dash_description,
@@ -180,6 +181,11 @@ def __init__(self, annotations=None):
180181
self.annotations = pd.Series()
181182

182183
def to_plotly_json(self):
184+
"""Return a dict representation of the EEGAnnotation object.
185+
186+
Implementing this function is necessary for Plotly/Dash to serialize
187+
EEGAnnotationList objects.
188+
"""
183189
return {key: value.to_dict() for key, value in self.annotations.items()}
184190

185191
def __get_series(self, attr):

0 commit comments

Comments
 (0)