Skip to content

v2 phase 3: 4 figures via figures:scientific-figure composer#60

Merged
neuromechanist merged 1 commit into
mainfrom
feature/v2-phase3-figures
May 21, 2026
Merged

v2 phase 3: 4 figures via figures:scientific-figure composer#60
neuromechanist merged 1 commit into
mainfrom
feature/v2-phase3-figures

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Summary

v2 Phase 3: build 4 publication-ready figures by actually invoking the figure-pipeline skills. Closes #11.

Skill invocations (in order)

Skill What it did What it didn't do
/figures:scientific-figure Loaded the 5-step pipeline (Plan -> Build -> Compose -> Validate -> Export). Provided the Cell journal spec (174mm two-column, 6pt minimum body font). Provided compose.py (svgutils-based composer at exact mm coords), validate_fonts.py, export.py Doesn't author panels; that's delegated to sub-skills
/figures:svg-figure Authored 4 hand-authored SVG panels under panels/: fig1_matrix.svg (4-perspective x 15-theme matrix), fig2_plot.svg (naturalness gradient plot), fig3_gap_matrix.svg (8 x 4 gap table), fig4_predictions.svg (4 perspectives x 5 columns) None
/figures:transparent-icons Generated 10 transparent PNG icons via Codex gpt-image-2: 6 stimulus thumbnails (gratings, photographs, Heider-Simmel triangles, abstract animation, character animation, live-action film) + 4 brain topography icons (occipital, central rolandic, left frontotemporal, occipital-and-frontal). Each at 256x256 with a shared theme.json for consistency None
/figures:figure-qa (agents) Couldn't get Bash permission; QA run inline via check_svg.py + visual Read; reports under qa/ Programmatic QA via agent blocked by sandbox; same checks performed inline
Composer compose.py configs/figN.json -o figN.svg for each. Single panel each, scale = 174/493 = 0.3529 to map pt-viewBox to mm-canvas None
Validator validate_fonts.py figN.svg --journal cell returns 0 issues across all 4 figures (25 + 30 + 85 + 71 = 211 text elements; all >= 6pt) None

Pipeline lesson (the demo observation)

The skill's example uses mm-viewBox with the claim "<text font-size=9> is 9 pt", but in practice rsvg-convert treats unit-less font-size in an mm-viewBox SVG as user units (= mm). Workaround applied: use pt-viewBox (1 unit = 1 pt) with width/height in mm; the validator's pt-unit assumption then matches the renderer.

A second pipeline lesson: rsvg-convert silently drops external image references (CVE-2023-38633 mitigation), even with absolute file:// URIs. Workaround applied: inline all icons as base64 data URIs in the panel SVGs. Adds ~130 KB per figure but renders portably across rsvg/cairosvg/Inkscape.

Programmatic QA results

After in-phase fixes (off-palette #e7f0fa and #fef0e7 lightened tints in Fig 3 swapped to Okabe-Ito hex with fill-opacity="0.10"):

Fig Text elements >= 6pt Off-palette Bbox overlaps Status
1 strand map 25/25 0 0 ship
2 naturalness gradient 30/30 0 0 ship
3 gap matrix 85/85 0 (after fix) 0 ship
4 predictions table 71/71 0 0 ship

QA reports saved at manuscript/narrative-review/figures/qa/figN_qa.md.

Output

  • figures/fig1-4.svg (final composed SVGs, 174mm wide; Figs 1 and 3 are 130mm tall, Figs 2 and 4 are 100mm tall)
  • figures/fig1-4.png (300 dpi PNG exports)
  • figures/panels/figN_*.svg (panel sources)
  • figures/icons/*.png (10 transparent icons, 256x256)
  • figures/configs/figN.json (composer configs)
  • figures/qa/figN_qa.md (QA reports)

Test plan

  • All 4 skills loaded and applied via the Skill tool
  • Panel SVGs validated by validate_fonts.py at Cell 6pt minimum (211 of 211 text elements pass)
  • Programmatic checks (check_svg.py) all pass: 0 off-palette, 0 bbox overlaps, 0 arrow-tip issues
  • Visual judgment: all 4 read cleanly at 174mm two-column Cell Press width
  • Composer (scientific-figure compose.py) produces SVGs at the exact mm dimensions
  • Pre-commit (markdownlint, typos, trailing-whitespace, end-of-file, json check) passes
  • Phase 4 (paper-review + humanizer) will review prose
  • Phase 5 (final assembly) compiles and opens final PR

@neuromechanist neuromechanist merged commit c6fa045 into main May 21, 2026
4 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.

Test fixture: 30s real EEG segment for runtests smoke tests

1 participant