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
ccc08006
Commit
ccc08006
authored
Mar 26, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pr to console.log for trace clarity
parent
fc3bc4ee
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
147 additions
and
136 deletions
+147
-136
extras_explorerjs.js
extras_explorerjs.js
+6
-6
ui-bg_glass_75_e6e6e6_1x400.png
libs/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png
+0
-0
ui-bg_highlight-soft_75_cccccc_1x100.png
libs/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png
+0
-0
asyncFA2.js
tinawebJS/asyncFA2.js
+13
-13
enviroment.js
tinawebJS/enviroment.js
+44
-44
methods.js
tinawebJS/methods.js
+21
-20
sigma.forceatlas2.js
tinawebJS/sigma.forceatlas2.js
+11
-11
sigma.parseCustom.js
tinawebJS/sigma.parseCustom.js
+11
-11
sigma.v1.customized.js
tinawebJS/sigma.v1.customized.js
+11
-11
sigmaUtils.js
tinawebJS/sigmaUtils.js
+30
-20
No files found.
extras_explorerjs.js
View file @
ccc08006
...
@@ -86,7 +86,7 @@ function ChangeGraphAppearanceByAtt( manualflag ) {
...
@@ -86,7 +86,7 @@ function ChangeGraphAppearanceByAtt( manualflag ) {
if
(
att_s
==
"age"
)
the_method
=
"colorsRelByBins"
if
(
att_s
==
"age"
)
the_method
=
"colorsRelByBins"
div_info
+=
'<li><a href="#" onclick=
\'
'
+
the_method
+
'("'
+
att_s
+
'")
\'
>By '
+
att_s
+
'('
+
att_c
+
')'
+
'</a></li>'
div_info
+=
'<li><a href="#" onclick=
\'
'
+
the_method
+
'("'
+
att_s
+
'")
\'
>By '
+
att_s
+
'('
+
att_c
+
')'
+
'</a></li>'
pr
(
'<li><a href="#" onclick=
\'
'
+
the_method
+
'("'
+
att_s
+
'")
\'
>By '
+
att_s
+
'('
+
att_c
+
')'
+
'</a></li>'
)
console
.
log
(
'<li><a href="#" onclick=
\'
'
+
the_method
+
'("'
+
att_s
+
'")
\'
>By '
+
att_s
+
'('
+
att_c
+
')'
+
'</a></li>'
)
}
}
div_info
+=
' </ul>'
div_info
+=
' </ul>'
div_info
+=
' </li>'
div_info
+=
' </li>'
...
@@ -151,7 +151,7 @@ function SomeEffect( ClusterCode ) {
...
@@ -151,7 +151,7 @@ function SomeEffect( ClusterCode ) {
n
.
forceLabel
=
false
;
n
.
forceLabel
=
false
;
var
node
=
TW
.
Nodes
[
n
.
id
]
var
node
=
TW
.
Nodes
[
n
.
id
]
if
(
node
.
type
==
Type
&&
!
isUndef
(
node
.
attributes
[
Cluster
])
&&
node
.
attributes
[
Cluster
]
==
clstID
)
{
if
(
node
.
type
==
Type
&&
!
isUndef
(
node
.
attributes
[
Cluster
])
&&
node
.
attributes
[
Cluster
]
==
clstID
)
{
//
pr
( n.id + " | " + Cluster + " : " + node.attributes[Cluster] )
//
console.log
( n.id + " | " + Cluster + " : " + node.attributes[Cluster] )
nodes_2_colour
[
n
.
id
]
=
n
.
degree
;
nodes_2_colour
[
n
.
id
]
=
n
.
degree
;
}
}
}
}
...
@@ -185,7 +185,7 @@ function SomeEffect( ClusterCode ) {
...
@@ -185,7 +185,7 @@ function SomeEffect( ClusterCode ) {
for
(
var
i
in
edges_2_colour
)
{
for
(
var
i
in
edges_2_colour
)
{
an_edge
=
TW
.
partialGraph
.
_core
.
graph
.
edgesIndex
[
i
]
an_edge
=
TW
.
partialGraph
.
_core
.
graph
.
edgesIndex
[
i
]
if
(
!
isUndef
(
an_edge
)
&&
!
an_edge
.
hidden
){
if
(
!
isUndef
(
an_edge
)
&&
!
an_edge
.
hidden
){
//
pr
(an_edge)
//
console.log
(an_edge)
an_edge
.
color
=
an_edge
.
attr
[
'true_color'
];
an_edge
.
color
=
an_edge
.
attr
[
'true_color'
];
an_edge
.
attr
[
'grey'
]
=
0
;
an_edge
.
attr
[
'grey'
]
=
0
;
}
}
...
@@ -289,11 +289,11 @@ function getTopPapers(type){
...
@@ -289,11 +289,11 @@ function getTopPapers(type){
//contentType: "application/json",
//contentType: "application/json",
//dataType: 'json',
//dataType: 'json',
success
:
function
(
data
){
success
:
function
(
data
){
pr
(
TW
.
APINAME
+
'info_div.php?'
+
"type="
+
type
+
"&bi="
+
bi
+
"&query="
+
jsonparams
+
"&gexf="
+
thisgexf
+
"&index="
+
TW
.
field
[
getUrlParam
.
file
]);
console
.
log
(
TW
.
APINAME
+
'info_div.php?'
+
"type="
+
type
+
"&bi="
+
bi
+
"&query="
+
jsonparams
+
"&gexf="
+
thisgexf
+
"&index="
+
TW
.
field
[
getUrlParam
.
file
]);
$
(
"#topPapers"
).
html
(
data
);
$
(
"#topPapers"
).
html
(
data
);
},
},
error
:
function
(){
error
:
function
(){
pr
(
'Page Not found: getTopPapers'
);
console
.
log
(
'Page Not found: getTopPapers'
);
}
}
});
});
}
}
...
@@ -302,7 +302,7 @@ function getTopPapers(type){
...
@@ -302,7 +302,7 @@ function getTopPapers(type){
//FOR UNI-PARTITE
//FOR UNI-PARTITE
function
selectionUni
(
currentNode
){
function
selectionUni
(
currentNode
){
pr
(
"
\
tin selectionUni:"
+
currentNode
.
id
);
console
.
log
(
"
\
tin selectionUni:"
+
currentNode
.
id
);
if
(
checkBox
==
false
&&
cursor_size
==
0
)
{
if
(
checkBox
==
false
&&
cursor_size
==
0
)
{
highlightSelectedNodes
(
false
);
highlightSelectedNodes
(
false
);
opossites
=
[];
opossites
=
[];
...
...
libs/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png
deleted
100644 → 0
View file @
fc3bc4ee
313 Bytes
libs/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png
deleted
100644 → 0
View file @
fc3bc4ee
329 Bytes
tinawebJS/asyncFA2.js
View file @
ccc08006
...
@@ -64,7 +64,7 @@ var ForceAtlas2 = function(graph) {
...
@@ -64,7 +64,7 @@ var ForceAtlas2 = function(graph) {
switch
(
self
.
state
.
step
)
{
switch
(
self
.
state
.
step
)
{
case
0
:
// Pass init
case
0
:
// Pass init
// Initialise layout data
// Initialise layout data
//
pr
("caso 0")
//
console.log
("caso 0")
nodes
.
forEach
(
function
(
n
)
{
nodes
.
forEach
(
function
(
n
)
{
if
(
n
.
fa2
)
{
if
(
n
.
fa2
)
{
n
.
fa2
.
mass
=
1
+
n
.
degree
;
n
.
fa2
.
mass
=
1
+
n
.
degree
;
...
@@ -103,7 +103,7 @@ var ForceAtlas2 = function(graph) {
...
@@ -103,7 +103,7 @@ var ForceAtlas2 = function(graph) {
break
;
break
;
case
1
:
// Repulsion
case
1
:
// Repulsion
//
pr
("caso 1")
//
console.log
("caso 1")
var
Repulsion
=
self
.
ForceFactory
.
buildRepulsion
(
var
Repulsion
=
self
.
ForceFactory
.
buildRepulsion
(
self
.
p
.
adjustSizes
,
self
.
p
.
adjustSizes
,
self
.
p
.
scalingRatio
self
.
p
.
scalingRatio
...
@@ -148,7 +148,7 @@ var ForceAtlas2 = function(graph) {
...
@@ -148,7 +148,7 @@ var ForceAtlas2 = function(graph) {
break
;
break
;
case
2
:
// Gravity
case
2
:
// Gravity
//
pr
("caso 2")
//
console.log
("caso 2")
var
Gravity
=
(
self
.
p
.
strongGravityMode
)
?
var
Gravity
=
(
self
.
p
.
strongGravityMode
)
?
(
self
.
ForceFactory
.
getStrongGravity
(
(
self
.
ForceFactory
.
getStrongGravity
(
self
.
p
.
scalingRatio
self
.
p
.
scalingRatio
...
@@ -178,7 +178,7 @@ var ForceAtlas2 = function(graph) {
...
@@ -178,7 +178,7 @@ var ForceAtlas2 = function(graph) {
break
;
break
;
case
3
:
// Attraction
case
3
:
// Attraction
//
pr
("caso 3")
//
console.log
("caso 3")
var
Attraction
=
self
.
ForceFactory
.
buildAttraction
(
var
Attraction
=
self
.
ForceFactory
.
buildAttraction
(
self
.
p
.
linLogMode
,
self
.
p
.
linLogMode
,
self
.
p
.
outboundAttractionDistribution
,
self
.
p
.
outboundAttractionDistribution
,
...
@@ -220,7 +220,7 @@ var ForceAtlas2 = function(graph) {
...
@@ -220,7 +220,7 @@ var ForceAtlas2 = function(graph) {
break
;
break
;
case
4
:
// Auto adjust speed
case
4
:
// Auto adjust speed
//
pr
("caso 4")
//
console.log
("caso 4")
var
totalSwinging
=
0
;
// How much irregular movement
var
totalSwinging
=
0
;
// How much irregular movement
var
totalEffectiveTraction
=
0
;
// Hom much useful movement
var
totalEffectiveTraction
=
0
;
// Hom much useful movement
var
swingingSum
=
0
;
var
swingingSum
=
0
;
...
@@ -282,7 +282,7 @@ var ForceAtlas2 = function(graph) {
...
@@ -282,7 +282,7 @@ var ForceAtlas2 = function(graph) {
break
;
break
;
case
5
:
// Apply forces
case
5
:
// Apply forces
//
pr
("caso 5")
//
console.log
("caso 5")
var
i
=
self
.
state
.
index
;
var
i
=
self
.
state
.
index
;
if
(
self
.
p
.
adjustSizes
)
{
if
(
self
.
p
.
adjustSizes
)
{
var
speed
=
self
.
p
.
speed
;
var
speed
=
self
.
p
.
speed
;
...
@@ -964,12 +964,12 @@ var applyForce = function(n, Force, theta) {
...
@@ -964,12 +964,12 @@ var applyForce = function(n, Force, theta) {
// 01. Return the values to MainContext when spatialization is finished
// 01. Return the values to MainContext when spatialization is finished
var
startForceAtlas2
=
function
(
graph
,
limit_it
)
{
var
startForceAtlas2
=
function
(
graph
,
limit_it
)
{
//
pr
("inside FA2")
//
console.log
("inside FA2")
//// if(!this.forceatlas2) {
//// if(!this.forceatlas2) {
//
pr
(graph);
//
console.log
(graph);
//
pr
(graph.nodes[0].x)
//
console.log
(graph.nodes[0].x)
//
pr
(graph.nodes[0].y)
//
console.log
(graph.nodes[0].y)
//
pr
("--------")
//
console.log
("--------")
// nodes = graph.nodes;
// nodes = graph.nodes;
// for(var n in nodes) {
// for(var n in nodes) {
...
@@ -1001,8 +1001,8 @@ var applyForce = function(n, Force, theta) {
...
@@ -1001,8 +1001,8 @@ var applyForce = function(n, Force, theta) {
count
++
;
count
++
;
if
(
flag
||
count
>
limit_it
)
break
;
if
(
flag
||
count
>
limit_it
)
break
;
}
}
//
pr
(forceatlas2.graph.nodes[0].x)
//
console.log
(forceatlas2.graph.nodes[0].x)
//
pr
(forceatlas2.graph.nodes[0].y)
//
console.log
(forceatlas2.graph.nodes[0].y)
// console.log("\titerations: "+count)
// console.log("\titerations: "+count)
result
=
{
result
=
{
"nodes"
:
forceatlas2
.
graph
.
nodes
,
"nodes"
:
forceatlas2
.
graph
.
nodes
,
...
...
tinawebJS/enviroment.js
View file @
ccc08006
...
@@ -71,7 +71,7 @@ function changeType() {
...
@@ -71,7 +71,7 @@ function changeType() {
var
nodes_2_colour
=
{}
var
nodes_2_colour
=
{}
var
edges_2_colour
=
{}
var
edges_2_colour
=
{}
pr
(
"CHanging the TYpE!!: "
+
present
.
level
)
console
.
log
(
"CHanging the TYpE!!: "
+
present
.
level
)
if
(
present
.
level
)
{
//If level=Global, fill all {X}-component
if
(
present
.
level
)
{
//If level=Global, fill all {X}-component
...
@@ -85,18 +85,18 @@ function changeType() {
...
@@ -85,18 +85,18 @@ function changeType() {
}
}
}
else
/* Local level, change to previous or alter component*/
{
}
else
/* Local level, change to previous or alter component*/
{
if
(
sels
.
length
==
0
)
{
if
(
sels
.
length
==
0
)
{
pr
(
" * * * * * * * * * * * * * * "
)
console
.
log
(
" * * * * * * * * * * * * * * "
)
pr
(
"the past: "
)
console
.
log
(
"the past: "
)
pr
(
past
.
type
.
map
(
Number
)
+
" , "
+
past
.
level
)
console
.
log
(
past
.
type
.
map
(
Number
)
+
" , "
+
past
.
level
)
pr
(
past
)
console
.
log
(
past
)
pr
(
"the present: "
)
console
.
log
(
"the present: "
)
pr
(
present
.
type
.
map
(
Number
)
+
" , "
+
present
.
level
)
console
.
log
(
present
.
type
.
map
(
Number
)
+
" , "
+
present
.
level
)
pr
(
present
)
console
.
log
(
present
)
pr
(
"str_type_t0: "
+
str_type_t0
)
console
.
log
(
"str_type_t0: "
+
str_type_t0
)
pr
(
"str_type_t1: "
+
str_type_t1
)
console
.
log
(
"str_type_t1: "
+
str_type_t1
)
pr
(
"str_nextState: "
+
str_nextState
)
console
.
log
(
"str_nextState: "
+
str_nextState
)
var
newsels
=
{}
var
newsels
=
{}
var
sumpastcat
=
type_t0
.
map
(
Number
).
reduce
(
function
(
a
,
b
){
return
a
+
b
;})
var
sumpastcat
=
type_t0
.
map
(
Number
).
reduce
(
function
(
a
,
b
){
return
a
+
b
;})
...
@@ -139,7 +139,7 @@ function changeType() {
...
@@ -139,7 +139,7 @@ function changeType() {
if
(
sumpastcat
==
2
)
{
if
(
sumpastcat
==
2
)
{
}
}
pr
(
" * * * * * * * * * * * * * * "
)
console
.
log
(
" * * * * * * * * * * * * * * "
)
}
}
}
}
...
@@ -396,7 +396,7 @@ function changeLevel() {
...
@@ -396,7 +396,7 @@ function changeLevel() {
// EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
// EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
function
EdgeWeightFilter
(
sliderDivID
,
type_attrb
,
type
,
criteria
)
{
function
EdgeWeightFilter
(
sliderDivID
,
type_attrb
,
type
,
criteria
)
{
// if ($(sliderDivID).html()!="") {
// if ($(sliderDivID).html()!="") {
//
pr
("\t\t\t\t\t\t[[ algorithm not applied "+sliderDivID+" ]]")
//
console.log
("\t\t\t\t\t\t[[ algorithm not applied "+sliderDivID+" ]]")
// return;
// return;
// }
// }
...
@@ -424,8 +424,8 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
...
@@ -424,8 +424,8 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
}
}
var
filterparams
=
AlgorithmForSliders
(
TW
.
Edges
,
type_attrb
,
type
,
criteria
)
//OK
var
filterparams
=
AlgorithmForSliders
(
TW
.
Edges
,
type_attrb
,
type
,
criteria
)
//OK
pr
(
"EdgeWeightFilter: "
+
type
)
console
.
log
(
"EdgeWeightFilter: "
+
type
)
pr
(
filterparams
)
console
.
log
(
filterparams
)
var
steps
=
filterparams
[
"steps"
]
var
steps
=
filterparams
[
"steps"
]
var
finalarray
=
filterparams
[
"finalarray"
]
var
finalarray
=
filterparams
[
"finalarray"
]
if
(
steps
<
3
)
{
if
(
steps
<
3
)
{
...
@@ -466,7 +466,7 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
...
@@ -466,7 +466,7 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
$
.
doTimeout
(
sliderDivID
+
"_"
+
filtervalue
,
300
,
function
()
{
$
.
doTimeout
(
sliderDivID
+
"_"
+
filtervalue
,
300
,
function
()
{
pr
(
"
\n
previous value "
+
lastvalue
+
" | current value "
+
filtervalue
)
console
.
log
(
"
\n
previous value "
+
lastvalue
+
" | current value "
+
filtervalue
)
// [ Stopping FA2 ]
// [ Stopping FA2 ]
TW
.
partialGraph
.
stopForceAtlas2
();
TW
.
partialGraph
.
stopForceAtlas2
();
...
@@ -483,11 +483,11 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
...
@@ -483,11 +483,11 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
if
(
mint0
!=
mint1
)
{
if
(
mint0
!=
mint1
)
{
if
(
mint0
<
mint1
)
{
if
(
mint0
<
mint1
)
{
delflag
=
true
;
delflag
=
true
;
pr
(
"cotainferior --||>--------|| a la derecha"
)
console
.
log
(
"cotainferior --||>--------|| a la derecha"
)
}
}
if
(
mint0
>
mint1
)
{
if
(
mint0
>
mint1
)
{
addflag
=
true
;
addflag
=
true
;
pr
(
"cotainferior --<||--------|| a la izquierda"
)
console
.
log
(
"cotainferior --<||--------|| a la izquierda"
)
}
}
iterarr
=
calc_range
(
mint0
,
mint1
).
sort
(
compareNumbers
);
iterarr
=
calc_range
(
mint0
,
mint1
).
sort
(
compareNumbers
);
}
}
...
@@ -495,11 +495,11 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
...
@@ -495,11 +495,11 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
if
(
maxt0
!=
maxt1
)
{
if
(
maxt0
!=
maxt1
)
{
if
(
maxt0
<
maxt1
)
{
if
(
maxt0
<
maxt1
)
{
addflag
=
true
;
addflag
=
true
;
pr
(
"cotasuperior ||--------||>-- a la derecha"
)
console
.
log
(
"cotasuperior ||--------||>-- a la derecha"
)
}
}
if
(
maxt0
>
maxt1
)
{
if
(
maxt0
>
maxt1
)
{
delflag
=
true
;
delflag
=
true
;
pr
(
"cotasuperior ||--------<||-- a la izquierda"
)
console
.
log
(
"cotasuperior ||--------<||-- a la izquierda"
)
}
}
iterarr
=
calc_range
(
maxt0
,
maxt1
).
sort
(
compareNumbers
);
iterarr
=
calc_range
(
maxt0
,
maxt1
).
sort
(
compareNumbers
);
}
}
...
@@ -512,16 +512,16 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
...
@@ -512,16 +512,16 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
if
(
i
>=
low
&&
i
<=
high
)
{
if
(
i
>=
low
&&
i
<=
high
)
{
if
(
addflag
)
{
if
(
addflag
)
{
//
pr
("adding "+ids.join())
//
console.log
("adding "+ids.join())
for
(
var
id
in
ids
)
{
for
(
var
id
in
ids
)
{
ID
=
ids
[
id
]
ID
=
ids
[
id
]
TW
.
Edges
[
ID
].
lock
=
false
;
TW
.
Edges
[
ID
].
lock
=
false
;
if
(
present
.
level
)
{
if
(
present
.
level
)
{
//
pr
("\tADD "+ID)
//
console.log
("\tADD "+ID)
// n = ID.split(";")
// n = ID.split(";")
// if(n.length>1)
// if(n.length>1)
//
pr
("\t\tsource:("+TW.Nodes[n[0]].x+","+TW.Nodes[n[0]].y+") ||| target:("+TW.Nodes[n[1]].x+","+TW.Nodes[n[1]].y+")")
//
console.log
("\t\tsource:("+TW.Nodes[n[0]].x+","+TW.Nodes[n[0]].y+") ||| target:("+TW.Nodes[n[1]].x+","+TW.Nodes[n[1]].y+")")
add1Elem
(
ID
)
add1Elem
(
ID
)
}
else
{
}
else
{
for
(
var
n
in
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
)
{
for
(
var
n
in
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
)
{
...
@@ -531,7 +531,7 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
...
@@ -531,7 +531,7 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
if
(
isUndef
(
getn
(
sid
)))
unHide
(
sid
)
if
(
isUndef
(
getn
(
sid
)))
unHide
(
sid
)
if
(
isUndef
(
getn
(
tid
)))
unHide
(
tid
)
if
(
isUndef
(
getn
(
tid
)))
unHide
(
tid
)
add1Elem
(
ID
)
add1Elem
(
ID
)
//
pr
("\tADD "+ID)
//
console.log
("\tADD "+ID)
}
}
}
}
}
}
...
@@ -541,16 +541,16 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
...
@@ -541,16 +541,16 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
}
else
{
}
else
{
if
(
delflag
)
{
if
(
delflag
)
{
//
pr
("deleting "+ids.join())
//
console.log
("deleting "+ids.join())
for
(
var
id
in
ids
)
{
for
(
var
id
in
ids
)
{
ID
=
ids
[
id
]
ID
=
ids
[
id
]
if
(
!
isUndef
(
gete
(
ID
)))
{
if
(
!
isUndef
(
gete
(
ID
)))
{
TW
.
partialGraph
.
dropEdge
(
ID
)
TW
.
partialGraph
.
dropEdge
(
ID
)
TW
.
Edges
[
ID
].
lock
=
true
;
TW
.
Edges
[
ID
].
lock
=
true
;
//
pr
("\tDEL "+ID)
//
console.log
("\tDEL "+ID)
// n = ID.split(";")
// n = ID.split(";")
// if(n.length>1)
// if(n.length>1)
//
pr
("\t\tsource:("+TW.Nodes[n[0]].x+","+TW.Nodes[n[0]].y+") ||| target:("+TW.Nodes[n[1]].x+","+TW.Nodes[n[1]].y+")")
//
console.log
("\t\tsource:("+TW.Nodes[n[0]].x+","+TW.Nodes[n[0]].y+") ||| target:("+TW.Nodes[n[1]].x+","+TW.Nodes[n[1]].y+")")
}
}
}
}
}
}
...
@@ -586,7 +586,7 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
...
@@ -586,7 +586,7 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
function
NodeWeightFilter
(
categories
,
sliderDivID
,
type_attrb
,
type
,
criteria
)
{
function
NodeWeightFilter
(
categories
,
sliderDivID
,
type_attrb
,
type
,
criteria
)
{
// if ($(sliderDivID).html()!="") {
// if ($(sliderDivID).html()!="") {
//
pr
("\t\t\t\t\t\t[[ algorithm not applied "+sliderDivID+" ]]")
//
console.log
("\t\t\t\t\t\t[[ algorithm not applied "+sliderDivID+" ]]")
// return;
// return;
// }
// }
...
@@ -616,8 +616,8 @@ function NodeWeightFilter( categories , sliderDivID , type_attrb , type , crit
...
@@ -616,8 +616,8 @@ function NodeWeightFilter( categories , sliderDivID , type_attrb , type , crit
}
}
var
filterparams
=
AlgorithmForSliders
(
TW
.
Nodes
,
type
,
type_attrb
,
criteria
)
var
filterparams
=
AlgorithmForSliders
(
TW
.
Nodes
,
type
,
type_attrb
,
criteria
)
pr
(
"NodeWeightFilter: "
+
type
)
console
.
log
(
"NodeWeightFilter: "
+
type
)
pr
(
filterparams
)
console
.
log
(
filterparams
)
var
steps
=
filterparams
[
"steps"
]
var
steps
=
filterparams
[
"steps"
]
var
finalarray
=
filterparams
[
"finalarray"
]
var
finalarray
=
filterparams
[
"finalarray"
]
...
@@ -727,10 +727,10 @@ function AlgorithmForSliders( elements , type_attrb , type , criteria) {
...
@@ -727,10 +727,10 @@ function AlgorithmForSliders( elements , type_attrb , type , criteria) {
e
=
elems
[
i
]
e
=
elems
[
i
]
id
=
e
.
id
id
=
e
.
id
elem_attrb
[
id
]
=
e
[
criteria
]
elem_attrb
[
id
]
=
e
[
criteria
]
//
pr
(id+"\t:\t"+e[criteria])
//
console.log
(id+"\t:\t"+e[criteria])
}
}
//
pr
("{ id : size|weight } ")
//
console.log
("{ id : size|weight } ")
//
pr
(elem_attrb)
//
console.log
(elem_attrb)
// // ( 3 )
// // ( 3 )
// // order dict edges_weight by edge weight | nodes_size by node size
// // order dict edges_weight by edge weight | nodes_size by node size
...
@@ -738,16 +738,16 @@ function AlgorithmForSliders( elements , type_attrb , type , criteria) {
...
@@ -738,16 +738,16 @@ function AlgorithmForSliders( elements , type_attrb , type , criteria) {
return
a
-
b
return
a
-
b
//ASCENDENT
//ASCENDENT
});
});
//
pr
(result.length)
//
console.log
(result.length)
// // ( 4 )
// // ( 4 )
// // printing ordered ASC by weigth
// // printing ordered ASC by weigth
// for (var i in result) {
// for (var i in result) {
// r = result[i]
// r = result[i]
// idid = r.key
// idid = r.key
// elemattrb = r.value
// elemattrb = r.value
//
pr
(idid+"\t:\t"+elemattrb)
//
console.log
(idid+"\t:\t"+elemattrb)
// // e = result[i]
// // e = result[i]
// //
pr
(e[criteria])
// //
console.log
(e[criteria])
// }
// }
var
N
=
result
.
length
var
N
=
result
.
length
// var magnitude = (""+N).length //order of magnitude of edges|nodes
// var magnitude = (""+N).length //order of magnitude of edges|nodes
...
@@ -760,24 +760,24 @@ function AlgorithmForSliders( elements , type_attrb , type , criteria) {
...
@@ -760,24 +760,24 @@ function AlgorithmForSliders( elements , type_attrb , type , criteria) {
var
steps
=
Math
.
round
(
Math
.
sqrt
(
N
)
);
var
steps
=
Math
.
round
(
Math
.
sqrt
(
N
)
);
var
stepsize
=
Math
.
round
(
N
/
steps
);
var
stepsize
=
Math
.
round
(
N
/
steps
);
//
pr
("-----------------------------------")
//
console.log
("-----------------------------------")
//
pr
("number of visible nodes|edges: "+N);
//
console.log
("number of visible nodes|edges: "+N);
//
pr
("number of steps : "+steps)
//
console.log
("number of steps : "+steps)
//
pr
("size of one step : "+stepsize)
//
console.log
("size of one step : "+stepsize)
//
pr
("-----------------------------------")
//
console.log
("-----------------------------------")
var
finalarray
=
[]
var
finalarray
=
[]
var
counter
=
0
var
counter
=
0
for
(
var
i
=
0
;
i
<
steps
*
2
;
i
++
)
{
for
(
var
i
=
0
;
i
<
steps
*
2
;
i
++
)
{
//
pr
(i)
//
console.log
(i)
var
IDs
=
[]
var
IDs
=
[]
for
(
var
j
=
0
;
j
<
stepsize
;
j
++
)
{
for
(
var
j
=
0
;
j
<
stepsize
;
j
++
)
{
if
(
!
isUndef
(
result
[
counter
]))
{
if
(
!
isUndef
(
result
[
counter
]))
{
k
=
result
[
counter
].
key
k
=
result
[
counter
].
key
// w = result[counter].value
// w = result[counter].value
//
pr
("\t["+counter+"] : "+w)
//
console.log
("\t["+counter+"] : "+w)
IDs
.
push
(
k
)
IDs
.
push
(
k
)
}
}
counter
++
;
counter
++
;
...
@@ -786,7 +786,7 @@ function AlgorithmForSliders( elements , type_attrb , type , criteria) {
...
@@ -786,7 +786,7 @@ function AlgorithmForSliders( elements , type_attrb , type , criteria) {
finalarray
[
i
]
=
(
edgeflag
)?
IDs
:
IDs
.
map
(
Number
);
finalarray
[
i
]
=
(
edgeflag
)?
IDs
:
IDs
.
map
(
Number
);
}
}
//
pr
("finalarray: ")
//
console.log
("finalarray: ")
return
{
"steps"
:
finalarray
.
length
,
"finalarray"
:
finalarray
}
return
{
"steps"
:
finalarray
.
length
,
"finalarray"
:
finalarray
}
}
}
//=========================== </ FILTERS-SLIDERS > ===========================//
//=========================== </ FILTERS-SLIDERS > ===========================//
...
...
tinawebJS/methods.js
View file @
ccc08006
function
cancelSelection
(
fromTagCloud
)
{
function
cancelSelection
(
fromTagCloud
)
{
pr
(
"
\
t***in cancelSelection"
);
console
.
log
(
"
\
t***in cancelSelection"
);
highlightSelectedNodes
(
false
);
//Unselect the selected ones :D
highlightSelectedNodes
(
false
);
//Unselect the selected ones :D
opossites
=
[];
opossites
=
[];
selections
=
[];
selections
=
[];
...
@@ -13,8 +13,9 @@ function cancelSelection (fromTagCloud) {
...
@@ -13,8 +13,9 @@ function cancelSelection (fromTagCloud) {
//Nodes colors go back to normal
//Nodes colors go back to normal
overNodes
=
false
;
overNodes
=
false
;
e
=
TW
.
partialGraph
.
_core
.
graph
.
edges
;
e
=
TW
.
partialGraph
.
graph
.
edges
()
;
for
(
i
=
0
;
i
<
e
.
length
;
i
++
){
for
(
i
=
0
;
i
<
e
.
length
;
i
++
){
console
.
log
(
e
)
e
[
i
].
color
=
e
[
i
].
attr
[
'grey'
]
?
e
[
i
].
attr
[
'true_color'
]
:
e
[
i
].
color
;
e
[
i
].
color
=
e
[
i
].
attr
[
'grey'
]
?
e
[
i
].
attr
[
'true_color'
]
:
e
[
i
].
color
;
e
[
i
].
attr
[
'grey'
]
=
0
;
e
[
i
].
attr
[
'grey'
]
=
0
;
}
}
...
@@ -58,7 +59,7 @@ function cancelSelection (fromTagCloud) {
...
@@ -58,7 +59,7 @@ function cancelSelection (fromTagCloud) {
}
}
function
highlightSelectedNodes
(
flag
){
function
highlightSelectedNodes
(
flag
){
pr
(
"
\
t***methods.js:highlightSelectedNodes(flag)"
+
flag
+
" selEmpty:"
+
is_empty
(
selections
))
console
.
log
(
"
\
t***methods.js:highlightSelectedNodes(flag)"
+
flag
+
" selEmpty:"
+
is_empty
(
selections
))
if
(
!
is_empty
(
selections
)){
if
(
!
is_empty
(
selections
)){
for
(
var
i
in
selections
)
{
for
(
var
i
in
selections
)
{
if
(
TW
.
Nodes
[
i
].
type
==
TW
.
catSoc
&&
swclickActual
==
"social"
){
if
(
TW
.
Nodes
[
i
].
type
==
TW
.
catSoc
&&
swclickActual
==
"social"
){
...
@@ -93,7 +94,7 @@ function alertCheckBox(eventCheck){
...
@@ -93,7 +94,7 @@ function alertCheckBox(eventCheck){
// AaBb: Socio-Semantic
// AaBb: Socio-Semantic
function
RefreshState
(
newNOW
){
function
RefreshState
(
newNOW
){
pr
(
"
\
t
\
t
\
tin RefreshState newNOW:_"
+
newNOW
+
"_."
)
console
.
log
(
"
\
t
\
t
\
tin RefreshState newNOW:_"
+
newNOW
+
"_."
)
if
(
newNOW
!=
""
)
{
if
(
newNOW
!=
""
)
{
PAST
=
NOW
;
PAST
=
NOW
;
...
@@ -122,7 +123,7 @@ function RefreshState(newNOW){
...
@@ -122,7 +123,7 @@ function RefreshState(newNOW){
var
N
=
(
Object
.
keys
(
TW
.
Nodes
).
filter
(
function
(
n
){
return
TW
.
Nodes
[
n
].
type
==
TW
.
catSoc
})
).
length
var
N
=
(
Object
.
keys
(
TW
.
Nodes
).
filter
(
function
(
n
){
return
TW
.
Nodes
[
n
].
type
==
TW
.
catSoc
})
).
length
var
k
=
Object
.
keys
(
getNeighs
(
Object
.
keys
(
selections
),
nodes1
)).
length
var
k
=
Object
.
keys
(
getNeighs
(
Object
.
keys
(
selections
),
nodes1
)).
length
var
s
=
Object
.
keys
(
selections
).
length
var
s
=
Object
.
keys
(
selections
).
length
pr
(
"in social N: "
+
N
+
" - k: "
+
k
+
" - s: "
+
s
)
console
.
log
(
"in social N: "
+
N
+
" - k: "
+
k
+
" - s: "
+
s
)
if
(
NOW
==
"A"
){
if
(
NOW
==
"A"
){
if
(
(
s
==
0
||
k
>=
(
N
-
1
))
)
{
if
(
(
s
==
0
||
k
>=
(
N
-
1
))
)
{
LevelButtonDisable
(
true
);
LevelButtonDisable
(
true
);
...
@@ -143,7 +144,7 @@ function RefreshState(newNOW){
...
@@ -143,7 +144,7 @@ function RefreshState(newNOW){
var
N
=
(
Object
.
keys
(
TW
.
Nodes
).
filter
(
function
(
n
){
return
TW
.
Nodes
[
n
].
type
==
TW
.
catSem
})
).
length
var
N
=
(
Object
.
keys
(
TW
.
Nodes
).
filter
(
function
(
n
){
return
TW
.
Nodes
[
n
].
type
==
TW
.
catSem
})
).
length
var
k
=
Object
.
keys
(
getNeighs
(
Object
.
keys
(
selections
),
nodes2
)).
length
var
k
=
Object
.
keys
(
getNeighs
(
Object
.
keys
(
selections
),
nodes2
)).
length
var
s
=
Object
.
keys
(
selections
).
length
var
s
=
Object
.
keys
(
selections
).
length
pr
(
"in semantic N: "
+
N
+
" - k: "
+
k
+
" - s: "
+
s
)
console
.
log
(
"in semantic N: "
+
N
+
" - k: "
+
k
+
" - s: "
+
s
)
if
(
NOW
==
"B"
)
{
if
(
NOW
==
"B"
)
{
if
(
(
s
==
0
||
k
>=
(
N
-
1
))
)
{
if
(
(
s
==
0
||
k
>=
(
N
-
1
))
)
{
LevelButtonDisable
(
true
);
LevelButtonDisable
(
true
);
...
@@ -210,7 +211,7 @@ function htmlfied_alternodes(elems) {
...
@@ -210,7 +211,7 @@ function htmlfied_alternodes(elems) {
}
}
function
manualForceLabel
(
nodeid
,
active
)
{
function
manualForceLabel
(
nodeid
,
active
)
{
//
pr
("manual|"+nodeid+"|"+active)
//
console.log
("manual|"+nodeid+"|"+active)
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
nodeid
].
active
=
active
;
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
nodeid
].
active
=
active
;
TW
.
partialGraph
.
draw
();
TW
.
partialGraph
.
draw
();
}
}
...
@@ -317,7 +318,7 @@ function htmlfied_tagcloud(elems , limit) {
...
@@ -317,7 +318,7 @@ function htmlfied_tagcloud(elems , limit) {
//missing: getTopPapers for both node types
//missing: getTopPapers for both node types
//considering complete graphs case! <= maybe i should mv it
//considering complete graphs case! <= maybe i should mv it
function
updateLeftPanel_fix
(
sels
,
oppos
)
{
function
updateLeftPanel_fix
(
sels
,
oppos
)
{
pr
(
"updateLeftPanel() corrected version** "
)
console
.
log
(
"updateLeftPanel() corrected version** "
)
var
namesDIV
=
''
var
namesDIV
=
''
var
alterNodesDIV
=
''
var
alterNodesDIV
=
''
var
informationDIV
=
''
var
informationDIV
=
''
...
@@ -377,15 +378,15 @@ function updateLeftPanel_fix( sels , oppos ) {
...
@@ -377,15 +378,15 @@ function updateLeftPanel_fix( sels , oppos ) {
}
}
function
printStates
()
{
function
printStates
()
{
pr
(
"
\
t
\
t
\
t
\
t---------"
+
getClientTime
()
+
"---------"
)
console
.
log
(
"
\
t
\
t
\
t
\
t---------"
+
getClientTime
()
+
"---------"
)
pr
(
"
\
t
\
t
\
t
\
tswMacro: "
+
swMacro
)
console
.
log
(
"
\
t
\
t
\
t
\
tswMacro: "
+
swMacro
)
pr
(
"
\
t
\
t
\
t
\
tswActual: "
+
swclickActual
+
" | swPrev: "
+
swclickPrev
)
console
.
log
(
"
\
t
\
t
\
t
\
tswActual: "
+
swclickActual
+
" | swPrev: "
+
swclickPrev
)
pr
(
"
\
t
\
t
\
t
\
tNOW: "
+
NOW
+
" | PAST: "
+
PAST
)
console
.
log
(
"
\
t
\
t
\
t
\
tNOW: "
+
NOW
+
" | PAST: "
+
PAST
)
pr
(
"
\
t
\
t
\
t
\
tselections: "
)
console
.
log
(
"
\
t
\
t
\
t
\
tselections: "
)
pr
(
Object
.
keys
(
selections
))
console
.
log
(
Object
.
keys
(
selections
))
pr
(
"
\
t
\
t
\
t
\
topposites: "
)
console
.
log
(
"
\
t
\
t
\
t
\
topposites: "
)
pr
(
Object
.
keys
(
opossites
))
console
.
log
(
Object
.
keys
(
opossites
))
pr
(
"
\
t
\
t
\
t
\
t------------------------------------"
)
console
.
log
(
"
\
t
\
t
\
t
\
t------------------------------------"
)
}
}
// just css
// just css
...
@@ -397,7 +398,7 @@ function LevelButtonDisable( TF ){
...
@@ -397,7 +398,7 @@ function LevelButtonDisable( TF ){
//Fixed! apres: refactor!
//Fixed! apres: refactor!
function
graphTagCloudElem
(
nodes
)
{
function
graphTagCloudElem
(
nodes
)
{
pr
(
"in graphTagCloudElem, nodae_id: "
+
nodes
);
console
.
log
(
"in graphTagCloudElem, nodae_id: "
+
nodes
);
cancelSelection
();
cancelSelection
();
TW
.
partialGraph
.
emptyGraph
();
TW
.
partialGraph
.
emptyGraph
();
...
@@ -550,7 +551,7 @@ function graphResetColor(){
...
@@ -550,7 +551,7 @@ function graphResetColor(){
}
}
function
hideEverything
(){
function
hideEverything
(){
pr
(
"
\
thiding all"
);
console
.
log
(
"
\
thiding all"
);
nodeslength
=
0
;
nodeslength
=
0
;
for
(
var
n
in
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
){
for
(
var
n
in
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
){
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
n
].
hidden
=
true
;
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
n
].
hidden
=
true
;
...
@@ -559,7 +560,7 @@ function hideEverything(){
...
@@ -559,7 +560,7 @@ function hideEverything(){
TW
.
partialGraph
.
_core
.
graph
.
edgesIndex
[
e
].
hidden
=
true
;
TW
.
partialGraph
.
_core
.
graph
.
edgesIndex
[
e
].
hidden
=
true
;
}
}
overNodes
=
false
;
//magic line!
overNodes
=
false
;
//magic line!
pr
(
"
\
tall hidded"
);
console
.
log
(
"
\
tall hidded"
);
//Remember that this function is the analogy of EmptyGraph
//Remember that this function is the analogy of EmptyGraph
//"Saving node positions" should be applied in this function, too.
//"Saving node positions" should be applied in this function, too.
}
}
...
...
tinawebJS/sigma.forceatlas2.js
View file @
ccc08006
...
@@ -110,7 +110,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
...
@@ -110,7 +110,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
switch
(
self
.
state
.
step
)
{
switch
(
self
.
state
.
step
)
{
case
0
:
// Pass init
case
0
:
// Pass init
//
pr
("case0 - "+"the self.count: "+self.count)
//
console.log
("case0 - "+"the self.count: "+self.count)
// Initialise layout data
// Initialise layout data
self
.
count
++
;
self
.
count
++
;
...
@@ -185,7 +185,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
...
@@ -185,7 +185,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
break
;
break
;
case
1
:
// Repulsion
case
1
:
// Repulsion
//
pr
("case1 - "+"the self.count: "+self.count)
//
console.log
("case1 - "+"the self.count: "+self.count)
var
Repulsion
=
self
.
ForceFactory
.
buildRepulsion
(
var
Repulsion
=
self
.
ForceFactory
.
buildRepulsion
(
self
.
p
.
adjustSizes
,
self
.
p
.
adjustSizes
,
self
.
p
.
scalingRatio
self
.
p
.
scalingRatio
...
@@ -230,7 +230,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
...
@@ -230,7 +230,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
break
;
break
;
case
2
:
// Gravity
case
2
:
// Gravity
//
pr
("case2 - "+"the self.count: "+self.count)
//
console.log
("case2 - "+"the self.count: "+self.count)
var
Gravity
=
(
self
.
p
.
strongGravityMode
)
?
var
Gravity
=
(
self
.
p
.
strongGravityMode
)
?
(
self
.
ForceFactory
.
getStrongGravity
(
(
self
.
ForceFactory
.
getStrongGravity
(
self
.
p
.
scalingRatio
self
.
p
.
scalingRatio
...
@@ -260,7 +260,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
...
@@ -260,7 +260,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
break
;
break
;
case
3
:
// Attraction
case
3
:
// Attraction
//
pr
("case3 - "+"the self.count: "+self.count)
//
console.log
("case3 - "+"the self.count: "+self.count)
var
Attraction
=
self
.
ForceFactory
.
buildAttraction
(
var
Attraction
=
self
.
ForceFactory
.
buildAttraction
(
self
.
p
.
linLogMode
,
self
.
p
.
linLogMode
,
self
.
p
.
outboundAttractionDistribution
,
self
.
p
.
outboundAttractionDistribution
,
...
@@ -308,7 +308,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
...
@@ -308,7 +308,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
break
;
break
;
case
4
:
// Auto adjust speed
case
4
:
// Auto adjust speed
//
pr
("case4 - "+"the self.count: "+self.count)
//
console.log
("case4 - "+"the self.count: "+self.count)
var
totalSwinging
=
0
;
// How much irregular movement
var
totalSwinging
=
0
;
// How much irregular movement
var
totalEffectiveTraction
=
0
;
// Hom much useful movement
var
totalEffectiveTraction
=
0
;
// Hom much useful movement
var
swingingSum
=
0
;
var
swingingSum
=
0
;
...
@@ -340,7 +340,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
...
@@ -340,7 +340,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
var
convg
=
((
Math
.
pow
(
nodes
.
length
,
2
))
/
promdxdy
);
/**/
var
convg
=
((
Math
.
pow
(
nodes
.
length
,
2
))
/
promdxdy
);
/**/
var
swingingVSnodes_length
=
swingingSum
/
nodes
.
length
;
/**/
var
swingingVSnodes_length
=
swingingSum
/
nodes
.
length
;
/**/
if
(
stopcriteria
&&
(
convg
>
swingingVSnodes_length
)){
if
(
stopcriteria
&&
(
convg
>
swingingVSnodes_length
)){
pr
(
"i've applied the stopcriteria: "
+
self
.
count
)
console
.
log
(
"i've applied the stopcriteria: "
+
self
.
count
)
TW
.
partialGraph
.
stopForceAtlas2
();
TW
.
partialGraph
.
stopForceAtlas2
();
}
}
...
@@ -373,7 +373,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
...
@@ -373,7 +373,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
break
;
break
;
case
5
:
// Apply forces
case
5
:
// Apply forces
//
pr
("case5 - "+"the self.count: "+self.count)
//
console.log
("case5 - "+"the self.count: "+self.count)
var
i
=
self
.
state
.
index
;
var
i
=
self
.
state
.
index
;
if
(
self
.
p
.
adjustSizes
)
{
if
(
self
.
p
.
adjustSizes
)
{
var
speed
=
self
.
p
.
speed
;
var
speed
=
self
.
p
.
speed
;
...
@@ -1120,7 +1120,7 @@ sigma.publicPrototype.startForceAtlas2 = function() {
...
@@ -1120,7 +1120,7 @@ sigma.publicPrototype.startForceAtlas2 = function() {
this
.
forceatlas2
.
init
();
this
.
forceatlas2
.
init
();
this
.
forceatlas2
.
active
=
true
;
this
.
forceatlas2
.
active
=
true
;
//
pr
("\t\t\t\t\tFA2 Started")
//
console.log
("\t\t\t\t\tFA2 Started")
var
ene
=
this
.
_core
.
graph
.
nodes
.
length
;
var
ene
=
this
.
_core
.
graph
.
nodes
.
length
;
var
isolatedBCauseFilter
=
0
;
var
isolatedBCauseFilter
=
0
;
for
(
var
i
in
this
.
_core
.
graph
.
nodesIndex
)
{
for
(
var
i
in
this
.
_core
.
graph
.
nodesIndex
)
{
...
@@ -1143,7 +1143,7 @@ sigma.publicPrototype.startForceAtlas2 = function() {
...
@@ -1143,7 +1143,7 @@ sigma.publicPrototype.startForceAtlas2 = function() {
// fixing anomaly in forceatlas2
// fixing anomaly in forceatlas2
$
.
doTimeout
(
250
,
function
(){
$
.
doTimeout
(
250
,
function
(){
if
(
!
present
.
level
&&
TW
.
partialGraph
.
forceatlas2
.
active
&&
TW
.
partialGraph
.
forceatlas2
.
count
==
0
)
{
if
(
!
present
.
level
&&
TW
.
partialGraph
.
forceatlas2
.
active
&&
TW
.
partialGraph
.
forceatlas2
.
count
==
0
)
{
pr
(
"SUPER JUTSU!!"
)
console
.
log
(
"SUPER JUTSU!!"
)
TW
.
partialGraph
.
startForceAtlas2
();
TW
.
partialGraph
.
startForceAtlas2
();
return
;
return
;
}
}
...
@@ -1156,7 +1156,7 @@ sigma.publicPrototype.stopForceAtlas2 = function() {
...
@@ -1156,7 +1156,7 @@ sigma.publicPrototype.stopForceAtlas2 = function() {
var
present
=
TW
.
partialGraph
.
states
.
slice
(
-
1
)[
0
]
var
present
=
TW
.
partialGraph
.
states
.
slice
(
-
1
)[
0
]
if
(
this
.
forceatlas2
)
{
if
(
this
.
forceatlas2
)
{
if
(
this
.
forceatlas2
.
count
)
{
if
(
this
.
forceatlas2
.
count
)
{
pr
(
"
\
t
\
t
\
t
\
t
\
tFA2 Stopped: "
+
this
.
forceatlas2
.
count
)
console
.
log
(
"
\
t
\
t
\
t
\
t
\
tFA2 Stopped: "
+
this
.
forceatlas2
.
count
)
if
(
present
.
level
&&
this
.
forceatlas2
.
count
>
2
)
{
if
(
present
.
level
&&
this
.
forceatlas2
.
count
>
2
)
{
// not-save-positions if an edge-filter is ON
// not-save-positions if an edge-filter is ON
first_state
=
present
.
type
;
first_state
=
present
.
type
;
...
@@ -1186,7 +1186,7 @@ sigma.publicPrototype.stopForceAtlas2 = function() {
...
@@ -1186,7 +1186,7 @@ sigma.publicPrototype.stopForceAtlas2 = function() {
if
(
first_time
)
{
if
(
first_time
)
{
$
.
doTimeout
(
100
,
function
(){
$
.
doTimeout
(
100
,
function
(){
pr
(
"
\
t
\
t
\
t
\
t
\
tFirst time FA2 Stopped"
)
console
.
log
(
"
\
t
\
t
\
t
\
t
\
tFirst time FA2 Stopped"
)
for
(
var
i
in
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
){
for
(
var
i
in
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
){
TW
.
Nodes
[
i
].
x
=
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
].
x
;
TW
.
Nodes
[
i
].
x
=
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
].
x
;
TW
.
Nodes
[
i
].
y
=
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
].
y
;
TW
.
Nodes
[
i
].
y
=
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
].
y
;
...
...
tinawebJS/sigma.parseCustom.js
View file @
ccc08006
...
@@ -38,23 +38,23 @@ ParseCustom.prototype.scanFile = function() {
...
@@ -38,23 +38,23 @@ ParseCustom.prototype.scanFile = function() {
switch
(
this
.
format
)
{
switch
(
this
.
format
)
{
case
"api.json"
:
case
"api.json"
:
pr
(
"scanFile: "
+
this
.
format
)
console
.
log
(
"scanFile: "
+
this
.
format
)
break
;
break
;
case
"db.json"
:
case
"db.json"
:
pr
(
"scanFile: "
+
this
.
format
)
console
.
log
(
"scanFile: "
+
this
.
format
)
break
;
break
;
case
"json"
:
case
"json"
:
pr
(
"scanFile: "
+
this
.
format
)
console
.
log
(
"scanFile: "
+
this
.
format
)
categories
=
this
.
getJSONCategories
(
this
.
data
);
categories
=
this
.
getJSONCategories
(
this
.
data
);
return
categories
;
return
categories
;
break
;
break
;
case
"gexf"
:
case
"gexf"
:
pr
(
"scanFile: "
+
this
.
format
)
console
.
log
(
"scanFile: "
+
this
.
format
)
categories
=
this
.
getGEXFCategories
(
this
.
data
);
categories
=
this
.
getGEXFCategories
(
this
.
data
);
return
categories
;
return
categories
;
break
;
break
;
default
:
default
:
pr
(
"scanFile jsaispas: "
+
this
.
format
)
console
.
log
(
"scanFile jsaispas: "
+
this
.
format
)
break
;
break
;
}
}
};
};
...
@@ -64,23 +64,23 @@ ParseCustom.prototype.makeDicts = function(categories) {
...
@@ -64,23 +64,23 @@ ParseCustom.prototype.makeDicts = function(categories) {
switch
(
this
.
format
)
{
switch
(
this
.
format
)
{
case
"api.json"
:
case
"api.json"
:
pr
(
"makeDicts: "
+
this
.
format
)
console
.
log
(
"makeDicts: "
+
this
.
format
)
break
;
break
;
case
"db.json"
:
case
"db.json"
:
pr
(
"makeDicts: "
+
this
.
format
)
console
.
log
(
"makeDicts: "
+
this
.
format
)
break
;
break
;
case
"json"
:
case
"json"
:
pr
(
"makeDicts: "
+
this
.
format
)
console
.
log
(
"makeDicts: "
+
this
.
format
)
dictionaries
=
this
.
parseJSON
(
categories
);
dictionaries
=
this
.
parseJSON
(
categories
);
return
dictionaries
;
return
dictionaries
;
break
;
break
;
case
"gexf"
:
case
"gexf"
:
pr
(
"makeDicts: "
+
this
.
format
)
console
.
log
(
"makeDicts: "
+
this
.
format
)
dictionaries
=
this
.
parseGEXF
(
categories
);
dictionaries
=
this
.
parseGEXF
(
categories
);
return
dictionaries
;
return
dictionaries
;
break
;
break
;
default
:
default
:
pr
(
"makeDicts jsaispas: "
+
this
.
format
)
console
.
log
(
"makeDicts jsaispas: "
+
this
.
format
)
break
;
break
;
}
}
};
};
...
@@ -240,7 +240,7 @@ function dictfyGexf( gexf , categories ){
...
@@ -240,7 +240,7 @@ function dictfyGexf( gexf , categories ){
var
color
;
var
color
;
if
(
colorNodes
.
length
>
0
){
if
(
colorNodes
.
length
>
0
){
colorNode
=
colorNodes
[
0
];
colorNode
=
colorNodes
[
0
];
color
=
'#'
+
sigma
.
t
ools
.
rgbToHex
(
parseFloat
(
colorNode
.
getAttribute
(
'r'
)),
color
=
'#'
+
sigma
T
ools
.
rgbToHex
(
parseFloat
(
colorNode
.
getAttribute
(
'r'
)),
parseFloat
(
colorNode
.
getAttribute
(
'g'
)),
parseFloat
(
colorNode
.
getAttribute
(
'g'
)),
parseFloat
(
colorNode
.
getAttribute
(
'b'
)));
parseFloat
(
colorNode
.
getAttribute
(
'b'
)));
}
// [ / get Colour ]
}
// [ / get Colour ]
...
...
tinawebJS/sigma.
min
.js
→
tinawebJS/sigma.
v1.customized
.js
View file @
ccc08006
...
@@ -460,8 +460,8 @@ sigma.classes.Cascade = function() {
...
@@ -460,8 +460,8 @@ sigma.classes.Cascade = function() {
// Interaction listeners:
// Interaction listeners:
this
.
mousecaptor
.
bind
(
'drag interpolate'
,
function
(
e
)
{
this
.
mousecaptor
.
bind
(
'drag interpolate'
,
function
(
e
)
{
//
pr
("drag stuff");
//
console.log
("drag stuff");
//
pr
("click dragging");
//
console.log
("click dragging");
self
.
draw
(
self
.
draw
(
self
.
p
.
auto
?
2
:
self
.
p
.
drawNodes
,
self
.
p
.
auto
?
2
:
self
.
p
.
drawNodes
,
self
.
p
.
auto
?
0
:
self
.
p
.
drawEdges
,
self
.
p
.
auto
?
0
:
self
.
p
.
drawEdges
,
...
@@ -477,7 +477,7 @@ sigma.classes.Cascade = function() {
...
@@ -477,7 +477,7 @@ sigma.classes.Cascade = function() {
);
);
}).
bind
(
'move'
,
function
()
{
}).
bind
(
'move'
,
function
()
{
//Detects any movement of the cursor
//Detects any movement of the cursor
//
pr
("move");
//
console.log
("move");
self
.
domElements
.
hover
.
getContext
(
'2d'
).
clearRect
(
self
.
domElements
.
hover
.
getContext
(
'2d'
).
clearRect
(
0
,
0
,
0
,
0
,
...
@@ -489,7 +489,7 @@ sigma.classes.Cascade = function() {
...
@@ -489,7 +489,7 @@ sigma.classes.Cascade = function() {
drawActive
();
drawActive
();
// if(cursor_size>0){
// if(cursor_size>0){
//
pr
("moving with mouse-circle ON");
//
console.log
("moving with mouse-circle ON");
// }
// }
});
});
...
@@ -1090,7 +1090,7 @@ sigma.classes.Cascade = function() {
...
@@ -1090,7 +1090,7 @@ sigma.classes.Cascade = function() {
tmp
=
b
.
replace
(
"rgba("
,
""
).
replace
(
")"
,
""
).
split
(
","
)
tmp
=
b
.
replace
(
"rgba("
,
""
).
replace
(
")"
,
""
).
split
(
","
)
b
=
rgbToHex
(
parseFloat
(
tmp
[
0
]
)
,
parseFloat
(
tmp
[
1
]
)
,
parseFloat
(
tmp
[
2
]
)
);
b
=
rgbToHex
(
parseFloat
(
tmp
[
0
]
)
,
parseFloat
(
tmp
[
1
]
)
,
parseFloat
(
tmp
[
2
]
)
);
}
}
//
pr
(source+" : "+a+"\t|\t"+target+" : "+b)
//
console.log
(source+" : "+a+"\t|\t"+target+" : "+b)
a
=
hex2rga
(
a
);
a
=
hex2rga
(
a
);
b
=
hex2rga
(
b
);
b
=
hex2rga
(
b
);
var
r
=
(
a
[
0
]
+
b
[
0
])
>>
1
;
var
r
=
(
a
[
0
]
+
b
[
0
])
>>
1
;
...
@@ -1099,7 +1099,7 @@ sigma.classes.Cascade = function() {
...
@@ -1099,7 +1099,7 @@ sigma.classes.Cascade = function() {
// var color = '#'+sigma.tools.rgbToHex(parseFloat(r),parseFloat(g),parseFloat(b))
// var color = '#'+sigma.tools.rgbToHex(parseFloat(r),parseFloat(g),parseFloat(b))
var
color
=
"rgba( "
+
r
+
", "
+
g
+
" , "
+
b
+
" ,0.5)"
;
var
color
=
"rgba( "
+
r
+
", "
+
g
+
" , "
+
b
+
" ,0.5)"
;
//
pr
(params.label);
//
console.log
(params.label);
// if(params.label=="nodes1") {
// if(params.label=="nodes1") {
// color = "#cedc75";
// color = "#cedc75";
// }
// }
...
@@ -1281,31 +1281,31 @@ sigma.classes.Cascade = function() {
...
@@ -1281,31 +1281,31 @@ sigma.classes.Cascade = function() {
self
.
nodes
=
[];
self
.
nodes
=
[];
if
(
self
.
nodes
.
length
>
0
)
{
if
(
self
.
nodes
.
length
>
0
)
{
pr
(
"splicing nodes"
)
console
.
log
(
"splicing nodes"
)
self
.
nodes
.
splice
(
0
,
self
.
nodes
.
length
);
self
.
nodes
.
splice
(
0
,
self
.
nodes
.
length
);
}
}
self
.
nodesIndex
=
{};
self
.
nodesIndex
=
{};
if
(
self
.
nodesIndex
.
length
>
0
)
{
if
(
self
.
nodesIndex
.
length
>
0
)
{
pr
(
"splicing nodesIndex"
)
console
.
log
(
"splicing nodesIndex"
)
self
.
nodesIndex
.
splice
(
0
,
self
.
nodesIndex
.
length
);
self
.
nodesIndex
.
splice
(
0
,
self
.
nodesIndex
.
length
);
}
}
self
.
edges
=
[];
self
.
edges
=
[];
if
(
self
.
edges
.
length
>
0
)
{
if
(
self
.
edges
.
length
>
0
)
{
pr
(
"splicing edges"
)
console
.
log
(
"splicing edges"
)
self
.
edges
.
splice
(
0
,
self
.
edges
.
length
);
self
.
edges
.
splice
(
0
,
self
.
edges
.
length
);
}
}
self
.
edgesIndex
=
{};
self
.
edgesIndex
=
{};
if
(
self
.
edgesIndex
.
length
>
0
)
{
if
(
self
.
edgesIndex
.
length
>
0
)
{
pr
(
"splicing edgesIndex"
)
console
.
log
(
"splicing edgesIndex"
)
self
.
edgesIndex
.
splice
(
0
,
self
.
edgesIndex
.
length
);
self
.
edgesIndex
.
splice
(
0
,
self
.
edgesIndex
.
length
);
}
}
labels
=
[];
labels
=
[];
if
(
labels
.
length
>
0
)
{
if
(
labels
.
length
>
0
)
{
pr
(
"splicing labels"
)
console
.
log
(
"splicing labels"
)
labels
.
splice
(
0
,
labels
.
length
);
labels
.
splice
(
0
,
labels
.
length
);
}
}
...
...
tinawebJS/sigmaUtils.js
View file @
ccc08006
...
@@ -13,20 +13,22 @@ SigmaUtils = function () {
...
@@ -13,20 +13,22 @@ SigmaUtils = function () {
var
n
=
nodes
[
i
];
var
n
=
nodes
[
i
];
if
(
initialState
[
catDict
[
n
.
type
]])
{
if
(
initialState
[
catDict
[
n
.
type
]])
{
var
node
=
(
{
var
node
=
{
id
:
n
.
id
,
id
:
n
.
id
,
label
:
n
.
label
,
label
:
n
.
label
,
size
:
n
.
size
,
size
:
n
.
size
,
color
:
n
.
color
,
color
:
n
.
color
,
type
:
n
.
type
,
x
:
n
.
x
,
x
:
n
.
x
,
y
:
n
.
y
y
:
n
.
y
,
})
type
:
n
.
type
}
if
(
n
.
shape
)
node
.
shape
=
n
.
shape
;
if
(
n
.
shape
)
node
.
shape
=
n
.
shape
;
// console.log(node)
// console.log(node)
if
(
Number
(
n
.
id
)
==
287
)
console
.
log
(
"coordinates of node 287: ( "
+
n
.
x
+
" , "
+
n
.
y
+
" ) "
)
if
(
Number
(
n
.
id
)
==
287
)
console
.
log
(
"coordinates of node 287: ( "
+
n
.
x
+
" , "
+
n
.
y
+
" ) "
)
graph
.
addNode
(
n
.
id
,
node
);
// REFA new way => no separate id
graph
.
nodes
.
push
(
node
);
// fill the "labels" global variable
// fill the "labels" global variable
updateSearchLabels
(
n
.
id
,
n
.
label
,
n
.
type
);
updateSearchLabels
(
n
.
id
,
n
.
label
,
n
.
type
);
...
@@ -42,15 +44,23 @@ SigmaUtils = function () {
...
@@ -42,15 +44,23 @@ SigmaUtils = function () {
e
=
TW
.
Edges
[
s
+
";"
+
t
]
e
=
TW
.
Edges
[
s
+
";"
+
t
]
if
(
e
)
{
if
(
e
)
{
if
(
e
.
source
!=
e
.
target
)
{
if
(
e
.
source
!=
e
.
target
)
{
var
edge
=
({
var
edge
=
{
// sigma mandatory properties
id
:
e
.
id
,
id
:
e
.
id
,
// REFA was: sourceID, targetID
source
:
e
.
source
,
target
:
e
.
target
,
weight
:
e
.
weight
,
// size : e.weight, // REFA s/weight/size/ ?
hidden
:
false
,
hidden
:
false
,
sourceID
:
e
.
source
,
// twjs additional properties
t
argetID
:
e
.
target
,
t
ype
:
e
.
type
type
:
e
.
type
,
}
weight
:
e
.
weight
})
// REFA new way
graph
.
addEdge
(
e
.
id
,
e
.
source
,
e
.
target
,
edge
);
graph
.
edges
.
push
(
edge
);
}
}
}
}
}
}
...
@@ -309,7 +319,7 @@ function clustersBy(daclass) {
...
@@ -309,7 +319,7 @@ function clustersBy(daclass) {
var
newval_size
=
Math
.
round
(
(
Min_size
+
(
NodeID_Val
[
i
][
"round"
]
-
real_min
)
*
((
Max_size
-
Min_size
)
/
(
real_max
-
real_min
))
)
);
var
newval_size
=
Math
.
round
(
(
Min_size
+
(
NodeID_Val
[
i
][
"round"
]
-
real_min
)
*
((
Max_size
-
Min_size
)
/
(
real_max
-
real_min
))
)
);
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
].
size
=
newval_size
;
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
].
size
=
newval_size
;
//
pr
("real:"+ NodeID_Val[i]["real"] + " | newvalue: "+newval_size)
//
console.log
("real:"+ NodeID_Val[i]["real"] + " | newvalue: "+newval_size)
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
].
label
=
"("
+
NodeID_Val
[
i
][
"real"
].
toFixed
(
min_pow
)
+
") "
+
TW
.
Nodes
[
i
].
label
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
].
label
=
"("
+
NodeID_Val
[
i
][
"real"
].
toFixed
(
min_pow
)
+
") "
+
TW
.
Nodes
[
i
].
label
}
}
...
@@ -448,13 +458,13 @@ function colorsRelByBins(daclass) {
...
@@ -448,13 +458,13 @@ function colorsRelByBins(daclass) {
function
colorsBy
(
daclass
)
{
function
colorsBy
(
daclass
)
{
pr
(
""
)
console
.
log
(
""
)
pr
(
" = = = = = = = = = = = = = = = = = "
)
console
.
log
(
" = = = = = = = = = = = = = = = = = "
)
pr
(
" = = = = = = = = = = = = = = = = = "
)
console
.
log
(
" = = = = = = = = = = = = = = = = = "
)
pr
(
"colorsBy ( "
+
daclass
+
" )"
)
console
.
log
(
"colorsBy ( "
+
daclass
+
" )"
)
pr
(
" = = = = = = = = = = = = = = = = = "
)
console
.
log
(
" = = = = = = = = = = = = = = = = = "
)
pr
(
" = = = = = = = = = = = = = = = = = "
)
console
.
log
(
" = = = = = = = = = = = = = = = = = "
)
pr
(
""
)
console
.
log
(
""
)
if
(
daclass
==
"clust_louvain"
)
{
if
(
daclass
==
"clust_louvain"
)
{
if
(
!
TW
.
partialGraph
.
states
.
slice
(
-
1
)[
0
].
LouvainFait
)
{
if
(
!
TW
.
partialGraph
.
states
.
slice
(
-
1
)[
0
].
LouvainFait
)
{
...
...
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