Skip to content

Commit

Permalink
feat: 🎨 enhance data visualizations and filter recent data
Browse files Browse the repository at this point in the history
- Add a 30-day data filter to daily_metrics.csv.sh for more relevant insights.
- Redesign plots in index.md with titles, subtitles, and tooltips for better clarity and interactivity.
  • Loading branch information
davidgasquez committed Oct 18, 2024
1 parent 22579c0 commit e2f8e09
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/data/daily_metrics.csv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ COPY (
providers_with_active_deals,
providers_with_power,
FROM read_parquet('https://data.filecoindataportal.xyz/filecoin_daily_metrics.parquet')
WHERE date >= CURRENT_DATE() - INTERVAL '30 days'
) TO STDOUT (FORMAT 'CSV');
EOF
55 changes: 48 additions & 7 deletions src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,67 @@ const daily_metrics = FileAttachment("data/daily_metrics.csv").csv({typed: true}
<div class="grid grid-cols-3">

<div class="card">
<h1>Unique Deal Making Providers</h1>


```js
Plot.lineY(daily_metrics, {x: "date", y: "unique_deal_making_providers"}).plot({y: {grid: true}})
resize((width) => Plot.plot({
title: "Deal Making Providers",
subtitle: "How many providers are making deals.",
x: {label: "Date"},
y: {grid: true, label: "Providers"},
width,
marks: [
Plot.ruleY([0]),
Plot.lineY(daily_metrics, {
x: "date",
y: "unique_deal_making_providers",
tip: true
})
]
}))
```

</div>

<div class="card"><h1>Providers With Active Deals</h1>
<div class="card">

```js
Plot.lineY(daily_metrics, {x: "date", y: "providers_with_active_deals"}).plot({y: {grid: true}})
resize((width) => Plot.plot({
title: "Providers With Active Deals",
subtitle: "How many providers have active deals.",
x: { label: "Date" },
y: { grid: true, label: "Providers", zero: true },
width,
marks: [
Plot.ruleY([0]),
Plot.lineY(daily_metrics, {
x: "date",
y: "providers_with_active_deals",
tip: true
})
]
}))
```

</div>
<div class="card"><h1>Providers With Power</h1>

<div class="card">

```js
Plot.lineY(daily_metrics, {x: "date", y: "providers_with_power"}).plot({y: {grid: true}})
resize((width) => Plot.plot({
title: "Providers With Power",
subtitle: "How many providers are with power.",
x: { label: "Date" },
y: { grid: true, label: "Providers", zero: true },
width,
marks: [
Plot.ruleY([0]),
Plot.lineY(daily_metrics, {
x: "date",
y: "providers_with_power",
tip: true
})
]
}))
```

</div>
Expand Down

0 comments on commit e2f8e09

Please sign in to comment.