more tweaks

This commit is contained in:
Sam 2024-08-15 15:00:44 +01:00
parent 3f3f27d4c8
commit 349101a236
8 changed files with 14 additions and 14 deletions

1
.gitignore vendored
View File

@ -3,4 +3,5 @@
.hugo_build.lock .hugo_build.lock
*.json *.json
/data /data
backend/api_logs.txt
*__pycache__* *__pycache__*

View File

@ -64,17 +64,17 @@ def business_growth():
delta = today - datetime.timedelta(days=2) 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')] 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": 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')] 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": 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')] 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": 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')] 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 # 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 json
return Response(json.dumps(sorted_data), mimetype='application/json') return Response(json.dumps(sorted_data), mimetype='application/json')

View File

@ -8,6 +8,6 @@ summary: "Timeseries chart showing the Bitcoin network hashrate and difficulty."
tags: ["Bitcoin", "Stats", "Hashrate"] 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" >}} {{< chart src="/js/hashrate.js" >}}

View File

@ -9,6 +9,6 @@ draft: false
tags: ["Bitcoin", "Stats"] 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" >}} {{< chart src="/js/miner-rewards.js" >}}

View File

@ -1,7 +1,7 @@
<header> <header>
<nav class="navbar" role="navigation"> <nav class="navbar" role="navigation">
<div class="navbar__left"> <div class="navbar__left">
<a href="/"><strong>Based Data</strong></a> <a href="/"><strong>BASED DATA</strong></a>
</div> </div>
<div class="navbar__right"> <div class="navbar__right">
<div class="navbar-links">{{ partial "navbarlinks.html" . }}</div> <div class="navbar-links">{{ partial "navbarlinks.html" . }}</div>

View File

@ -52,6 +52,7 @@
.navbar__left a { .navbar__left a {
text-decoration: none !important; text-decoration: none !important;
font-weight: 540;
color: var(--text-color) !important; color: var(--text-color) !important;
font-size: 22px; font-size: 22px;
} }

View File

@ -43,10 +43,11 @@ function updateChart() {
axisTick: axisTick, axisTick: axisTick,
axisLabel: axisLabel, axisLabel: axisLabel,
axisLine: axisLine, axisLine: axisLine,
type: "time", type: "category",
}, },
yAxis: { yAxis: {
axisTick: axisTick, axisTick: axisTick,
scale: true,
splitLine: { splitLine: {
show: false, show: false,
}, },

View File

@ -31,7 +31,7 @@ const toolboxParams = {
dataZoom: { dataZoom: {
yAxisIndex: "none", yAxisIndex: "none",
}, },
restore: {}, dataView: {},
saveAsImage: { saveAsImage: {
pixelRatio: 2, pixelRatio: 2,
}, },
@ -73,13 +73,10 @@ const yaxisTextStyle2 = {
color: textColor, color: textColor,
}; };
function dataZoom(start = 90, end = 100, bottom = 15, height = 15) { function dataZoom() {
const dataZoom = [ const dataZoom = [
{ {
start: start, type: "inside",
end: end,
bottom: bottom,
height: height,
}, },
]; ];