<!-- GENERATED by scripts/build-llms.mjs from llms/retrieval.md — do not edit this file. -->

# `lr-rag-eval-dashboard`

- **Import** `import '@aceshooting/lyra-ui/components/lr-rag-eval-dashboard.js';` (stable tag alias; registers the tag)
- **Class** `LyraRagEvalDashboard`, also available unregistered from `@aceshooting/lyra-ui/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.class.js`
- **Family** `components/retrieval/` — see `llms/index.md` for its siblings
- **Status** `stable` since `7.0.0` — see the maturity and deprecation policy in `llms/shared.md`
- **Release history** [CHANGELOG.md](../../CHANGELOG.md); family-wide breaking-change summaries: [llms-full.txt](../../llms-full.txt)
- **Deprecations** none
- **Optional peers** none
- **Themeable via** 14 parts, 1 custom property — see this component's own `@csspart`/`@cssprop` list below
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`

---

## `lr-rag-eval-dashboard`

Controlled RAG evaluation overview with latest metric cards, per-metric trends, evaluation slices,
and run history. The host computes metrics and owns evaluation execution.

**Properties:** `metrics: LyraRagEvaluationMetric[] = []` and
`runs: LyraRagEvaluationRun[] = []`
(attribute: false); `metricId: string = ''` (attribute `metric-id`, with the first metric used for
display when unset/unmatched); `slice: string = ''`; `label?: string` (visible heading and
fallback overall-region name; a non-empty host `aria-label` makes the host the sole overall owner,
while an explicitly empty host label stays empty on the region);
`showChart: boolean = true` (attribute `show-chart`, reflected, string-aware true-default
converter); `chartHeight: string = '220px'` (attribute `chart-height`).

`LyraRagEvaluationMetric = { id, label, category, format? }`, where category is
`'retrieval' | 'generation' | 'system' | custom-string` and format is `'number' | 'percent'`.
`LyraRagEvaluationRun = { id, label, metrics: Record<string, number>; slice?, timestamp?, metadata? }`.

Metrics and runs are canonicalized independently by nonblank `id`. Malformed rows and later
duplicates are omitted first-wins before metric fallback, slice derivation/filtering, cards, charts,
history, counts, rendering, or actions.

**Events:** `lr-metric-change` (`{ metricId }`), `lr-slice-change` (`{ slice }`), and
`lr-run-change` (`{ run }`). All are controlled intents; the component does not mutate the
corresponding selection properties.

**CSS parts:** `base`, `heading`, `slices`, `slice`, `slice-selected`, `metrics`, `metric`,
`metric-selected`, `metric-category` (the caller-supplied category rendered visibly on each metric),
`chart`, `runs`, `runs-heading`, `run`, `empty`.

**Themeable custom properties:** `--lr-rag-eval-dashboard-selected-border-color` (default
`var(--lr-color-brand)`) — border color shared by the controlled active slice and metric.

Percent values clamp to 0–1 and all numbers use `effectiveLocale`. The chart is built from the
filtered run order; the host computes every metric and owns evaluation execution.
**Slots:** none. **Optional peer deps:** none.

```ts
import "@aceshooting/lyra-ui/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.js";
```

`lr-grounding-summary` and `lr-rag-answer` now accept `GroundingAssessment.claims` and expose
`showClaims: boolean = true`; `lr-retrieval-results` forwards `RetrievalChunk.locator` as the
document-viewer-compatible `anchor` in `lr-chunk-open`.
