Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dariah
search-commons-webresources
Commits
a7ffc068
Commit
a7ffc068
authored
May 14, 2018
by
Gradl, Tobias
Browse files
1091: Explain significant terms
Task-Url:
https://pm.winseda.de/issues/1091
parent
f8f9a7ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
css/application.css
View file @
a7ffc068
...
...
@@ -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
;
}
...
...
js/groupview.js
View file @
a7ffc068
...
...
@@ -73,11 +73,11 @@ GroupView.prototype.setupCloud = function() {
tagcount
:
100
,
animate
:
true
,
animateDirection
:
"
topDown
"
,
height
:
5
0
0
,
width
:
7
00
,
height
:
3
50
,
width
:
9
00
,
tagsize
:
{
factor
:
8
0
,
offset
:
7
factor
:
5
0
,
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
.
fillSignificantTerms
Cloud
=
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 <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>
"
)
}
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment