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
e6e3c221
Commit
e6e3c221
authored
Oct 06, 2015
by
delanoe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:PkSM3/garg
parents
d6cbccbd
e0e0f171
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
108 additions
and
11 deletions
+108
-11
extras_explorerjs.js
extras_explorerjs.js
+98
-1
settings_explorerjs.js
settings_explorerjs.js
+1
-1
sigma.parseCustom.js
tinawebJS/sigma.parseCustom.js
+9
-9
No files found.
extras_explorerjs.js
View file @
e6e3c221
...
@@ -210,7 +210,50 @@ function genericGetTopPapers(theids , corpus_id , thediv) {
...
@@ -210,7 +210,50 @@ function genericGetTopPapers(theids , corpus_id , thediv) {
});
});
}
}
//DataFolderMode
function
TestFunction
()
{
//http://localhost:8000/api/corpusintersection/1a50317a50145
var
jquerytemplatenb
=
$
(
"#jquerytemplatenb"
).
html
()
var
corpuses
=
$
(
'input[name=optradio]:checked'
)[
0
];
if
(
isUndef
(
corpuses
))
return
false
;
var
pageurl
=
window
.
location
.
href
.
split
(
"/"
)
var
cid
;
for
(
var
i
in
pageurl
)
{
if
(
pageurl
[
i
]
==
"corpus"
)
{
cid
=
parseInt
(
i
);
break
;
}
}
var
corpus_id
=
pageurl
[
cid
+
1
];
pr
(
""
)
pr
(
"!!!!!!! DEBUGGING !!!!!!!"
)
// pr(jquerytemplatenb)
// pr(corpuses.id)
// pr(corpus_id)
var
theids
=
[
jquerytemplatenb
,
corpus_id
,
corpuses
.
id
]
var
query_url
=
window
.
location
.
origin
+
'/api/corpusintersection/'
+
corpus_id
+
'/'
+
theids
.
join
(
"a"
)
pr
(
query_url
)
pr
(
"!!!!!!! !!!!!!! !!!!!!! !!!!!!!"
)
pr
(
""
)
// $.ajax({
// type: 'GET',
// url: window.location.origin+'/api/corpusintersection/'+corpus_id+'/'+theids.join("a"),
// //contentType: "application/json",
// //dataType: 'json',
// success : function(data){
// console.log(data)
// },
// error: function(){
// pr('Page Not found: TestFunction()');
// }
// });
}
// Uses: genericGetTopPapers()
function
getTopPapers
(
type
){
function
getTopPapers
(
type
){
if
(
getAdditionalInfo
){
if
(
getAdditionalInfo
){
...
@@ -238,6 +281,13 @@ function getTopPapers(type){
...
@@ -238,6 +281,13 @@ function getTopPapers(type){
pr
(
"the IDs of the selectioons"
)
pr
(
"the IDs of the selectioons"
)
pr
(
theids
)
pr
(
theids
)
pr
(
""
)
pr
(
"!!!!!!! DEBUGGING !!!!!!!"
)
pr
(
window
.
location
.
origin
+
'/api/tfidf/'
+
corpus_id
+
'/'
+
theids
.
join
(
"a"
))
pr
(
"!!!!!!! !!!!!!! !!!!!!! !!!!!!!"
)
pr
(
""
)
$
.
ajax
({
$
.
ajax
({
type
:
'GET'
,
type
:
'GET'
,
url
:
window
.
location
.
origin
+
'/api/tfidf/'
+
corpus_id
+
'/'
+
theids
.
join
(
"a"
),
url
:
window
.
location
.
origin
+
'/api/tfidf/'
+
corpus_id
+
'/'
+
theids
.
join
(
"a"
),
...
@@ -311,7 +361,9 @@ function getTopPapers(type){
...
@@ -311,7 +361,9 @@ function getTopPapers(type){
}
}
}
}
// NOT-USED
function
printCorpuses
()
{
function
printCorpuses
()
{
console
.
log
(
"!!!!!!!! in printCorpuses() !!!!!!!! "
)
var
corpuses
=
$
(
'input[name=optradio]:checked'
);
var
corpuses
=
$
(
'input[name=optradio]:checked'
);
var
count
=
3
var
count
=
3
for
(
var
c
in
corpuses
)
{
for
(
var
c
in
corpuses
)
{
...
@@ -355,6 +407,51 @@ function printCorpuses() {
...
@@ -355,6 +407,51 @@ function printCorpuses() {
console
.
log
(
" - - -- -- - "
)
console
.
log
(
" - - -- -- - "
)
console
.
log
(
corpusesList
)
console
.
log
(
corpusesList
)
var
theids
=
[]
var
pageurl
=
window
.
location
.
href
.
split
(
"/"
)
var
cid
;
for
(
var
i
in
pageurl
)
{
if
(
pageurl
[
i
]
==
"corpus"
)
{
cid
=
parseInt
(
i
);
break
;
}
}
var
corpus_id
=
pageurl
[
cid
+
1
];
theids
.
push
(
corpus_id
)
for
(
var
corpora
in
corpusesList
)
{
console
.
log
(
"other corpus_id:"
)
console
.
log
(
corpora
)
theids
.
push
(
corpora
)
break
}
console
.
log
(
"the two corpuses:"
)
console
.
log
(
theids
)
$
.
ajax
({
type
:
'GET'
,
url
:
window
.
location
.
origin
+
'/api/corpusintersection/'
+
theids
.
join
(
"a"
),
//contentType: "application/json",
//dataType: 'json',
success
:
function
(
data
){
var
nodes
=
getVisibleNodes
()
for
(
var
n
in
nodes
)
{
if
(
data
[
nodes
[
n
].
id
])
{
nodes
[
n
].
color
=
"#ff0000"
;
}
}
partialGraph
.
draw
()
},
error
:
function
(){
pr
(
'Page Not found: printCorpuses()'
);
}
});
}
}
...
...
settings_explorerjs.js
View file @
e6e3c221
...
@@ -9,7 +9,7 @@ var getAdditionalInfo=true;//for topPapers div
...
@@ -9,7 +9,7 @@ var getAdditionalInfo=true;//for topPapers div
var
mainfile
=
false
;
var
mainfile
=
false
;
getUrlParam
.
file
=
window
.
location
.
origin
+
"/"
+
$
(
"#graphid"
).
html
();
getUrlParam
.
file
=
window
.
location
.
origin
+
"/
static/node_link.json"
;
//window.location.origin+"/
"+$("#graphid").html();
var
corpusesList
=
{}
var
corpusesList
=
{}
var
dataFolderTree
=
{};
var
dataFolderTree
=
{};
...
...
tinawebJS/sigma.parseCustom.js
View file @
e6e3c221
...
@@ -680,8 +680,8 @@ function parseSimpleJSON( data , seed ) {
...
@@ -680,8 +680,8 @@ function parseSimpleJSON( data , seed ) {
pk
=
(
isUndef
(
nodesNodes
[
i
].
pk
))?
""
:
nodesNodes
[
i
].
pk
;
pk
=
(
isUndef
(
nodesNodes
[
i
].
pk
))?
""
:
nodesNodes
[
i
].
pk
;
color
=
(
isUndef
(
nodesNodes
[
i
].
color
))?
"#800000"
:
nodesNodes
[
i
].
color
;
color
=
(
isUndef
(
nodesNodes
[
i
].
color
))?
"#800000"
:
nodesNodes
[
i
].
color
;
label
=
(
isUndef
(
nodesNodes
[
i
].
label
))
?
(
"node_"
+
i
):
nodesNodes
[
i
].
label
;
label
=
(
(
isUndef
(
nodesNodes
[
i
].
label
))
?
(
"node_"
+
i
):
nodesNodes
[
i
].
label
)
+
""
;
size
=
(
isUndef
(
nodesNodes
[
i
].
size
))?
1
:
nodesNodes
[
i
].
size
;
size
=
Number
((
isUndef
(
nodesNodes
[
i
].
size
))?
1
:
nodesNodes
[
i
].
size
)
;
group
=
(
isUndef
(
nodesNodes
[
i
].
group
))?
1
:
nodesNodes
[
i
].
group
;
group
=
(
isUndef
(
nodesNodes
[
i
].
group
))?
1
:
nodesNodes
[
i
].
group
;
// iscluster = (isUndef(nodesNodes[i].hidden))?false:nodesNodes[i].hidden;
// iscluster = (isUndef(nodesNodes[i].hidden))?false:nodesNodes[i].hidden;
// if (iscluster==1) {
// if (iscluster==1) {
...
@@ -692,7 +692,7 @@ function parseSimpleJSON( data , seed ) {
...
@@ -692,7 +692,7 @@ function parseSimpleJSON( data , seed ) {
var
node
=
({
var
node
=
({
id
:
pk
,
id
:
pk
,
label
:
label
,
label
:
label
,
size
:
Math
.
log
(
size
),
size
:
Math
.
log
(
size
+
1
),
x
:
rand
.
getRandom
(),
x
:
rand
.
getRandom
(),
y
:
rand
.
getRandom
(),
y
:
rand
.
getRandom
(),
type
:
catSoc
,
type
:
catSoc
,
...
@@ -703,13 +703,13 @@ function parseSimpleJSON( data , seed ) {
...
@@ -703,13 +703,13 @@ function parseSimpleJSON( data , seed ) {
lock
:
false
,
lock
:
false
,
iscluster
:
false
iscluster
:
false
});
// The graph node
});
// The graph node
// pr(node
)
pr
(
node
.
color
)
Nodes
[
pk
]
=
node
;
Nodes
[
pk
]
=
node
;
if
(
parseInt
(
node
.
size
)
<
parseInt
(
minNodeSize
))
minNodeSize
=
node
.
size
;
if
(
parseInt
(
node
.
size
)
<
parseInt
(
minNodeSize
))
minNodeSize
=
node
.
size
;
if
(
parseInt
(
node
.
size
)
>
parseInt
(
maxNodeSize
))
maxNodeSize
=
node
.
size
;
if
(
parseInt
(
node
.
size
)
>
parseInt
(
maxNodeSize
))
maxNodeSize
=
node
.
size
;
}
}
pr
(
"IMAFJAIJOAJSODJASKJD 01"
)
for
(
var
i
in
Nodes
){
for
(
var
i
in
Nodes
){
normalizedSize
=
desirableNodeSizeMIN
+
(
Nodes
[
i
].
size
-
1
)
*
((
desirableNodeSizeMAX
-
desirableNodeSizeMIN
)
/
(
parseInt
(
maxNodeSize
)
-
parseInt
(
minNodeSize
)));
normalizedSize
=
desirableNodeSizeMIN
+
(
Nodes
[
i
].
size
-
1
)
*
((
desirableNodeSizeMAX
-
desirableNodeSizeMIN
)
/
(
parseInt
(
maxNodeSize
)
-
parseInt
(
minNodeSize
)));
...
@@ -748,7 +748,6 @@ function parseSimpleJSON( data , seed ) {
...
@@ -748,7 +748,6 @@ function parseSimpleJSON( data , seed ) {
idS
=
Nodes
[
edge
.
sourceID
].
type
;
idS
=
Nodes
[
edge
.
sourceID
].
type
;
idT
=
Nodes
[
edge
.
targetID
].
type
;
idT
=
Nodes
[
edge
.
targetID
].
type
;
if
(
idS
==
catSoc
&&
idT
==
catSoc
)
{
if
(
idS
==
catSoc
&&
idT
==
catSoc
)
{
edge
.
label
=
"nodes1"
;
edge
.
label
=
"nodes1"
;
...
@@ -768,9 +767,10 @@ function parseSimpleJSON( data , seed ) {
...
@@ -768,9 +767,10 @@ function parseSimpleJSON( data , seed ) {
nodes1
[
source
].
neighbours
.
push
(
target
);
nodes1
[
source
].
neighbours
.
push
(
target
);
nodes1
[
target
].
neighbours
.
push
(
source
);
nodes1
[
target
].
neighbours
.
push
(
source
);
if
(
Nodes
[
source
].
color
&&
Nodes
[
target
].
color
)
{
Edges
[
indice
]
=
edge
;
Edges
[
indice
]
=
edge
;
partialGraph
.
addEdge
(
indice
,
source
,
target
,
edge
);
partialGraph
.
addEdge
(
indice
,
source
,
target
,
edge
);
}
}
}
}
}
...
...
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