From b01d0eddc6ea2ac12df94122aa533073a67e6425 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Thu, 10 Jul 2025 12:18:59 +0200 Subject: [PATCH 1/4] :wrench: configure the plotlly renderer on Read The Docs --- docs/conf.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 66522e3..6c198de 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 ----------------------------------------------------- @@ -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" From 72f52ce4e65ef9fd7166ed3014aea31350f3b565 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Thu, 10 Jul 2025 12:20:54 +0200 Subject: [PATCH 2/4] :zap: see if requirejs is still needed --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 6c198de..8e80246 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -50,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 From f519233c29227d3426428d3c3de0271347cc53da Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Mon, 14 Jul 2025 15:17:34 +0200 Subject: [PATCH 3/4] :wrench: setup was moved to conf.py --- docs/api_examples/scatter_plot.ipynb | 5 +---- docs/api_examples/scatter_plot.py | 3 --- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/docs/api_examples/scatter_plot.ipynb b/docs/api_examples/scatter_plot.ipynb index 28f7a40..f1886f7 100644 --- a/docs/api_examples/scatter_plot.ipynb +++ b/docs/api_examples/scatter_plot.ipynb @@ -295,10 +295,7 @@ "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 2f8d7f9..6386897 100644 --- a/docs/api_examples/scatter_plot.py +++ b/docs/api_examples/scatter_plot.py @@ -80,9 +80,6 @@ from vuecore.plots.basic.scatter import create_scatter_plot -# Set the Plotly renderer based on the environment -pio.renderers.default = "notebook" - # %% [markdown] # ## 1. Basic Scatter Plot From d62c45f1c5e47157ed5551d46ce2d1616f048859 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Mon, 14 Jul 2025 15:20:06 +0200 Subject: [PATCH 4/4] :art: remove unused import --- docs/api_examples/scatter_plot.ipynb | 1 - docs/api_examples/scatter_plot.py | 1 - 2 files changed, 2 deletions(-) diff --git a/docs/api_examples/scatter_plot.ipynb b/docs/api_examples/scatter_plot.ipynb index f1886f7..818d430 100644 --- a/docs/api_examples/scatter_plot.ipynb +++ b/docs/api_examples/scatter_plot.ipynb @@ -293,7 +293,6 @@ "source": [ "# Imports\n", "import pandas as pd\n", - "import plotly.io as pio\n", "\n", "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 6386897..f8c3283 100644 --- a/docs/api_examples/scatter_plot.py +++ b/docs/api_examples/scatter_plot.py @@ -76,7 +76,6 @@ # %% # Imports import pandas as pd -import plotly.io as pio from vuecore.plots.basic.scatter import create_scatter_plot