|
7 | 7 | <script src="https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.8.4/nv.d3.js"></script>
|
8 | 8 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.8.4/nv.d3.css">
|
9 | 9 |
|
| 10 | +<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet"> |
| 11 | +<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script> |
| 12 | + |
| 13 | +<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs/dt-1.10.21/datatables.min.css"/> |
| 14 | +<script type="text/javascript" src="https://cdn.datatables.net/v/bs/dt-1.10.21/datatables.js"></script> |
| 15 | + |
10 | 16 | <style>
|
11 | 17 | .chart {
|
12 | 18 | height: 300px;
|
|
25 | 31 | #tables {
|
26 | 32 | clear: both;
|
27 | 33 | }
|
| 34 | + |
| 35 | + .dot { |
| 36 | + height: 20px; |
| 37 | + width: 20px; |
| 38 | + border-radius: 50%; |
| 39 | + display: inline-block; |
| 40 | + } |
28 | 41 | </style>
|
29 | 42 | {% endblock %}
|
30 | 43 |
|
@@ -95,23 +108,30 @@ <h3>
|
95 | 108 | {% endfor %}
|
96 | 109 | </tbody>
|
97 | 110 | </table>
|
98 |
| -</div> |
99 | 111 |
|
100 | 112 | <h3>
|
101 | 113 | Tuple frequency
|
102 | 114 | </h3>
|
103 | 115 |
|
104 |
| -<table class="table table-striped"> |
| 116 | +<input id="toggle-text" type="checkbox" data-toggle="toggle"> Show text |
| 117 | +<table id="tuples-table" class="table table-striped"> |
105 | 118 | <thead>
|
106 | 119 | <tr>
|
107 |
| - <th>Tuple</th> |
| 120 | + {% for language in languages %} |
| 121 | + <th>{{ language.title }}</th> |
| 122 | + {% endfor %} |
108 | 123 | <th>Count</th>
|
109 | 124 | </tr>
|
110 | 125 | </thead>
|
111 | 126 | <tbody>
|
112 | 127 | {% for t, c in tuples %}
|
113 | 128 | <tr>
|
114 |
| - <td>{{ t|join:", " }} </td> |
| 129 | + {% for tense in t %} |
| 130 | + <td> |
| 131 | + <span class="dot" title="{{ tense }}"></span> |
| 132 | + <span class="txt">{{ tense }}</span> |
| 133 | + </td> |
| 134 | + {% endfor %} |
115 | 135 | <td>{{ c }}</td>
|
116 | 136 | </tr>
|
117 | 137 | {% endfor %}
|
@@ -171,6 +191,25 @@ <h3>
|
171 | 191 | }
|
172 | 192 |
|
173 | 193 | Object.keys(counters).sort().forEach(graphLanguage);
|
| 194 | + |
| 195 | + $('.dot').each(function() { |
| 196 | + $(this).css('background-color', colors[$(this).attr('title')]); |
| 197 | + }); |
| 198 | + |
| 199 | + $('.txt').hide(); |
| 200 | + |
| 201 | + $('#toggle-text').change(function() { |
| 202 | + $('.dot').toggle(); |
| 203 | + $('.txt').toggle(); |
| 204 | + }); |
| 205 | + |
| 206 | + var indexLastColumn = $('#tuples-table').find('tr')[0].cells.length - 1; |
| 207 | + $('#tuples-table').DataTable({ |
| 208 | + order: [[ indexLastColumn, 'desc' ]], |
| 209 | + paging: false, |
| 210 | + info: false, |
| 211 | + }); |
| 212 | + |
174 | 213 | </script>
|
175 | 214 |
|
176 | 215 | {% endblock %}
|
0 commit comments