mock sales and subscription data, and the generator that makes it
two shapes, because a dashboard gets asked to do two things: daily orders with seasonality worth charting, and a subscription list where 'active' is a calculation over dates rather than a column. both as .xlsx and .csv. the excel files are the realistic input and the csv twins need no parser, so an app can read them with nothing installed. the generator has no dependencies — an xlsx is a zip of xml and it writes one directly. fixed seed, so a re-run is byte-identical and a diff means the generator changed rather than the data drifting.
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
# sample-data
|
||||
|
||||
Mock datasets for building and demonstrating dashboards. **Everything here is generated** — no real
|
||||
company, person, or number appears in it.
|
||||
|
||||
Two shapes, because a dashboard is usually asked to do two different things.
|
||||
|
||||
## `sales.xlsx` / `sales.csv` — 6,402 rows
|
||||
|
||||
Two years of daily orders, 2024-08-01 to 2026-07-31.
|
||||
|
||||
| Column | |
|
||||
|---|---|
|
||||
| `Order ID` | `ORD-10000` upward |
|
||||
| `Date` | ISO, one row per order |
|
||||
| `Region` | North · South · East · West · Central |
|
||||
| `Category` | Hardware · Software · Services · Accessories |
|
||||
| `Product` | four per category |
|
||||
| `Channel` | Direct · Partner · Online |
|
||||
| `Sales Rep` | six names |
|
||||
| `Units`, `Unit Price`, `Revenue` | `Revenue = Units × Unit Price` |
|
||||
|
||||
**It has deliberate shape, so a chart of it proves something.** A Q4 lift and a summer dip, quiet
|
||||
weekends, steady growth across the two years, and one region — East — pulling ahead only in the second
|
||||
year. Price ranges differ per category, so the mix moves the average.
|
||||
|
||||
## `subscriptions.xlsx` / `subscriptions.csv` — 480 rows
|
||||
|
||||
A customer list, for the other half: cohorts, MRR, churn.
|
||||
|
||||
| Column | |
|
||||
|---|---|
|
||||
| `Account ID`, `Company`, `Country` | eight countries |
|
||||
| `Plan`, `MRR` | Starter 19 · Team 79 · Business 249 · Enterprise 900 |
|
||||
| `Seats` | |
|
||||
| `Started`, `Cancelled` | `Cancelled` is empty for live accounts |
|
||||
| `Status` | Active · Cancelled |
|
||||
|
||||
**Churn is not evenly spread** — Starter churns about a third, Enterprise well under a tenth, which is the
|
||||
pattern anybody reading it expects to find. "Active" is a calculation over dates, not just a column to
|
||||
filter on, which is the point of including both.
|
||||
|
||||
## Both formats, on purpose
|
||||
|
||||
The `.xlsx` files are the realistic input — people have spreadsheets. The `.csv` twins are identical data
|
||||
and need no parser, so an app can read them with nothing installed. Pick per what you are building; do not
|
||||
assume the Excel one has to be converted first.
|
||||
|
||||
## Regenerating
|
||||
|
||||
`generate.ts` writes all four from a fixed seed, so a re-run is byte-identical and any diff means the
|
||||
generator changed. It has no dependencies — an `.xlsx` is a zip of XML and it writes one directly, which
|
||||
is why nothing had to be installed to produce these.
|
||||
|
||||
```bash
|
||||
bun run generate.ts .
|
||||
```
|
||||
Reference in New Issue
Block a user