diff --git a/docs/api_examples/scatter_plot.ipynb b/docs/api_examples/scatter_plot.ipynb index 1f5906e..05ba1f6 100644 --- a/docs/api_examples/scatter_plot.ipynb +++ b/docs/api_examples/scatter_plot.ipynb @@ -293,12 +293,8 @@ "source": [ "# Imports\n", "import pandas as pd\n", - "import plotly.io as pio\n", "\n", - "from vuecore.plots.basic.scatter import create_scatter_plot\n", - "\n", - "# Set the Plotly renderer based on the environment\n", - "pio.renderers.default = \"notebook\"" + "from vuecore.plots.basic.scatter import create_scatter_plot" ] }, { diff --git a/docs/api_examples/scatter_plot.py b/docs/api_examples/scatter_plot.py index f9cc861..96e36ed 100644 --- a/docs/api_examples/scatter_plot.py +++ b/docs/api_examples/scatter_plot.py @@ -76,13 +76,9 @@ # %% # Imports import pandas as pd -import plotly.io as pio from vuecore.plots.basic.scatter import create_scatter_plot -# Set the Plotly renderer based on the environment -pio.renderers.default = "notebook" - # %% [markdown] # ### 0.3. Create sample data # We create a synthetic dataset that contains simulated gene expression values, p-values, regulation status, and significance scores for 8 genes across two cell types. diff --git a/docs/conf.py b/docs/conf.py index 66522e3..8e80246 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,6 +12,7 @@ # import os from importlib import metadata +from pathlib import Path # -- Project information ----------------------------------------------------- @@ -49,7 +50,7 @@ # Plolty support through require javascript library # https://myst-nb.readthedocs.io/en/latest/render/interactive.html#plotly html_js_files = [ - "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js" + # "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.7/require.min.js" ] # https://myst-nb.readthedocs.io/en/latest/configuration.html @@ -133,7 +134,11 @@ # https://github.com/readthedocs/readthedocs.org/issues/1139 if os.environ.get("READTHEDOCS") == "True": - from pathlib import Path + # Set the Plotly renderer to notebook for ReadTheDocs (visualize plotly figures + # in the documentation) - needed for plotly6 + # Plotly normally decides itself fine which renderer to use, so keep it to RTD + # see https://plotly.com/python/renderers/#setting-the-default-renderer + os.environ["PLOTLY_RENDERER"] = "notebook" PROJECT_ROOT = Path(__file__).parent.parent PACKAGE_ROOT = PROJECT_ROOT / "src" / "vuecore"