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
37ad3d64
Commit
37ad3d64
authored
Oct 03, 2016
by
delanoe
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/romain-testing' into testing-merge
parents
4121cf5e
4f0f9e7d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
11 deletions
+26
-11
ngramlists_tools.py
gargantext/util/ngramlists_tools.py
+10
-2
extras_explorerjs.js
static/lib/graphExplorer/extras_explorerjs.js
+2
-2
settings_explorerjs.js
static/lib/graphExplorer/settings_explorerjs.js
+1
-0
methods.js
static/lib/graphExplorer/tinawebJS/methods.js
+7
-1
explorer.html
templates/graphExplorer/explorer.html
+6
-6
No files found.
gargantext/util/ngramlists_tools.py
View file @
37ad3d64
...
...
@@ -462,6 +462,9 @@ def import_ngramlists(fname, delimiter=DEFAULT_CSV_DELIM,
for
j
,
colname
in
enumerate
(
csv_row
):
if
colname
in
[
'label'
,
'status'
,
'forms'
]:
columns
[
colname
]
=
j
# skip empty columns
elif
match
(
r'^\s*$'
,
colname
):
pass
else
:
raise
ValueError
(
'Wrong header "
%
s" on line
%
i (only possible headers are "label", "forms" and "status")'
%
(
colname
,
n_read_lines
))
if
'label'
not
in
columns
:
...
...
@@ -548,7 +551,9 @@ def import_ngramlists(fname, delimiter=DEFAULT_CSV_DELIM,
imported_ngrams_dbdata
.
append
((
ngram_str
,
n_words
))
# returns a dict {term => id} and a count of inserted ones
# -------------------------
(
new_ngrams_ids
,
n_added_ng
)
=
bulk_insert_ifnotexists
(
# -------------------------
model
=
Ngram
,
uniquekey
=
'terms'
,
fields
=
(
'terms'
,
'n'
),
...
...
@@ -612,7 +617,7 @@ def merge_ngramlists(new_lists={}, onto_corpus=None, del_originals=[]):
- resolves conflicts if terms belong in different lists
> map wins over both other types
> main wins over stop
> stop never wins
> stop never wins
£TODO STOP wins over candidates from main
@param new_lists: a dict of *new* imported lists with format:
{'stop': UnweightedList,
...
...
@@ -667,7 +672,10 @@ def merge_ngramlists(new_lists={}, onto_corpus=None, del_originals=[]):
for
ng_id
in
new_lists
[
list_type
]
.
items
:
collect
(
ng_id
)
from
gargantext.util.toolchain.main
import
t
print
(
"MERGE DEBUG: starting index_new_ngrams"
,
t
())
n_added
=
index_new_ngrams
(
all_possibly_new_ngram_ids
,
onto_corpus
)
print
(
"MERGE DEBUG: finished index_new_ngrams"
,
t
())
my_log
.
append
(
"MERGE: added
%
i new ngram occurrences in docs"
%
n_added
)
...
...
@@ -677,7 +685,7 @@ def merge_ngramlists(new_lists={}, onto_corpus=None, del_originals=[]):
# DB nodes stored with same indices 0,1,2 (resp. stop, miam and map)
# find target ids of the list node objects
tgt_nodeids
=
[
onto_corpus
.
children
(
"STOPLIST"
)
.
first
()
.
id
,
onto_corpus
.
children
(
"STOPLIST"
)
.
first
()
.
id
,
# £todo via parent project?
onto_corpus
.
children
(
"MAINLIST"
)
.
first
()
.
id
,
onto_corpus
.
children
(
"MAPLIST"
)
.
first
()
.
id
]
...
...
static/lib/graphExplorer/extras_explorerjs.js
View file @
37ad3d64
...
...
@@ -89,10 +89,10 @@ function CRUD( list_id , ngram_ids , http_method , callback) {
// general listener: shift key in the window <=> add to selection
$
(
document
).
on
(
'keyup keydown'
,
function
(
e
){
// changes the global boolean ("add node to selection" status) if keydown and SHIFT
checkBox
=
e
.
shiftKey
checkBox
=
manuallyChecked
||
e
.
shiftKey
// show it in the real checkbox too
$
(
'#checkboxdiv'
).
prop
(
"checked"
,
e
.
shiftKey
)
$
(
'#checkboxdiv'
).
prop
(
"checked"
,
manuallyChecked
||
e
.
shiftKey
)
}
);
// = = = = = = = = = = = [ Clusters Plugin ] = = = = = = = = = = = //
...
...
static/lib/graphExplorer/settings_explorerjs.js
View file @
37ad3d64
...
...
@@ -169,6 +169,7 @@ var gexf;
//var zoom=0;
var
checkBox
=
false
;
var
manuallyChecked
=
false
;
var
overNodes
=
false
;
var
shift_key
=
false
;
...
...
static/lib/graphExplorer/tinawebJS/methods.js
View file @
37ad3d64
...
...
@@ -79,7 +79,13 @@ function highlightSelectedNodes(flag){
function
alertCheckBox
(
eventCheck
){
// console.log('FUN t.methods:alertCheckBox')
if
(
!
isUndef
(
eventCheck
.
checked
))
checkBox
=
eventCheck
.
checked
;
// NB: we use 2 booleans to adapt to SHIFT checking
// - var checkBox ---------> has the real box state
// - var manuallyChecked --> remembers if it was changed here
if
(
!
isUndef
(
eventCheck
.
checked
))
{
checkBox
=
eventCheck
.
checked
;
manuallyChecked
=
eventCheck
.
checked
}
}
// States:
...
...
templates/graphExplorer/explorer.html
View file @
37ad3d64
...
...
@@ -58,7 +58,7 @@
<!-- this is the tweakbar -->
<div
class=
"container-fluid navbar-default"
>
<div
id=
"defaultop"
class=
"row"
>
<div
id=
"left"
class=
"col-sm-
10 col-md-10
col-lg-7"
>
<div
id=
"left"
class=
"col-sm-
8 col-md-8
col-lg-7"
>
<ul
class=
"nav navbar-nav"
>
<!--
...
...
@@ -75,9 +75,9 @@
<button
type=
"button"
id=
"changetype"
class=
"btn btn-success btn-sm"
>
Change Type
</button>
</a></li>
<li
class=
'basicitem'
><a>
<
!-- <
li class='basicitem'><a>
<button type="button" id="changelevel" class="btn btn-info btn-sm" disabled>Change Level</button>
</a></li>
</a></li>
-->
<!-- TODO fix: category0 -> category1 switching -->
<li
class=
'basicitem'
><a>
...
...
@@ -88,10 +88,10 @@
</ul>
</a></li>
<li
class=
'basicitem'
><a>
<
!-- <
li class='basicitem'><a>
Compare<br>
<img width="30" title="Compare with other corpus!" onclick="GetUserPortfolio(); $('#corpuses').modal('show');" src="{% static "img/INTER.png" %}"></img>
</a></li>
</a></li>
-->
<li
class=
'basicitem'
><a>
<!-- TODO fix: category0 -> category1 switching -->
...
...
@@ -124,7 +124,7 @@
</ul>
</div>
<!-- /div#left -->
<div
id=
"right"
class=
"col-sm-
1 col-md-1
col-lg-4"
>
<div
id=
"right"
class=
"col-sm-
3 col-md-3
col-lg-4"
>
<div
class=
'row'
id=
"searchnav"
>
<div
class=
"col-sm-1 col-md-1 col-lg-1"
style=
"font-size:75%; line-height:90%; padding:0"
>
...
...
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