Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
david Chavalarias
clinicaltrials
Commits
9e96eeda
Commit
9e96eeda
authored
Oct 31, 2014
by
PkSM3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monograph ok
parent
7313845f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
115 deletions
+61
-115
extras_explorerjs.js
extras_explorerjs.js
+1
-74
main.js
tinawebJS/js/main.js
+10
-9
methods.js
tinawebJS/js/methods.js
+39
-21
sigma.parseCustom.js
tinawebJS/js/sigma.parseCustom.js
+11
-11
No files found.
extras_explorerjs.js
View file @
9e96eeda
...
...
@@ -62,7 +62,6 @@ function callGeomap(){
// $("#CurrentView").hide();
}
function
clickInCountry
(
CC
)
{
// pr("in extras.js: you've clicked "+CC)
var
results
=
[]
...
...
@@ -177,78 +176,6 @@ function getTopPapers(type){
}
}
//very obsolete: please renew!
//For UNI-PARTITE
function
updateLeftPanel_uni
(){
//Uni-partite graph
pr
(
"
\
t ** in updateLeftPanel_uni() ** "
);
var
names
=
''
;
var
information
=
''
;
counter
=
0
;
names
+=
'<div id="selectionsBox">'
;
names
+=
'<h4>'
;
for
(
var
i
in
selections
){
if
(
counter
==
4
){
names
+=
'<h4>[...]</h4>'
;
break
;
}
names
+=
Nodes
[
i
].
label
+
', '
;
counter
++
;
}
names
+=
'</h4>'
;
names
=
names
.
replace
(
", </h4>"
,
"</h4>"
);
names
=
names
.
replace
(
", <h4>"
,
"<h4>"
);
names
+=
'</div>'
;
minFont
=
12
;
//maxFont=(minFont+oposMAX)-1;
maxFont
=
20
;
getTopPapers
(
"semantic"
);
js2
=
'
\'
);"'
;
information
+=
'<br><h4>Information:</h4>'
;
information
+=
'<ul>'
;
for
(
var
i
in
selections
){
information
+=
'<div id="opossitesBox">'
;
information
+=
'<li><b>'
+
Nodes
[
i
].
label
.
toUpperCase
()
+
'</b></li>'
;
//for(var j in Nodes[i].attributes){
// if(Nodes[i].attributes[j].attr=="period"||
// Nodes[i].attributes[j].attr=="cluster_label"
// )
information
+=
'<li><b>Topic'
+
'</b>: '
+
Nodes
[
i
].
attributes
[
"cluster_label"
]
+
'</li>'
;
information
+=
'<a href="https://www.google.com/#q='
+
Nodes
[
i
].
label
+
'" target=blank>'
+
'www</a>'
;
//}
information
+=
'</div>'
;
information
+=
'</ul><br>'
;
}
$
(
"#names"
).
html
(
names
);
//Information extracted, just added
$
(
"#information"
).
html
(
information
);
//Information extracted, just added
$
(
"#tips"
).
html
(
""
);
$
(
"#topPapers"
).
show
();
/***** The animation *****/
_cG
=
$
(
"#leftcolumn"
);
_cG
.
animate
({
"left"
:
"0px"
},
function
()
{
$
(
"#aUnfold"
).
attr
(
"class"
,
"leftarrow"
);
$
(
"#zonecentre"
).
css
({
left
:
_cG
.
width
()
+
"px"
});
});
i
=
0
;
for
(
var
s
in
selections
)
i
++
;
if
(
is_empty
(
selections
)
==
true
||
i
==
0
){
cancelSelection
(
false
);
partialGraph
.
draw
();
}
}
//FOR UNI-PARTITE
function
selectionUni
(
currentNode
){
...
...
@@ -381,7 +308,7 @@ function getTips(){
//
da hell is this
//
both obsolete
function
closeDialog
()
{
$
(
'#windowTitleDialog'
).
modal
(
'hide'
);
}
...
...
tinawebJS/js/main.js
View file @
9e96eeda
...
...
@@ -17,7 +17,7 @@ if (mainfile) {
parse
(
getUrlParam
.
file
);
nb_cats
=
scanCategories
();
pr
(
"nb_cats: "
+
nb_cats
);
listGexfs
();
//
listGexfs();
graphtype
=
(
nb_cats
==
1
)?
"mono"
:
"bi"
;
bringTheNoise
(
getUrlParam
.
file
,
graphtype
);
...
...
@@ -194,13 +194,14 @@ function bringTheNoise(pathfile,type){
// < === EXTRACTING DATA === >
if
(
mainfile
)
{
pr
(
"mainfile: "
+
mainfile
)
parse
(
decodeURIComponent
(
pathfile
));
if
(
type
==
"mono"
)
{
$
(
"#changetype"
).
hide
();
onepartiteExtract
();
$
(
"#left"
).
hide
();
pushSWClick
(
"social"
);
pr
(
partialGraph
.
_core
.
graph
.
nodes
.
length
)
pr
(
partialGraph
.
_core
.
graph
.
edges
.
length
)
}
if
(
type
==
"bi"
)
{
...
...
@@ -208,8 +209,6 @@ function bringTheNoise(pathfile,type){
semanticConverged
=
true
;
pr
(
"here in fullextract"
)
fullExtract
();
$
(
"#closeloader"
).
click
();
pushSWClick
(
"social"
);
pr
(
partialGraph
.
_core
.
graph
.
nodes
.
length
)
pr
(
partialGraph
.
_core
.
graph
.
edges
.
length
)
...
...
@@ -217,9 +216,10 @@ function bringTheNoise(pathfile,type){
partialGraph
.
zoomTo
(
partialGraph
.
_core
.
width
/
2
,
partialGraph
.
_core
.
height
/
2
,
0.8
).
draw
(
2
,
2
,
2
);
theListeners
();
$
(
"#closeloader"
).
click
();
}
else
{
//
var
theurl
,
thedata
,
thename
;
if
(
type
==
"unique_id"
)
{
...
...
@@ -240,6 +240,7 @@ function bringTheNoise(pathfile,type){
thename
=
false
;
}
// Assigning name for the network
if
(
thename
)
thename
=
getUrlParam
.
nodeidparam
.
replace
(
/
\_
/g
,
' '
).
toUpperCase
();
else
{
elements
=
[]
...
...
@@ -251,8 +252,8 @@ function bringTheNoise(pathfile,type){
}
}
thename
=
'"'
+
elements
.
join
(
'" , "'
)
+
'"'
;
}
SigmaLayouting
(
theurl
,
thedata
,
thename
);
}
}
...
...
tinawebJS/js/methods.js
View file @
9e96eeda
...
...
@@ -365,22 +365,33 @@ function htmlfied_nodesatts(elems){
var
id
=
elems
[
i
]
var
node
=
Nodes
[
id
]
if
(
node
.
type
==
catSoc
)
{
if
(
mainfile
)
{
information
+=
'<li><b>'
+
node
.
label
+
'</b></li>'
;
if
(
node
.
htmlCont
==
""
){
if
(
!
isUndef
(
node
.
level
))
information
+=
'<li>'
+
node
.
level
+
'</li>'
;
}
else
{
information
+=
'<li>'
+
$
(
"<div/>"
).
html
(
node
.
htmlCont
).
text
()
+
'</li>'
;
}
socnodes
.
push
(
information
)
}
if
(
node
.
type
==
catSem
){
information
+=
'<li><b>'
+
node
.
label
+
'</b></li>'
;
google
=
'<a href=http://www.google.com/#hl=en&source=hp&q=%20'
+
node
.
label
.
replace
(
" "
,
"+"
)
+
'%20><img src="'
+
twjs
+
'img/google.png"></img></a>'
;
wiki
=
'<a href=http://en.wikipedia.org/wiki/'
+
node
.
label
.
replace
(
" "
,
"_"
)
+
'><img src="'
+
twjs
+
'img/wikipedia.png"></img></a>'
;
flickr
=
'<a href=http://www.flickr.com/search/?w=all&q='
+
node
.
label
.
replace
(
" "
,
"+"
)
+
'><img src="'
+
twjs
+
'img/flickr.png"></img></a>'
;
information
+=
'<li>'
+
google
+
" "
+
wiki
+
" "
+
flickr
+
'</li><br>'
;
semnodes
.
push
(
information
)
for
(
var
i
in
node
.
attributes
)
{
information
+=
'<li> '
+
i
+
" : "
+
node
.
attributes
[
i
]
+
'</li>'
;
}
socnodes
.
push
(
information
);
}
else
{
if
(
node
.
type
==
catSoc
){
information
+=
'<li><b>'
+
node
.
label
+
'</b></li>'
;
if
(
node
.
htmlCont
==
""
){
if
(
!
isUndef
(
node
.
level
))
{
information
+=
'<li>'
+
node
.
level
+
'</li>'
;
}
}
else
{
information
+=
'<li>'
+
$
(
"<div/>"
).
html
(
node
.
htmlCont
).
text
()
+
'</li>'
;
}
socnodes
.
push
(
information
)
}
if
(
node
.
type
==
catSem
){
information
+=
'<li><b>'
+
node
.
label
+
'</b></li>'
;
google
=
'<a href=http://www.google.com/#hl=en&source=hp&q=%20'
+
node
.
label
.
replace
(
" "
,
"+"
)
+
'%20><img src="'
+
twjs
+
'img/google.png"></img></a>'
;
wiki
=
'<a href=http://en.wikipedia.org/wiki/'
+
node
.
label
.
replace
(
" "
,
"_"
)
+
'><img src="'
+
twjs
+
'img/wikipedia.png"></img></a>'
;
flickr
=
'<a href=http://www.flickr.com/search/?w=all&q='
+
node
.
label
.
replace
(
" "
,
"+"
)
+
'><img src="'
+
twjs
+
'img/flickr.png"></img></a>'
;
information
+=
'<li>'
+
google
+
" "
+
wiki
+
" "
+
flickr
+
'</li><br>'
;
semnodes
.
push
(
information
)
}
}
}
return
socnodes
.
concat
(
semnodes
)
...
...
@@ -1039,8 +1050,10 @@ function MultipleSelection(nodes){
if
(
!
checkBox
)
{
checkBox
=
true
;
if
(
!
is_empty
(
prevsels
)
&&
(
PAST
==
NOW
||
PAST
==
"--"
))
{
pr
(
"IN MULTIPLE SELECTION: past="
+
PAST
)
pr
(
"IN MULTIPLE SELECTION: now="
+
NOW
)
if
(
!
is_empty
(
prevsels
)
&&
(
PAST
==
"--"
||
PAST
==
NOW
))
{
var
blacklist
=
{};
for
(
var
i
in
ndsids
)
{
ID
=
ndsids
[
i
];
...
...
@@ -1061,6 +1074,10 @@ function MultipleSelection(nodes){
ndsids
=
tmparr
;
}
}
// bug in first A* to a*
pr
(
"IN MULTIPLE SELECTION: ndsids="
)
pr
(
ndsids
)
pr
(
""
)
if
(
ndsids
.
length
>
0
)
{
for
(
var
i
in
ndsids
)
{
...
...
@@ -1092,8 +1109,9 @@ function MultipleSelection(nodes){
partialGraph
.
draw
();
if
(
categoriesIndex
.
length
==
1
)
updateLeftPanel_uni
();
if
(
categoriesIndex
.
length
==
2
)
updateLeftPanel_fix
();
updateLeftPanel_fix
();
// if(categoriesIndex.length==1) updateLeftPanel_uni();
// if(categoriesIndex.length==2) updateLeftPanel_fix();
RefreshState
(
""
)
}
...
...
@@ -1303,8 +1321,8 @@ function hideEverything(){
}
function
unHide
(
id
){
// pr("in unhide "+iwantograph+" | swMacro: "+swMacro)
pr
(
"unhide "
+
id
)
id
=
""
+
id
;
if
(
id
.
split
(
";"
).
length
==
1
)
{
// i've received a NODE
if
(
!
isUndef
(
getn
(
id
)))
return
;
...
...
tinawebJS/js/sigma.parseCustom.js
View file @
9e96eeda
...
...
@@ -115,9 +115,9 @@ function onepartiteExtract(){
window
.
NODE
=
nodeNode
;
var
id
=
nodeNode
.
getAttribute
(
'id'
);
var
id
=
""
+
nodeNode
.
getAttribute
(
'id'
);
var
label
=
nodeNode
.
getAttribute
(
'label'
)
||
id
;
//viz
var
size
=
1
;
sizeNodes
=
nodeNode
.
getElementsByTagName
(
'size'
);
...
...
@@ -281,7 +281,6 @@ function onepartiteExtract(){
}
}
$
(
"#closeloader"
).
click
();
}
function
fullExtract
(){
...
...
@@ -348,7 +347,6 @@ function fullExtract(){
var
id
=
nodeNode
.
getAttribute
(
'id'
);
var
label
=
nodeNode
.
getAttribute
(
'label'
)
||
id
;
//viz
var
size
=
1
;
sizeNodes
=
nodeNode
.
getElementsByTagName
(
'size'
);
...
...
@@ -422,8 +420,7 @@ function fullExtract(){
numberOfDocs
++
;
//node.size=desirableScholarSize;
if
(
typeof
(
node
.
size
)
===
"undefined"
)
node
.
size
=
nodew
;
}
else
{
}
else
{
node
.
type
=
catSem
;
node
.
id
=
"N::"
+
node
.
id
;
numberOfNGrams
++
;
...
...
@@ -439,14 +436,16 @@ function fullExtract(){
}
}
//New scale for node size: now, between 2 and 5 instead [1,70]
for
(
var
i
in
Nodes
){
normalizedSize
=
desirableNodeSizeMIN
+
(
Nodes
[
i
].
size
-
1
)
*
((
desirableNodeSizeMAX
-
desirableNodeSizeMIN
)
/
(
parseInt
(
maxNodeSize
)
-
parseInt
(
minNodeSize
)));
Nodes
[
i
].
size
=
""
+
normalizedSize
;
nodeK
=
Nodes
[
i
];
if
(
Nodes
[
i
].
type
==
catSoc
)
partialGraph
.
addNode
(
i
,
nodeK
);
if
(
Nodes
[
i
].
type
==
catSoc
)
{
nodeK
.
shape
=
"square"
;
partialGraph
.
addNode
(
i
,
nodeK
);
}
// pr(nodeK)
}
...
...
@@ -465,7 +464,6 @@ function fullExtract(){
target
=
(
Nodes
[
"D::"
+
target
])?
(
"D::"
+
target
):(
"N::"
+
target
)
var
indice
=
source
+
";"
+
target
;
var
edge
=
{
id
:
indice
,
...
...
@@ -507,6 +505,9 @@ function fullExtract(){
idT
=
Nodes
[
edge
.
targetID
].
type
;
Edges
[
indice
]
=
edge
;
if
(
idS
==
idT
)
pr
(
edge
.
sourceID
+
"|"
+
idS
+
" <-> "
+
idT
+
"|"
+
edge
.
targetID
)
if
(
idS
==
catSoc
&&
idT
==
catSoc
){
// pr("anything here?")
...
...
@@ -600,7 +601,6 @@ function fullExtract(){
}
}
$
(
"#closeloader"
).
click
();
}
...
...
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