fix(insights): sankey diagram inconsistent sizing

This commit is contained in:
Herculino Trotta
2025-02-11 00:40:37 -03:00
parent 9c339faa72
commit 7a2acb6497
2 changed files with 2 additions and 2 deletions

View File

@@ -47,7 +47,7 @@ def generate_sankey_data(transactions_queryset):
# Function to add flow
def add_flow(from_node, to_node, amount, currency):
percentage = (amount / total_amount) * 100 if total_amount else 0
scaled_flow = 1 + min(percentage / 5, 2) # Scale 1-5, capping at 100%
scaled_flow = 1 + min(percentage / 20, 4) # Scale 1-5, capping at 100%
flows.append(
{
"from_node": from_node,

View File

@@ -1,7 +1,7 @@
{% extends "layouts/base.html" %}
{% block content %}
<canvas id="sankeyChart" class="h-100"></canvas>
<canvas id="sankeyChart" height="379"></canvas>
<script>
function setupSankeyChart(data, chartId = 'sankeyChart') {