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
b5307731
Commit
b5307731
authored
Sep 22, 2014
by
PkSM3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
last fixes
parent
236873ae
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
162 additions
and
107 deletions
+162
-107
explorerjs.html
explorerjs.html
+8
-8
nohup.out
php/PySQlite/nohup.out
+1
-0
enviroment.js
tinawebJS/js/enviroment.js
+24
-7
main.js
tinawebJS/js/main.js
+0
-12
methods.js
tinawebJS/js/methods.js
+38
-77
sigma.forceatlas2.js
tinawebJS/js/sigma.forceatlas2.js
+44
-2
sigmaUtils.js
tinawebJS/js/sigmaUtils.js
+47
-1
No files found.
explorerjs.html
View file @
b5307731
...
...
@@ -135,15 +135,15 @@
</a></li>
</ul>
<ul
class=
"nav navbar-nav navbar-right"
>
<ul
id=
"colorGraph"
class=
"nav navbar-nav navbar-right"
>
<li
class=
"dropdown"
>
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<img
title=
"Set Colors"
src=
"img/colors.png"
width=
"20px"
><b
class=
"caret"
></b></img>
</a>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"#"
id=
"colorbyCC"
>
By Country
</a></li>
<li><a
href=
"#"
><strike>
By Acronym
</strike>
</a></li>
<li><a
href=
"#"
id=
"colorbyDef"
>
By Default
</a></li>
<li><a
href=
"#"
onclick=
'clustersBy("country")'
>
By Country
</a></li>
<li><a
href=
"#"
onclick=
'clustersBy("acronym")'
>
By Acronym
</a></li>
<li><a
href=
"#"
onclick=
'clustersBy("default")'
>
By Default
</a></li>
<li
class=
"divider"
></li>
<li><a
href=
"#"
>
<span
class=
"glyphicon glyphicon-repeat"
></span>
<strike>
Properties
</strike></a></li>
</ul>
...
...
php/PySQlite/nohup.out
0 → 100644
View file @
b5307731
* Running on http://127.0.0.1:8080/
tinawebJS/js/enviroment.js
View file @
b5307731
...
...
@@ -165,11 +165,20 @@ function changeType() {
changeToMacro
(
"semantic"
);
pushSWClick
(
"semantic"
);
RefreshState
(
"B"
)
}
else
{
if
(
is_empty
(
selections
))
{
changeToMacro
(
"semantic"
);
pushSWClick
(
"semantic"
);
RefreshState
(
"B"
)
}
else
{
changeToMeso
(
"sociosemantic"
);
pushSWClick
(
"sociosemantic"
);
RefreshState
(
"AaBb"
)
}
}
return
;
}
...
...
@@ -177,11 +186,19 @@ function changeType() {
if
(
swMacro
)
{
changeToMacro
(
"social"
);
pushSWClick
(
"social"
);
RefreshState
(
"A"
)
RefreshState
(
"A"
);
}
else
{
if
(
is_empty
(
selections
))
{
changeToMacro
(
"social"
);
pushSWClick
(
"social"
);
RefreshState
(
"A"
);
}
else
{
changeToMeso
(
"sociosemantic"
);
pushSWClick
(
"sociosemantic"
);
RefreshState
(
"AaBb"
)
RefreshState
(
"AaBb"
);
}
}
return
;
}
...
...
tinawebJS/js/main.js
View file @
b5307731
...
...
@@ -732,18 +732,6 @@ function theListeners(){
});
$
(
"#colorbyCC"
).
click
(
function
(){
clustersBy
(
"country"
);
});
$
(
"#colorbyDef"
).
click
(
function
(){
clustersBy
(
"default"
);
});
// $.doTimeout(10,function (){
// var deftoph=$("#defaultop").height();
// var refh=$("#fixedtop").height();
...
...
tinawebJS/js/methods.js
View file @
b5307731
...
...
@@ -223,25 +223,37 @@ function RefreshState(newNOW){
// k : number of ( selected nodes + their neighbors )
// s : number of selections
var
N
=
Object
.
keys
(
partialGraph
.
_core
.
graph
.
nodes
.
filter
(
function
(
n
){
return
n
.
type
==
catSoc
&&
!
n
.
hidden
})).
length
;
var
k
=
Object
.
keys
(
getNeighs
(
selections
,
nodes1
)).
length
var
k
=
Object
.
keys
(
getNeighs
(
Object
.
keys
(
selections
)
,
nodes1
)).
length
var
s
=
Object
.
keys
(
selections
).
length
pr
(
"in social N: "
+
N
+
" - k: "
+
k
+
" - s: "
+
s
)
if
(
NOW
==
"A"
&&
(
s
==
0
||
k
>=
N
))
LevelButtonDisable
(
true
);
else
LevelButtonDisable
(
false
);
if
(
NOW
==
"A"
){
if
(
(
s
==
0
||
k
>=
(
N
-
1
))
)
{
LevelButtonDisable
(
true
);
}
else
LevelButtonDisable
(
false
);
if
(
s
==
N
)
LevelButtonDisable
(
false
);
}
EdgeWeightFilter
(
"#sliderAEdgeWeight"
,
"label"
,
"nodes1"
,
"weight"
);
$
(
"#colorGraph"
).
show
();
}
if
(
NOW
==
"B"
||
NOW
==
"b"
)
{
var
N
=
Object
.
keys
(
partialGraph
.
_core
.
graph
.
nodes
.
filter
(
function
(
n
){
return
n
.
type
==
catSem
&&
!
n
.
hidden
})).
length
;
var
k
=
Object
.
keys
(
getNeighs
(
selections
,
nodes2
)).
length
var
k
=
Object
.
keys
(
getNeighs
(
Object
.
keys
(
selections
)
,
nodes2
)).
length
var
s
=
Object
.
keys
(
selections
).
length
pr
(
"in semantic N: "
+
N
+
" - k: "
+
k
+
" - s: "
+
s
)
if
(
NOW
==
"B"
&&
(
s
==
0
||
k
>=
N
)
)
LevelButtonDisable
(
true
);
else
LevelButtonDisable
(
false
);
if
(
NOW
==
"B"
)
{
if
(
(
s
==
0
||
k
>=
(
N
-
1
))
)
{
LevelButtonDisable
(
true
);
}
else
LevelButtonDisable
(
false
);
if
(
s
==
N
)
LevelButtonDisable
(
false
);
}
EdgeWeightFilter
(
"#sliderBEdgeWeight"
,
"label"
,
"nodes2"
,
"weight"
);
NodeWeightFilter
(
"#sliderBNodeWeight"
,
"type"
,
"NGram"
,
"size"
)
$
(
"#colorGraph"
).
hide
();
}
if
(
NOW
==
"AaBb"
){
LevelButtonDisable
(
true
);
$
(
"#colorGraph"
).
hide
();
}
}
...
...
@@ -442,10 +454,10 @@ function getNodeIDs(elems){
// tag cloud div
//missing: the graphNGrams javascript
function
htmlfied_alternodes
(
elems
){
function
htmlfied_alternodes
(
elems
)
{
var
oppositesNodes
=
[]
js1
=
""
//'onclick="edgesTF=false;cancelSelection(true);graphNGrams
(\'';
js2
=
"
"
//"');
"
js1
=
'onclick="graphTagCloudElem
(
\'
'
;
js2
=
"
');
\"
"
frecMAX
=
elems
[
0
].
value
for
(
var
i
in
elems
){
id
=
elems
[
i
].
key
...
...
@@ -458,11 +470,9 @@ function htmlfied_alternodes(elems){
((
desirableTagCloudFont_MAX
-
desirableTagCloudFont_MIN
)
/
(
frecMAX
-
1
));
}
if
(
!
isUndef
(
Nodes
[
id
])){
htmlfied_alternode
=
'<span class="tagcloud-item" style="font-size:'
+
fontSize
+
'px;"'
+
">"
//+js1+id+js2+'>'
+
Nodes
[
id
].
label
+
'</span>'
;
// js1 js2
// onclick="graphNGrams(' ');
htmlfied_alternode
=
'<span class="tagcloud-item" style="font-size:'
+
fontSize
+
'px;" '
+
js1
+
id
+
js2
+
'>'
+
Nodes
[
id
].
label
+
'</span>'
;
oppositesNodes
.
push
(
htmlfied_alternode
)
}
}
...
...
@@ -555,63 +565,18 @@ function LevelButtonDisable( TF ){
$
(
'#changelevel'
).
prop
(
'disabled'
,
TF
);
}
function
graphNGrams
(
node_id
){
pr
(
"
\
tin graphNGrams"
);
/**/
fullurl
=
returnBaseUrl
()
+
"img/trans/"
;
document
.
getElementById
(
"viewType"
).
src
=
fullurl
+
"status_meso_view.png"
;
document
.
getElementById
(
"socio"
).
src
=
fullurl
+
"inactive_scholars.png"
;
document
.
getElementById
(
"semantic"
).
src
=
fullurl
+
"active_tags.png"
;
document
.
getElementById
(
"sociosemantic"
).
src
=
fullurl
+
"inactive_sociosem.png"
;
document
.
getElementById
(
"switch"
).
src
=
fullurl
+
"graph_macro.png"
;
console
.
log
(
"in graphNGrams, nodae_id: "
+
node_id
);
if
(
Nodes
[
node_id
].
type
==
catSem
)
{
labels
=
[];
hideEverything
()
//partialGraph.stopForceAtlas2();
unHide
(
node_id
);
for
(
i
=
0
;
i
<
nodes2
[
node_id
].
neighbours
.
length
;
i
++
)
{
unHide
(
nodes2
[
node_id
].
neighbours
[
i
]);
}
function
graphTagCloudElem
(
node_id
){
pr
(
"
\
tin graphTagCloudElem"
);
/**/
/* ALGORITMO ESTRELLA*/
existingNodes
=
partialGraph
.
_core
.
graph
.
nodes
.
filter
(
function
(
n
)
{
return
!
n
[
'hidden'
];
});
edgesFound
=
[];
for
(
i
=
0
;
i
<
existingNodes
.
length
;
i
++
){
if
(
existingNodes
[
i
].
id
==
node_id
)
i
++
;
for
(
j
=
0
;
j
<
existingNodes
.
length
;
j
++
){
i1
=
existingNodes
[
i
].
id
+
";"
+
existingNodes
[
j
].
id
;
i2
=
existingNodes
[
j
].
id
+
";"
+
existingNodes
[
i
].
id
;
if
(
!
isUndef
(
Edges
[
i1
])
&&
!
isUndef
(
Edges
[
i2
])){
if
(
Edges
[
i1
].
weight
>
Edges
[
i2
].
weight
){
unHide
(
i1
);
}
if
(
Edges
[
i1
].
weight
<
Edges
[
i2
].
weight
){
unHide
(
i2
);
}
if
(
Edges
[
i1
].
weight
==
Edges
[
i2
].
weight
){
unHide
(
i1
);
}
}
}
}
node
=
partialGraph
.
_core
.
graph
.
nodesIndex
[
node_id
];
selection
(
node
);
partialGraph
.
startForceAtlas2
();
$
(
"#category-A"
).
hide
();
$
(
"#category-B"
).
show
();
changeButton
(
"active_tags.png"
);
}
console
.
log
(
"in graphTagCloudElem, nodae_id: "
+
node_id
);
cancelSelection
();
swMacro
=
true
;
changeType
();
MultipleSelection
(
node_id
);
changeLevel
();
}
//obsolete
function
graphDocs
(
node_id
){
pr
(
"
\
tin graphDocs, node_id: "
+
node_id
);
...
...
@@ -659,7 +624,6 @@ function graphDocs(node_id){
}
node
=
partialGraph
.
_core
.
graph
.
nodesIndex
[
node_id
];
selection
(
node
);
partialGraph
.
startForceAtlas2
();
$
(
"#category-A"
).
show
();
$
(
"#category-B"
).
hide
();
changeButton
(
"active_scholars.png"
);
...
...
@@ -1143,7 +1107,7 @@ function markAsSelected(n_id,sel) {
// }
}
//obsolete au non
function
DrawAsSelectedNodes
(
nodeskeys
)
{
greyEverything
();
...
...
@@ -1495,7 +1459,6 @@ function unHideElem(id){
function
changeToMeso
(
iwannagraph
)
{
labels
=
[]
pr
(
"changing to Meso-"
+
iwannagraph
);
fullurl
=
returnBaseUrl
()
+
"img/trans/"
;
if
(
iwannagraph
==
"social"
)
{
if
(
!
is_empty
(
selections
)){
//hideEverything();
...
...
@@ -1607,8 +1570,6 @@ function changeToMeso(iwannagraph) {
}
createEdgesForExistingNodes
(
iwannagraph
);
partialGraph
.
startForceAtlas2
();
socsemFlag
=
true
;
}
}
...
...
@@ -1865,7 +1826,7 @@ function saveGraphIMG(){
document
.
location
.
href
=
strData
.
replace
(
"image/png"
,
strDownloadMime
)
}
//to erase
function
testSave
(){
var
strDownloadMime
=
"image/octet-stream"
...
...
tinawebJS/js/sigma.forceatlas2.js
View file @
b5307731
// Mathieu Jacomy @ Sciences Po Médialab & WebAtlas
// (requires sigma.js to be loaded)
sigma
.
forceatlas2
=
sigma
.
forceatlas2
||
{};
sigma
.
forceatlas2
.
ForceAtlas2
=
function
(
graph
)
{
sigma
.
forceatlas2
.
ForceAtlas2
=
function
(
graph
,
V
,
E
)
{
sigma
.
classes
.
Cascade
.
call
(
this
);
var
self
=
this
;
this
.
graph
=
graph
;
...
...
@@ -35,9 +35,14 @@ sigma.forceatlas2.ForceAtlas2 = function(graph) {
// Runtime (the ForceAtlas2 itself)
this
.
init
=
function
()
{
console
.
log
(
"#Nodes: "
+
V
)
console
.
log
(
"#Edges: "
+
E
)
self
.
state
=
{
step
:
0
,
index
:
0
};
self
.
graph
.
nodes
.
forEach
(
function
(
n
)
{
n
.
fa2
=
{
mass
:
1
+
n
.
degree
,
old_dx
:
0
,
...
...
@@ -45,6 +50,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph) {
dx
:
0
,
dy
:
0
};
});
return
self
;
...
...
@@ -67,6 +73,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph) {
// Initialise layout data
self
.
count
++
;
nodes
.
forEach
(
function
(
n
)
{
if
(
n
.
fa2
)
{
n
.
fa2
.
mass
=
1
+
n
.
degree
;
n
.
fa2
.
old_dx
=
n
.
fa2
.
dx
;
...
...
@@ -82,6 +89,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph) {
dy
:
0
};
}
});
// If Barnes Hut active, initialize root region
...
...
@@ -964,7 +972,41 @@ sigma.forceatlas2.Region.prototype.applyForce = function(n, Force, theta) {
sigma
.
publicPrototype
.
startForceAtlas2
=
function
()
{
//if(!this.forceatlas2) {
if
(
fa2enabled
)
{
this
.
forceatlas2
=
new
sigma
.
forceatlas2
.
ForceAtlas2
(
this
.
_core
.
graph
);
// -- UPDATING THE DEGREE --
for
(
var
i
in
this
.
_core
.
graph
.
nodesIndex
)
{
pr
(
i
+
" -> "
+
this
.
_core
.
graph
.
nodesIndex
[
i
].
degree
)
}
for
(
var
i
in
this
.
_core
.
graph
.
nodes
)
{
if
(
!
this
.
_core
.
graph
.
nodes
[
i
].
hidden
)
{
this
.
_core
.
graph
.
nodes
[
i
].
degree
=
0
;
this
.
_core
.
graph
.
nodesIndex
[
this
.
_core
.
graph
.
nodes
[
i
].
id
].
degree
=
0
;
}
}
for
(
var
e
in
this
.
_core
.
graph
.
edges
)
{
edge
=
this
.
_core
.
graph
.
edges
[
e
];
if
(
!
edge
.
hidden
)
{
nodeIDS
=
edge
.
source
.
id
;
nodeIDT
=
edge
.
target
.
id
;
this
.
_core
.
graph
.
nodesIndex
[
nodeIDS
].
degree
++
;
this
.
_core
.
graph
.
nodesIndex
[
nodeIDT
].
degree
++
;
}
}
for
(
var
i
in
this
.
_core
.
graph
.
nodesIndex
)
{
// if(this._core.graph.nodesIndex[i].degree==0)
// this._core.graph.nodesIndex[i].hidden = true;
pr
(
i
+
" -> "
+
this
.
_core
.
graph
.
nodesIndex
[
i
].
degree
)
}
// -- / UPDATING THE DEGREE --
var
V
=
10
;
var
E
=
100
;
this
.
forceatlas2
=
new
sigma
.
forceatlas2
.
ForceAtlas2
(
this
.
_core
.
graph
,
V
,
E
);
this
.
forceatlas2
.
setAutoSettings
();
this
.
forceatlas2
.
init
();
$
(
"#overviewzone"
).
hide
();
...
...
tinawebJS/js/sigmaUtils.js
View file @
b5307731
...
...
@@ -13,7 +13,7 @@ function showMeSomeLabels(N){
}
});
counter
=
0
;
n
=
partialGraph
.
_core
.
graph
.
nodes
;
n
=
getVisibleNodes
()
;
for
(
i
=
0
;
i
<
n
.
length
;
i
++
)
{
if
(
n
[
i
].
hidden
==
false
){
if
(
n
[
i
].
inDegree
==
minIn
&&
n
[
i
].
forceLabel
==
false
)
{
...
...
@@ -183,6 +183,21 @@ function getCountries(){
return
Object
.
keys
(
countries
);
}
function
getAcronyms
()
{
var
nodes
=
getVisibleNodes
();
var
acrs
=
{}
pr
(
"in getAcronyms"
)
for
(
var
i
in
nodes
)
{
// pr(i)
// pr(nodes[i].id+" : "+nodes[i].attr["CC"]+" , "+nodes[i].attr["ACR"])
if
(
nodes
[
i
].
attr
[
"ACR"
]
!=
"-"
)
acrs
[
nodes
[
i
].
attr
[
"ACR"
]]
=
1
// pr("")
}
return
(
Object
.
keys
(
acrs
)
);
}
function
clustersBy
(
daclass
)
{
if
(
daclass
==
"country"
)
{
...
...
@@ -195,6 +210,10 @@ function clustersBy(daclass) {
pr
(
CCxID
)
var
nodes
=
getVisibleNodes
();
for
(
var
i
in
nodes
)
{
nodes
[
i
].
color
=
Nodes
[
nodes
[
i
].
id
].
color
;
}
colorList
.
sort
(
function
(){
return
Math
.
random
()
-
0.5
;
});
// pr(colorList);
for
(
var
i
in
nodes
)
{
...
...
@@ -205,6 +224,33 @@ function clustersBy(daclass) {
}
}
if
(
daclass
==
"acronym"
)
{
CCs
=
getAcronyms
()
CCxID
=
{}
for
(
var
i
in
CCs
)
{
code
=
CCs
[
i
]
CCxID
[
code
]
=
parseInt
(
i
);
}
pr
(
CCxID
)
var
nodes
=
getVisibleNodes
();
for
(
var
i
in
nodes
)
{
nodes
[
i
].
color
=
Nodes
[
nodes
[
i
].
id
].
color
;
}
colorList
.
sort
(
function
(){
return
Math
.
random
()
-
0.5
;
});
// pr(colorList);
for
(
var
i
in
nodes
)
{
cc
=
nodes
[
i
].
attr
[
"ACR"
]
if
(
!
isUndef
(
cc
)
&&
cc
!=
"-"
)
{
nodes
[
i
].
color
=
colorList
[
CCxID
[
cc
]
];
}
}
}
if
(
daclass
==
"default"
)
{
var
nodes
=
getVisibleNodes
();
for
(
var
i
in
nodes
)
{
...
...
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