/
document-topic-distribution.html
62 lines (58 loc) · 2.17 KB
/
document-topic-distribution.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
{% extends "base.html" %}
{% block main %}
<main class="main">
<div class="main_content">
<h1>Document-Topic Distributions</h1>
<p>Each document consists to a certain extent of each topic, which is one of the theoretical assumptions of
topic models. Visualizing those proportions in a heatmap displays the kind of information that is probably
most useful to literary scholars. Going beyond pure exploration, it can be used to show thematic
developments over a set of texts as well as a single text, akin to a dynamic topic model.</p>
</p>
<p id="document-topic-heatmap"></p>
</div>
<script type="text/javascript" src="{{ url_for('static', filename='js/apexcharts.js') }}"></script>
<script>
function plotDocumentTopicHeatmap() {
// Get data from API endpoint
$.getJSON("{{ url_for('document_topic_overview') }}", function (data) {
var options = {
chart: {
toolbar: {
show: true,
tools: {
download: true,
}
},
height: 400,
type: 'heatmap',
},
dataLabels: {
enabled: false
},
colors: ['#213365'],
series: data,
tooltip: {
x: {
show: true
}
},
xaxis: {
tooltip: {
enabled: false,
}
}
}
// Get element
var chart = new ApexCharts(
document.querySelector('#document-topic-heatmap'),
options
);
// Render plot
chart.render();
});
};
// Call the function to plot heatmap
plotDocumentTopicHeatmap()
</script>
</main>
{% endblock %}