diff --git a/playground/example_inventory_replenishment.html b/playground/example_inventory_replenishment.html
new file mode 100644
index 00000000..2dd80718
--- /dev/null
+++ b/playground/example_inventory_replenishment.html
@@ -0,0 +1,318 @@
+
+
+
+
+
+ tsb — Inventory Replenishment Planning — Examples
+
+
+
+
+
+
Initializing playground…
+
+
+ ← Back to examples
+ 📦 Inventory Replenishment Planning
+ Scenario: A retail operations analyst combines daily sell-through with SKU master data to find categories moving fastest and flag items whose on-hand stock is below lead-time demand.
+ Skills you'll use: readCsv, merge, function-valued assign, rolling-style demand features, filters, and pivot tables.
+
+
+
1 · Enrich sales with product master data
+
Parse store/SKU sales, join attributes, and compute inventory value and sell-through.
+
+
+
+
+
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+
+
+
2 · Calculate reorder points from recent demand
+
Estimate rolling demand per SKU, compare it to on-hand stock, and summarize reorder status.
+
+
+
+
+
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+
+
+
+
+
+
diff --git a/playground/example_marketing_attribution.html b/playground/example_marketing_attribution.html
new file mode 100644
index 00000000..19031b5f
--- /dev/null
+++ b/playground/example_marketing_attribution.html
@@ -0,0 +1,314 @@
+
+
+
+
+
+ tsb — Marketing Attribution ROAS — Examples
+
+
+
+
+
+
Initializing playground…
+
+
+ ← Back to examples
+ 📣 Marketing Attribution ROAS
+ Scenario: A growth team has campaign spend in spreadsheet-wide format and conversions in event format. Normalize the spend, join conversion facts, and compare return on ad spend across regions and channels.
+ Skills you'll use: melt, multi-column merge, KPI columns, groupby().agg(), pivotTableFull, and top-N selection.
+
+
+
1 · Normalize spend and join conversions
+
Turn wide channel spend into a tidy table, join conversion facts, and compute ROAS and cost per order.
+
+
+
+
+
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+
+
+
2 · Compare region/channel performance
+
Create a pivot-table scorecard and list the strongest daily placements.
+
+
+
+
+
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+
+
+
+
+
+
diff --git a/playground/example_marketplace_fraud.html b/playground/example_marketplace_fraud.html
new file mode 100644
index 00000000..3426220e
--- /dev/null
+++ b/playground/example_marketplace_fraud.html
@@ -0,0 +1,303 @@
+
+
+
+
+
+ tsb — Marketplace Fraud Triage — Examples
+
+
+
+
+
+
Initializing playground…
+
+
+ ← Back to examples
+ 🛡️ Marketplace Fraud Triage
+ Scenario: A payments risk team needs a repeatable notebook-style workflow: join live transactions to merchant chargeback history, estimate loss exposure, and produce a review queue plus a segment/device heatmap.
+ Skills you'll use: merge, derived columns, boolean filters, groupby().agg(), nlargestDataFrame, pivotTableFull.
+
+
+
1 · Join risk signals and score transactions
+
Blend transaction-level events with merchant risk metadata, then calculate expected loss and a risk score.
+
+
+
+
+
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+
+
+
2 · Build a fraud heatmap and merchant leaderboard
+
Summarize exposure by segment/device and rank merchants by estimated loss.
+
+
+
+
+
Click ▶ Run to execute
+
Ctrl+Enter to run · Tab to indent
+
+
+
+
+
+
+
diff --git a/playground/examples.html b/playground/examples.html
index 52eeeb1f..6a98dcae 100644
--- a/playground/examples.html
+++ b/playground/examples.html
@@ -229,6 +229,24 @@ Sports League Standings
Product Pricing Tiers
Scenario: An e-commerce merchandiser wants to bucket the catalogue into 4 price tiers (Budget / Mid / Premium / Luxury) and see the count and average margin per tier.
+
+
+ 🛡️
+ Marketplace Fraud Triage
+ Scenario: A payments risk team joins transactions with merchant chargeback history, scores expected loss, and builds a segment/device heatmap plus a manual review queue.
+
+
+
+ 📦
+ Inventory Replenishment Planning
+ Scenario: A retail operations analyst combines daily sell-through with SKU master data to calculate reorder points and summarize replenishment risk.
+
+
+
+ 📣
+ Marketing Attribution ROAS
+ Scenario: A growth team reshapes campaign spend, joins conversion facts, and compares return on ad spend by region and channel.
+
diff --git a/playground/index.html b/playground/index.html
index 7224a77f..d1b4e018 100644
--- a/playground/index.html
+++ b/playground/index.html
@@ -131,7 +131,7 @@ 📚 Real-World Examples
-
Ten complete, real-world workflows running interactively in the browser — sales dashboards, stock returns, A/B tests, web analytics, league tables, and more.
+
Thirteen complete, real-world workflows running interactively in the browser — sales dashboards, stock returns, A/B tests, web analytics, league tables, and more.
✅ New — start here
diff --git a/tests/playground.test.ts b/tests/playground.test.ts
index 1fd6b68d..bbaaed76 100644
--- a/tests/playground.test.ts
+++ b/tests/playground.test.ts
@@ -32,6 +32,12 @@ const NON_PLAYGROUND_PAGES = new Set([
"examples.html",
]);
+const REAL_WORLD_EXAMPLE_PAGES = [
+ "example_marketplace_fraud.html",
+ "example_inventory_replenishment.html",
+ "example_marketing_attribution.html",
+] as const;
+
function listPlaygroundHtmlFiles(): string[] {
return readdirSync(PLAYGROUND_DIR)
.filter((f) => f.endsWith(".html"))
@@ -50,6 +56,14 @@ describe("playground page conformance", () => {
expect(files.length).toBeGreaterThan(0);
});
+ it("links the complex real-world examples from the gallery", () => {
+ const html = read("examples.html");
+ for (const file of REAL_WORLD_EXAMPLE_PAGES) {
+ expect(html).toContain(`href="${file}"`);
+ expect(files).toContain(file);
+ }
+ });
+
for (const file of files) {
describe(file, () => {
const html = read(file);