Commit a7ffc068 authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

1091: Explain significant terms

Task-Url: https://pm.winseda.de/issues/1091
parent f8f9a7ff
......@@ -2,6 +2,25 @@
cursor: pointer;
}
#significant-terms-table-container {
-webkit-column-count: 3; /* Chrome, Safari, Opera */
-moz-column-count: 3; /* Firefox */
column-count: 3;
-moz-column-width: 200px;
-webkit-column-width: 200px;
column-width: 200px;
height: 100%;
width: 100%;
overflow-y: scroll;
}
#significant-terms-table td, #significant-terms-table th{
text-align: center;
}
.bx-wrapper: {
overflow-y: scroll;
}
......
......@@ -73,11 +73,11 @@ GroupView.prototype.setupCloud = function() {
tagcount: 100,
animate: true,
animateDirection: "topDown",
height: 500,
width: 700,
height: 350,
width: 900,
tagsize: {
factor: 80,
offset: 7
factor: 50,
offset: 15
}
},
};
......@@ -92,7 +92,11 @@ GroupView.prototype.loadSignificantTerms = function(callback) {
success: function(data) {
if (data!=null && data!=undefined && data.length>0) {
$("#significant-terms-cloud").show();
_this.fillSignificantTerms(data);
$("#termtable").css("height", (_this.options.wordcloud.height + 10) + "px");
$("#termcloud").css("height", (_this.options.wordcloud.height + 10) + "px");
_this.fillSignificantTermsCloud(data);
_this.fillSignificantTermsTable(data);
if (callback!==undefined && callback!==null) {
callback(data);
}
......@@ -102,7 +106,7 @@ GroupView.prototype.loadSignificantTerms = function(callback) {
});
};
GroupView.prototype.fillSignificantTerms = function(data) {
GroupView.prototype.fillSignificantTermsCloud = function(data) {
var _this = this;
var tags = [];
......@@ -123,3 +127,28 @@ GroupView.prototype.fillSignificantTerms = function(data) {
textClickEvent: function(tag) { _this.handleTagTextClicked(tag); }
});
};
GroupView.prototype.fillSignificantTermsTable = function(data) {
var _this = this;
$("#significant-terms-table").html("<thead>" +
"<tr>" +
"<th>Term</th>" +
"<th class=\"td-no-wrap\">Score&nbsp;<a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-significantterms-aggregation.html#_jlh_score\" target=\"_blank\">" +
"<i class=\"fa fa-question-circle\" aria-hidden=\"true\"></i></th>" +
"<th class=\"td-no-wrap\">Treffer Subset</th>" +
"<th class=\"td-no-wrap\">Treffer Superset</th>" +
"</tr>" +
"</head>" +
"<tbody></tbody>")
var tags = [];
for (var i=0; i<data.length; i++) {
$("#significant-terms-table tbody").append("<tr>" +
"<td><em>" + data[i].term + "</em></td>" +
"<th>" + (Math.round(data[i].weight * 10000) / 10000) + "</th>" +
"<td>" + data[i].count + "</td>" +
"<td>" + data[i].bgCount + "</td>" +
"</tr>")
}
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment