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
d8d27f26
Commit
d8d27f26
authored
Jun 25, 2015
by
PkSM3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UPDATE] csv parser and date-max+1
parent
1348a4af
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
5 deletions
+15
-5
views.py
gargantext_web/views.py
+6
-1
CSVParser.py
parsing/FileParsers/CSVParser.py
+5
-1
Docs_dyna_chart_and_table.js
static/js/Docs_dyna_chart_and_table.js
+2
-2
Journals_dyna_chart_and_table.js
static/js/Journals_dyna_chart_and_table.js
+1
-1
NGrams_dyna_chart_and_table.js
static/js/NGrams_dyna_chart_and_table.js
+1
-0
No files found.
gargantext_web/views.py
View file @
d8d27f26
...
...
@@ -391,7 +391,12 @@ def newpaginatorJSON(request , corpus_id):
resdict
=
{}
resdict
[
"id"
]
=
doc
.
id
resdict
[
"date"
]
=
realdate
resdict
[
"name"
]
=
doc
.
name
resdict
[
"name"
]
=
""
if
doc
.
name
and
doc
.
name
!=
""
:
resdict
[
"name"
]
=
doc
.
name
else
:
resdict
[
"name"
]
=
doc
.
hyperdata
[
"doi"
]
filtered_docs
.
append
(
resdict
)
except
Exception
as
e
:
print
(
"pag2 error01 detail:"
,
e
)
...
...
parsing/FileParsers/CSVParser.py
View file @
d8d27f26
...
...
@@ -4,6 +4,9 @@ from .FileParser import FileParser
from
..NgramsExtractors
import
*
from
datetime
import
datetime
from
io
import
BytesIO
import
csv
import
sys
csv
.
field_size_limit
(
sys
.
maxsize
)
class
CSVParser
(
FileParser
):
...
...
@@ -14,7 +17,7 @@ class CSVParser(FileParser):
import
csv
f
=
open
(
file
,
"r"
)
reader
=
csv
.
reader
(
f
)
reader
=
csv
.
reader
(
f
,
delimiter
=
'
\t
'
)
counter
=
0
for
row
in
reader
:
...
...
@@ -36,6 +39,7 @@ class CSVParser(FileParser):
pub
[
"publication_year"
]
=
"2014"
pub
[
"publication_month"
]
=
"01"
pub
[
"publication_day"
]
=
"01"
pub
[
"language_iso3"
]
=
"eng"
pub
[
"authors"
]
=
[
authors
]
hyperdata_list
.
append
(
pub
)
...
...
static/js/Docs_dyna_chart_and_table.js
View file @
d8d27f26
...
...
@@ -84,6 +84,7 @@ function Final_UpdateTable( action ) {
var
dataini
=
TheBuffer
[
0
].
toISOString
().
split
(
"T"
)[
0
]
var
datafin
=
TheBuffer
[
1
].
toISOString
().
split
(
"T"
)[
0
]
pr
(
"show me the pubs of the selected period"
)
console
.
log
(
TheBuffer
)
pr
(
"
\
tfrom ["
+
dataini
+
"] to ["
+
datafin
+
"]"
)
TimeRange
=
[]
...
...
@@ -295,8 +296,7 @@ function Main_test( Data , SearchFilter ) {
latest
=
t1
;
TheBuffer
=
[
new
Date
(
t0
[
0
],(
t0
[
1
]
-
1
),
t0
[
2
]),
new
Date
(
t1
[
0
],(
t1
[
1
]
-
1
),
t1
[
2
])];
TheBuffer
=
[
new
Date
(
t0
[
0
],(
t0
[
1
]
-
1
),
t0
[
2
]),
new
Date
(
t1
[
0
],(
t1
[
1
]
-
1
),
t1
[
2
]
+
1
)];
var
arrayd3
=
[]
for
(
var
e
in
Data
)
{
...
...
static/js/Journals_dyna_chart_and_table.js
View file @
d8d27f26
...
...
@@ -406,7 +406,7 @@ function Main_test( data , initial) {
.
title
(
function
(
d
)
{
var
value
=
d
.
value
.
avg
?
d
.
value
.
avg
:
d
.
value
;
if
(
isNaN
(
value
))
value
=
0
;
return
value
+
"
ngrams with "
+
FirstScore
+
"="
+
Number
(
d
.
key
)
;
return
value
+
"
journals with "
+
Number
(
d
.
key
)
+
" publications"
;
})
.
xAxis
();
LineChart
.
yAxis
().
ticks
(
5
)
...
...
static/js/NGrams_dyna_chart_and_table.js
View file @
d8d27f26
...
...
@@ -408,6 +408,7 @@ $("#Save_All").click(function(){
},
success
:
function
(
data
){
console
.
log
(
data
)
location
.
reload
()
},
error
:
function
(
result
)
{
console
.
log
(
"Data not found in #Save_All"
);
...
...
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