Writing reports
Components
Reference
All components
Every piece a report is built from, one page each, with its props, an example and the checks that fail it.
A report is one file, report.tsx, with its SQL in .sql files beside it:
it names its queries, then lists components that read the results by name.
This section is the reference for every component. You rarely write these
yourself: ask Claude, for example “Add a line chart of sales per month to
the Sales report”, and use these pages to know what is possible and what to
ask for.
Every example writes its rows in the SQL itself, so it needs no table; a date function in it may need the dialect of your connector (see Report files → Dialects). On your own data the SQL reads your tables instead.
The report file#
| Page | What it covers |
|---|---|
| Report files | report.tsx: meta, connector, the queries, $from and $to, dialects, the checks |
| Props every component takes | title, description, span, info, metric, When and Repeat, and the number formats |
Charts#
| Component | Shows |
|---|---|
| Line | One or more measures over time, as lines |
| StackedBars | Parts of a whole per period, as stacked bars, with optional rate lines |
| CategoryBars | One measure across categories, as bars |
| BarsWithLine | A count as bars and a rate as a line, on one chart |
| Treemap | Shares of a whole, as nested rectangles |
| Funnel | Stages that narrow, as nested areas |
| Waffle | Stages as 100 squares, each square 1 % |
| Progress | A figure against its target, as a bar |
| DriverTree | Measures joined parent to child, as cards on a canvas |
Numbers and tables#
| Component | Shows |
|---|---|
| Kpis | A row of figures as tiles |
| Table | Rows and columns |
| GroupedTable | Rows with the same measures repeated per group of columns |
| ShareBars | A list of labelled bars, each a share out of 100 |
Layout#
| Component | Does |
|---|---|
| Section | Puts a heading over a group of components |
| Tabs | Shows one group of components at a time |
| Drills | Opens components for one row in a dialog when a row or tile is clicked |
Inputs#
| Component | Does |
|---|---|
| Inputs | Values the reader sets, and the card of sliders and numbers on the page |
| select | A choice from a list, in the View menu or the filter bar |
| toggle | An on/off switch in the View menu |
| slider | A number picked on a slider, inside Inputs |
| number | A typed number, inside Inputs |
Your own visual#
| Component | Does |
|---|---|
| Custom | Draws a component written in the report’s report.tsx, for a visual no component has |
The “(i)” dialog#
| Component | Does |
|---|---|
| Info and Technical | The report’s “(i)”: the Info and Technical tabs |
| Panel | A further tab in the dialog |
| Rules, Rule and Lead | The definitions a report follows, which components pick by id |
| Sql | Shows a query of the report |
| Value | Prints one figure from the report’s data in the dialog |
| Definition | Prints a named metric’s one-line definition |