Skip to content
Merged
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
5 changes: 4 additions & 1 deletion plotly_resampler/figure_resampler/figure_resampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
MinMaxLTTB,
)
from .figure_resampler_interface import AbstractFigureAggregator
from .jupyter_dash_persistent_inline_output import JupyterDashPersistentInlineOutput
from .utils import is_figure, is_fr

# Default arguments for the Figure overview
Expand Down Expand Up @@ -626,6 +625,10 @@ def show_dash(
# function signatures are slightly different for the (Jupyter)Dash and the
# JupyterDashInlinePersistent implementations
if mode == "inline_persistent":
from .jupyter_dash_persistent_inline_output import (
JupyterDashPersistentInlineOutput,
)

jpi = JupyterDashPersistentInlineOutput(self)
jpi.run_app(app=app, **kwargs)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
try:
from IPython.display import HTML, display
except ImportError:
pass
raise ImportError(
"The `jupyter_dash_persistent_inline_output` requirements are not installed.\n"
"Please install them with:\n"
"pip install plotly_resampler[inline_persistent]"
)

from dash._jupyter import JupyterDash, _jupyter_config, make_server, retry
from dash._jupyter import JupyterDash, _jupyter_config, make_server
from plotly.graph_objects import Figure
from retrying import retry


class JupyterDashPersistentInlineOutput:
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ tsdownsample = ">=0.1.3"

[tool.poetry.extras]
# Optional dependencies
inline_persistent = ["kaleido", "Flask-Cors"]
inline_persistent = ["kaleido", "Flask-Cors", "ipython"]

[tool.poetry.dev-dependencies]
pytest = "^7.2.0"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_figure_resampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ def test_manual_jupyterdashpersistentinline():

import dash

from plotly_resampler.figure_resampler.figure_resampler import (
from plotly_resampler.figure_resampler.jupyter_dash_persistent_inline_output import (
JupyterDashPersistentInlineOutput,
)

Expand Down
Loading