Build an interactive webapp for a scientific paper with figpress-apps — an interactive counterpart of a figure (draggable views, linked panels, sliders) published as a static site and as one archivable HTML file, also usable in Jupyter/marimo. Use when asked for an interactive figure, explorer or webapp for a paper, when working in a repository's webapps/ folder, or when a repository depends on figpress-apps.
Ships in figpress-apps. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
figpress-apps = a Python package (export data, build, serve, test, notebook widget) carrying a small
browser library of plain ES modules. No build step, no framework, no CDN. Read
references/conventions.md before writing any JS: its rules are
enforced by figpress-apps build.
In the paper repository (Python ≥ 3.11):
uv add "figpress-apps==YYYY.MM.DD" # pin a release (PyPI)
uv add --dev "figpress-apps[notebook]==YYYY.MM.DD" # optional, notebooks
Copy assets/template/ to webapps/<name>/: index.html, widget.js (the
app), science.js (pure science), science.test.js, export.py. Rename the dataset in
export.py and widget.js together, and adapt the meta keys widget.js reads (the template's
meta.view). The template projects 3-D points for a viewing direction; for a 2-D app keep its
structure and put your state (e.g. an angle) in views[id] — see
references/components.md (skypanel is the general 2-D panel).
export.pyWrite the arrays the page needs with figpress_apps.export(out, name, arrays, meta=…)
(references/data-contract.md). Rules:
meta).narrow=[…]; narrowing is checked against each array's range
and fails loudly (e.g. MJD times). Never cast silently yourself.science.js.science.jsPure functions, no DOM: given data and the interactive state (a view direction, a slider value),
return the numbers and arrays to draw plus a readout string. Port only the per-interaction part of
the paper's Python, and check it with science.test.js against numbers computed by the paper's
Python (paste them in with their source, or export them):
uv run figpress-apps test webapps/<name>
The JS must reproduce the paper. A figure that disagrees with the paper is worse than none.
widget.jsThe app is an anywidget module (export default { async render({ model, el, signal }) }) that:
loads data with loadData (from the model in notebooks, by name on the web — copy the template's
first lines), initialises model state, builds the layout, mounts components
(references/components.md) with options, and disposes them on
signal. State rules:
camera, views, …); values are replaced, never mutated.compute), never into the model.model.save_changes() at the end of an interaction (pointer-up, slider change), not per move.uv run python webapps/<name>/export.py --out build/data
uv run figpress-apps build webapps/<name> --data build/data/<dataset> --out build/site/<name> --single-file build/<name>.html
uv run figpress-apps serve build/site # http://127.0.0.1:8000/<name>/ ; the single file just opens
uv run figpress-apps test webapps/<name>
The build fails on relative imports, import.meta.url, unresolvable or remote imports and
datasets of another data-format version — fix the code, never work around the check. Check both
outputs in a browser: the served page and the single file from disk. To read the panels'
readouts headlessly, use references/check-page.md.
from figpress_apps.anywidget import Widget
w = Widget(app="webapps/<name>/widget.js", data="build/data/<dataset>"); w
w.views # state syncs back after each interaction
JupyterLab must run in an environment with anywidget and ipywidgets installed.
references/worked-example.md walks through figpress-apps' globe example (rotatable globe, draggable viewing directions, four linked sky panels reproducing a paper's numbers).
assets/template/export.py (opens in a new tab)assets/template/index.html (opens in a new tab)assets/template/science.js (opens in a new tab)assets/template/science.test.js (opens in a new tab)assets/template/widget.js (opens in a new tab)card.json (opens in a new tab)references/check-page.md (opens in a new tab)references/components.md (opens in a new tab)references/conventions.md (opens in a new tab)references/data-contract.md (opens in a new tab)references/worked-example.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/figpress-apps:figpress-appsfrom figpress-apps
figpress-apps@nstarman-skills is listed by nstarman/skills — review the source before installing
npx claudepluginhub nstarman/skills --plugin figpress-apps