# Forest Plot — Chart-Specific Rules

> Extends the global rules in [data-visualization-guide.md](../data-visualization-guide.md). All global rules apply. This file adds forest-plot-specific layout, row, CI, and axis details.

---

## Overview

A forest plot displays point estimates and confidence intervals for multiple studies or subgroups in a single aligned view. Common in meta-analyses and subgroup analyses.

---

## Layout

Three columns left to right:
1. **Label column** — study name, subgroup label, or header
2. **Plot column** — CI lines, point estimate shapes, null reference line
3. **Estimate column** — numeric estimate and CI text (e.g., `0.67 (0.56–0.80)`)

---

## Point Estimates

- Render as a small square (≈10×10px)
- **Fill:** 100 stop of the row's color scale
- **Stroke:** 300 stop, **1px** weight
- Corner radius: 2px

---

## Confidence Intervals

- Horizontal line from CI low to CI high
- **Color:** 300 stop of the row's color scale
- **Stroke weight:** 1px
- Cap both ends with a short vertical tick (≈8px tall), same color and weight

---

## Summary / Pooled Row

- Replace the square point estimate with a **diamond** shape
- Diamond spans the full CI width, centered on the point estimate x position
- **Fill:** 100 stop, **Stroke:** 300 stop, **1px** weight
- Label text uses heavier weight (fontWeight 600)

---

## Null Reference Line

- Dashed vertical line at HR=1 for hazard/odds ratios (or 0 for mean differences)
- **Color:** `border-strong` token
- **Stroke weight:** 1px
- **Dash pattern:** 3px on / 3px off

---

## X Axis

- **Log scale** for hazard ratios and odds ratios; **linear** for mean differences
- Axis spine extends 8px beyond the first and last tick on both ends
- No y-axis spine — rows are categorical; labels float freely

---

## Header Rows

- Subgroup section headers are rendered as label-only rows (no CI element)
- Use heavier font weight (fontWeight 600) and a slightly darker text color
- Do not render a CI line or point estimate for header rows

---

## Color Assignment

- Each subgroup section can use a different color scale for visual grouping
- Individual rows inherit the color scale from their subgroup or from direct assignment
- The summary/pooled diamond typically uses the primary series color (Pink)

---

## Notes

*Add agent or design team notes here as forest plot conventions evolve.*
