-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
100 lines (75 loc) · 3.11 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
93
94
95
96
97
98
99
100
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tikvah Telegram Channel Top used words</title>
<script src="https://cdn.tailwindcss.com"></script>
<style>
#chartdiv {
width: 100%;
height: 580px;
}
#chartdiv-pair {
width: 100%;
height: 580px;
}
</style>
</head>
<body>
<div class=" text-2xl text-center text-pink-500 underline py-3"><a href="https://t.me/s/tikvahethiopia">Tikvah Telegram Channel</a> Most Used 300 Words Until 2024-08-07</div>
<section class="section">
<div id="chartdiv"></div>
<div class=" text-2xl text-center text-pink-500 underline py-7"> Most Used 250 Pair Words Until 2024-08-07</div>
<div id="chartdiv-pair"></div>
</section>
<div class="text-center underline">
<a href="https://github.com/hmhard/tikvah-tg-channel-analysis">View on Github</a>
</div>
<script src="./top-300.js" type="text/javascript"></script>
<script src="./top-pair-250.js" type="text/javascript"></script>
<!-- Load d3.js -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E=" crossorigin="anonymous"></script>
<script src="https://www.amcharts.com/lib/4/core.js"></script>
<script src="https://www.amcharts.com/lib/4/charts.js"></script>
<script src="https://www.amcharts.com/lib/4/plugins/wordCloud.js"></script>
<script src="https://www.amcharts.com/lib/4/themes/animated.js"></script>
<script>
var datas = Object.keys(data).map(item => ({
tag: item,
value: data[item]
}));
var pair_datas = Object.keys(pair_data).map(item => ({
tag: item,
value: pair_data[item]
}));
var myWords = Object.keys(data);
var pairWords = Object.keys(pair_data);
$(window).on('load', function() {
loadText();
});
function loadText() {
drawWorldCloud(pairWords.join(' '), pair_datas, "chartdiv-pair");
drawWorldCloud(myWords.join(' '), datas, "chartdiv");
}
function drawWorldCloud(sentence, datav, div) {
am4core.useTheme(am4themes_animated);
var chart = am4core.create(div, am4plugins_wordCloud.WordCloud);
var series = chart.series.push(new am4plugins_wordCloud.WordCloudSeries());
series.accuracy = 4;
series.step = 15;
series.rotationThreshold = 0.7;
series.maxCount = 5000;
series.minWordLength = 2;
series.labels.template.tooltipText = "{word}: {value}";
series.fontFamily = "'M PLUS 1p', sans-serif";
series.maxFontSize = am4core.percent(50);
series.data = datav
series.dataFields.word = "tag";
series.dataFields.value = "value";
series.colors = new am4core.ColorSet();
series.colors.passOptions = {};
}
</script>
</body>
</html>