Private Market Liquidity Assessment Model

Private Market Liquidity Assessment Model

Evaluate the potential liquidity of unlisted investments.

---

---

Liquidity Factor Analysis

Contribution of each factor to the final liquidity score.

Key Observations

${scoreCategory}

`; const gaugeCtx = document.getElementById('scoreGaugeChart').getContext('2d'); if(scoreGaugeChart) scoreGaugeChart.destroy(); scoreGaugeChart = new Chart(gaugeCtx, { type: 'doughnut', data: { datasets: [{ data: [finalScore, 100 - finalScore], backgroundColor: [scoreColor, '#e2e8f0'], borderWidth: 0 }] }, options: { rotation: -90, circumference: 180, cutout: '70%', responsive: true, plugins: { legend: { display: false }, tooltip: { enabled: false } } } }); // Factor Analysis Chart const factorCtx = document.getElementById('factorChart').getContext('2d'); if (factorChart) factorChart.destroy(); factorChart = new Chart(factorCtx, { type: 'bar', data: { labels: Object.keys(subScores).map(key => factorLabels[key]), datasets: [{ label: 'Factor Score', data: Object.values(subScores), backgroundColor: '#34d399' }] }, options: { indexAxis: 'y', responsive: true, scales: { x: { beginAtZero: true, max: 100 } }, plugins: { legend: { display: false } } } }); // Observations const strengths = Object.keys(subScores).filter(k => subScores[k] >= 80).map(k => factorLabels[k]); const weaknesses = Object.keys(subScores).filter(k => subScores[k] < 50).map(k => factorLabels[k]); document.getElementById('observations-list').innerHTML = `

Strengths

    ${strengths.length ? strengths.map(s => `
  • ${s}
  • `).join('') : '
  • None significant
  • '}

Weaknesses

    ${weaknesses.length ? weaknesses.map(w => `
  • ${w}
  • `).join('') : '
  • None significant
  • '}
`; } // --- EVENT HANDLING --- document.getElementById('factors-form').addEventListener('input', e => { const updatedKey = e.target.dataset.key; const newValue = parseInt(e.target.value); appData.weights[updatedKey] = newValue; let total = Object.values(appData.weights).reduce((a, b) => a + b, 0); if (total !== 100) { const otherKeys = Object.keys(appData.weights).filter(k => k !== updatedKey); let remainder = 100 - newValue; let currentOtherTotal = total - newValue || 1; // Avoid division by zero otherKeys.forEach(key => { const proportion = appData.weights[key] / currentOtherTotal; appData.weights[key] = Math.round(proportion * remainder); }); total = Object.values(appData.weights).reduce((a, b) => a + b, 0); if (total !== 100) appData.weights[otherKeys[0]] += (100 - total); } Object.keys(appData.weights).forEach(key => { document.getElementById(`weight-${key}`).value = appData.weights[key]; document.getElementById(`weight-val-${key}`).textContent = `${appData.weights[key]}%`; }); document.getElementById('total-weight-display').textContent = `Total Weight: ${Object.values(appData.weights).reduce((a,b)=>a+b, 0)}%`; updateDashboard(); }); // --- PDF GENERATION --- document.getElementById('download-pdf-btn').addEventListener('click', () => { const { finalScore, subScores } = calculateLiquidityScore(); const scoreText = document.getElementById('score-text').innerText.split('\n'); const doc = new jsPDF(); let cursorY = 20; doc.setFontSize(22); doc.setFontStyle('bold'); doc.setTextColor('#047857'); doc.text('Private Investment Liquidity Report', 105, cursorY, { align: 'center' }); cursorY += 15; doc.setFontSize(12); doc.setTextColor('#374151'); doc.text(`Generated on: ${new Date().toLocaleDateString('en-US')}`, 105, cursorY, {align: 'center'}); cursorY += 15; doc.setFontSize(16); doc.text('Overall Liquidity Score', 14, cursorY); doc.addImage(scoreGaugeChart.toBase64Image('image/png', 1.0), 'PNG', 15, cursorY + 5, 80, 45); doc.setFontSize(36); doc.text(scoreText[0], 140, cursorY + 30); doc.setFontSize(14); doc.text(scoreText[1], 140, cursorY + 40); cursorY += 60; doc.setFontSize(16); doc.text('Liquidity Factor Analysis', 14, cursorY); cursorY += 8; const tableBody = Object.keys(subScores).map(key => { const profileKey = Object.keys(appData.profile).find(pk => pk.toLowerCase() === key.toLowerCase()); return [factorLabels[key], appData.profile[profileKey], `${subScores[key]}/100`]; }); doc.autoTable({ startY: cursorY, head: [['Factor', 'Input', 'Score']], body: tableBody, theme: 'grid', headStyles: { fillColor: '#059669' } }); doc.save('Liquidity-Assessment-Report.pdf'); }); // --- INITIALIZATION --- function runAllUpdates() { renderFactorsForm(); updateDashboard(); } // Correctly map profile form IDs to appData keys and set up listener const initialProfile = {}; Array.from(profileForm.querySelectorAll('select')).forEach(el => { const key = el.id.replace(/-(\w)/g, (_, c) => c.toUpperCase()); initialProfile[key] = el.value; }); appData.profile = initialProfile; profileForm.addEventListener('change', (e) => { const key = e.target.id.replace(/-(\w)/g, (_, c) => c.toUpperCase()); appData.profile[key] = e.target.value; runAllUpdates(); }); runAllUpdates(); setActiveTab('dashboard'); });
Scroll to Top