forked from rknightuk/app-defaults
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwordcloud.njk
More file actions
27 lines (21 loc) · 683 Bytes
/
wordcloud.njk
File metadata and controls
27 lines (21 loc) · 683 Bytes
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
---
layout: base
isWordCloudPage: true
---
<script>
window.WordCloudWords = {{ words | stringify | safe }}
</script>
<style>
.canvas {
border: 20px solid white;
}
</style>
<canvas id="wordcloud-canvas" class="canvas" height="600" width="1200"></canvas>
<script type="text/javascript">
(function() {
const width = (window.innerWidth > 1200 ? 1200 : window.innerWidth) - 70
document.getElementById('wordcloud-canvas').width = width
document.getElementById('wordcloud-canvas').height = 600
WordCloud(document.getElementById('wordcloud-canvas'), { list: window.WordCloudWords, rotateRatio: 1, shrinkToFit: true } )
})()
</script>