Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
043c82c9
Commit
043c82c9
authored
May 04, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show stopwords in term table
parent
a540dfc5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
18 deletions
+26
-18
ngramlists.py
gargantext/views/api/ngramlists.py
+5
-3
NGrams_dyna_chart_and_table.js
static/js/gargantext/NGrams_dyna_chart_and_table.js
+20
-13
terms.html
templates/pages/corpora/terms.html
+1
-2
No files found.
gargantext/views/api/ngramlists.py
View file @
043c82c9
...
...
@@ -475,10 +475,12 @@ class ListFamily(APIView):
hidden_ngrams_query
=
_query_grouped_ngrams
(
groups_id
,
details
=
True
,
scoring_metric_id
=
scores_id
)
# infos for stoplist terms, absent from mainlist
stop_ngrams_query
=
_query_list
(
other_list_ids
[
'stoplist'
],
details
=
True
,
scoring_metric_id
=
scores_id
)
# and for the other lists (stop and map)
# no details needed here, just the member ids
# - maplist ngrams will already be in ngraminfos b/c of mainlist
# - stoplist ngrams will not be shown in detail
for
li
in
other_list_ids
:
li_elts
=
_query_list
(
other_list_ids
[
li
],
details
=
False
)
.
all
()
...
...
@@ -497,7 +499,7 @@ class ListFamily(APIView):
# TODO add maplist membership
ngrams_which_need_detailed_info
=
mainlist_query
.
all
()
else
:
ngrams_which_need_detailed_info
=
mainlist_query
.
all
()
+
hidden_ngrams_query
.
all
()
ngrams_which_need_detailed_info
=
mainlist_query
.
all
()
+
hidden_ngrams_query
.
all
()
+
stop_ngrams_query
.
all
()
# the output form of details is:
# ngraminfo[id] => [term, weight]
...
...
static/js/gargantext/NGrams_dyna_chart_and_table.js
View file @
043c82c9
...
...
@@ -1422,19 +1422,19 @@ function GROUPCRUD( groupnode_id , post_data , callback) {
* 3. Creates the scores distribution chart over table
* 4. Set up Search div
*
* @param data: a response from the api/node/CID/ngrams/list/ routes
* @param
ng
data: a response from the api/node/CID/ngrams/list/ routes
* @param initial: initial score type "occs" or "tfidf"
* @param search_filter: eg 'filter_all' (see SearchFilters.MODE)
*/
function
MainTableAndCharts
(
data
,
initial
,
search_filter
)
{
function
MainTableAndCharts
(
ng
data
,
initial
,
search_filter
)
{
// debug
// alert("refresh main")
console
.
log
(
""
)
console
.
log
(
" = = = = MainTableAndCharts: = = = = "
)
console
.
log
(
"data:"
)
console
.
log
(
data
)
console
.
log
(
"
ng
data:"
)
console
.
log
(
ng
data
)
console
.
log
(
"initial:"
)
//
console
.
log
(
initial
)
console
.
log
(
"search_filter:"
)
// eg 'filter_all'
...
...
@@ -1442,13 +1442,13 @@ function MainTableAndCharts( data , initial , search_filter) {
console
.
log
(
" = = = = / MainTableAndCharts: = = = = "
)
console
.
log
(
""
)
// Expected infos in "data.ngrams" should have the form:
// Expected infos in "
ng
data.ngrams" should have the form:
// { "1": { id: "1", name: "réalité", score: 36 },
// "9": { id: "9", name: "pdg", score: 116 },
// "10": { id:"10", name: "infrastructure", score: 12 } etc. }
// (see filling of rec_info below)
// console.log(data.ngrams)
// console.log(
ng
data.ngrams)
var
DistributionDict
=
{}
for
(
var
i
in
DistributionDict
)
...
...
@@ -1530,8 +1530,8 @@ function MainTableAndCharts( data , initial , search_filter) {
$
(
'#mapAll'
).
data
(
"columnSelection"
,
'SOME'
)
var
div_stats
=
"<p>"
;
for
(
var
i
in
data
.
scores
)
{
var
value
=
(
!
isNaN
(
Number
(
data
.
scores
[
i
])))?
Number
(
data
.
scores
[
i
]).
toFixed
(
1
)
:
data
.
scores
[
i
];
for
(
var
i
in
ng
data
.
scores
)
{
var
value
=
(
!
isNaN
(
Number
(
ngdata
.
scores
[
i
])))?
Number
(
ngdata
.
scores
[
i
]).
toFixed
(
1
)
:
ng
data
.
scores
[
i
];
div_stats
+=
i
+
": "
+
value
+
" | "
}
div_stats
+=
"</p>"
...
...
@@ -1539,11 +1539,11 @@ function MainTableAndCharts( data , initial , search_filter) {
AjaxRecords
=
{}
for
(
var
id
in
data
.
ngrams
)
{
for
(
var
id
in
ng
data
.
ngrams
)
{
// console.log(i)
// console.log(data.ngrams[i])
var
le_ngram
=
data
.
ngrams
[
id
]
;
// console.log(
ng
data.ngrams[i])
var
le_ngram
=
ng
data
.
ngrams
[
id
]
;
// INIT records
// one record <=> one line in the table + ngram states
...
...
@@ -2011,13 +2011,20 @@ function AfterAjax() {
// ----------------------------------------- MAPLIST
if
(
Object
.
keys
(
NGrams
[
"map"
]).
length
>
0
)
{
for
(
var
ngram_id
in
NGrams
[
"main"
].
ngrams
)
{
my
Miam
Ngram
=
NGrams
[
"main"
].
ngrams
[
ngram_id
]
myNgram
=
NGrams
[
"main"
].
ngrams
[
ngram_id
]
if
(
NGrams
[
"map"
][
ngram_id
])
{
// keepstateId = 1
keepstateId
=
System
[
0
][
"statesD"
][
"keep"
]
// initialize state of maplist items
myMiamNgram
[
"state"
]
=
keepstateId
;
myNgram
[
"state"
]
=
keepstateId
;
}
else
if
(
NGrams
[
"stop"
][
ngram_id
])
{
// delstateId = 2
delstateId
=
System
[
0
][
"statesD"
][
"delete"
]
// initialize state of stoplist items
myNgram
[
"state"
]
=
delstateId
;
}
}
}
...
...
templates/pages/corpora/terms.html
View file @
043c82c9
...
...
@@ -67,14 +67,13 @@
<option
value=
'0'
>
Candidates only
</option>
<!-- <option value='1' selected="selected">Map terms only</option> -->
<option
value=
'1'
>
Map terms only
</option>
<option
value=
'2'
>
New s
topwords only
</option>
<option
value=
'2'
>
S
topwords only
</option>
</select>
</div>
</h4>
</div>
<div
id=
"terms_table"
class=
"panel-body"
>
<div
id=
"div-table"
>
<!-- (table id="my-ajax-table") dynamically set by Ngrams_dyna_chart_and_table -->
...
...
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