feat(insights): sankey diagram (WIP)

This commit is contained in:
Herculino Trotta
2025-02-11 00:37:30 -03:00
parent b53a4a0286
commit 02376ad02b
6 changed files with 274 additions and 1 deletions
+15 -1
View File
@@ -1,3 +1,17 @@
from django.shortcuts import render
# Create your views here.
from apps.transactions.models import Transaction
from apps.insights.utils.sankey import generate_sankey_data
def sankey(request):
# Get filtered transactions
transactions = Transaction.objects.filter(date__year=2025)
# Generate Sankey data
sankey_data = generate_sankey_data(transactions)
print(sankey_data)
return render(
request, "insights/fragments/sankey.html", {"sankey_data": sankey_data}
)