You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6789e01
Browse filesBrowse the repository at this point in the historyBrowse files
Update README for the redesigned executive dashboard
- Replace the two-bullet dashboard section with what the report actually
does: KPI cards, the nine visuals, browser-side cross-filtering, themes,
CSV export, and the design decisions behind it
- Correct the project structure to match the repo (generator/, spark/,
dashboards/assets/, docs/, data/raw|silver|gold)
- List the metrics the Gold layer actually surfaces
- Add a Docker-free path for running the pipeline end to end
- Fix the Python badge: the project targets 3.9, not 3.11
| 1 | Revenue Trend · Top Products by Brand · Revenue by Category |
258
+
| 2 | Revenue by City · Revenue by Gender · Payment Methods |
259
+
| 3 | Order Status · Top Customers · Monthly Orders |
228
260
229
-
The executive dashboard provides interactive business insights including:
261
+
### Interactivity
230
262
231
-
- Revenue
232
-
- Order Status Distribution
263
+
Every filter re-aggregates the **entire fact table in the browser**. The Gold rows are dictionary-encoded into base64 typed arrays and embedded in the page, so one filter change recomputes all eight KPIs and all nine charts in roughly **70 ms** — no server round trip, no pre-baked trace toggling.
233
264
234
-
Dashboard is built using **Plotly**.
265
+
-**Filters** — Year, Month, Category, Brand, Payment Method, Gender, Order Status, plus a type-ahead City search
266
+
-**Metric switch** — Revenue / Profit / Quantity, repainting every value-based chart and rewriting its title
267
+
-**Themes** — light and dark, each a separately chosen palette rather than an inverted one
268
+
-**Export** — the current selection downloads as CSV; Plotly's PNG export is kept, its logo and lasso/box-select tools removed
-**Bars, not pies.** Length is easier to compare than angle, so payment methods and order status are horizontal bars rather than donuts.
273
+
-**Colour encodes the measure**, not decoration — Revenue green, Profit blue, Quantity orange, order counts purple. Every colour was checked for contrast against its surface and for colour-vision separation.
274
+
-**Order Status uses a reserved status palette** (Delivered green through Cancelled red) with values always labelled, so colour never carries meaning on its own.
275
+
-**No legends.** Each chart shows one series at a time and the metric switch says which.
276
+
-**Real date axes.** Trend charts plot actual dates, so `Jan 2024` reads as a month instead of the integer `202401`.
277
+
-**Left joins, not filters.** An order line with an unresolved brand or payment method still counts toward revenue and only drops out of that one breakdown — dropping those rows outright would silently delete a fifth of the revenue. The unresolved counts are printed in the dashboard footer.
278
+
279
+
### Data standardisation
280
+
281
+
`spark/gold_analytics.py` normalises dimension attributes before they reach a chart: HTML fragments (`<b>Sony</b>`) and emoji (`IKEA📱💻`) are stripped, and placeholder values (`NULL`, `Unknown`, `-`, `N/A`) become genuine nulls instead of showing up as categories.
282
+
283
+
### Generating it
284
+
285
+
```bash
286
+
python spark/gold_analytics.py
287
+
```
288
+
289
+
Writes `dashboards/executive_dashboard.html` and `docs/index.html` (the GitHub Pages copy). The Airflow DAG runs this as its `run_analytics` task.
239
290
240
291
---
241
292
@@ -334,6 +385,20 @@ source venv/bin/activate
334
385
pip install -r requirements.txt
335
386
```
336
387
388
+
## Run the Pipeline Directly
389
+
390
+
Runs the whole pipeline without Docker (requires a JRE for PySpark):
391
+
392
+
```bash
393
+
python generator/run.py --scale 0.01
394
+
python spark/bronze_to_silver.py
395
+
python spark/silver_to_gold.py
396
+
python spark/gold_analytics.py
397
+
python -m pytest tests/ -v
398
+
```
399
+
400
+
Then open `dashboards/executive_dashboard.html` in a browser.
0 commit comments