Skip to content

Commit 232416b

Browse files
committed
🖊️ review code
1 parent 526b64c commit 232416b

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

plotly_resampler/figure_resampler/jupyter_dash_persistent_inline_output.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,23 @@ def run_app(
178178
port=8050,
179179
server_url=None,
180180
):
181-
"""
182-
:type app: dash.Dash
183-
:param width: Width of app when displayed using mode="inline"
184-
:param height: Height of app when displayed using mode="inline"
185-
:param host: Host of the server
186-
:param port: Port used by the server
187-
:param server_url: Use if a custom url is required to display the app.
181+
"""Run the inline persistent dash app in the notebook.
182+
183+
Parameters
184+
----------
185+
app : dash.Dash
186+
A Dash application instance
187+
width : str, optional
188+
Width of app when displayed using mode="inline", by default "100%"
189+
height : int, optional
190+
Height of app when displayed using mode="inline", by default 650
191+
host : str, optional
192+
Host of the server, by default "127.0.0.1"
193+
port : int, optional
194+
Port used by the server, by default 8050
195+
server_url : str, optional
196+
Use if a custom url is required to display the app, by default None
197+
188198
"""
189199
# Terminate any existing server using this port
190200
old_server = JupyterDash._servers.get((host, port))
@@ -312,8 +322,6 @@ def wait_for_app():
312322
_get_error()
313323
raise err
314324

315-
print(dashboard_url)
316-
print(alive_url)
317325
try:
318326
wait_for_app()
319327
self._display_inline_output(dashboard_url, width=width, height=height)

tests/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ def construct_index(series: pd.Series, index_type: str) -> pd.Index:
8181

8282

8383
def decode_trace_bdata(data: dict | list):
84-
"""As from plotly>6.0.0, traces can be encoded as binary strings, we"""
84+
"""As from plotly>6.0.0, traces can be encoded as binary strings, we need to decode
85+
them to get the actual data.
86+
"""
8587
if isinstance(data, dict) and "bdata" in data:
8688
bdata = data["bdata"]
8789
dtype = data["dtype"]

0 commit comments

Comments
 (0)