AGENT SKILL

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
所属仓库
yibocat/prismnext
最近更新
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

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

  1. Copy this skill's templates/plot-spec.mjs and scripts/render_plot.mjs into the experiment island. Fill the spec from a real run CSV — no invented series. The spec returns an options object, not a DOM node (d3 may be null; prefer plain JS).
  2. Run via experiment-run:
    "$PRISM_NODE" render_plot.mjs spec.mjs --data results.csv --out fig-density.svg
    
    Quote $PRISM_NODE. Declare the SVG in artifacts. Empty/missing CSV must fail the run — fix the data, not the error.
  3. 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-compile
  • interaction-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.fontSize in the spec.

04 同仓库更多 Skills

yibocat
yibocat/prismnext

demo-multi-file

Local test skill with an extra notes file

★ 4
yibocat
yibocat/prismnext

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.

★ 4
yibocat
yibocat/prismnext

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.

★ 4
yibocat
yibocat/prismnext

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.

★ 4
yibocat
yibocat/prismnext

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.

★ 4
yibocat
yibocat/prismnext

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.

★ 4