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
Expand all
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 ) {
if
(
att_s
==
"age"
)
the_method
=
"colorsRelByBins"
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
+=
' </li>'
...
...
@@ -151,7 +151,7 @@ function SomeEffect( ClusterCode ) {
n
.
forceLabel
=
false
;
var
node
=
TW
.
Nodes
[
n
.
id
]
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
;
}
}
...
...
@@ -185,7 +185,7 @@ function SomeEffect( ClusterCode ) {
for
(
var
i
in
edges_2_colour
)
{
an_edge
=
TW
.
partialGraph
.
_core
.
graph
.
edgesIndex
[
i
]
if
(
!
isUndef
(
an_edge
)
&&
!
an_edge
.
hidden
){
//
pr
(an_edge)
//
console.log
(an_edge)
an_edge
.
color
=
an_edge
.
attr
[
'true_color'
];
an_edge
.
attr
[
'grey'
]
=
0
;
}
...
...
@@ -289,11 +289,11 @@ function getTopPapers(type){
//contentType: "application/json",
//dataType: 'json',
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
);
},
error
:
function
(){
pr
(
'Page Not found: getTopPapers'
);
console
.
log
(
'Page Not found: getTopPapers'
);
}
});
}
...
...
@@ -302,7 +302,7 @@ function getTopPapers(type){
//FOR UNI-PARTITE
function
selectionUni
(
currentNode
){
pr
(
"
\
tin selectionUni:"
+
currentNode
.
id
);
console
.
log
(
"
\
tin selectionUni:"
+
currentNode
.
id
);
if
(
checkBox
==
false
&&
cursor_size
==
0
)
{
highlightSelectedNodes
(
false
);
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) {
switch
(
self
.
state
.
step
)
{
case
0
:
// Pass init
// Initialise layout data
//
pr
("caso 0")
//
console.log
("caso 0")
nodes
.
forEach
(
function
(
n
)
{
if
(
n
.
fa2
)
{
n
.
fa2
.
mass
=
1
+
n
.
degree
;
...
...
@@ -103,7 +103,7 @@ var ForceAtlas2 = function(graph) {
break
;
case
1
:
// Repulsion
//
pr
("caso 1")
//
console.log
("caso 1")
var
Repulsion
=
self
.
ForceFactory
.
buildRepulsion
(
self
.
p
.
adjustSizes
,
self
.
p
.
scalingRatio
...
...
@@ -148,7 +148,7 @@ var ForceAtlas2 = function(graph) {
break
;
case
2
:
// Gravity
//
pr
("caso 2")
//
console.log
("caso 2")
var
Gravity
=
(
self
.
p
.
strongGravityMode
)
?
(
self
.
ForceFactory
.
getStrongGravity
(
self
.
p
.
scalingRatio
...
...
@@ -178,7 +178,7 @@ var ForceAtlas2 = function(graph) {
break
;
case
3
:
// Attraction
//
pr
("caso 3")
//
console.log
("caso 3")
var
Attraction
=
self
.
ForceFactory
.
buildAttraction
(
self
.
p
.
linLogMode
,
self
.
p
.
outboundAttractionDistribution
,
...
...
@@ -220,7 +220,7 @@ var ForceAtlas2 = function(graph) {
break
;
case
4
:
// Auto adjust speed
//
pr
("caso 4")
//
console.log
("caso 4")
var
totalSwinging
=
0
;
// How much irregular movement
var
totalEffectiveTraction
=
0
;
// Hom much useful movement
var
swingingSum
=
0
;
...
...
@@ -282,7 +282,7 @@ var ForceAtlas2 = function(graph) {
break
;
case
5
:
// Apply forces
//
pr
("caso 5")
//
console.log
("caso 5")
var
i
=
self
.
state
.
index
;
if
(
self
.
p
.
adjustSizes
)
{
var
speed
=
self
.
p
.
speed
;
...
...
@@ -964,12 +964,12 @@ var applyForce = function(n, Force, theta) {
// 01. Return the values to MainContext when spatialization is finished
var
startForceAtlas2
=
function
(
graph
,
limit_it
)
{
//
pr
("inside FA2")
//
console.log
("inside FA2")
//// if(!this.forceatlas2) {
//
pr
(graph);
//
pr
(graph.nodes[0].x)
//
pr
(graph.nodes[0].y)
//
pr
("--------")
//
console.log
(graph);
//
console.log
(graph.nodes[0].x)
//
console.log
(graph.nodes[0].y)
//
console.log
("--------")
// nodes = graph.nodes;
// for(var n in nodes) {
...
...
@@ -1001,8 +1001,8 @@ var applyForce = function(n, Force, theta) {
count
++
;
if
(
flag
||
count
>
limit_it
)
break
;
}
//
pr
(forceatlas2.graph.nodes[0].x)
//
pr
(forceatlas2.graph.nodes[0].y)
//
console.log
(forceatlas2.graph.nodes[0].x)
//
console.log
(forceatlas2.graph.nodes[0].y)
// console.log("\titerations: "+count)
result
=
{
"nodes"
:
forceatlas2
.
graph
.
nodes
,
...
...
tinawebJS/enviroment.js
View file @
ccc08006
This diff is collapsed.
Click to expand it.
tinawebJS/methods.js
View file @
ccc08006
function
cancelSelection
(
fromTagCloud
)
{
pr
(
"
\
t***in cancelSelection"
);
console
.
log
(
"
\
t***in cancelSelection"
);
highlightSelectedNodes
(
false
);
//Unselect the selected ones :D
opossites
=
[];
selections
=
[];
...
...
@@ -13,8 +13,9 @@ function cancelSelection (fromTagCloud) {
//Nodes colors go back to normal
overNodes
=
false
;
e
=
TW
.
partialGraph
.
_core
.
graph
.
edges
;
e
=
TW
.
partialGraph
.
graph
.
edges
()
;
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
].
attr
[
'grey'
]
=
0
;
}
...
...
@@ -58,7 +59,7 @@ function cancelSelection (fromTagCloud) {
}
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
)){
for
(
var
i
in
selections
)
{
if
(
TW
.
Nodes
[
i
].
type
==
TW
.
catSoc
&&
swclickActual
==
"social"
){
...
...
@@ -93,7 +94,7 @@ function alertCheckBox(eventCheck){
// AaBb: Socio-Semantic
function
RefreshState
(
newNOW
){
pr
(
"
\
t
\
t
\
tin RefreshState newNOW:_"
+
newNOW
+
"_."
)
console
.
log
(
"
\
t
\
t
\
tin RefreshState newNOW:_"
+
newNOW
+
"_."
)
if
(
newNOW
!=
""
)
{
PAST
=
NOW
;
...
...
@@ -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
k
=
Object
.
keys
(
getNeighs
(
Object
.
keys
(
selections
),
nodes1
)).
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
(
(
s
==
0
||
k
>=
(
N
-
1
))
)
{
LevelButtonDisable
(
true
);
...
...
@@ -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
k
=
Object
.
keys
(
getNeighs
(
Object
.
keys
(
selections
),
nodes2
)).
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
(
(
s
==
0
||
k
>=
(
N
-
1
))
)
{
LevelButtonDisable
(
true
);
...
...
@@ -210,7 +211,7 @@ function htmlfied_alternodes(elems) {
}
function
manualForceLabel
(
nodeid
,
active
)
{
//
pr
("manual|"+nodeid+"|"+active)
//
console.log
("manual|"+nodeid+"|"+active)
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
nodeid
].
active
=
active
;
TW
.
partialGraph
.
draw
();
}
...
...
@@ -317,7 +318,7 @@ function htmlfied_tagcloud(elems , limit) {
//missing: getTopPapers for both node types
//considering complete graphs case! <= maybe i should mv it
function
updateLeftPanel_fix
(
sels
,
oppos
)
{
pr
(
"updateLeftPanel() corrected version** "
)
console
.
log
(
"updateLeftPanel() corrected version** "
)
var
namesDIV
=
''
var
alterNodesDIV
=
''
var
informationDIV
=
''
...
...
@@ -377,15 +378,15 @@ function updateLeftPanel_fix( sels , oppos ) {
}
function
printStates
()
{
pr
(
"
\
t
\
t
\
t
\
t---------"
+
getClientTime
()
+
"---------"
)
pr
(
"
\
t
\
t
\
t
\
tswMacro: "
+
swMacro
)
pr
(
"
\
t
\
t
\
t
\
tswActual: "
+
swclickActual
+
" | swPrev: "
+
swclickPrev
)
pr
(
"
\
t
\
t
\
t
\
tNOW: "
+
NOW
+
" | PAST: "
+
PAST
)
pr
(
"
\
t
\
t
\
t
\
tselections: "
)
pr
(
Object
.
keys
(
selections
))
pr
(
"
\
t
\
t
\
t
\
topposites: "
)
pr
(
Object
.
keys
(
opossites
))
pr
(
"
\
t
\
t
\
t
\
t------------------------------------"
)
console
.
log
(
"
\
t
\
t
\
t
\
t---------"
+
getClientTime
()
+
"---------"
)
console
.
log
(
"
\
t
\
t
\
t
\
tswMacro: "
+
swMacro
)
console
.
log
(
"
\
t
\
t
\
t
\
tswActual: "
+
swclickActual
+
" | swPrev: "
+
swclickPrev
)
console
.
log
(
"
\
t
\
t
\
t
\
tNOW: "
+
NOW
+
" | PAST: "
+
PAST
)
console
.
log
(
"
\
t
\
t
\
t
\
tselections: "
)
console
.
log
(
Object
.
keys
(
selections
))
console
.
log
(
"
\
t
\
t
\
t
\
topposites: "
)
console
.
log
(
Object
.
keys
(
opossites
))
console
.
log
(
"
\
t
\
t
\
t
\
t------------------------------------"
)
}
// just css
...
...
@@ -397,7 +398,7 @@ function LevelButtonDisable( TF ){
//Fixed! apres: refactor!
function
graphTagCloudElem
(
nodes
)
{
pr
(
"in graphTagCloudElem, nodae_id: "
+
nodes
);
console
.
log
(
"in graphTagCloudElem, nodae_id: "
+
nodes
);
cancelSelection
();
TW
.
partialGraph
.
emptyGraph
();
...
...
@@ -550,7 +551,7 @@ function graphResetColor(){
}
function
hideEverything
(){
pr
(
"
\
thiding all"
);
console
.
log
(
"
\
thiding all"
);
nodeslength
=
0
;
for
(
var
n
in
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
){
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
n
].
hidden
=
true
;
...
...
@@ -559,7 +560,7 @@ function hideEverything(){
TW
.
partialGraph
.
_core
.
graph
.
edgesIndex
[
e
].
hidden
=
true
;
}
overNodes
=
false
;
//magic line!
pr
(
"
\
tall hidded"
);
console
.
log
(
"
\
tall hidded"
);
//Remember that this function is the analogy of EmptyGraph
//"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) {
switch
(
self
.
state
.
step
)
{
case
0
:
// Pass init
//
pr
("case0 - "+"the self.count: "+self.count)
//
console.log
("case0 - "+"the self.count: "+self.count)
// Initialise layout data
self
.
count
++
;
...
...
@@ -185,7 +185,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
break
;
case
1
:
// Repulsion
//
pr
("case1 - "+"the self.count: "+self.count)
//
console.log
("case1 - "+"the self.count: "+self.count)
var
Repulsion
=
self
.
ForceFactory
.
buildRepulsion
(
self
.
p
.
adjustSizes
,
self
.
p
.
scalingRatio
...
...
@@ -230,7 +230,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
break
;
case
2
:
// Gravity
//
pr
("case2 - "+"the self.count: "+self.count)
//
console.log
("case2 - "+"the self.count: "+self.count)
var
Gravity
=
(
self
.
p
.
strongGravityMode
)
?
(
self
.
ForceFactory
.
getStrongGravity
(
self
.
p
.
scalingRatio
...
...
@@ -260,7 +260,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
break
;
case
3
:
// Attraction
//
pr
("case3 - "+"the self.count: "+self.count)
//
console.log
("case3 - "+"the self.count: "+self.count)
var
Attraction
=
self
.
ForceFactory
.
buildAttraction
(
self
.
p
.
linLogMode
,
self
.
p
.
outboundAttractionDistribution
,
...
...
@@ -308,7 +308,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
break
;
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
totalEffectiveTraction
=
0
;
// Hom much useful movement
var
swingingSum
=
0
;
...
...
@@ -340,7 +340,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
var
convg
=
((
Math
.
pow
(
nodes
.
length
,
2
))
/
promdxdy
);
/**/
var
swingingVSnodes_length
=
swingingSum
/
nodes
.
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
();
}
...
...
@@ -373,7 +373,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
break
;
case
5
:
// Apply forces
//
pr
("case5 - "+"the self.count: "+self.count)
//
console.log
("case5 - "+"the self.count: "+self.count)
var
i
=
self
.
state
.
index
;
if
(
self
.
p
.
adjustSizes
)
{
var
speed
=
self
.
p
.
speed
;
...
...
@@ -1120,7 +1120,7 @@ sigma.publicPrototype.startForceAtlas2 = function() {
this
.
forceatlas2
.
init
();
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
isolatedBCauseFilter
=
0
;
for
(
var
i
in
this
.
_core
.
graph
.
nodesIndex
)
{
...
...
@@ -1143,7 +1143,7 @@ sigma.publicPrototype.startForceAtlas2 = function() {
// fixing anomaly in forceatlas2
$
.
doTimeout
(
250
,
function
(){
if
(
!
present
.
level
&&
TW
.
partialGraph
.
forceatlas2
.
active
&&
TW
.
partialGraph
.
forceatlas2
.
count
==
0
)
{
pr
(
"SUPER JUTSU!!"
)
console
.
log
(
"SUPER JUTSU!!"
)
TW
.
partialGraph
.
startForceAtlas2
();
return
;
}
...
...
@@ -1156,7 +1156,7 @@ sigma.publicPrototype.stopForceAtlas2 = function() {
var
present
=
TW
.
partialGraph
.
states
.
slice
(
-
1
)[
0
]
if
(
this
.
forceatlas2
)
{
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
)
{
// not-save-positions if an edge-filter is ON
first_state
=
present
.
type
;
...
...
@@ -1186,7 +1186,7 @@ sigma.publicPrototype.stopForceAtlas2 = function() {
if
(
first_time
)
{
$
.
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
){
TW
.
Nodes
[
i
].
x
=
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
].
x
;
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() {
switch
(
this
.
format
)
{
case
"api.json"
:
pr
(
"scanFile: "
+
this
.
format
)
console
.
log
(
"scanFile: "
+
this
.
format
)
break
;
case
"db.json"
:
pr
(
"scanFile: "
+
this
.
format
)
console
.
log
(
"scanFile: "
+
this
.
format
)
break
;
case
"json"
:
pr
(
"scanFile: "
+
this
.
format
)
console
.
log
(
"scanFile: "
+
this
.
format
)
categories
=
this
.
getJSONCategories
(
this
.
data
);
return
categories
;
break
;
case
"gexf"
:
pr
(
"scanFile: "
+
this
.
format
)
console
.
log
(
"scanFile: "
+
this
.
format
)
categories
=
this
.
getGEXFCategories
(
this
.
data
);
return
categories
;
break
;
default
:
pr
(
"scanFile jsaispas: "
+
this
.
format
)
console
.
log
(
"scanFile jsaispas: "
+
this
.
format
)
break
;
}
};
...
...
@@ -64,23 +64,23 @@ ParseCustom.prototype.makeDicts = function(categories) {
switch
(
this
.
format
)
{
case
"api.json"
:
pr
(
"makeDicts: "
+
this
.
format
)
console
.
log
(
"makeDicts: "
+
this
.
format
)
break
;
case
"db.json"
:
pr
(
"makeDicts: "
+
this
.
format
)
console
.
log
(
"makeDicts: "
+
this
.
format
)
break
;
case
"json"
:
pr
(
"makeDicts: "
+
this
.
format
)
console
.
log
(
"makeDicts: "
+
this
.
format
)
dictionaries
=
this
.
parseJSON
(
categories
);
return
dictionaries
;
break
;
case
"gexf"
:
pr
(
"makeDicts: "
+
this
.
format
)
console
.
log
(
"makeDicts: "
+
this
.
format
)
dictionaries
=
this
.
parseGEXF
(
categories
);
return
dictionaries
;
break
;
default
:
pr
(
"makeDicts jsaispas: "
+
this
.
format
)
console
.
log
(
"makeDicts jsaispas: "
+
this
.
format
)
break
;
}
};
...
...
@@ -240,7 +240,7 @@ function dictfyGexf( gexf , categories ){
var
color
;
if
(
colorNodes
.
length
>
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
(
'b'
)));
}
// [ / get Colour ]
...
...
tinawebJS/sigma.
min
.js
→
tinawebJS/sigma.
v1.customized
.js
View file @
ccc08006
...
...
@@ -460,8 +460,8 @@ sigma.classes.Cascade = function() {
// Interaction listeners:
this
.
mousecaptor
.
bind
(
'drag interpolate'
,
function
(
e
)
{
//
pr
("drag stuff");
//
pr
("click dragging");
//
console.log
("drag stuff");
//
console.log
("click dragging");
self
.
draw
(
self
.
p
.
auto
?
2
:
self
.
p
.
drawNodes
,
self
.
p
.
auto
?
0
:
self
.
p
.
drawEdges
,
...
...
@@ -477,7 +477,7 @@ sigma.classes.Cascade = function() {
);
}).
bind
(
'move'
,
function
()
{
//Detects any movement of the cursor
//
pr
("move");
//
console.log
("move");
self
.
domElements
.
hover
.
getContext
(
'2d'
).
clearRect
(
0
,
0
,
...
...
@@ -489,7 +489,7 @@ sigma.classes.Cascade = function() {
drawActive
();
// 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() {
tmp
=
b
.
replace
(
"rgba("
,
""
).
replace
(
")"
,
""
).
split
(
","
)
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
);
b
=
hex2rga
(
b
);
var
r
=
(
a
[
0
]
+
b
[
0
])
>>
1
;
...
...
@@ -1099,7 +1099,7 @@ sigma.classes.Cascade = function() {
// var color = '#'+sigma.tools.rgbToHex(parseFloat(r),parseFloat(g),parseFloat(b))
var
color
=
"rgba( "
+
r
+
", "
+
g
+
" , "
+
b
+
" ,0.5)"
;
//
pr
(params.label);
//
console.log
(params.label);
// if(params.label=="nodes1") {
// color = "#cedc75";
// }
...
...
@@ -1281,31 +1281,31 @@ sigma.classes.Cascade = function() {
self
.
nodes
=
[];
if
(
self
.
nodes
.
length
>
0
)
{
pr
(
"splicing nodes"
)
console
.
log
(
"splicing nodes"
)
self
.
nodes
.
splice
(
0
,
self
.
nodes
.
length
);
}
self
.
nodesIndex
=
{};
if
(
self
.
nodesIndex
.
length
>
0
)
{
pr
(
"splicing nodesIndex"
)
console
.
log
(
"splicing nodesIndex"
)
self
.
nodesIndex
.
splice
(
0
,
self
.
nodesIndex
.
length
);
}
self
.
edges
=
[];
if
(
self
.
edges
.
length
>
0
)
{
pr
(
"splicing edges"
)
console
.
log
(
"splicing edges"
)
self
.
edges
.
splice
(
0
,
self
.
edges
.
length
);
}
self
.
edgesIndex
=
{};
if
(
self
.
edgesIndex
.
length
>
0
)
{
pr
(
"splicing edgesIndex"
)
console
.
log
(
"splicing edgesIndex"
)
self
.
edgesIndex
.
splice
(
0
,
self
.
edgesIndex
.
length
);
}
labels
=
[];
if
(
labels
.
length
>
0
)
{
pr
(
"splicing labels"
)
console
.
log
(
"splicing labels"
)
labels
.
splice
(
0
,
labels
.
length
);
}
...
...
tinawebJS/sigmaUtils.js
View file @
ccc08006
...
...
@@ -13,20 +13,22 @@ SigmaUtils = function () {
var
n
=
nodes
[
i
];
if
(
initialState
[
catDict
[
n
.
type
]])
{
var
node
=
(
{
var
node
=
{
id
:
n
.
id
,
label
:
n
.
label
,
size
:
n
.
size
,
color
:
n
.
color
,
type
:
n
.
type
,
x
:
n
.
x
,
y
:
n
.
y
})
y
:
n
.
y
,
type
:
n
.
type
}
if
(
n
.
shape
)
node
.
shape
=
n
.
shape
;
// console.log(node)
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
updateSearchLabels
(
n
.
id
,
n
.
label
,
n
.
type
);
...
...
@@ -42,15 +44,23 @@ SigmaUtils = function () {
e
=
TW
.
Edges
[
s
+
";"
+
t
]
if
(
e
)
{
if
(
e
.
source
!=
e
.
target
)
{
var
edge
=
({
var
edge
=
{
// sigma mandatory properties
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
,
sourceID
:
e
.
source
,
t
argetID
:
e
.
target
,
type
:
e
.
type
,
weight
:
e
.
weight
})
graph
.
addEdge
(
e
.
id
,
e
.
source
,
e
.
target
,
edge
);
// twjs additional properties
t
ype
:
e
.
type
}
// REFA new way
graph
.
edges
.
push
(
edge
);
}
}
}
...
...
@@ -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
))
)
);
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
}
...
...
@@ -448,13 +458,13 @@ function colorsRelByBins(daclass) {
function
colorsBy
(
daclass
)
{
pr
(
""
)
pr
(
" = = = = = = = = = = = = = = = = = "
)
pr
(
" = = = = = = = = = = = = = = = = = "
)
pr
(
"colorsBy ( "
+
daclass
+
" )"
)
pr
(
" = = = = = = = = = = = = = = = = = "
)
pr
(
" = = = = = = = = = = = = = = = = = "
)
pr
(
""
)
console
.
log
(
""
)
console
.
log
(
" = = = = = = = = = = = = = = = = = "
)
console
.
log
(
" = = = = = = = = = = = = = = = = = "
)
console
.
log
(
"colorsBy ( "
+
daclass
+
" )"
)
console
.
log
(
" = = = = = = = = = = = = = = = = = "
)
console
.
log
(
" = = = = = = = = = = = = = = = = = "
)
console
.
log
(
""
)
if
(
daclass
==
"clust_louvain"
)
{
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