Skip to content

Commit 56aa5a9

Browse files
Merge pull request #76 from easyscience/plotly
Resolve Plotly display issues and optimize notebook size
2 parents 32c0ea6 + 19d225a commit 56aa5a9

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

docs/mkdocs.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@ extra:
2727
name: EasyDiffraction Library Source Code on GitHub
2828

2929
# Jupyter notebooks
30-
plugins:
31-
- mkdocs-jupyter:
32-
execute_ignore:
33-
- 'quick*.ipynb'
34-
- 'basic*.ipynb'
35-
- 'advanced*.ipynb'
36-
- 'cryst*.ipynb'
37-
- 'pdf*.ipynb'
38-
# - '*emcee*.ipynb' # Ignore notebooks with 'emcee' in the name from execution
30+
#plugins:
31+
# - mkdocs-jupyter:
32+
# execute_ignore:
33+
# - 'quick*.ipynb'
34+
# - 'basic*.ipynb'
35+
# - 'advanced*.ipynb'
36+
# - 'cryst*.ipynb'
37+
# - 'pdf*.ipynb'
3938

4039
##################
4140
# Add new settings

src/easydiffraction/plotting/plotters/plotter_plotly.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
display = None
1313
HTML = None
1414

15-
from easydiffraction.utils.utils import is_github_ci
15+
from easydiffraction.utils.utils import is_pycharm
1616

1717
from .plotter_base import SERIES_CONFIG
1818
from .plotter_base import PlotterBase
@@ -111,13 +111,7 @@ def plot(
111111

112112
# Show the figure
113113

114-
# In GitHub CI builds (e.g., during Jupyter Book generation), avoid
115-
#
116-
# calling `fig.show()`
117-
# because it can emit `application/vnd.plotly.v1+json` outputs that some toolchains warn about.
118-
# Instead, convert the figure to HTML and display it directly.
119-
# Use a regular Figure and show it
120-
if not is_github_ci() or display is None or HTML is None:
114+
if is_pycharm() or display is None or HTML is None:
121115
fig.show(config=config)
122116
else:
123117
html_fig = pio.to_html(

0 commit comments

Comments
 (0)