-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
92 lines (86 loc) · 3.22 KB
/
index.html
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script>
fetch('https://analytics.vrchat.ind3x.site/consolidated_occupants.txt', {
method: 'GET',
headers: {
'Content-Type': 'text/plain',
}
})
.then(function(response) {
return response.text();
})
.then(function(text) {
const rawEntries = text.trim().split(/\n/);
const splittedEntries = rawEntries.map(entry => {
return entry.split(';')
})
const entries1 = splittedEntries.map(entry => [new Date(parseInt(entry[0])), parseInt(entry[1])])
const entries2 = splittedEntries.map(entry => [new Date(parseInt(entry[0])), parseInt(entry[2])])
const entries3 = splittedEntries.map(entry => [new Date(parseInt(entry[0])), parseInt(entry[3])])
const entries4 = splittedEntries.map(entry => [new Date(parseInt(entry[0])), parseInt(entry[4])])
const entries5 = splittedEntries.map(entry => [new Date(parseInt(entry[0])), parseInt(entry[5])])
Highcharts.chart('curve_chart', {
chart: { zoomType: 'x' },
title: { text: 'Occupants (updated every 5 minutes)' },
subtitle: {
text: document.ontouchstart === undefined ? 'Click and drag in the plot area to zoom in' : 'Pinch the chart to zoom in'
},
xAxis: { type: 'datetime' },
yAxis: { title: { text: 'Occupants' } },
plotOptions: {
area: {
fillColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0, Highcharts.getOptions().colors[0]],
[1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
]
},
marker: { radius: 2 },
lineWidth: 1,
states: { hover: { lineWidth: 1 } },
threshold: null
}
},
series: [
{
name: 'Sky Club',
data: entries1
},
{
name: 'Ind3x\'s Home',
data: entries2
},
{
name: 'Club Galaxy',
data: entries3
},
{
name: 'Full Moon Party Beach Club',
data: entries4
},
{
name: 'Void Club',
data: entries5
}
]
});
});
</script>
</head>
<body>
<div id="curve_chart" style="height: calc(100vh - 3rem)"></div>
GitHub: <a href="https://github.com/Ind3xOnGitHub/vrchat-world-tracking" target="_blank" rel="noopener">https://github.com/Ind3xOnGitHub/vrchat-world-tracking</a>
</body>
</html>