---
name: visualize-infographics
description: >
  Create self-contained HTML/SVG infographics that break down a number, explain its
  parts or derivation, or reveal a connected process and relationships. Prefer this
  method for explaining one outcome; use visualize-infographics-antv for several
  independent statistics or multiple metric panels. Supports figures embedded in
  one-pagers and slides.
---

# HTML Infographics

Create polished, self-contained HTML infographics with inline CSS and SVG. No JavaScript or external dependencies.

## Standalone or embedded

For an infographic inside a one-pager or presentation, keep the relevant host skill loaded: `visualize-onepager` or `visualize-presentation-slides`. If it is not already loaded, find and read its `SKILL.md` in the current runtime’s installed skill catalog; shared skill directories may not contain every host as a sibling. Supply an inline HTML/CSS/SVG figure within that host's deliverable rather than creating a second page. The host owns structure, word/page or viewport limits, accessibility and delivery; infographic patterns supply the visual explanation. For a standalone request, keep the single-file workflow below.

Use the current project's instruction-linked design guidance or actual UI tokens, including colors, typography and light/dark modes. This takes precedence over the MAROSCH example palette and defaults below. Do not copy another project's theme. Preserve chart labels, units, sources and evidence distinctions when embedding.

For the AntV template/editor alternative, read `visualize-infographics-antv` from the current installed catalog when that variant is requested. The default HTML/SVG workflow below stays dependency-free; the AntV method has a separately pinned local renderer.

## Selection preference

Use this method to break down one number, explain its composition or trace how an outcome is derived. Choose the figure that reveals the relationship: decomposition, branches, a waterfall or a connected process. For several independent statistics or multiple chart panels, prefer `visualize-infographics-antv` from the installed catalog. These methods complement each other; preserve the question and data instead of forcing a template.

## Workflow

1. Determine infographic type (see "Choosing the Right Type" below)
2. Load the relevant reference file for patterns
3. Compose the HTML using the base structure, design system, and component patterns
4. Save as a single `.html` file

## Choosing the Right Type

| User wants to... | Type | Reference |
|---|---|---|
| Show numbers, stats, metrics | Data visualization | [data-viz.md](references/data-viz.md) |
| Compare options, show rankings | Data viz + layout | [data-viz.md](references/data-viz.md) + [layout-patterns.md](references/layout-patterns.md) |
| Show how things connect, flow, depend on each other | Relationship diagram | [relationship-patterns.md](references/relationship-patterns.md) |
| Show a process or timeline | Process flow / timeline | [relationship-patterns.md](references/relationship-patterns.md) + [layout-patterns.md](references/layout-patterns.md) |
| Build a full infographic page with mixed content | Mixed layout | All three reference files |
| Show org structure or hierarchy | Hierarchy | [relationship-patterns.md](references/relationship-patterns.md) |

Load only the reference files needed for the specific request.

## Design System

### Colors

**Source of truth:** `the active project’s DESIGN.md` — tokens in `design-tokens.css` in the same folder.

Primary palette — MAROSCH brand system:

```
Primary:    #E41E8C (brand pink)
Secondary:  #7E09AA (brand purple)
Midpoint:   #B61C9A (gradient midpoint)
Gradient:   linear-gradient(135deg, #E41E8C 0%, #B61C9A 40%, #7E09AA 100%)
Success:    #22c55e (green)
Warning:    #f59e0b (amber)
Danger:     #ef4444 (red)
Info:       #3b82f6 (blue)
```

Dark mode (default):
```
Background: #09090b (cinematic), #18181b (cards)
Text:       #fafafa (headings), #d4d4d8 (body), #a1a1aa (captions)
Border:     rgba(255,255,255,0.08)
Shadow:     0 8px 24px rgba(0,0,0,0.4)
```

Light mode:
```
Background: #ffffff (page), #faf9fb (cards)
Text:       #0d0d14 (headings), #3a3a4a (body), #8888a0 (captions)
Border:     #e4e4e7
Shadow:     0 8px 24px rgba(0,0,0,0.12)
```

For sequential data (charts with multiple bars/segments), use this order:
`#E41E8C` → `#C51A96` → `#A716A0` → `#7E09AA` → `#9F4BC4`

