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
26af0583
Commit
26af0583
authored
Oct 05, 2016
by
delanoe
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/romain-testing' into testing
parents
5826a35c
58734474
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
19 deletions
+117
-19
NGrams_dyna_chart_and_table.js
static/lib/gargantext/NGrams_dyna_chart_and_table.js
+3
-1
myGraphs.html
templates/pages/corpora/myGraphs.html
+114
-18
No files found.
static/lib/gargantext/NGrams_dyna_chart_and_table.js
View file @
26af0583
...
@@ -2378,7 +2378,9 @@ function MainTableAndCharts( ngdata , initial , filtersParams, callerLabel) {
...
@@ -2378,7 +2378,9 @@ function MainTableAndCharts( ngdata , initial , filtersParams, callerLabel) {
// restore chart filters
// restore chart filters
if
(
typeof
(
filtersParams
.
from
)
!=
'undefined'
if
(
typeof
(
filtersParams
.
from
)
!=
'undefined'
&&
typeof
(
filtersParams
.
to
)
!=
'undefined'
)
{
&&
typeof
(
filtersParams
.
to
)
!=
'undefined'
&&
!
(
filtersParams
.
from
==
null
)
&&
!
(
filtersParams
.
to
==
null
))
{
var
fromVal
=
filtersParams
.
from
var
fromVal
=
filtersParams
.
from
var
toVal
=
filtersParams
.
to
var
toVal
=
filtersParams
.
to
...
...
templates/pages/corpora/myGraphs.html
View file @
26af0583
...
@@ -215,7 +215,7 @@
...
@@ -215,7 +215,7 @@
</div>
\
</div>
\
</div>'
</div>'
var
finishedHtml
Template
=
'
\
var
finishedHtml
Condi
=
'
\
<br>
\
<br>
\
From: begin of corpus
\
From: begin of corpus
\
, To: end of corpus
\
, To: end of corpus
\
...
@@ -224,8 +224,8 @@
...
@@ -224,8 +224,8 @@
<li>
\
<li>
\
<a href="/projects/%%project_id%%/corpora/%%corpus_id%%/explorer?cooc_id=%%cooc_id%%&distance=conditional&bridgeness=5">
\
<a href="/projects/%%project_id%%/corpora/%%corpus_id%%/explorer?cooc_id=%%cooc_id%%&distance=conditional&bridgeness=5">
\
<span class="glyphicon glyphicon-eye-open" style="font-size:150%"></span>
\
<span class="glyphicon glyphicon-eye-open" style="font-size:150%"></span>
\
~%%nb_nodes%% nodes,
\
~%%
co_
nb_nodes%% nodes,
\
~%%nb_edges%% edges
\
~%%
co_
nb_edges%% edges
\
with <b>Conditional</b> distance
\
with <b>Conditional</b> distance
\
</a>
\
</a>
\
</li>
\
</li>
\
...
@@ -238,6 +238,54 @@
...
@@ -238,6 +238,54 @@
</ul>
\
</ul>
\
<br>'
<br>'
var
finishedHtmlDistri
=
'
\
<br>
\
From: begin of corpus
\
, To: end of corpus
\
<br>
\
<ul id="graph_%%cooc_id%%_finished">
\
<li>
\
<a href="/projects/%%project_id%%/corpora/%%corpus_id%%/explorer?cooc_id=%%cooc_id%%&distance=conditional&bridgeness=5">
\
<span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span>
\
Compute this graph with Conditional distance
\
</a>
\
</li>
\
<li>
\
<a href="/projects/%%project_id%%/corpora/%%corpus_id%%/explorer?cooc_id=%%cooc_id%%&distance=conditional&bridgeness=5">
\
<span class="glyphicon glyphicon-eye-open" style="font-size:150%"></span>
\
~%%di_nb_nodes%% nodes,
\
~%%di_nb_edges%% edges
\
with <b>Distributional</b> distance
\
</a>
\
</li>
\
</ul>
\
<br>'
var
finishedHtmlTemplate
=
'
\
<br>
\
From: begin of corpus
\
, To: end of corpus
\
<br>
\
<ul id="graph_%%cooc_id%%_finished">
\
<li>
\
<a href="/projects/%%project_id%%/corpora/%%corpus_id%%/explorer?cooc_id=%%cooc_id%%&distance=conditional&bridgeness=5">
\
<span class="glyphicon glyphicon-eye-open" style="font-size:150%"></span>
\
~%%co_nb_nodes%% nodes,
\
~%%co_nb_edges%% edges
\
with <b>Conditional</b> distance
\
</a>
\
</li>
\
<li>
\
<a href="/projects/%%project_id%%/corpora/%%corpus_id%%/explorer?cooc_id=%%cooc_id%%&distance=distributional&bridgeness=5">
\
<span class="glyphicon glyphicon-eye-open" style="font-size:150%"></span>
\
~%%di_nb_nodes%% nodes,
\
~%%di_nb_edges%% edges
\
with <b>Distributional</b> distance
\
</a>
\
</li>
\
</ul>
\
<br>'
var
baseSkeletonTemplate
=
'
\
var
baseSkeletonTemplate
=
'
\
<div id="graph_%%cooc_id%%" class="graph-elt first-graph">
\
<div id="graph_%%cooc_id%%" class="graph-elt first-graph">
\
<div class="row">
\
<div class="row">
\
...
@@ -297,12 +345,15 @@
...
@@ -297,12 +345,15 @@
* @param coocId
* @param coocId
* @param coocName
* @param coocName
* @param coocDate
* @param coocDate
* @param nNodes (optional <=> if finished_status)
* @param coNbNodes (optional <=> if finished_status on conditional)
* @param nEdges (optional <=> if finished_status)
* @param coNbEdges (optional <=> if finished_status on conditional)
* @param diNbNodes (optional <=> if finished_status on distributional)
* @param diNbEdges (optional <=> if finished_status on distributional)
*/
*/
function
showNewCoocDiv
(
statusCode
,
function
showNewCoocDiv
(
statusCode
,
coocId
,
coocName
,
coocDate
,
coocId
,
coocName
,
coocDate
,
nbNodes
,
nbEdges
)
{
coNbNodes
,
coNbEdges
,
diNbNodes
,
diNbEdges
)
{
var
resultHtml
=
baseSkeletonTemplate
var
resultHtml
=
baseSkeletonTemplate
// initial if
// initial if
...
@@ -314,9 +365,22 @@
...
@@ -314,9 +365,22 @@
break
;
break
;
case
"finished_status"
:
case
"finished_status"
:
resultHtml
=
resultHtml
.
replace
(
/%%HERE_RESPONSE_DEPENDANT%%/
,
if
((
typeof
coNbNodes
!=
'undefined'
)
&&
coNbNodes
finishedHtmlTemplate
&&
(
typeof
diNbNodes
!=
'undefined'
)
&&
diNbNodes
)
{
)
resultHtml
=
resultHtml
.
replace
(
/%%HERE_RESPONSE_DEPENDANT%%/
,
finishedHtmlTemplate
)
}
else
if
((
typeof
coNbNodes
!=
'undefined'
)
&&
!
(
coNbNodes
==
null
))
{
console
.
log
(
"condi case"
,
coNbNodes
)
resultHtml
=
resultHtml
.
replace
(
/%%HERE_RESPONSE_DEPENDANT%%/
,
finishedHtmlCondi
)
}
else
if
((
typeof
diNbNodes
!=
'undefined'
)
&&
!
(
diNbNodes
==
null
))
{
console
.
log
(
"distri case"
)
resultHtml
=
resultHtml
.
replace
(
/%%HERE_RESPONSE_DEPENDANT%%/
,
finishedHtmlDistri
)
}
break
;
break
;
default
:
default
:
...
@@ -332,9 +396,13 @@
...
@@ -332,9 +396,13 @@
resultHtml
=
resultHtml
.
replace
(
/%%cooc_name%%/g
,
coocName
);
resultHtml
=
resultHtml
.
replace
(
/%%cooc_name%%/g
,
coocName
);
resultHtml
=
resultHtml
.
replace
(
/%%cooc_date%%/g
,
formatDateLikeDjango
(
coocDate
));
resultHtml
=
resultHtml
.
replace
(
/%%cooc_date%%/g
,
formatDateLikeDjango
(
coocDate
));
if
(
typeof
nbEdges
!=
'undefined'
&&
typeof
nbNodes
!=
'undefined'
)
{
if
(
typeof
coNbEdges
!=
'undefined'
&&
typeof
coNbNodes
!=
'undefined'
)
{
resultHtml
=
resultHtml
.
replace
(
/%%nb_nodes%%/g
,
nbNodes
);
resultHtml
=
resultHtml
.
replace
(
/%%co_nb_nodes%%/g
,
coNbNodes
);
resultHtml
=
resultHtml
.
replace
(
/%%nb_edges%%/g
,
nbEdges
);
resultHtml
=
resultHtml
.
replace
(
/%%co_nb_edges%%/g
,
coNbEdges
);
}
if
(
typeof
diNbEdges
!=
'undefined'
&&
typeof
diNbNodes
!=
'undefined'
)
{
resultHtml
=
resultHtml
.
replace
(
/%%di_nb_nodes%%/g
,
diNbNodes
);
resultHtml
=
resultHtml
.
replace
(
/%%di_nb_edges%%/g
,
diNbEdges
);
}
}
// what do we do with those results ?
// what do we do with those results ?
...
@@ -368,8 +436,8 @@
...
@@ -368,8 +436,8 @@
var
coocId
=
null
// 1 & 2
var
coocId
=
null
// 1 & 2
var
coocName
=
null
// 1 & 2
var
coocName
=
null
// 1 & 2
var
coocDate
=
null
// 1 & 2
var
coocDate
=
null
// 1 & 2
var
n
bNodes
=
null
// 2
var
coN
bNodes
=
null
// 2
var
n
bEdges
=
null
// 2
var
coN
bEdges
=
null
// 2
// run the "save new graph" ajax
// run the "save new graph" ajax
// -----------------------------
// -----------------------------
...
@@ -441,17 +509,45 @@
...
@@ -441,17 +509,45 @@
var
coocNodeDate
=
data
[
'date'
]
var
coocNodeDate
=
data
[
'date'
]
// test if ready like this for the moment
// test if ready like this for the moment
if
(
typeof
data
[
'hyperdata'
][
'conditional'
]
!=
"undefined"
)
{
if
((
typeof
data
[
'hyperdata'
][
'conditional'
]
!=
"undefined"
)
&&
(
typeof
data
[
'hyperdata'
][
'distributional'
]
!=
"undefined"
)){
console
.
log
(
"GRAPH is READY"
,
coocNodeId
)
console
.
log
(
"GRAPH is READY"
,
coocNodeId
)
graphReadyFlag
=
true
graphReadyFlag
=
true
var
nbNodes
=
data
[
'hyperdata'
][
'conditional'
][
'nodes'
]
var
coNbNodes
=
data
[
'hyperdata'
][
'conditional'
][
'nodes'
]
var
nbEdges
=
data
[
'hyperdata'
][
'conditional'
][
'edges'
]
var
coNbEdges
=
data
[
'hyperdata'
][
'conditional'
][
'edges'
]
var
diNbNodes
=
data
[
'hyperdata'
][
'distributional'
][
'nodes'
]
var
diNbEdges
=
data
[
'hyperdata'
][
'distributional'
][
'edges'
]
// console.warn("running callback for graph id:" + coocNodeId)
// console.warn("running callback for graph id:" + coocNodeId)
showNewCoocDiv
(
"finished_status"
,
coocNodeId
,
showNewCoocDiv
(
"finished_status"
,
coocNodeId
,
coocNodeName
,
coocNodeDate
,
coocNodeName
,
coocNodeDate
,
nbNodes
,
nbEdges
)
coNbNodes
,
coNbEdges
,
diNbNodes
,
diNbEdges
)
}
else
if
(
typeof
data
[
'hyperdata'
][
'conditional'
]
!=
"undefined"
){
console
.
log
(
"conditional GRAPH is READY"
,
coocNodeId
)
graphReadyFlag
=
true
var
coNbNodes
=
data
[
'hyperdata'
][
'conditional'
][
'nodes'
]
var
coNbEdges
=
data
[
'hyperdata'
][
'conditional'
][
'edges'
]
// console.warn("running callback for graph id:" + coocNodeId)
showNewCoocDiv
(
"finished_status"
,
coocNodeId
,
coocNodeName
,
coocNodeDate
,
coNbNodes
,
coNbEdges
,
null
,
null
)
}
else
if
(
typeof
data
[
'hyperdata'
][
'distributional'
]
!=
"undefined"
){
console
.
log
(
"distributional GRAPH is READY"
,
coocNodeId
)
graphReadyFlag
=
true
var
diNbNodes
=
data
[
'hyperdata'
][
'distributional'
][
'nodes'
]
var
diNbEdges
=
data
[
'hyperdata'
][
'distributional'
][
'edges'
]
// console.warn("running callback for graph id:" + coocNodeId)
showNewCoocDiv
(
"finished_status"
,
coocNodeId
,
coocNodeName
,
coocNodeDate
,
null
,
null
,
diNbNodes
,
diNbEdges
)
}
}
// stopping conditions
// stopping conditions
...
...
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