figure-observable-plot
Use when a data figure needs Observable Plot's chart vocabulary — density, hexbin, facets, cell heatmap, geo — spec + CSV → experiment-run → SVG, then stop. Ordinary line/bar/scatter → figure-matplotlib. Diagrams → figure-typst (.typ paper) or figure-tikz (.tex paper). Panel cards → figure-interaction. Manuscript include → figure-pipeline, and only if the user asked.
- License 许可
- MIT
- 最近更新
- 2026-09-05
- Stars
- ★ 4
- Forks
- 0
01 前言 Front Matter
- name
- figure-observable-plot
- license
- MIT
- description
- Use when a data figure needs Observable Plot's chart vocabulary — density, hexbin, facets, cell heatmap, geo — spec + CSV → experiment-run → SVG, then stop. Ordinary line/bar/scatter → figure-matplotlib. Diagrams → figure-typst (.typ paper) or figure-tikz (.tex paper). Panel cards → figure-interaction. Manuscript include → figure-pipeline, and only if the user asked.
02 资源文件 3
- 参考文档references/plot-recipes.md3.8 KB
- 脚本scripts/render_plot.mjs6.3 KB
- 脚本templates/plot-spec.mjs1.1 KB
03 SKILL.md 正文
Figure: Observable Plot (SVG lane)
Chart types matplotlib reaches awkwardly, rendered headless to SVG. The loop is spec + CSV → experiment-run → SVG. When the SVG exists, the job is done.
The renderer (scripts/render_plot.mjs) uses the app's bundled
@observablehq/plot + jsdom — nothing to install. experiment-run
injects $PRISM_NODE and $PRISM_APP_NODE_MODULES.
When to use
- Density contours / 2D density over scatter
- Hexbin for large point clouds
- Faceted small multiples (
fx/fy) - Cell/tile heatmaps (viridis-family, never jet)
- Geographic / graticule views (
references/plot-recipes.md; topojson is the user's data)
When not
- Ordinary 2D line/bar/scatter →
figure-matplotlib - Architecture / commutative diagrams →
figure-tikz - "Make a reopenable card" →
figure-interaction(file must exist first) - Interactive / animated / 3D — this lane is static SVG only
Closed path
- Copy this skill's
templates/plot-spec.mjsandscripts/render_plot.mjsinto the experiment island. Fill the spec from a real run CSV — no invented series. The spec returns an options object, not a DOM node (d3may be null; prefer plain JS). - Run via
experiment-run:
Quote"$PRISM_NODE" render_plot.mjs spec.mjs --data results.csv --out fig-density.svg$PRISM_NODE. Declare the SVG inartifacts. Empty/missing CSV must fail the run — fix the data, not the error. - Stop. Chat can preview the SVG.
Done = experiment-run exits 0 and the SVG is in the island
artifacts. One short sentence in chat.
Do not (unless the user named that next step):
- Convert SVG → PDF (
cairosvg,sips,gs) so LaTeX or "looking" works — the SVG is the figure figure-pipeline/\includesvg/latex-compileinteraction-write
references/plot-recipes.md only when the mark type is unclear.
Rules
- One spec, one visual question.
- Categorical: Okabe-Ito (
#0072B2 #E69F00 #009E73 #D55E00 #CC79A7 #56B4E9 #F0E442). Continuous: viridis-family. - Set explicit
width/height/style.fontSizein the spec.
04 同仓库更多 Skills
demo-multi-file
Local test skill with an extra notes file
writing-results
Use when drafting a Results / Experiments / Analysis section — narrating verified evidence from run receipts, with complete statistical reporting, derivation analysis, and honest treatment of negative results. Every number traces to a run; every claim survives the audit.
writing-related-work
Use when drafting a Related Work / literature review section or a standalone synthesis note — organizing prior work into a grounded, cited narrative or comparing methods across papers, from the project library plus staged external discovery. Never cites from memory.
writing-preliminaries
Use when drafting a Preliminaries / Background / Notation section — definitions, problem setup, and formal statements the rest of the paper builds on, with notation consistency and machine-checked formal claims. Reference patterns, not molds; include only what later sections actually use.
writing-methods
Use when drafting a Methods / Methodology / Approach / Model section — expounding the ideas and the reasoning behind the method, grounded in the project's brief, notes, and prior discussions, with empirical details from run receipts. Structure follows the idea's shape; reference angles, not fixed templates.
writing-introduction
Use when drafting or rewriting a paper's Introduction — framing the problem, positioning against prior work, and stating contributions as checkable claims, grounded in the brief, notes, and the library. Reference rhetorical patterns, adapted to the paper — never applied as molds.