Analysis Visualizations
Overview
Loan Pilot utilizes Recharts to provide underwriters with visual insights into a borrower's financial health. These visualizations translate raw extraction data from bank statements, financial statements, and GST returns into actionable trends and comparison metrics.
Bank Balance Trends
The bank statement analysis engine generates a time-series dataset used to visualize liquidity and cash flow volatility.
Data Interface
The visualization components consume the daily_balances array returned by the /api/analyze/bank-statement endpoint.
interface DailyBalance {
date: string; // ISO format date
balance: number; // End-of-day balance
}
Usage in Charts
Underwriters can view a Line Chart representing daily balance fluctuations. This is critical for identifying:
- Minimum Balance Breaches: Points where the balance approaches zero or goes negative.
- Volatility: The
cashflow_volatilitymetric is derived from these trends to assess risk. - Inflow Patterns: Large spikes indicating significant credits.
Financial Ratio Analysis
Extracted metrics from Balance Sheets and Profit & Loss statements are visualized to compare a business's performance against industry benchmarks.
Key Metrics Visualized
The system automatically calculates and charts the following ratios:
| Metric | Category | Description | | :--- | :--- | :--- | | DSCR | Solvency | Debt Service Coverage Ratio; indicates ability to pay current debt. | | Current/Quick Ratio | Liquidity | Measures ability to cover short-term liabilities with liquid assets. | | Net Profit Margin | Profitability | Percentage of revenue remaining after all expenses. | | Debt-to-Equity | Leverage | Relative proportion of shareholders' equity and debt used to finance assets. |
Component Integration
Financial ratios are typically rendered using Bar Charts or Radar Charts to show multi-year trends (e.g., comparing period_year performance).
// Example API Output for Ratios
"ratios": {
"current_ratio": 1.5,
"debt_to_equity_ratio": 0.8,
"net_profit_margin": 0.12,
"dscr": 2.1
}
GST and Revenue Reconciliation
One of the core features of the analysis suite is the reconciliation chart, which compares revenue reported across different official documents.
Cross-Source Visualization
The Reconciliation Chart (usually a Composed Chart) visualizes the delta between:
- Bank Credits: Total inflows identified as business revenue in bank statements.
- GST Returns: Turnover reported in GSTR-3B/1 filings.
- P&L Revenue: Stated revenue in the audited financial statements.
Reconciliation Metrics
The visualization highlights the Reconciliation Score, a confidence metric based on how closely these three sources align. Significant deviations (e.g., Bank Credits >> GST Turnover) are flagged visually to indicate potential under-reporting or undisclosed revenue streams.
Implementation Details
Recharts Configuration
To ensure consistency across the dashboard, the following configurations are applied to the visualization components:
- ResponsiveContainer: All charts are wrapped in a responsive container to adapt to the grid-based dashboard layout.
- Tooltips: Custom tooltips are implemented to show exact currency values and dates on hover.
- Reference Lines: Used in balance charts to highlight the "Minimum Average Balance" (MAB) requirements.
Integration Example
When building custom views for a loan application, the analysis data is passed to the chart components as follows:
import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer } from 'recharts';
// Component for Bank Balance Trends
const BalanceTrendChart = ({ data }) => (
<ResponsiveContainer width="100%" height={300}>
<LineChart data={data}>
<CartesianGrid strokeDasharray="3 3" />
<XAxis dataKey="date" />
<YAxis tickFormatter={(value) => `₹${value}`} />
<Tooltip formatter={(value) => [`₹${value}`, 'Balance']} />
<Line type="monotone" dataKey="balance" stroke="#8884d8" dot={false} />
</LineChart>
</ResponsiveContainer>
);