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
0c694226
Commit
0c694226
authored
Apr 08, 2016
by
delanoe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] Temporal Graph implemented. Ok.
parent
461caaf9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
30 deletions
+58
-30
hyperdata.py
gargantext/models/hyperdata.py
+1
-1
cooccurrences.py
graphExplorer/cooccurrences.py
+20
-27
menu.html
templates/pages/menu.html
+37
-2
No files found.
gargantext/models/hyperdata.py
View file @
0c694226
...
@@ -5,7 +5,7 @@ from .nodes import Node
...
@@ -5,7 +5,7 @@ from .nodes import Node
import
datetime
import
datetime
__all__
=
[
'NodeHyperdata'
]
__all__
=
[
'NodeHyperdata'
,
'HyperdataKey'
]
class
classproperty
(
object
):
class
classproperty
(
object
):
...
...
graphExplorer/cooccurrences.py
View file @
0c694226
from
gargantext.models
import
Node
,
Ngram
,
NodeNgram
,
NodeNgramNgram
,
\
from
gargantext.models
import
Node
,
Ngram
,
NodeNgram
,
NodeNgramNgram
,
\
NodeHyperdata
NodeHyperdata
,
HyperdataKey
from
gargantext.util.db
import
session
,
aliased
,
bulk_insert
,
func
from
gargantext.util.db
import
session
,
aliased
,
bulk_insert
,
func
from
gargantext.util.lists
import
WeightedMatrix
,
UnweightedList
,
Translations
from
gargantext.util.lists
import
WeightedMatrix
,
UnweightedList
,
Translations
...
@@ -144,15 +144,11 @@ def countCooccurrences( corpus=None
...
@@ -144,15 +144,11 @@ def countCooccurrences( corpus=None
date_start_utc
=
date_start
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
date_start_utc
=
date_start
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
Start
=
aliased
(
NodeHyperdata
)
Start
=
aliased
(
NodeHyperdata
)
StartFormat
=
aliased
(
Hyperdata
)
cooc_query
=
(
cooc_query
.
join
(
Start
cooc_query
=
(
cooc_query
.
join
(
Start
,
Start
.
node_id
==
Node
.
id
,
Start
.
node_id
==
Node
.
id
)
)
.
join
(
StartFormat
.
filter
(
Start
.
key
==
'publication_date'
)
,
StartFormat
.
id
==
Start
.
hyperdata_id
.
filter
(
Start
.
value_utc
>=
date_start_utc
)
)
.
filter
(
StartFormat
.
name
==
'publication_date'
)
.
filter
(
Start
.
value_datetime
>=
date_start_utc
)
)
)
...
@@ -162,15 +158,12 @@ def countCooccurrences( corpus=None
...
@@ -162,15 +158,12 @@ def countCooccurrences( corpus=None
date_end_utc
=
date_end
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
date_end_utc
=
date_end
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
End
=
aliased
(
NodeHyperdata
)
End
=
aliased
(
NodeHyperdata
)
EndFormat
=
aliased
(
Hyperdata
)
cooc_query
=
(
cooc_query
.
join
(
End
cooc_query
=
(
cooc_query
.
join
(
End
,
End
.
node_id
==
Node
.
id
,
End
.
node_id
==
Node
.
id
)
)
.
join
(
EndFormat
.
filter
(
End
.
key
==
'publication_date'
)
,
EndFormat
.
id
==
End
.
hyperdata_id
.
filter
(
End
.
value_utc
<=
date_end_utc
)
)
.
filter
(
EndFormat
.
name
==
'publication_date'
)
.
filter
(
End
.
value_datetime
<=
date_end_utc
)
)
)
...
...
templates/pages/menu.html
View file @
0c694226
...
@@ -94,10 +94,10 @@
...
@@ -94,10 +94,10 @@
<!-- FIXME a pop up for advanced mode of graphs --!>
<!-- FIXME a pop up for advanced mode of graphs --!>
<a type="button" class="btn btn-default
<a type="button" class="btn btn-default
{% if view == "conditional" %}active{%endif%}"
{% if view == "conditional" %}active{%endif%}"
href="/projects/{{project.id}}/corpora/{{ corpus.id }}/explorer?field1=ngrams&field2=ngrams&distance=conditional&bridgeness=5"
>Graphs (Conditional)</a>
data-url="/projects/{{project.id}}/corpora/{{ corpus.id }}/explorer?field1=ngrams&field2=ngrams&distance=conditional&bridgeness=5" onclick='gotoexplorer(this)'
>Graphs (Conditional)</a>
<a type="button" class="btn btn-default
<a type="button" class="btn btn-default
{% if view == "distributional" %}active{%endif%}"
{% if view == "distributional" %}active{%endif%}"
href="/projects/{{project.id}}/corpora/{{ corpus.id }}/explorer?field1=ngrams&field2=ngrams&distance=distributional&bridgeness=5"
>Graphs (Distributional)</a>
data-url="/projects/{{project.id}}/corpora/{{ corpus.id }}/explorer?field1=ngrams&field2=ngrams&distance=distributional&bridgeness=5" onclick='gotoexplorer(this)'
>Graphs (Distributional)</a>
<!--
<!--
<a type="button" class="btn btn-default
<a type="button" class="btn btn-default
{% if view == "journalTerms" %}active{%endif%}"
{% if view == "journalTerms" %}active{%endif%}"
...
@@ -198,6 +198,37 @@
...
@@ -198,6 +198,37 @@
});});
});});
</script>
</script>
<script
type=
"text/javascript"
>
function
gotoexplorer
(
elem
)
{
var
url_
=
$
(
elem
).
data
(
"url"
)
if
(
TheBuffer
==
false
)
return
window
.
open
(
url_
,
'_blank'
);
var
current_timerange
=
TheBuffer
var
time_limits
=
[
new
Date
(
oldest
[
0
],
oldest
[
1
]
-
1
,
oldest
[
2
]),
new
Date
(
latest
[
0
],
latest
[
1
]
-
1
,
latest
[
2
]
)
];
time_limits
[
0
]
=
new
Date
(
time_limits
[
0
].
setDate
(
time_limits
[
0
].
getDate
()
-
1
)
);
time_limits
[
1
]
=
new
Date
(
time_limits
[
1
].
setDate
(
time_limits
[
1
].
getDate
()
+
1
)
);
if
(
(
+
current_timerange
[
0
]
===+
time_limits
[
0
]
)
&&
(
+
current_timerange
[
1
]
===+
time_limits
[
1
]
)
)
{
url_
=
url_
// rien
}
else
{
var
start__
=
new
Date
(
current_timerange
[
0
].
setDate
(
current_timerange
[
0
].
getDate
()
+
1
)
);
var
end__
=
new
Date
(
current_timerange
[
1
].
setDate
(
current_timerange
[
1
].
getDate
()
-
1
)
);
var
start_
=
start__
.
getFullYear
()
+
"-"
+
(
start__
.
getMonth
()
+
1
)
+
"-"
+
(
start__
.
getDay
()
+
1
)
var
end_
=
end__
.
getFullYear
()
+
"-"
+
(
end__
.
getMonth
()
+
1
)
+
"-"
+
(
end__
.
getDay
()
+
1
)
url_
+=
"&start="
+
start_
+
"&end="
+
end_
;
// url_ += "&start=" + start__.getFullYear() + "&end="+end__.getFullYear();
}
return
window
.
open
(
url_
,
'_blank'
);
}
</script>
{% if debug == False %}
{% if debug == False %}
<!-- Piwik -->
<!-- Piwik -->
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
...
@@ -222,3 +253,7 @@
...
@@ -222,3 +253,7 @@
</body>
</body>
</html>
</html>
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