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
dab2307e
Commit
dab2307e
authored
Jan 07, 2015
by
Mathieu Rodic
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://delanoe.org:1979/gargantext
into mat-master
parents
f9d26fa4
eae4a399
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
25 deletions
+28
-25
views.py
gargantext_web/views.py
+1
-19
requirements.txt
init/requirements.txt
+3
-3
corpus.html
templates/corpus.html
+23
-2
subcorpus.html
templates/subcorpus.html
+1
-1
No files found.
gargantext_web/views.py
View file @
dab2307e
...
@@ -474,7 +474,7 @@ def subcorpusJSON(request, project_id, corpus_id, start , end ):
...
@@ -474,7 +474,7 @@ def subcorpusJSON(request, project_id, corpus_id, start , end ):
filtered_docs
.
append
(
doc
)
filtered_docs
.
append
(
doc
)
# ordering from most recent to the older.
# ordering from most recent to the older.
ordered
=
sorted
(
filtered_docs
,
key
=
lambda
x
:
x
.
date
,
reverse
=
True
)
ordered
=
sorted
(
filtered_docs
,
key
=
lambda
x
:
x
.
date
)
# pages of 10 elements. Like a sir.
# pages of 10 elements. Like a sir.
paginator
=
Paginator
(
ordered
,
10
)
paginator
=
Paginator
(
ordered
,
10
)
...
@@ -503,24 +503,6 @@ def subcorpusJSON(request, project_id, corpus_id, start , end ):
...
@@ -503,24 +503,6 @@ def subcorpusJSON(request, project_id, corpus_id, start , end ):
return
HttpResponse
(
serializer
.
data
,
content_type
=
'application/json'
)
return
HttpResponse
(
serializer
.
data
,
content_type
=
'application/json'
)
# for pagexample.html
from
django.core.paginator
import
Paginator
,
InvalidPage
,
EmptyPage
def
get_pagination_page
(
page
=
1
):
items
=
range
(
0
,
100
)
paginator
=
Paginator
(
items
,
10
)
try
:
page
=
int
(
page
)
except
ValueError
:
page
=
1
try
:
items
=
paginator
.
page
(
page
)
except
(
EmptyPage
,
InvalidPage
):
items
=
paginator
.
page
(
paginator
.
num_pages
)
return
items
def
delete_project
(
request
,
node_id
):
def
delete_project
(
request
,
node_id
):
Node
.
objects
.
filter
(
id
=
node_id
)
.
all
()
.
delete
()
Node
.
objects
.
filter
(
id
=
node_id
)
.
all
()
.
delete
()
...
...
init/requirements.txt
View file @
dab2307e
...
@@ -6,7 +6,7 @@ Pillow==2.5.3
...
@@ -6,7 +6,7 @@ Pillow==2.5.3
Pygments==1.6
Pygments==1.6
SQLAlchemy==0.9.8
SQLAlchemy==0.9.8
South==1.0
South==1.0
# aldjemy==0.3.51
aldjemy==0.3.10
amqp==1.4.6
amqp==1.4.6
anyjson==0.3.3
anyjson==0.3.3
billiard==3.3.0.18
billiard==3.3.0.18
...
@@ -31,9 +31,9 @@ graphviz==0.4
...
@@ -31,9 +31,9 @@ graphviz==0.4
ipython==2.2.0
ipython==2.2.0
kombu==3.0.23
kombu==3.0.23
lxml==3.3.6
lxml==3.3.6
#
matplotlib==1.4.0
matplotlib==1.4.0
networkx==1.9
networkx==1.9
#
nltk==3.0a4
nltk==3.0a4
nose==1.3.4
nose==1.3.4
numpy==1.8.2
numpy==1.8.2
pandas==0.14.1
pandas==0.14.1
...
...
templates/corpus.html
View file @
dab2307e
...
@@ -224,11 +224,32 @@ d3.csv("/chart/corpus/{{ corpus.id }}/data.csv", function (data) {
...
@@ -224,11 +224,32 @@ d3.csv("/chart/corpus/{{ corpus.id }}/data.csv", function (data) {
var
dateFormat
=
d3
.
time
.
format
(
"%Y/%m/%d"
);
var
dateFormat
=
d3
.
time
.
format
(
"%Y/%m/%d"
);
var
numberFormat
=
d3
.
format
(
".2f"
);
var
numberFormat
=
d3
.
format
(
".2f"
);
var
justdates
=
{}
data
.
forEach
(
function
(
e
)
{
data
.
forEach
(
function
(
e
)
{
e
.
dd
=
dateFormat
.
parse
(
e
.
date
);
e
.
dd
=
dateFormat
.
parse
(
e
.
date
);
e
.
month
=
d3
.
time
.
month
(
e
.
dd
);
// pre-calculate month for better performance
e
.
month
=
d3
.
time
.
month
(
e
.
dd
);
// pre-calculate month for better performance
justdates
[
e
.
date
]
=
true
;
});
});
var
orderDates
=
Object
.
keys
(
justdates
).
reverse
();
var
latest
=
orderDates
[
0
].
split
(
"/"
)
var
oldest
=
orderDates
[
orderDates
.
length
-
1
].
split
(
"/"
)
pr
(
"latest:"
)
pr
(
latest
)
pr
(
"oldest:"
)
pr
(
oldest
)
var
t0_year
=
oldest
[
0
]
var
t0_month
=
oldest
[
1
]
var
t0_day
=
oldest
[
2
]
var
t1_year
=
latest
[
0
]
var
t1_month
=
latest
[
1
]
var
t1_day
=
latest
[
2
]
// feed it through crossfilter
// feed it through crossfilter
var
ndx
=
crossfilter
(
data
);
var
ndx
=
crossfilter
(
data
);
var
all
=
ndx
.
groupAll
();
var
all
=
ndx
.
groupAll
();
...
@@ -280,7 +301,7 @@ d3.csv("/chart/corpus/{{ corpus.id }}/data.csv", function (data) {
...
@@ -280,7 +301,7 @@ d3.csv("/chart/corpus/{{ corpus.id }}/data.csv", function (data) {
.
valueAccessor
(
function
(
d
)
{
.
valueAccessor
(
function
(
d
)
{
return
d
.
value
.
avg
;
return
d
.
value
.
avg
;
})
})
.
x
(
d3
.
time
.
scale
().
domain
([
new
Date
(
1990
,
01
,
01
),
new
Date
(
2015
,
01
,
31
)]))
.
x
(
d3
.
time
.
scale
().
domain
([
new
Date
(
t0_year
,
t0_month
,
t0_day
),
new
Date
(
t1_year
,
t1_month
,
t1_day
)]))
.
round
(
d3
.
time
.
month
.
round
)
.
round
(
d3
.
time
.
month
.
round
)
.
xUnits
(
d3
.
time
.
months
)
.
xUnits
(
d3
.
time
.
months
)
.
elasticY
(
true
)
.
elasticY
(
true
)
...
@@ -310,7 +331,7 @@ d3.csv("/chart/corpus/{{ corpus.id }}/data.csv", function (data) {
...
@@ -310,7 +331,7 @@ d3.csv("/chart/corpus/{{ corpus.id }}/data.csv", function (data) {
.
group
(
volumeByMonthGroup
)
.
group
(
volumeByMonthGroup
)
.
centerBar
(
true
)
.
centerBar
(
true
)
.
gap
(
0
)
.
gap
(
0
)
.
x
(
d3
.
time
.
scale
().
domain
([
new
Date
(
1990
,
01
,
01
),
new
Date
(
2015
,
01
,
11
)]))
.
x
(
d3
.
time
.
scale
().
domain
([
new
Date
(
t0_year
,
t0_month
,
t0_day
),
new
Date
(
t1_year
,
t1_month
,
t1_day
)]))
.
round
(
d3
.
time
.
month
.
round
)
.
round
(
d3
.
time
.
month
.
round
)
.
xUnits
(
d3
.
time
.
months
)
.
xUnits
(
d3
.
time
.
months
)
.
renderlet
(
function
(
chart
)
{
.
renderlet
(
function
(
chart
)
{
...
...
templates/subcorpus.html
View file @
dab2307e
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
<ul>
<ul>
{% for doc in documents %}
{% for doc in documents %}
{% if doc.date %}
{% if doc.date %}
<li>
<b>
{{ doc.date }}
</b>
,
<a
href=
"/admin/node/document/{{doc.id}}"
>
id:{{ doc.id}} title:{{ doc.name}}
</a>
</li>
<li>
<b>
{{ doc.date }}
</b>
:
<a
target=
"_blank"
href=
"/nodeinfo/{{doc.id}}"
>
{{ doc.name}}
</a>
, @ {{ doc.metadata.source}}
</li>
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
</ul>
</ul>
...
...
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