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
e8adc3d9
Commit
e8adc3d9
authored
Sep 13, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] ngrams table: add a client-side monograms/multigrams filter
parent
a272535a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
NGrams_dyna_chart_and_table.js
static/lib/gargantext/NGrams_dyna_chart_and_table.js
+17
-3
terms.html
templates/pages/corpora/terms.html
+2
-0
No files found.
static/lib/gargantext/NGrams_dyna_chart_and_table.js
View file @
e8adc3d9
...
@@ -2186,16 +2186,30 @@ function MainTableAndCharts( ngdata , initial , search_filter) {
...
@@ -2186,16 +2186,30 @@ function MainTableAndCharts( ngdata , initial , search_filter) {
// bind a filter named 'my_state_filter' to dynatable.queries.functions
// bind a filter named 'my_state_filter' to dynatable.queries.functions
MyTable
.
data
(
'dynatable'
).
queries
MyTable
.
data
(
'dynatable'
).
queries
// selects on current state <=> shows only elements of specific list
// selects on current state <=> shows only elements of specific list
//
nb: possible value are in {0,1,2}
(see terms.html > #picklistmenu)
// (see terms.html > #picklistmenu)
.
functions
[
'my_state_filter'
]
=
function
(
record
,
selectedValue
)
{
.
functions
[
'my_state_filter'
]
=
function
(
record
,
selectedValue
)
{
if
(
selectedValue
==
'reset'
)
{
if
(
selectedValue
==
'reset'
)
{
// return (AjaxRecords[record.id].state >= 0)
// return (AjaxRecords[record.id].state >= 0)
return
true
return
true
}
}
else
{
// for states, possible value are in {0,1,2}
else
if
(
selectedValue
<=
2
)
{
// return true or false
// return true or false
return
(
AjaxRecords
[
record
.
id
].
state
==
selectedValue
)
return
(
AjaxRecords
[
record
.
id
].
state
==
selectedValue
)
}
}
// for values > max_state we can also select mono/multi
else
if
(
selectedValue
==
3
)
{
// one-word terms aka monograms aka monolexical terms
return
(
AjaxRecords
[
record
.
id
][
'name'
].
indexOf
(
" "
)
==
-
1
)
}
else
if
(
selectedValue
==
4
)
{
// MWE aka multigrams aka polylexical terms
return
(
AjaxRecords
[
record
.
id
][
'name'
].
indexOf
(
" "
)
!=
-
1
)
}
else
{
console
.
error
(
"unknown value in #picklistmenu :"
,
selectedValue
)
return
true
}
}
}
// and set this filter's initial status to 'maplist' (aka state == 1)
// and set this filter's initial status to 'maplist' (aka state == 1)
...
...
templates/pages/corpora/terms.html
View file @
e8adc3d9
...
@@ -144,6 +144,8 @@ em {
...
@@ -144,6 +144,8 @@ em {
<!-- <option value='1' selected="selected">Map terms only</option> -->
<!-- <option value='1' selected="selected">Map terms only</option> -->
<option
value=
'1'
>
Map terms only
</option>
<option
value=
'1'
>
Map terms only
</option>
<option
value=
'2'
>
Stopwords only
</option>
<option
value=
'2'
>
Stopwords only
</option>
<option
value=
'3'
>
One word terms only
</option>
<option
value=
'4'
>
Multiword terms only
</option>
</select>
</select>
</div>
</div>
</h4>
</h4>
...
...
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