For categorical data with distinct meanings, use semantically appropriate colors (green for positive, red for negative, amber for warning).

### Typography

```
Display:       'Schibsted Grotesk', 'Helvetica Neue', sans-serif (500, 600, 700 only — also the brand wordmark)
Body:          'Inter', -apple-system, BlinkMacSystemFont, sans-serif (300-600)
Mono / Data:   'JetBrains Mono', 'SF Mono', 'Fira Code', monospace (400, 500)

Display weight follows rendered size (DESIGN.md size→weight ladder). Only these three weights are loaded;
any other number renders as faux bold:
  ≤ 25px    font-weight: 700 (--weight-title)    letter-spacing: -0.01em
  31–39px   font-weight: 600 (--weight-heading)  letter-spacing: -0.02em
  49px+     font-weight: 500 (--weight-display)  letter-spacing: -0.02em

Hero numbers:  3.0625rem (49px), font-weight: 500, letter-spacing: -0.02em (Schibsted Grotesk)
Section title: 1.5rem, font-weight: 700, letter-spacing: -0.01em (Schibsted Grotesk)
Card title:    1.15rem, font-weight: 700, letter-spacing: -0.01em (Schibsted Grotesk)
Body:          0.9rem, line-height: 1.6 (Inter)
Caption/label: 0.8rem, color: --text-muted (JetBrains Mono)
Uppercase tag: 0.75rem, font-weight: 500, text-transform: uppercase, letter-spacing: 0.1em (JetBrains Mono)
```

Google Fonts: `https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@500..700&family=Inter:wght@300..600&family=JetBrains+Mono:wght@400;500&display=swap`

### Spacing & Shape

```
Page padding:     40px 24px
Section gap:      32px (margin-bottom)
Card padding:     24-32px
Card radius:      12px (--radius-lg)
Inner radius:     8px (--radius-md)
Card shadow:      (use --shadow-medium for dark, --shadow-soft for light)
Grid gap:         20-24px
Inner element gap: 8-16px
```

## Best Practices

- **One file, zero dependencies**: All CSS inline in `<style>`, all graphics as inline SVG. No CDNs, no JavaScript, no images.
- **Visual hierarchy**: Use size, weight, and color to guide the eye. Hero numbers large in the display face at weight 500 — size carries the emphasis, not weight. Labels small and muted.
- **Type rules (DESIGN.md non-negotiables)**: no blur, glow, or `filter` on headline text; letter-spacing is static — one value per rule, never animated; only the three loaded display weights (500/600/700), never 800/900.
- **Whitespace**: Generous padding inside cards (24-32px). Consistent gaps between sections (32px). Don't crowd elements.
- **Color restraint**: Use 2-3 colors per chart. Reserve accent colors for emphasis. Too many colors = visual noise.
- **Contrast**: Ensure text is readable. White text on dark/colored backgrounds. Dark text on light backgrounds. Never light gray on white.
- **Alignment**: Use CSS Grid for layouts. Everything should snap to a grid. Avoid absolute positioning except for diagram connectors.
- **Data integrity**: Labels on every chart. Units on every number. Legend when using multiple colors. Source attribution when showing real data.
- **Card-based layout**: Wrap each logical section in a white card with rounded corners and subtle shadow. This creates visual separation.
- **Gradient headers only at top**: Use the brand gradient banner for the main title only. Section headers use solid colors or just bold text.
- **Light mode texture**: On white backgrounds, use the dot-grid texture pattern from MAROSCH DESIGN.md to prevent flat white.
- **SVG for charts**: Use SVG `circle` with `stroke-dasharray` for donuts/rings. Use `polyline` for sparklines. Use `line`/`path` for connectors. Calculate values precisely.
- **Donut math**: For a circle with radius `r`, circumference = `2 * π * r`. A segment of `X%` has dash length = `X/100 * circumference`. Offset each segment by the cumulative length of all preceding segments (as negative `stroke-dashoffset`).

## Output

Save the infographic to the user's preferred location as a `.html` file. Use a descriptive filename like `market-analysis-2024.html` or `product-roadmap.html`. Tell the user they can open it in any browser.
