-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_screener.html
More file actions
55 lines (51 loc) · 2.2 KB
/
test_screener.html
File metadata and controls
55 lines (51 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Test Screener Table</title>
<style>
table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid #ddd; padding: 8px; }
th { background: #333; color: white; }
</style>
</head>
<body>
<div id="output"></div>
<script>
fetch('period_metrics.json')
.then(r => r.json())
.then(periodData => {
fetch('real_metrics.json')
.then(r => r.json())
.then(metricsData => {
const coins = Object.entries(metricsData).map(([symbol, data]) => ({
symbol,
...data
}));
const coinsWithScores = coins.map(coin => {
const scores = {};
for (const [key, period] of Object.entries(periodData)) {
scores[key] = period.scores[coin.symbol] || 0;
}
return { ...coin, periodScores: scores };
});
let html = '<h3>Period Keys: ' + Object.keys(periodData).join(', ') + '</h3>';
html += '<table><tr><th>Монета</th>';
for (const key of Object.keys(periodData)) {
html += '<th>' + key + '</th>';
}
html += '</tr>';
coinsWithScores.slice(0, 5).forEach(coin => {
html += '<tr><td>' + coin.symbol + '</td>';
for (const key of Object.keys(periodData)) {
html += '<td>' + (coin.periodScores[key] || 0).toFixed(1) + '</td>';
}
html += '</tr>';
});
html += '</table>';
document.getElementById('output').innerHTML = html;
});
});
</script>
</body>
</html>