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
f6cb0f71
Commit
f6cb0f71
authored
Jun 18, 2015
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'samuel' into merge
parents
fae79313
15dbf721
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
342 additions
and
241 deletions
+342
-241
urls.py
gargantext_web/urls.py
+6
-4
ISTex.py
parsing/FileParsers/ISTex.py
+11
-4
views.py
scrappers/scrap_pubmed/views.py
+1
-1
Docs_dyna_chart_and_table.js
static/js/Docs_dyna_chart_and_table.js
+250
-196
NGrams_dyna_chart_and_table.js
static/js/NGrams_dyna_chart_and_table.js
+7
-9
documents.html
templates/corpus/documents.html
+61
-25
journals.html
templates/corpus/journals.html
+2
-0
terms.html
templates/corpus/terms.html
+2
-0
views.py
tests/ngramstable/views.py
+2
-2
No files found.
gargantext_web/urls.py
View file @
f6cb0f71
...
...
@@ -54,9 +54,9 @@ urlpatterns = patterns('',
url
(
r'^project/(\d+)/corpus/(\d+)/journals/journals.json$'
,
corpus_views
.
test_journals
),
url
(
r'^project/(\d+)/corpus/(\d+)/journals'
,
corpus_views
.
get_journals
),
# Terms view
url
(
r'^project/(\d+)/corpus/(\d+)/terms/ngrams.json$'
,
corpus_views
.
test_ngrams
),
url
(
r'^project/(\d+)/corpus/(\d+)/terms'
,
corpus_views
.
get_ngrams
),
#
#
Terms view
#
url(r'^project/(\d+)/corpus/(\d+)/terms/ngrams.json$', corpus_views.test_ngrams),
#
url(r'^project/(\d+)/corpus/(\d+)/terms', corpus_views.get_ngrams),
# Update corpus
url
(
r'^project/(\d+)/corpus/(\d+)/(\w+)/update$'
,
views
.
update
),
...
...
@@ -108,7 +108,9 @@ urlpatterns = patterns('',
url
(
r'^tests/project/(\d+)/ISTEXquery/go$'
,
pubmedscrapper
.
testISTEX
),
url
(
r'^tests/paginator/corpus/(\d+)/$'
,
views
.
newpaginatorJSON
),
url
(
r'^tests/move2trash/$'
,
views
.
move_to_trash_multiple
),
url
(
r'^corpus/(\d+)/document/(\d+)/testpage$'
,
samtest
.
test_test
)
url
(
r'^corpus/(\d+)/document/(\d+)/testpage$'
,
samtest
.
test_test
),
url
(
r'^project/(\d+)/corpus/(\d+)/terms/ngrams.json$'
,
samtest
.
test_ngrams
),
url
(
r'^project/(\d+)/corpus/(\d+)/terms'
,
samtest
.
get_ngrams
)
)
...
...
parsing/FileParsers/ISTex.py
View file @
f6cb0f71
...
...
@@ -19,7 +19,7 @@ class ISTex(FileParser):
"source"
:
'corpusName'
,
"title"
:
'title'
,
"genre"
:
"genre"
,
# "language_iso3" : 'MedlineCitation/Article/L
anguage',
"language_iso3"
:
'l
anguage'
,
"doi"
:
'doi'
,
"host"
:
'host'
,
"publication_date"
:
'pubdate'
,
...
...
@@ -34,11 +34,13 @@ class ISTex(FileParser):
try
:
# print(path," ==> ",len(json_doc[path]))
hyperdata
[
key
]
=
json_doc
[
path
]
except
:
pass
except
:
pass
# print("|",hyperdata["
publication_date
"])
# print("|",hyperdata["
language_iso3
"])
if
"doi"
in
hyperdata
:
hyperdata
[
"doi"
]
=
hyperdata
[
"doi"
][
0
]
if
"doi"
in
hyperdata
:
hyperdata
[
"doi"
]
=
hyperdata
[
"doi"
][
0
]
keywords
=
[]
if
"keywords"
in
hyperdata
:
...
...
@@ -75,6 +77,11 @@ class ISTex(FileParser):
if
"genre"
in
hyperdata
:
if
len
(
hyperdata
[
"genre"
])
==
0
:
hyperdata
.
pop
(
"genre"
)
if
"language_iso3"
in
hyperdata
:
if
len
(
hyperdata
[
"language_iso3"
])
>
0
:
hyperdata
[
"language_iso3"
]
=
hyperdata
[
"language_iso3"
][
0
]
else
:
hyperdata
[
"language_iso3"
]
=
"eng"
RealDate
=
hyperdata
[
"publication_date"
]
if
"publication_date"
in
hyperdata
:
hyperdata
.
pop
(
"publication_date"
)
...
...
scrappers/scrap_pubmed/views.py
View file @
f6cb0f71
...
...
@@ -66,7 +66,7 @@ def getGlobalStatsISTEXT(request ):
print
(
"LOG::TIME:_ "
+
datetime
.
datetime
.
now
()
.
isoformat
()
+
" query ="
,
query
)
print
(
"LOG::TIME:_ "
+
datetime
.
datetime
.
now
()
.
isoformat
()
+
" N ="
,
N
)
query_string
=
query
.
replace
(
" "
,
"+"
)
url
=
"http://api.istex.fr/document/?q="
+
query_string
url
=
"http://api.istex.fr/document/?q="
+
query_string
+
"&output=id,title,abstract,pubdate,corpusName,authors,language"
tasks
=
MedlineFetcher
()
...
...
static/js/Docs_dyna_chart_and_table.js
View file @
f6cb0f71
This diff is collapsed.
Click to expand it.
static/js/NGrams_dyna_chart_and_table.js
View file @
f6cb0f71
...
...
@@ -370,15 +370,18 @@ $("#Clean_All").click(function(){
});
$
(
"#Save_All"
).
click
(
function
(){
console
.
log
(
"click in save all 01"
)
var
sum__selected_elems
=
0
;
var
poubelle
=
[]
for
(
var
i
in
FlagsBuffer
)
if
(
Object
.
keys
(
FlagsBuffer
[
i
]).
length
==
0
)
poubelle
.
push
(
i
)
for
(
var
i
in
FlagsBuffer
)
{
if
(
Object
.
keys
(
FlagsBuffer
[
i
]).
length
==
0
)
poubelle
.
push
(
i
)
sum__selected_elems
+=
Object
.
keys
(
FlagsBuffer
[
i
]).
length
;
}
console
.
log
(
"click in save all 02"
)
for
(
var
i
in
poubelle
)
delete
FlagsBuffer
[
poubelle
[
i
]];
console
.
log
(
"click in save all 03, sum:"
+
sum__selected_elems
)
if
(
sum__selected_elems
>
0
)
{
console
.
log
(
""
)
console
.
log
(
"Do the ajax conexion with API and send this array to be processed:"
)
...
...
@@ -498,11 +501,6 @@ function Main_test( data , initial) {
oldest
=
Number
(
min_occ
);
latest
=
Number
(
max_occ
);
var
ndx
=
false
;
ndx
=
crossfilter
();
ndx
.
add
(
DistributionList
);
...
...
templates/corpus/documents.html
View file @
f6cb0f71
...
...
@@ -4,7 +4,7 @@
{% load staticfiles %}
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static "
css
/
bootstrap
.
css
"
%}"
>
<
link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static "
js
/
bootstrap
/
bootstrap-select
.
min
.
css
"
%}"
>
<
!-- here goes import stylesheet js/bootstrap/bootstrap-multiselect.css, mais ca marche pas--
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static "
css
/
morris
.
css
"
%}"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static "
css
/
jquery
.
easy-pie-chart
.
css
"%}"
>
...
...
@@ -72,6 +72,7 @@ th a {
<input
type=
"hidden"
id=
"list_id"
value=
"{{ list_id }}"
></input>
<div
class=
"container"
>
<div
class=
"jumbotron"
>
...
...
@@ -87,18 +88,7 @@ th a {
</div>
<div
id=
"collapseOne"
class=
"panel-collapse collapse no-transition"
role=
"tabpanel"
>
<div
class=
"panel-body"
>
<p
align=
"right"
>
<table
id=
"my-ajax-table"
class=
"table table-bordered"
>
<thead>
<!-- <th data-dynatable-column="id">ID</th> -->
<th
width=
"100px;"
data-dynatable-column=
"date"
>
Date
</th>
<th
data-dynatable-column=
"name"
>
Title
</th>
<th
data-dynatable-column=
"del"
data-dynatable-no-sort=
"true"
>
Trash
</th>
</thead>
<tbody>
</tbody>
</table>
</p>
<div
id=
"div-table"
></div>
<p
align=
"right"
>
<button
id=
"move2trash"
class=
"btn btn-primary btn-lg"
>
Trash It!
</button>
</p>
...
...
@@ -111,24 +101,70 @@ th a {
</div>
</div>
<div
id=
"supmofos"
>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"col-md-4"
>
<div
class=
"jumbotron"
>
<h3><a
href=
"/project/{{project.id}}/corpus/{{corpus.id}}/chart"
>
Advanced charts
</a></h3>
<ol>
<li>
Count
</li>
<!-- read, compute -->
<li>
Filter
</li>
<!-- count, compute -->
<li>
Compare
</li>
<!-- select, cut -->
</ol>
<h4><a
href=
"/project/{{project.id}}/corpus/{{corpus.id}}/"
>
Back to corpus
</a></h3>
</div>
</div>
<div
class=
"col-md-4"
>
<div
class=
"jumbotron"
>
<!-- <h3><a href="/project/{{project.id}}/corpus/{{corpus.id}}/matrix">Matrix</a></h3> -->
<h3>
Matrix (soon)
</h3>
<ol>
<li>
Sort
</li>
<li>
Group
</li>
<li>
Cluster
</li>
</ol>
<h4><a
href=
"/project/{{project.id}}/corpus/{{corpus.id}}/"
>
Back to corpus
</a></h3>
</div>
</div>
<div
class=
"col-md-4"
>
<div
class=
"jumbotron"
>
{% if processing > 0 %}
<h3>
<img
width=
"20px"
src=
"{% static "
js
/
libs
/
img2
/
loading-bar
.
gif
"
%}"
></img>
Graph (later)
</h3>
{% else %}
<h3><a
href=
"/project/{{project.id}}/corpus/{{ corpus.id }}/explorer"
>
Graph
</a></h3>
{% endif %}
<ol>
<li>
Visualize
</li>
<li>
Explore
</li>
<li>
Read
</li>
</ol>
<h4><a
href=
"/project/{{project.id}}/corpus/{{corpus.id}}/"
>
Back to corpus
</a></h3>
</div>
</div>
</div>
</div>
<select
data-width=
"100px"
dir=
"ltr"
class=
"selectpicker"
>
<option
selected
>
All
</option>
<option>
Title
</option>
<option>
Date
</option>
<optgroup
label=
"Duplicates"
>
<option>
by DOI
</option>
<option>
by Title
</option>
</optgroup>
</select>
<div
id=
"filter_search"
style=
"visibility:hidden"
>
<select
id=
"example-single-optgroups"
onchange=
"SearchFilters(this);"
>
<!-- <optgroup label=""> -->
<option
id=
"filter_all"
value=
"filter_all"
>
All
</option>
<!-- <option id="filter_title" value="filter_title">Title</option> -->
<!-- <option id="filter_date" value="filter_date">Date</option> -->
<!-- </optgroup> -->
<!-- <optgroup label="Duplicates"> -->
<!-- <option value="filter_doi">By DOI</option> -->
<option
id=
"filter_dupl-titles"
value=
"filter_dupl-titles"
>
Duplicates by Title
</option>
<!-- </optgroup> -->
</select>
</div>
<script
type=
"text/javascript"
src=
"{% static "
js
/
jquery
/
jquery
.
min
.
js
"
%}"
></script>
<script
src=
"{% static "
js
/
charts
/
bootstrap
.
min
.
js
"
%}"
></script>
<
script
type=
"text/javascript"
src=
"{% static "
js
/
bootstrap
/
bootstrap-select
.
min
.
js
"
%}"
></script
>
<
!-- here goes import script js/bootstrap/bootstrap-multiselect.js, mais ca marche pas--
>
<script
type=
"text/javascript"
src=
"{% static "
js
/
jquery
/
jquery
.
dynatable
.
js
"
%}"
></script>
<!-- custom-lib for dynatable.js and dc.js -->
...
...
templates/corpus/journals.html
View file @
f6cb0f71
...
...
@@ -110,6 +110,8 @@ input[type=radio]:checked + label {
{% endblock %}
<input
type=
"hidden"
id=
"list_id"
value=
"{{ list_id }}"
></input>
{% block content %}
<div
class=
"container"
>
<div
class=
"container"
>
...
...
templates/corpus/terms.html
View file @
f6cb0f71
...
...
@@ -114,6 +114,8 @@ input[type=radio]:checked + label {
{% block content %}
<input
type=
"hidden"
id=
"list_id"
value=
"{{ list_id }}"
></input>
<div
class=
"container"
>
<div
class=
"container"
>
...
...
tests/ngramstable/views.py
View file @
f6cb0f71
...
...
@@ -100,7 +100,7 @@ def get_ngrams(request , project_id , corpus_id ):
except
ValueError
:
raise
Http404
()
t
=
get_template
(
'
tests/ngra
ms.html'
)
t
=
get_template
(
'
corpus/ter
ms.html'
)
user
=
cache
.
User
[
request
.
user
.
username
]
.
id
date
=
datetime
.
datetime
.
now
()
...
...
@@ -173,7 +173,7 @@ def get_journals(request , project_id , corpus_id ):
except
ValueError
:
raise
Http404
()
t
=
get_template
(
'
test
s/journals.html'
)
t
=
get_template
(
'
corpu
s/journals.html'
)
user
=
cache
.
User
[
request
.
user
.
username
]
.
id
date
=
datetime
.
datetime
.
now
()
...
...
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