Skip to content

Docs: interactive figures on the theme's PlotlyFigure - #100

Merged
max-models merged 1 commit into
develfrom
theme-plotly-figure
Nov 7, 2026
Merged

max-models merged 1 commit into
develfrom
theme-plotly-figure

Conversation

@max-models

@max-models max-models commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

The interactive figures of the guides are now web figures shown by the docs theme's PlotlyFigure (starlight-theme 0.8). The site's own PlotlyChart is removed.

  • The figure scripts (generate_docs_figures.py, generate_gvec_figures.py, generate_desc_figures.py) write public/plotly/<name>.plotly.json through PlotResult.save (Save plots as web figures for the docs theme #97). The two figures made directly in Plotly (the hand-built slice and the profile Gantt chart) go through PlotResult(fig).save too.
  • All 28 <PlotlyChart src=… height=…> in the guides become <PlotlyFigure src="….plotly.json">. The page reserves each figure's space from its aspect ratio, so the fixed heights are gone.
  • plotly.js now comes from the theme (npm, loaded when a figure scrolls into view) instead of a CDN script. Converted Matplotlib figures keep their white plot area (white_plot), as PlotlyChart did. The other colours follow the theme.
  • The Plotly guide has a short section on embedding a .plotly.json in an MDX page.

Checks:

  • I ran generate_docs_figures.py locally: all 21 of its figures are written, with an aspect hint, and the animations keep their frames. The GVEC and DESC figures need those packages and are generated in CI.
  • In the dev server, the Plotly guide's four figures render in light and dark mode. The dev server needs PlotlyFigure: plotly.js unbundled in dev, plot inside the frame starlight-theme#56 to load plotly.js, and a production build is not affected.
  • The pre-commit hooks pass.

@max-models
max-models merged commit 41bcea9 into devel Nov 7, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant