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
15f8d25d
Commit
15f8d25d
authored
Oct 06, 2014
by
PkSM3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
multiple bugfix
parent
3ad22b68
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
107 deletions
+83
-107
enviroment.js
tinawebJS/js/enviroment.js
+4
-3
main.js
tinawebJS/js/main.js
+5
-11
methods.js
tinawebJS/js/methods.js
+69
-91
sigma.parseCustom.js
tinawebJS/js/sigma.parseCustom.js
+0
-1
sigmaUtils.js
tinawebJS/js/sigmaUtils.js
+5
-1
No files found.
tinawebJS/js/enviroment.js
View file @
15f8d25d
...
...
@@ -12,14 +12,15 @@ function changeType() {
pushSWClick
(
"semantic"
);
RefreshState
(
"B"
)
}
else
{
//From soc* to SocSem
if
(
is_empty
(
selections
))
{
//soc to SocSem
changeToMacro
(
"semantic"
);
pushSWClick
(
"semantic"
);
RefreshState
(
"B"
)
}
else
{
//soc* to SocSem
changeToMeso
(
"sociosemantic"
);
pushSWClick
(
"sociosemantic"
);
RefreshState
(
"AaBb"
)
...
...
@@ -246,7 +247,7 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
partialGraph
.
refresh
()
partialGraph
.
draw
()
fa2enabled
=
true
;
partialGraph
.
startForceAtlas2
()
//
fa2enabled=true; partialGraph.startForceAtlas2()
// });
}
...
...
tinawebJS/js/main.js
View file @
15f8d25d
...
...
@@ -81,9 +81,6 @@ function sigmaLimits(){
function
bringTheNoise
(
pathfile
,
type
){
pr
(
"printing the pathfile:"
)
pr
(
pathfile
)
$
(
"#semLoader"
).
hide
();
$
(
'#modalloader'
).
modal
(
'show'
);
// === get width and height === //
...
...
@@ -95,11 +92,8 @@ function bringTheNoise(pathfile,type){
.
graphProperties
(
sigmaJsGraphProperties
)
.
mouseProperties
(
sigmaJsMouseProperties
);
otherGraph
=
sigma
.
init
(
document
.
getElementById
(
'sigma-othergraph'
))
// .drawingProperties(sigmaJsDrawingProperties)
// .graphProperties(sigmaJsGraphProperties)
// .mouseProperties(sigmaJsMouseProperties);
//dummy graph (semantic layouting in background)
otherGraph
=
sigma
.
init
(
document
.
getElementById
(
'sigma-othergraph'
));
// === resize topbar and tweakbar === //
var
body
=
document
.
getElementsByTagName
(
'body'
)[
0
];
...
...
@@ -284,8 +278,8 @@ function theListeners(){
$
.
ui
.
autocomplete
.
prototype
.
_renderItem
=
function
(
ul
,
item
)
{
var
searchVal
=
$
(
"#searchinput"
).
val
();
var
desc
=
extractContext
(
item
.
desc
,
searchVal
);
pr
(
"desc:"
)
pr
(
desc
)
//
pr("desc:")
//
pr(desc)
return
$
(
'<li onclick=
\'
var s = "'
+
item
.
label
+
'"; search(s);$("#searchinput").val(strSearchBar);
\'
></li>'
)
.
data
(
'item.autocomplete'
,
item
)
.
append
(
"<a><span class=
\"
labelresult
\"
>"
+
item
.
label
+
"</span></a>"
)
...
...
@@ -456,7 +450,7 @@ function theListeners(){
if
(
is_empty
(
actualSel
)
||
i
==
0
){
pr
(
"cursor radius ON, mouseDown -> selecciones vacias"
);
cancelSelection
(
false
);
LevelButtonDisable
(
true
);
// $("#names").html("");
// $("#opossiteNodes").html("");
// $("#information").html("");
...
...
tinawebJS/js/methods.js
View file @
15f8d25d
...
...
@@ -226,7 +226,7 @@ function RefreshState(newNOW){
// N : number of nodes
// 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
N
=
(
Object
.
keys
(
Nodes
).
filter
(
function
(
n
){
return
Nodes
[
n
].
type
==
catSoc
})
).
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
)
...
...
@@ -238,8 +238,7 @@ function RefreshState(newNOW){
}
if
(
NOW
==
"a"
)
{
i
=
0
;
for
(
var
s
in
selections
)
{
i
++
;
break
;}
if
(
is_empty
(
selections
)
||
i
==
0
)
LevelButtonDisable
(
false
);
LevelButtonDisable
(
false
);
}
$
(
"#semLoader"
).
hide
();
...
...
@@ -248,7 +247,7 @@ function RefreshState(newNOW){
}
if
(
NOW
==
"B"
||
NOW
==
"b"
)
{
var
N
=
Object
.
keys
(
partialGraph
.
_core
.
graph
.
nodes
.
filter
(
function
(
n
){
return
n
.
type
==
catSem
&&
!
n
.
hidden
})).
length
;
var
N
=
(
Object
.
keys
(
Nodes
).
filter
(
function
(
n
){
return
Nodes
[
n
].
type
==
catSem
})
).
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
)
...
...
@@ -260,8 +259,7 @@ function RefreshState(newNOW){
}
if
(
NOW
==
"b"
)
{
i
=
0
;
for
(
var
s
in
selections
)
{
i
++
;
break
;}
if
(
is_empty
(
selections
)
||
i
==
0
)
LevelButtonDisable
(
false
);
LevelButtonDisable
(
false
);
}
if
(
semanticConverged
)
$
(
"#semLoader"
).
hide
();
else
$
(
"#semLoader"
).
show
();
...
...
@@ -1435,94 +1433,87 @@ function unHideElem(id){
function
changeToMeso
(
iwannagraph
)
{
labels
=
[]
partialGraph
.
emptyGraph
();
pr
(
"changing to Meso-"
+
iwannagraph
);
pr
(
"changing to Meso-"
+
iwannagraph
);
if
(
iwannagraph
==
"social"
)
{
if
(
!
is_empty
(
selections
)){
//hideEverything();
//
hideEverything();
if
(
swclickPrev
==
"social"
)
{
// for(var i in partialGraph._core.graph.edgesIndex){
// e=partialGraph._core.graph.edgesIndex[i];
// if(e.color==greyColor) {
// e.hidden=true;
// }
// }
// for(var i in partialGraph._core.graph.nodesIndex){
// n=partialGraph._core.graph.nodesIndex[i];
// if(n.color==greyColor) {
// n.hidden=true;
// }
// }
// hideEverything();
var
finalnodes
=
{}
for
(
var
i
in
selections
)
{
unHide
(
i
);
for
(
var
j
in
nodes1
[
i
].
neighbours
)
{
finalnodes
[
i
]
=
1
for
(
var
j
in
nodes1
[
i
].
neighbours
)
{
id
=
nodes1
[
i
].
neighbours
[
j
];
s
=
i
;
t
=
id
;
// if(Edges[s+";"+t])
// pr(Nodes[s].label+";"+Nodes[t].label+" : lock "+Edges[s+";"+t].lock)
// if(Edges[t+";"+s])
// pr(Nodes[t].label+";"+Nodes[s].label+" : lock "+Edges[t+";"+s].lock)
edg1
=
Edges
[
s
+
";"
+
t
];
if
(
edg1
){
pr
(
edg1
.
id
)
// pr("\tunhide "+
edg1.id)
if
(
!
edg1
.
lock
){
unHide
(
t
)
;
finalnodes
[
t
]
=
1
;
}
}
edg2
=
Edges
[
t
+
";"
+
s
];
if
(
edg2
){
pr
(
edg2
.
id
)
// pr("\tunhide "+
edg2.id)
if
(
!
edg2
.
lock
){
unHide
(
t
)
;
finalnodes
[
t
]
=
1
;
}
}
// unHide(id);
}
}
}
for
(
var
Nk
in
finalnodes
)
unHide
(
Nk
);
createEdgesForExistingNodes
(
iwannagraph
);
/**/
}
if
(
swclickPrev
==
"semantic"
)
{
var
finalnodes
=
{}
for
(
var
i
in
selections
)
{
if
(
Nodes
[
i
].
type
==
catSem
){
for
(
var
j
in
opossites
)
{
unHide
(
j
);
// unHide(j);
finalnodes
[
j
]
=
1
;
}
}
else
{
unHide
(
i
);
// unHide(i);
finalnodes
[
i
]
=
1
;
neigh
=
nodes1
[
i
].
neighbours
;
for
(
var
j
in
neigh
)
{
unHide
(
neigh
[
j
]);
// unHide(neigh[j]);
finalnodes
[
neigh
[
j
]]
=
1
;
}
}
}
createEdgesForExistingNodes
(
iwannagraph
);
for
(
var
Nk
in
finalnodes
)
unHide
(
Nk
);
createEdgesForExistingNodes
(
iwannagraph
);
/**/
}
if
(
swclickPrev
==
"sociosemantic"
)
{
// hideEverything();
var
finalnodes
=
{}
for
(
var
i
in
selections
)
{
if
(
Nodes
[
i
].
type
==
catSoc
){
unHide
(
i
);
// unHide(i);
finalnodes
[
i
]
=
1
;
for
(
var
j
in
nodes1
[
i
].
neighbours
)
{
id
=
nodes1
[
i
].
neighbours
[
j
];
unHide
(
id
);
// unHide(id);
finalnodes
[
id
]
=
1
;
}
createEdgesForExistingNodes
(
iwannagraph
);
//
createEdgesForExistingNodes(iwannagraph);
}
if
(
Nodes
[
i
].
type
==
catSem
){
for
(
var
j
in
opossites
)
{
unHide
(
j
);
// unHide(j);
finalnodes
[
j
]
=
1
;
}
createEdgesForExistingNodes
(
iwannagraph
);
}
}
for
(
var
Nk
in
finalnodes
)
unHide
(
Nk
);
createEdgesForExistingNodes
(
iwannagraph
);
}
}
...
...
@@ -1532,7 +1523,7 @@ function changeToMeso(iwannagraph) {
if
(
iwannagraph
==
"sociosemantic"
)
{
if
(
!
is_empty
(
selections
)
&&
!
is_empty
(
opossites
)){
hideEverything
();
//
hideEverything();
for
(
var
i
in
selections
)
{
unHide
(
i
);
}
...
...
@@ -1545,61 +1536,73 @@ function changeToMeso(iwannagraph) {
socsemFlag
=
true
;
}
EdgeWeightFilter
(
"#sliderBEdgeWeight"
,
"label"
,
"nodes2"
,
"weight"
);
NodeWeightFilter
(
"#sliderBNodeWeight"
,
"type"
,
"NGram"
,
"size"
)
EdgeWeightFilter
(
"#sliderAEdgeWeight"
,
"label"
,
"nodes1"
,
"weight"
);
//
EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
//
NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size")
//
EdgeWeightFilter("#sliderAEdgeWeight", "label" , "nodes1", "weight");
$
(
"#colorGraph"
).
hide
();
}
if
(
iwannagraph
==
"semantic"
)
{
if
(
!
is_empty
(
opossites
)){
hideEverything
()
//
hideEverything()
//pr("2. swclickPrev: "+swclickPrev+" - swclickActual: "+swclickActual);
var
finalnodes
=
{}
if
(
swclickPrev
==
"semantic"
)
{
for
(
var
i
in
selections
)
{
unHide
(
i
);
// unHide(i);
finalnodes
[
i
]
=
1
;
neigh
=
nodes2
[
i
].
neighbours
;
for
(
var
j
in
neigh
)
{
unHide
(
neigh
[
j
]);
// unHide(neigh[j]);
finalnodes
[
neigh
[
j
]]
=
1
;
}
}
for
(
var
Nk
in
finalnodes
)
unHide
(
Nk
);
createEdgesForExistingNodes
(
iwannagraph
);
}
if
(
swclickPrev
==
"social"
)
{
if
(
swclickPrev
==
"social"
)
{
var
finalnodes
=
{}
for
(
var
i
in
selections
)
{
if
(
Nodes
[
i
].
type
==
catSoc
){
for
(
var
j
in
opossites
)
{
unHide
(
j
);
// unHide(j);
finalnodes
[
j
]
=
1
;
}
}
else
{
unHide
(
i
)
;
}
else
{
// unHide(i);
finalnodes
[
i
]
=
1
;
neigh
=
nodes2
[
i
].
neighbours
;
for
(
var
j
in
neigh
)
{
unHide
(
neigh
[
j
]);
// unHide(neigh[j]);
finalnodes
[
neigh
[
j
]]
=
1
;
}
}
}
for
(
var
Nk
in
finalnodes
)
unHide
(
Nk
);
createEdgesForExistingNodes
(
iwannagraph
);
}
if
(
swclickPrev
==
"sociosemantic"
)
{
if
(
swclickPrev
==
"sociosemantic"
)
{
var
finalnodes
=
{}
for
(
var
i
in
selections
)
{
if
(
Nodes
[
i
].
type
==
catSoc
){
for
(
var
j
in
opossites
)
{
unHide
(
j
);
// unHide(j);
finalnodes
[
i
]
=
1
;
}
createEdgesForExistingNodes
(
iwannagraph
);
break
;
}
if
(
Nodes
[
i
].
type
==
catSem
){
unHide
(
i
);
//sneaky bug!
// unHide(i);//sneaky bug!
finalnodes
[
i
]
=
1
;
for
(
var
j
in
nodes2
[
i
].
neighbours
)
{
id
=
nodes2
[
i
].
neighbours
[
j
];
unHide
(
id
);
// unHide(id);
finalnodes
[
id
]
=
1
;
}
createEdgesForExistingNodes
(
iwannagraph
);
}
}
}
for
(
var
Nk
in
finalnodes
)
unHide
(
Nk
);
createEdgesForExistingNodes
(
iwannagraph
);
}
}
...
...
@@ -1607,33 +1610,9 @@ function changeToMeso(iwannagraph) {
NodeWeightFilter
(
"#sliderBNodeWeight"
,
"type"
,
"NGram"
,
"size"
)
$
(
"#colorGraph"
).
hide
();
}
// highlightSelectedNodes(true);
// partialGraph.draw();
// // partialGraph.zoomTo(partialGraph._core.width / 2, partialGraph._core.height / 2, 0.8);
// partialGraph.refresh();
// partialGraph.startForceAtlas2();
MultipleSelection
(
Object
.
keys
(
selections
));
// greyEverything();
// for(var i in selections) markAsSelected(i,true);
// overNodes=true;
$
(
'.gradient'
).
css
({
"background-size"
:
"90px 90px"
});
}
...
...
@@ -1745,7 +1724,6 @@ function changeToMacro(iwannagraph) {
// partialGraph.draw();
// // partialGraph.zoomTo(partialGraph._core.width / 2, partialGraph._core.height / 2, 0.8);
// partialGraph.refresh();
// partialGraph.startForceAtlas2();
$
(
'.gradient'
).
css
({
"background-size"
:
"40px 40px"
});
}
...
...
tinawebJS/js/sigma.parseCustom.js
View file @
15f8d25d
...
...
@@ -788,5 +788,4 @@ function extractFromJson(data,seed){
//edge.hidden=false/**///should be commented
}
}
tinawebJS/js/sigmaUtils.js
View file @
15f8d25d
//for socialgraph
function
showMeSomeLabels
(
N
){
/*======= Show some labels at the beginning =======*/
minIn
=
50
,
...
...
@@ -112,6 +114,7 @@ function exactfind(label) {
return
null
;
}
//to general utils (not used btw)
function
cloneObject
(
source
)
{
for
(
i
in
source
)
{
if
(
typeof
source
[
i
]
==
'source'
)
{
...
...
@@ -284,7 +287,8 @@ function calculateFull(hex) {
return
[
r
,
g
,
b
];
}
// function for calculating 3 letters hex value
// function for calculating 3 letters hex value
function
calculatePartial
(
hex
)
{
var
r
=
parseInt
(
hex
.
substring
(
0
,
1
)
+
hex
.
substring
(
0
,
1
),
16
);
var
g
=
parseInt
(
hex
.
substring
(
1
,
2
)
+
hex
.
substring
(
1
,
2
),
16
);
...
...
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