Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions plotly_resampler/figure_resampler/figure_resampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,9 @@ def show_dash(
available_modes = list(dash._jupyter.JupyterDisplayMode.__args__) + [
"inline_persistent"
]
assert (
mode is None or mode in available_modes
), f"mode must be one of {available_modes}"
if mode is None:
mode = "external"
assert mode in available_modes, f"mode must be one of {available_modes}"
graph_properties = {} if graph_properties is None else graph_properties
assert "config" not in graph_properties # There is a param for config
if self["layout"]["autosize"] is True and self["layout"]["height"] is None:
Expand Down
8 changes: 8 additions & 0 deletions tests/test_figure_resampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2024,3 +2024,11 @@ def test_manual_range_def(shared_xaxes):
assert isinstance(ud, list) and len(ud) == 2
ud = fig._construct_update_data({"xaxis2.range": [2, 10], "xaxis.range": [5, 100]})
assert isinstance(ud, list) and len(ud) == 3


def test_show_dash_with_default_mode():
x = np.arange(100)
y = np.sin(x)
fig = FigureResampler(go.Figure())
fig.add_trace(go.Scattergl(), hf_x=x, hf_y=y)
fig.show_dash(config={"scrollZoom": True}) # mode defaults to None
Loading