AJAYKASU commited on
Commit
d511855
·
verified ·
1 Parent(s): 54b68ab

Polish: Navy/Gold Pie Chart & Ownership Table

Browse files
Files changed (1) hide show
  1. static/script.js +47 -10
static/script.js CHANGED
@@ -91,7 +91,7 @@ function updateDashboard(data) {
91
  // 2. IPO STRUCTURING (The Pro Layer)
92
  if (data.structure) {
93
  document.getElementById('s-final-price').textContent = `$${data.structure.final_price.toFixed(2)}`;
94
- document.getElementById('s-dilution').textContent = `${data.structure.dilution}%`;
95
 
96
  // Down-Round Alert
97
  const drAlert = document.getElementById('dr-alert');
@@ -102,26 +102,63 @@ function updateDashboard(data) {
102
  drAlert.style.display = 'none';
103
  }
104
 
105
- // Ownership Pie Chart
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  const ownerData = [{
107
- values: [data.structure.ownership["Existing Shareholders"], data.structure.ownership["New Public Investors"]],
108
  labels: ['Existing Holders', 'New Public Investors'],
109
  type: 'pie',
110
- marker: { colors: ['#333', '#FFD700'] }, // Grey vs Gold
111
- textinfo: 'label+percent',
112
- hole: 0.4
 
113
  }];
114
 
115
  const ownerLayout = {
116
  paper_bgcolor: 'rgba(0,0,0,0)',
117
  plot_bgcolor: 'rgba(0,0,0,0)',
118
- font: { color: '#ccc' },
119
  showlegend: false,
120
- margin: { t: 10, b: 10, l: 10, r: 10 },
121
- height: 250
122
  };
123
 
124
- Plotly.newPlot('ownership-chart', ownerData, ownerLayout, { responsive: true });
125
  }
126
 
127
 
 
91
  // 2. IPO STRUCTURING (The Pro Layer)
92
  if (data.structure) {
93
  document.getElementById('s-final-price').textContent = `$${data.structure.final_price.toFixed(2)}`;
94
+ document.getElementById('s-raise').textContent = `$${data.structure.capital_raised.toFixed(0)}M`;
95
 
96
  // Down-Round Alert
97
  const drAlert = document.getElementById('dr-alert');
 
102
  drAlert.style.display = 'none';
103
  }
104
 
105
+ // --- VISUALIZATION: PIE CHART & TABLE ---
106
+ const existingShares = data.structure.ownership["Existing Shareholders"];
107
+ const newShares = data.structure.ownership["New Public Investors"];
108
+ const totalShares = data.structure.total_shares;
109
+
110
+ // 1. Generate Table HTML
111
+ const tableHTML = `
112
+ <table style="width:100%; border-collapse:collapse; color:#eee;">
113
+ <thead>
114
+ <tr style="border-bottom:1px solid #444; color:#888;">
115
+ <th style="text-align:left; padding-bottom:5px;">Group</th>
116
+ <th style="text-align:right; padding-bottom:5px;">Shares (M)</th>
117
+ <th style="text-align:right; padding-bottom:5px;">% Own</th>
118
+ </tr>
119
+ </thead>
120
+ <tbody>
121
+ <tr>
122
+ <td style="padding:8px 0; color:#a0c4ff;">Existing</td>
123
+ <td style="text-align:right;">${existingShares.toFixed(2)}</td>
124
+ <td style="text-align:right;">${((existingShares / totalShares) * 100).toFixed(1)}%</td>
125
+ </tr>
126
+ <tr>
127
+ <td style="padding:8px 0; color:#FFD700;">New Investors</td>
128
+ <td style="text-align:right;">${newShares.toFixed(2)}</td>
129
+ <td style="text-align:right;">${((newShares / totalShares) * 100).toFixed(1)}%</td>
130
+ </tr>
131
+ <tr style="border-top:1px solid #444; font-weight:bold;">
132
+ <td style="padding-top:8px;">Total</td>
133
+ <td style="text-align:right; padding-top:8px;">${totalShares.toFixed(2)}</td>
134
+ <td style="text-align:right; padding-top:8px;">100%</td>
135
+ </tr>
136
+ </tbody>
137
+ </table>
138
+ `;
139
+ document.getElementById('ownership-table').innerHTML = tableHTML;
140
+
141
+ // 2. Render Pie Chart (Navy & Gold)
142
  const ownerData = [{
143
+ values: [existingShares, newShares],
144
  labels: ['Existing Holders', 'New Public Investors'],
145
  type: 'pie',
146
+ marker: { colors: ['#001F3F', '#D4AF37'] }, // Navy vs Gold
147
+ textinfo: 'percent',
148
+ hoverinfo: 'label+value+percent',
149
+ hole: 0.6
150
  }];
151
 
152
  const ownerLayout = {
153
  paper_bgcolor: 'rgba(0,0,0,0)',
154
  plot_bgcolor: 'rgba(0,0,0,0)',
155
+ font: { color: '#ccc', family: 'Inter' },
156
  showlegend: false,
157
+ margin: { t: 0, b: 0, l: 0, r: 0 },
158
+ height: 220
159
  };
160
 
161
+ Plotly.newPlot('ownership-chart', ownerData, ownerLayout, { responsive: true, displayModeBar: false });
162
  }
163
 
164