collocatordb/derekovecs: provide information about where collocates appear
diff --git a/templates/index.html.ep b/templates/index.html.ep
index 461d5b4..3711753 100644
--- a/templates/index.html.ep
+++ b/templates/index.html.ep
@@ -107,12 +107,21 @@
return ["hsl(",hue,",90%,70%)"].join("");
}
- function bitmask2window(n) {
- var str = n.toString(2).padStart(10, "0")
- .replace(/^([0-9]{5})/, '$1 ')
- .replace(/0/g, '·')
- .replace(/1/g, '+');
- return str;
+ function bitmask2window(autofocus, win) {
+ var af_str = autofocus.toString(2).padStart(10, "0")
+ .replace(/^([0-9]{5})/, '$1 ')
+ .replace(/0/g, '·')
+ .replace(/1/g, '◼');
+ var w_str = win.toString(2).padStart(10, "0")
+ .replace(/^([0-9]{5})/, '$1 ')
+ .replace(/0/g, '·')
+ .replace(/1/g, 'o');
+ for (var i=0, l=af_str.length; i<l; i++) {
+ if(af_str.charAt(i) == '·' && w_str.charAt(i) == 'o' ) {
+ af_str = af_str.substring(0, i) + "◽" + af_str.substring(i+1);
+ }
+ }
+ return af_str;
}
function bitvec2window(n, heat, word) {
@@ -310,7 +319,7 @@
{ "data": "dice", render: function ( data, type, row ) {return data.toExponential(2) }},
{ "data": "ld", render: function ( data, type, row ) {return data.toFixed(2) }},
{ "data": "af", render: function ( data, type, row ) {return data.toFixed(2) }},
- { "data": "win", width: "auto", sClass: "dt-center mono compact", render: function ( data, type, row ) {return bitmask2window(data) }},
+ { "data": "afwin", width: "auto", sClass: "dt-center mono compact", render: function ( data, type, row ) {return bitmask2window(data, row.win) }},
{ "data": "llfmd", render: function ( data, type, row ) {return data.toFixed(1) }},
{ "data": "rlfmd", render: function ( data, type, row ) {return data.toFixed(1) }},
{ "data": "lnpmi", render: function ( data, type, row ) {return data.toFixed(2) }},