Skip to content

feat: equation layout for mathematical-style graphics - #47

Merged
gregmeyer merged 3 commits into
mainfrom
feat/equation-layout
Apr 2, 2026
Merged

feat: equation layout for mathematical-style graphics#47
gregmeyer merged 3 commits into
mainfrom
feat/equation-layout

Conversation

@gregmeyer

Copy link
Copy Markdown
Owner

Summary

  • New equation layout type that renders equations as stacked, typographically rich graphics
  • Parses equation strings into terms and operators automatically (=, +, , ×, ÷)
  • Supports both CSS (default) and Pretext SVG text rendering modes
  • Designed for social media graphics where the equation IS the visual content

Usage

CLI:

modern-graphics create --layout equation \
  --equation "Satisfaction = Perception - Expectation" \
  --eq-label "The Satisfaction Gap" \
  --footnote "The gap is where churn lives." \
  --theme dark --png

MCP:

{"layout": "equation", "theme": "dark", "args": {"equation": "Satisfaction = Perception - Expectation", "label": "The Satisfaction Gap", "footnote": "The gap is where churn lives."}}

Test plan

  • CSS mode renders stacked equation with operators aligned left
  • Pretext mode renders with SVG text slots
  • Dark theme: white text on dark gradient, blue operators
  • Apple theme: dark text on light background, blue operators
  • Multi-operator equation (Revenue = Volume × Price − Cost) parses correctly
  • All 51 smoke tests pass

🤖 Generated with Claude Code

gregmeyer and others added 3 commits April 2, 2026 11:42
New layout type that renders equations like "Satisfaction = Perception −
Expectation" as stacked, typographically rich graphics. Parses equation
strings into terms and operators, renders each term on its own line with
the operator aligned left.

- Supports CSS (default) and Pretext SVG text rendering modes
- Auto-detects operators: =, +, −, ×, ÷
- Themes work via color_scheme integration (dark, apple, etc.)
- Optional label (small caps above) and footnote (italic below rule)
- Three size presets: small (64px), medium (84px), large (108px)
- CLI: --equation, --eq-label, --footnote, --eq-size
- MCP: layout="equation", args={"equation": "...", "label": "...", ...}

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- DIAGRAM_TYPES.md: add Equation Diagrams section with CLI example
- CREATE_COMMAND.md: add equation row to Layout Decision Table
- QUICKSTART.md: add equation to diagram types list, update count to 11+
- New examples/equation_examples.py with 4 variants (dark, apple,
  corporate themes; CSS and Pretext rendering modes)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Generated dark and apple theme equation examples into the showcase
directory so they render inline in the docs on GitHub.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gregmeyer
gregmeyer merged commit 2adbe3d into main Apr 2, 2026
2 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.

1 participant