Skip to content

Docs: live examples of web figures - #89

Merged
max-models merged 1 commit into
develfrom
web-figure-examples
Nov 7, 2026
Merged

max-models merged 1 commit into
develfrom
web-figure-examples

Conversation

@max-models

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

Copy link
Copy Markdown
Owner

The "Web figures" guide now shows embedded web figures, not only describes them.

  • The guide becomes MDX, with an Examples section of three figures embedded with PlotlyFigure, each with its code:
    • lines in the site's palette with a black reference line, from a Canvas;
    • a Plotly heatmap with a contour in Matplotlib's C1: the colormap stays and the contour takes the palette;
    • an animation with a slider and Play button.
  • scripts/web_figure_examples.py writes them to docs/public/figures/. The docs workflow runs it as pre-build, and the smoke paths check the page and the three files. Run it by hand for astro dev.

Two fixes to the Plotly output of a canvas, found on the way:

  • An untitled subplot no longer gets the placeholder title "(0, 0)".
  • The margins were 10 px on every side, which cut off the axis titles. A web figure's automargin makes room for tick labels, but Plotly then pins a title without a standoff to the edge of the figure, half outside. The left and bottom margins now leave room when there is a y or x label (70 and 60 px), and the axis titles get a standoff of 8 px.

Checks:

@max-models
max-models merged commit 966f4dd into devel Nov 7, 2026
30 checks passed
@max-models
max-models deleted the web-figure-examples branch November 7, 2026 16:11
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