Report Schema ​
RichView reports are declarative JSON or YAML documents validated at runtime by Zod schemas and at edit-time by TypeScript types.
Report structure ​
interface Report {
title: string;
subtitle?: string;
theme?: "default-dark" | "default-light" | "auto";
generatedBy?: {
model?: string;
timestamp?: string; // ISO 8601
confidenceScore?: number; // 0--1
};
settings?: ReportSettings;
sections: Section[];
}Section types ​
Every section has an id (auto-generated if omitted), a type, and optional assertions for verification.
markdown ​
Rich text content rendered from Markdown.
- id: intro
type: markdown
content: |
Revenue grew **12%** quarter-over-quarter, driven by
expansion in the enterprise segment.chart ​
Interactive ECharts visualization. The chart field uses RichView's internal chart spec (not raw ECharts JSON).
- id: revenue
type: chart
title: Revenue by Quarter
chart:
type: bar # bar, line, area, pie, scatter, heatmap, radar, funnel, gauge
xAxis: { field: quarter }
yAxis: { field: revenue, format: currency }
series:
- dataKey: revenue
name: Revenue
data:
type: inline
columns: [quarter, revenue]
values:
- [Q1, 1200000]
- [Q2, 1350000]Chart types: bar, line, area, pie, scatter, heatmap, radar, funnel, gauge, treemap, sankey, candlestick, boxplot, waterfall, stacked-bar, stacked-area, grouped-bar, horizontal-bar, donut, bubble, multi-axis.
table ​
Structured data display with optional column configuration.
- id: metrics
type: table
title: Key Metrics
columns:
- key: metric
label: Metric
- key: value
label: Value
align: right
data:
type: inline
columns: [metric, value]
values:
- [Monthly Active Users, "2.4M"]
- [Revenue, "$4.2M"]big-number ​
KPI card with value, label, and optional change indicator.
- id: revenue-kpi
type: big-number
label: Total Revenue
value: "$4.2M"
change:
value: 12
direction: up
period: vs last quarterimage ​
Captioned image with alt text.
- id: architecture
type: image
src: https://example.com/diagram.png
alt: System architecture diagram
caption: Figure 1. High-level architecturecode ​
Syntax-highlighted code block.
- id: query
type: code
language: sql
code: |
SELECT date, SUM(revenue) as total
FROM sales
GROUP BY date
ORDER BY datevideo ​
Embedded video (YouTube, Vimeo, or direct URL).
- id: demo
type: video
url: https://www.youtube.com/watch?v=example
caption: Product walkthroughcallout ​
Highlighted information box with severity level.
- id: warning
type: callout
variant: warning # info, warning, danger, success
content: Data for December is preliminary and subject to revision.divider ​
Visual separator between sections.
- id: sep
type: dividerembed ​
External content embed via URL.
- id: dashboard
type: embed
url: https://example.com/dashboardquote ​
Pull quote or blockquote.
- id: ceo-quote
type: quote
content: "We've never seen growth like this."
attribution: CEO, Annual ReportData sources ​
Sections that display data (chart, table) accept a data field:
| Type | Description |
|---|---|
inline | Data embedded directly in the schema |
file | Reference to a CSV/JSON file path |
sql | SQL query against a configured connection |
slash-command | Slash command data source |
database | Direct database connection |
Assertions ​
Sections can include assertions for the verification pipeline:
assertions:
- type: range-check
field: revenue
min: 0
max: 100000000
status: pass
- type: freshness-check
field: timestamp
maxAge: "30d"
status: passTypes: range-check, consistency-check, freshness-check, citation-check.
Layout options ​
Sections accept layout hints:
| Field | Values | Description |
|---|---|---|
layout | full, half | Column width (consecutive half sections form 2-column rows) |
layoutAlign | start, end | Alignment within a column row |
Generating the JSON Schema ​
For IDE autocomplete, generate the full JSON Schema:
richview schema > richview-report.schema.json