AI traffic analyst
Shown as Tideline, a made-up product
Traffic for one site with an analyst that explains every change: a summary line that rewrites itself, pinned launches and an anomaly on the chart, questions you can ask, and what moved with its measured lift.
Installation
pnpm dlx shadcn@latest add "https://propui.dev/r/tideline-traffic.json?token=…"Adds the piece to components/propui/01-tideline-traffic/ and installs motion. Needs a free account: sign in and the command includes your token. Fonts load from Prop UI; download the zip to self-host them.
When to use
Reach for it when
- A traffic or analytics screen where people ask why a number moved, not only what it is.
- Showing launches, changes and an anomaly on the same chart as the metric they affected.
- Letting a team filter by source, page, country or device and get a summary that still reads true.
Something else fits when
- A whole analytics product with many reports and screens: a full dashboard fits better.
- Revenue movement between two dates: Revenue movement explains MRR by bar.
- Comparing acquisition channels on cost and value: Unit economics plots CAC against LTV.
Usage
Fills a full window: give it a container with a definite height.
import Piece from "@/components/propui/01-tideline-traffic/Section";
export default function Page() {
return (
<main className="h-dvh w-full overflow-hidden">
<Piece />
</main>
);
}Replace the seeded series in data.ts (SITE, SOURCES, PAGES, EVENTS and the generator) with your own daily rows, and keep analyst.ts working from the view so the summary, questions and impacts stay computed. Wire Schedule and Export to your own report and download endpoints.
Your data
Replace these and everything on screen follows.
SITE, UPDATED, REPORT_TOstring- The heading, the freshness line and the default address in Schedule.
RANGES, METRICS{ id; label; … }[]- The 7D / 30D / 90D switch and the four metric tabs.
SOURCES, PAGES, COUNTRIES, DEVICESreadonly string[]- The Sources and Top pages lists and the two segment selects.
EVENTS{ id; at; kind; title; note }[]- The numbered pins and the "!" anomaly pin on the chart, and the What moved list.
SIGNUP_GOALnumber- The goal line on Signups and the goal meter.
viewOf()(range, filter, segment) => View- Every number on screen: totals, previous period, rows and the chart series.
Interactions
- Switch the range: the chart morphs point for point to the new period and the metrics roll to their new values.
- Pick a metric tab to chart it; on Signups a dashed line shows the daily goal.
- Click a row in Top pages or Sources to filter everything by it; click the chip or the row again to clear it.
- Change country or device to segment the whole view.
- Hover the chart, or focus it and use the arrow keys, to read each day against the previous period.
- Pick a suggested question or type your own: the answer highlights the days it talks about.
- Click an item in What moved, or its pin on the chart, to see its measured impact.
- Schedule a weekly or monthly email of the view, turn it off again, or Export the view as CSV.
Keyboard
- ←or→
- On the focused chart, move a day back or forward.
- HomeorEnd
- On the focused chart, jump to the first or last day.
- Esc
- Close the Schedule popover.
- Enter
- In the question box, ask; in Schedule, save.
Behaviour
Read from the code: roles, motion, breakpoints and what runs.
Accessibility
- The range is a radio group and the metrics are tabs with aria-selected, so the current choice is announced.
- List rows, insights and chart pins are buttons with aria-pressed, so an active filter or pin is heard as pressed.
- The analyst summary, each answer and the chart readout are polite live regions.
- The goal is a meter with its value and maximum; the segment selects and the question box have labels.
- Colour pairs meet WCAG AA contrast in both themes.
Motion
- A range or metric change morphs the chart on one spring; the metric values roll to their new numbers.
- The summary line fades in from a slight blur when it rewrites itself; answers and insight details fade and grow in.
- Reduced motion draws the chart in place and turns the bar transitions off.
Responsive
- Below 1100px the analyst rail moves under the chart, with the goal card beside the insights.
- Below 860px the actions take their own row under the title, the metrics form a 2 by 2 grid and the lists stack.
- Below 560px the range spans the row with Schedule and Export sharing the next one, the selects share a row, the chart is 260px tall and What moved folds behind a toggle.
Performance
- The chart is one SVG redrawn on a spring only while a range or metric change settles.
- All series are computed from a seeded generator in memory; nothing is fetched.
- No images: one local font file and inline SVG.
Notes for AI
Give your coding assistant the Markdown, not a screenshot.
- Keep every sentence the analyst says computed from the view in analyst.ts; never hard-code a number into copy.
- When a filter hides an event, say so rather than inventing a lift.
- Light and dark follow the nearest data-theme attribute, or the system setting. Keep colours in the tokens at the top of post.css.
/p/tideline-traffic/markdownThe whole library for assistants: llms.txt, or the MCP server in AI tools and MCP.