From 349101a23654ac8358188abf6b05d890c1fbce58 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 15 Aug 2024 15:00:44 +0100 Subject: [PATCH] more tweaks --- .gitignore | 1 + backend/app.py | 8 ++++---- content/data-lab/hashrate.md | 2 +- content/data-lab/miner-rewards.md | 2 +- layouts/partials/header.html | 2 +- static/css/navbar.css | 1 + static/js/bitcoin-business-growth-chart.js | 3 ++- static/js/chart-params.js | 9 +++------ 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index a57b14f..07bb386 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ .hugo_build.lock *.json /data +backend/api_logs.txt *__pycache__* diff --git a/backend/app.py b/backend/app.py index a45ecf7..6fc5c89 100644 --- a/backend/app.py +++ b/backend/app.py @@ -64,17 +64,17 @@ def business_growth(): delta = today - datetime.timedelta(days=2) filtered_data = [item for item in filtered_data if item['cumulative_period_type'] == cumulative_period_type and delta <= datetime.datetime.strptime(item['date'], '%Y-%m-%d')] elif cumulative_period_type == "7 day": - delta = today - datetime.timedelta(days=7) + delta = today - datetime.timedelta(days=8) filtered_data = [item for item in filtered_data if item['cumulative_period_type'] == cumulative_period_type and delta <= datetime.datetime.strptime(item['date'], '%Y-%m-%d')] elif cumulative_period_type == "28 day": - delta = today - datetime.timedelta(days=28) + delta = today - datetime.timedelta(days=29) filtered_data = [item for item in filtered_data if item['cumulative_period_type'] == cumulative_period_type and delta <= datetime.datetime.strptime(item['date'], '%Y-%m-%d')] elif cumulative_period_type == "365 day": - delta = today - datetime.timedelta(days=365) + delta = today - datetime.timedelta(days=366) filtered_data = [item for item in filtered_data if item['cumulative_period_type'] == cumulative_period_type and delta <= datetime.datetime.strptime(item['date'], '%Y-%m-%d')] # Sort by date - sorted_data = sorted(filtered_data, key=lambda x: x['date'], reverse=True) + sorted_data = sorted(filtered_data, key=lambda x: x['date'], reverse=False) # Return json return Response(json.dumps(sorted_data), mimetype='application/json') diff --git a/content/data-lab/hashrate.md b/content/data-lab/hashrate.md index ba4b3a1..9762bbd 100644 --- a/content/data-lab/hashrate.md +++ b/content/data-lab/hashrate.md @@ -8,6 +8,6 @@ summary: "Timeseries chart showing the Bitcoin network hashrate and difficulty." tags: ["Bitcoin", "Stats", "Hashrate"] --- -The estimated hashrate and difficulty of the Bitcoin network, accompanied by the 28-day moving average. +This chart shows the estimated hashrate and difficulty of the Bitcoin network, accompanied by the 28-day moving average. This information is extracted from my node using the `bitcoin-cli getnetworkhashps` command. {{< chart src="/js/hashrate.js" >}} diff --git a/content/data-lab/miner-rewards.md b/content/data-lab/miner-rewards.md index 2140ed1..02830ce 100644 --- a/content/data-lab/miner-rewards.md +++ b/content/data-lab/miner-rewards.md @@ -9,6 +9,6 @@ draft: false tags: ["Bitcoin", "Stats"] --- -Total daily aggregated miner income denominated in USD for that day. +The following chart shows daily miner revenue in USD for the period selected in the dropdown. This information is based on the sum of bitcoin mined each day (i.e. the block-subsidy) plus the transaction fees. Price data is obtained from the CoinGecko. {{< chart src="/js/miner-rewards.js" >}} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index f18aee9..7d5b527 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,7 +1,7 @@