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
8a351ffa
Commit
8a351ffa
authored
Jan 06, 2016
by
PkSM3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
global variables changed
parent
9c9ca5c6
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
451 additions
and
477 deletions
+451
-477
parameters_details.php
LOCALDB/parameters_details.php
+2
-0
db.json
db.json
+16
-0
extras_explorerjs.js
extras_explorerjs.js
+55
-54
settings_explorerjs.js
settings_explorerjs.js
+54
-96
Tinaweb.js
tinawebJS/Tinaweb.js
+22
-22
enviroment.js
tinawebJS/enviroment.js
+92
-91
main.js
tinawebJS/main.js
+50
-52
methods.js
tinawebJS/methods.js
+79
-79
sigma.forceatlas2.js
tinawebJS/sigma.forceatlas2.js
+14
-15
sigma.min.js
tinawebJS/sigma.min.js
+5
-5
sigma.parseCustom.js
tinawebJS/sigma.parseCustom.js
+24
-24
sigmaUtils.js
tinawebJS/sigmaUtils.js
+38
-39
No files found.
LOCALDB/parameters_details.php
View file @
8a351ffa
...
...
@@ -8,6 +8,8 @@ $gexf_db = array();
# $gexf_db["data/ClimateChange/ClimateChangeV1.gexf"] = "data/ClimateChange/wosclimatechange-61715-1-wosclimatechange-db(2).db";
$gexf_db
[
"data/ClimateChange/Maps_S_800.gexf"
]
=
"data/ClimateChange/wos_climate-change_title_2014-2015.db"
;
$gexf_db
[
"data/AXA/EditedJan20151980 nodes V2 PageRank.gexf"
]
=
"data/AXA/data.db"
;
$gexf
=
str_replace
(
'"'
,
''
,
$_GET
[
"gexf"
]);
$mainpath
=
dirname
(
getcwd
())
.
"/"
;
...
...
db.json
View file @
8a351ffa
{
"data/AXA"
:
{
"dbname"
:
"data.db"
,
"title"
:
"ISITITLE"
,
"date"
:
"ISIpubdate"
,
"abstract"
:
"ISIABSTRACT"
,
"gexfs"
:
{
"EditedJan20151980 nodes V2 PageRank.gexf"
:
{
"social"
:
{
"table"
:
"ISIAUTHOR"
,
"textCol"
:
"data"
,
"forkeyCol"
:
"id"
},
"semantic"
:
{
"table"
:
"ISItermsAsbestos"
,
"textCol"
:
"data"
,
"forkeyCol"
:
"id"
}
},
"asbestos.gexf"
:
{
"social"
:
{
"table"
:
"ISIAUTHOR"
,
"textCol"
:
"data"
,
"forkeyCol"
:
"id"
},
"semantic"
:
{
"table"
:
"ISItermsAsbestos"
,
"textCol"
:
"data"
,
"forkeyCol"
:
"id"
}
}
}
},
"data/ClimateChange"
:
{
"dbname"
:
"wos_climate-change_title_2014-2015.db"
,
"title"
:
"ISITITLE"
,
...
...
extras_explorerjs.js
View file @
8a351ffa
This diff is collapsed.
Click to expand it.
settings_explorerjs.js
View file @
8a351ffa
/*
* Customize as you want ;)
*/
// ============ < DEVELOPER OPTIONS > ============
var
geomap
=
false
;
var
colorByAtt
=
false
;
var
twittertimeline
=
false
;
var
minimap
=
false
;
var
getAdditionalInfo
=
false
;
//for topPapers div
var
mainfile
=
[
"db.json"
];
// // var mainfile = "api.json";
// var mainfile = [
// "data/2-Terms-Authors-300nodes.gexf",
// "data/0-terms-terms-MainNodes.gexf",
// "data/maziyar2.json",
// "data/3-Terms-Countries-300nodes.gexf",
// // "data/noclimatechange_mnodes.gexf",
// "data/20150518t1052_phylograph.json",
// // "data/phylograph_6.json",
// // "data/maziyar.json",
// // "data/20141128_GPs_03_bi.gexf",
// // "data/example.json",
// // "data/Elisa__Omodei.gexf",
// ];
var
APINAME
=
"LOCALDB/"
// getUrlParam.file = "data/testgraph.json";
var
dataFolderTree
=
{};
var
egonode
=
{}
var
iwantograph
=
""
;
var
bridge
=
{};
external
=
""
;
//external="http://tina.iscpif.fr/explorerjs/";//Just if you want to use the server-apps from tina.server
bridge
[
"forFilteredQuery"
]
=
external
+
"php/bridgeClientServer_filter.php"
;
bridge
[
"forNormalQuery"
]
=
external
+
"php/bridgeClientServer.php"
;
var
gexfDict
=
{};
// gexfDict["data/terrorism/terrorism_mono.gexf"] = "[2001-2014] TERRORISM (1-partite graph)";
// gexfDict["data/terrorism/terrorism_bi.gexf"] = "[2001-2014] TERRORISM (2-partite graph)";
var
field
=
{}
// field["data/20141128_GPs_03_bi.gexf"] = "ISItermsfirstindexing";
// field["data/20141215_GPs_04.gexf"] = "ISItermsfirstindexing";
// field["data/medq2/20141128_MED_02_bi.gexf"] = "ISItermsBigWL";
// field["data/medq2/20141128_MED_03_bi.gexf"] = "ISItermsBigWL";
// field["data/medq2/20141208_MED_Author_name-ISItermsjulien_index.gexf"] = "ISItermsjulien_index";
// field["data/medq1/20141208_MED_01_bi.gexf"] = "ISItermsfirstindex";
// field["data/terrorism/terrorism_mono.gexf"] = "ISItermsListV1";
// field["data/terrorism/terrorism_bi.gexf"] = "ISItermsListV1";
var
TW
=
{}
TW
.
geomap
=
false
;
TW
.
colorByAtt
=
false
;
TW
.
twittertimeline
=
false
;
TW
.
minimap
=
false
;
TW
.
getAdditionalInfo
=
false
;
// True: Activate TopPapers feature.
TW
.
mainfile
=
[
"db.json"
];
// // TW.mainfile = "api.json";
// TW.mainfile = [
// "data/2-Terms-Authors-300nodes.gexf",
// "data/0-terms-terms-MainNodes.gexf",
// "data/maziyar2.json",
// "data/3-Terms-Countries-300nodes.gexf",
// // "data/noclimatechange_mnodes.gexf",
// "data/20150518t1052_phylograph.json",
// // "data/phylograph_6.json",
// // "data/maziyar.json",
// // "data/20141128_GPs_03_bi.gexf",
// // "data/example.json",
// // "data/Elisa__Omodei.gexf",
// ];
TW
.
APINAME
=
"LOCALDB/"
;
TW
.
bridge
=
{};
TW
.
bridge
[
"forFilteredQuery"
]
=
"php/bridgeClientServer_filter.php"
;
TW
.
bridge
[
"forNormalQuery"
]
=
"php/bridgeClientServer.php"
;
TW
.
gexfDict
=
{};
TW
.
gexfDictReverse
=
{}
for
(
var
i
in
TW
.
gexfDict
){
TW
.
gexfDictReverse
[
TW
.
gexfDict
[
i
]]
=
i
;
}
TW
.
field
=
{}
// field["data/20141128_GPs_03_bi.gexf"] = "ISItermsfirstindexing";
// field["data/20141215_GPs_04.gexf"] = "ISItermsfirstindexing";
TW
.
Relations
=
{}
TW
.
SystemStates
=
{}
TW
.
SystemStates
.
level
=
true
;
TW
.
SystemStates
.
type
=
[
true
]
//[ true , false ]; //social activated!
TW
.
SystemStates
.
selections
=
[];
TW
.
SystemStates
.
opposites
=
[];
TW
.
catSoc
=
"Document"
;
TW
.
catSem
=
"NGram"
;
var
ParseCustom
=
function
()
{};
var
SigmaUtils
=
function
()
{};
var
TinaWebJS
=
function
()
{};
var
Relations
=
{}
var
SystemStates
=
{}
SystemStates
.
level
=
true
;
SystemStates
.
type
=
[
true
]
//[ true , false ]; //social activated!
SystemStates
.
selections
=
[];
SystemStates
.
opposites
=
[];
ircNick
=
""
;
ircCHN
=
""
;
var
catSoc
=
"Document"
;
var
catSem
=
"NGram"
;
var
sizeMult
=
[];
sizeMult
[
catSoc
]
=
0.0
;
sizeMult
[
catSem
]
=
0.0
;
sizeMult
[
TW
.
catSoc
]
=
0.0
;
sizeMult
[
TW
.
catSem
]
=
0.0
;
var
inactiveColor
=
'#666'
;
var
startingNodeId
=
"1"
;
...
...
@@ -155,10 +118,9 @@ var sigmaJsMouseProperties = {
// ============ < VARIABLES.JS > ============
//"http://webchat.freenode.net/?nick=Ademe&channels=#anoe"
var
ircUrl
=
"http://webchat.freenode.net/?nick="
+
ircNick
+
"&channels="
+
ircCHN
;
var
twjs
=
"tinawebJS/"
;
var
categories
=
{};
var
categoriesIndex
=
[];
TW
.
categories
=
{};
TW
.
categoriesIndex
=
[];
var
gexf
;
//var zoom=0;
...
...
@@ -183,7 +145,7 @@ var lastFilter = []
lastFilter
[
"#slidercat0edgesweight"
]
=
{
"orig"
:
"-"
,
"last"
:
"-"
}
lastFilter
[
"#slidercat1edgesweight"
]
=
{
"orig"
:
"-"
,
"last"
:
"-"
}
var
Filters
=
{}
TW
.
Filters
=
{}
...
...
@@ -193,11 +155,11 @@ var overviewScale = 0.25;
var
overviewHover
=
false
;
var
moveDelay
=
80
,
zoomDelay
=
2
;
//var Vecindad;
var
partialGraph
;
TW
.
partialGraph
;
var
otherGraph
;
var
Nodes
=
[];
var
Edges
=
[];
var
Clusters
=
[];
TW
.
Nodes
=
[];
TW
.
Edges
=
[];
TW
.
Clusters
=
[];
var
nodeslength
=
0
;
...
...
@@ -232,10 +194,6 @@ var maxEdgeWeight=0.0;
//---------------------------------------------------
var
bipartite
=
false
;
var
gexfDictReverse
=
{}
for
(
var
i
in
gexfDict
){
gexfDictReverse
[
gexfDict
[
i
]]
=
i
;
}
var
colorList
=
[
"#000000"
,
"#FFFF00"
,
"#1CE6FF"
,
"#FF34FF"
,
"#FF4A46"
,
"#008941"
,
"#006FA6"
,
"#A30059"
,
"#FFDBE5"
,
"#7A4900"
,
"#0000A6"
,
"#63FFAC"
,
"#B79762"
,
"#004D43"
,
"#8FB0FF"
,
"#997D87"
,
"#5A0007"
,
"#809693"
,
"#FEFFE6"
,
"#1B4400"
,
"#4FC601"
,
"#3B5DFF"
,
"#4A3B53"
,
"#FF2F80"
,
"#61615A"
,
"#BA0900"
,
"#6B7900"
,
"#00C2A0"
,
"#FFAA92"
,
"#FF90C9"
,
"#B903AA"
,
"#D16100"
,
"#DDEFFF"
,
"#000035"
,
"#7B4F4B"
,
"#A1C299"
,
"#300018"
,
"#0AA6D8"
,
"#013349"
,
"#00846F"
,
"#372101"
,
"#FFB500"
,
"#C2FFED"
,
"#A079BF"
,
"#CC0744"
,
"#C0B9B2"
,
"#C2FF99"
,
"#001E09"
,
"#00489C"
,
"#6F0062"
,
"#0CBD66"
,
"#EEC3FF"
,
"#456D75"
,
"#B77B68"
,
"#7A87A1"
,
"#788D66"
,
"#885578"
,
"#FAD09F"
,
"#FF8A9A"
,
"#D157A0"
,
"#BEC459"
,
"#456648"
,
"#0086ED"
,
"#886F4C"
,
"#34362D"
,
"#B4A8BD"
,
"#00A6AA"
,
"#452C2C"
,
"#636375"
,
"#A3C8C9"
,
"#FF913F"
,
"#938A81"
,
"#575329"
,
"#00FECF"
,
"#B05B6F"
,
"#8CD0FF"
,
"#3B9700"
,
"#04F757"
,
"#C8A1A1"
,
"#1E6E00"
,
"#7900D7"
,
"#A77500"
,
"#6367A9"
,
"#A05837"
,
"#6B002C"
,
"#772600"
,
"#D790FF"
,
"#9B9700"
,
"#549E79"
,
"#FFF69F"
,
"#201625"
,
"#72418F"
,
"#BC23FF"
,
"#99ADC0"
,
"#3A2465"
,
"#922329"
,
"#5B4534"
,
"#FDE8DC"
,
"#404E55"
,
"#0089A3"
,
"#CB7E98"
,
"#A4E804"
,
"#324E72"
,
"#6A3A4C"
,
"#83AB58"
,
"#001C1E"
,
"#D1F7CE"
,
"#004B28"
,
"#C8D0F6"
,
"#A3A489"
,
"#806C66"
,
"#222800"
,
"#BF5650"
,
"#E83000"
,
"#66796D"
,
"#DA007C"
,
"#FF1A59"
,
"#8ADBB4"
,
"#1E0200"
,
"#5B4E51"
,
"#C895C5"
,
"#320033"
,
"#FF6832"
,
"#66E1D3"
,
"#CFCDAC"
,
"#D0AC94"
,
"#7ED379"
,
"#012C58"
];
...
...
tinawebJS/Tinaweb.js
View file @
8a351ffa
...
...
@@ -48,7 +48,7 @@ SelectionEngine = function() {
if
(
cursorsize
>
0
)
{
clickedNodes
=
this
.
SelectThis2
(
area
)
}
else
{
clickedNodes
=
partialGraph
.
_core
.
graph
.
nodes
.
filter
(
function
(
n
)
{
clickedNodes
=
TW
.
partialGraph
.
_core
.
graph
.
nodes
.
filter
(
function
(
n
)
{
return
!!
n
[
'hover'
];
}).
map
(
function
(
n
)
{
return
n
.
id
;
...
...
@@ -122,7 +122,7 @@ SelectionEngine = function() {
if
(
cursorsize
>
0
)
{
targeted
=
this
.
SelectThis2
(
area
)
}
else
{
targeted
=
partialGraph
.
_core
.
graph
.
nodes
.
filter
(
function
(
n
)
{
targeted
=
TW
.
partialGraph
.
_core
.
graph
.
nodes
.
filter
(
function
(
n
)
{
return
!!
n
[
'hover'
];
}).
map
(
function
(
n
)
{
return
n
.
id
;
...
...
@@ -203,7 +203,7 @@ SelectionEngine = function() {
cancelSelection
(
false
);
MultipleSelection2
(
targeted
);
}
partialGraph
.
draw
();
TW
.
partialGraph
.
draw
();
$
(
"input#searchinput"
).
val
(
""
);
$
(
"input#searchinput"
).
autocomplete
(
"close"
);
...
...
@@ -240,7 +240,7 @@ SelectionEngine = function() {
//Multiple selection
var
counter
=
0
;
var
actualSel
=
[];
partialGraph
.
iterNodes
(
function
(
n
){
TW
.
partialGraph
.
iterNodes
(
function
(
n
){
if
(
!
n
.
hidden
){
distance
=
Math
.
sqrt
(
Math
.
pow
((
x1
-
parseInt
(
n
.
displayX
)),
2
)
+
...
...
@@ -263,7 +263,7 @@ SelectionEngine = function() {
greyEverything
();
var
typeNow
=
partialGraph
.
states
.
slice
(
-
1
)[
0
].
type
.
map
(
Number
).
join
(
"|"
)
var
typeNow
=
TW
.
partialGraph
.
states
.
slice
(
-
1
)[
0
].
type
.
map
(
Number
).
join
(
"|"
)
console
.
log
(
"console.loging the Type:"
)
console
.
log
(
typeNow
)
console
.
log
(
" - - - - - - "
)
...
...
@@ -280,8 +280,8 @@ SelectionEngine = function() {
else
ndsids
=
nodes
;
for
(
var
i
in
ndsids
)
{
s
=
ndsids
[
i
];
if
(
Relations
[
typeNow
]
&&
Relations
[
typeNow
][
s
]
)
{
neigh
=
Relations
[
typeNow
][
s
]
if
(
TW
.
Relations
[
typeNow
]
&&
TW
.
Relations
[
typeNow
][
s
]
)
{
neigh
=
TW
.
Relations
[
typeNow
][
s
]
if
(
neigh
)
{
for
(
var
j
in
neigh
)
{
t
=
neigh
[
j
]
...
...
@@ -300,7 +300,7 @@ SelectionEngine = function() {
for
(
var
i
in
nodes_2_colour
)
{
if
(
i
)
{
n
=
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
]
n
=
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
]
if
(
n
)
{
n
.
color
=
n
.
attr
[
'true_color'
];
n
.
attr
[
'grey'
]
=
0
;
...
...
@@ -312,7 +312,7 @@ SelectionEngine = function() {
}
}
for
(
var
i
in
edges_2_colour
)
{
an_edge
=
partialGraph
.
_core
.
graph
.
edgesIndex
[
i
]
an_edge
=
TW
.
partialGraph
.
_core
.
graph
.
edgesIndex
[
i
]
if
(
!
isUndef
(
an_edge
)
&&
!
an_edge
.
hidden
){
an_edge
.
color
=
an_edge
.
attr
[
'true_color'
];
an_edge
.
attr
[
'grey'
]
=
0
;
...
...
@@ -321,13 +321,13 @@ SelectionEngine = function() {
var
the_new_sels
=
Object
.
keys
(
selections
).
map
(
Number
)
partialGraph
.
states
.
slice
(
-
1
)[
0
].
selections
=
the_new_sels
;
partialGraph
.
states
.
slice
(
-
1
)[
0
].
setState
(
{
sels
:
the_new_sels
}
)
TW
.
partialGraph
.
states
.
slice
(
-
1
)[
0
].
selections
=
the_new_sels
;
TW
.
partialGraph
.
states
.
slice
(
-
1
)[
0
].
setState
(
{
sels
:
the_new_sels
}
)
var
neighsDict
=
{}
if
(
Relations
[
"1|1"
])
{
if
(
TW
.
Relations
[
"1|1"
])
{
for
(
var
s
in
the_new_sels
)
{
var
neighs
=
Relations
[
"1|1"
][
the_new_sels
[
s
]];
var
neighs
=
TW
.
Relations
[
"1|1"
][
the_new_sels
[
s
]];
for
(
var
n
in
neighs
)
{
if
(
!
neighsDict
[
neighs
[
n
]])
neighsDict
[
neighs
[
n
]]
=
0
;
...
...
@@ -343,7 +343,7 @@ SelectionEngine = function() {
overNodes
=
true
;
partialGraph
.
draw
();
TW
.
partialGraph
.
draw
();
updateLeftPanel_fix
(
selections
,
oppos
);
...
...
@@ -452,7 +452,7 @@ TinaWebJS = function ( sigmacanvas ) {
SelInst
.
MultipleSelection2
({
nodes
:
targeted
});
cursor_size
=
prev_cursor_size
;
}
partialGraph
.
draw
();
TW
.
partialGraph
.
draw
();
$
(
"input#searchinput"
).
val
(
""
);
$
(
"input#searchinput"
).
autocomplete
(
"close"
);
...
...
@@ -481,7 +481,7 @@ TinaWebJS = function ( sigmacanvas ) {
cancelSelection
(
false
);
SelInst
.
MultipleSelection2
({
nodes
:
targeted
});
}
partialGraph
.
draw
();
TW
.
partialGraph
.
draw
();
$
(
"input#searchinput"
).
val
(
""
);
$
(
"input#searchinput"
).
autocomplete
(
"close"
);
...
...
@@ -743,10 +743,10 @@ TinaWebJS = function ( sigmacanvas ) {
onchange
:
function
(
value
){
$
.
doTimeout
(
100
,
function
(){
partialGraph
.
iterNodes
(
function
(
n
)
{
if
(
Nodes
[
n
.
id
].
type
==
catSoc
)
{
var
newval
=
parseFloat
(
Nodes
[
n
.
id
].
size
)
+
parseFloat
((
value
-
1
))
*
0.3
if
(
TW
.
Nodes
[
n
.
id
].
type
==
TW
.
catSoc
)
{
var
newval
=
parseFloat
(
TW
.
Nodes
[
n
.
id
].
size
)
+
parseFloat
((
value
-
1
))
*
0.3
n
.
size
=
(
newval
<
1.0
)?
1
:
newval
;
sizeMult
[
catSoc
]
=
parseFloat
(
value
-
1
)
*
0.3
;
sizeMult
[
TW
.
catSoc
]
=
parseFloat
(
value
-
1
)
*
0.3
;
}
});
partialGraph
.
draw
();
...
...
@@ -764,10 +764,10 @@ TinaWebJS = function ( sigmacanvas ) {
onchange
:
function
(
value
){
$
.
doTimeout
(
100
,
function
(){
partialGraph
.
iterNodes
(
function
(
n
)
{
if
(
Nodes
[
n
.
id
].
type
==
catSem
)
{
var
newval
=
parseFloat
(
Nodes
[
n
.
id
].
size
)
+
parseFloat
((
value
-
1
))
*
0.3
if
(
TW
.
Nodes
[
n
.
id
].
type
==
TW
.
catSem
)
{
var
newval
=
parseFloat
(
TW
.
Nodes
[
n
.
id
].
size
)
+
parseFloat
((
value
-
1
))
*
0.3
n
.
size
=
(
newval
<
1.0
)?
1
:
newval
;
sizeMult
[
catSem
]
=
parseFloat
(
value
-
1
)
*
0.3
;
sizeMult
[
TW
.
catSem
]
=
parseFloat
(
value
-
1
)
*
0.3
;
}
});
partialGraph
.
draw
();
...
...
tinawebJS/enviroment.js
View file @
8a351ffa
This diff is collapsed.
Click to expand it.
tinawebJS/main.js
View file @
8a351ffa
...
...
@@ -21,6 +21,7 @@
/
\(([\s\S]
*
?)\)
/
,
/
[
$
\w]
+/g
);
var
AjaxSync
=
(
function
(
TYPE
,
URL
,
DATA
,
CT
,
DT
)
{
var
Result
=
[]
TYPE
=
(
!
TYPE
)?
"GET"
:
"POST"
...
...
@@ -46,7 +47,7 @@ var AjaxSync = (function(TYPE, URL, DATA, CT , DT) {
}).
index
();
function
getGexfPath
(
v
){
gexfpath
=
(
gexfDictReverse
[
v
])?
gexfDictReverse
[
v
]:
v
;
var
gexfpath
=
(
TW
.
gexfDictReverse
[
v
])?
TW
.
gexfDictReverse
[
v
]:
v
;
return
gexfpath
;
}
...
...
@@ -57,30 +58,27 @@ function jsActionOnGexfSelector(gexfLegend){
window
.
location
=
window
.
location
.
origin
+
window
.
location
.
pathname
+
"?file="
+
encodeURIComponent
(
gexfLegend
);
}
var
urlfile_override
=
(
isUndef
(
getUrlParam
.
file
))?
false
:
true
;
var
files_selector
=
""
if
(
urlfile_override
)
mainfile
.
unshift
(
getUrlParam
.
file
);
if
(
!
isUndef
(
getUrlParam
.
file
)
)
TW
.
mainfile
.
unshift
(
getUrlParam
.
file
);
unique_mainfile
=
mainfile
.
filter
(
function
(
item
,
pos
)
{
return
mainfile
.
indexOf
(
item
)
==
pos
;
var
unique_mainfile
=
TW
.
mainfile
.
filter
(
function
(
item
,
pos
)
{
return
TW
.
mainfile
.
indexOf
(
item
)
==
pos
;
});
mainfile
=
unique_mainfile
;
TW
.
mainfile
=
unique_mainfile
;
console
.
log
(
"THE URL.FILE PARAM:"
)
console
.
log
(
mainfile
)
console
.
log
(
TW
.
mainfile
)
files_selector
+=
'<select onchange="jsActionOnGexfSelector(this.value);">'
for
(
var
i
in
mainfile
)
{
var
gotoURL
=
window
.
location
.
origin
+
window
.
location
.
pathname
+
"?file="
+
mainfile
[
i
];
files_selector
+=
'<option>'
+
mainfile
[
i
]
+
'</option>'
for
(
var
i
in
TW
.
mainfile
)
{
var
gotoURL
=
window
.
location
.
origin
+
window
.
location
.
pathname
+
"?file="
+
TW
.
mainfile
[
i
];
files_selector
+=
'<option>'
+
TW
.
mainfile
[
i
]
+
'</option>'
}
files_selector
+=
"</select>"
$
(
"#network"
).
html
(
files_selector
)
var
file
=
(
Array
.
isArray
(
mainfile
))?
mainfile
[
0
]:
mainfile
;
var
file
=
(
Array
.
isArray
(
TW
.
mainfile
))?
TW
.
mainfile
[
0
]:
TW
.
mainfile
;
var
RES
=
AjaxSync
({
URL
:
file
});
...
...
@@ -91,7 +89,7 @@ if(RES["OK"]) {
if
(
file
==
"db.json"
)
{
getAdditionalInfo
=
true
;
TW
.
getAdditionalInfo
=
true
;
fileparam
=
file
;
...
...
@@ -103,8 +101,8 @@ if(RES["OK"]) {
for
(
var
gexf
in
the_gexfs
)
{
pr
(
"
\
t
\
t
\
t"
+
gexf
)
pr
(
"
\
t
\
t
\
t
\
t"
+
the_gexfs
[
gexf
][
"semantic"
][
"table"
]
)
field
[
path
+
"/"
+
gexf
]
=
the_gexfs
[
gexf
][
"semantic"
][
"table"
]
gexfDict
[
path
+
"/"
+
gexf
]
=
"A "
+
gexf
TW
.
field
[
path
+
"/"
+
gexf
]
=
the_gexfs
[
gexf
][
"semantic"
][
"table"
]
TW
.
gexfDict
[
path
+
"/"
+
gexf
]
=
"A "
+
gexf
getUrlParam
.
file
=
path
+
"/"
+
gexf
break
}
...
...
@@ -112,8 +110,8 @@ if(RES["OK"]) {
}
pr
(
"
\n
============================
\n
"
)
pr
(
field
)
pr
(
gexfDict
)
pr
(
TW
.
field
)
pr
(
TW
.
gexfDict
)
var
sub_RES
=
AjaxSync
({
URL
:
getUrlParam
.
file
});
the_data
=
sub_RES
[
"data"
]
fileparam
=
sub_RES
[
"format"
]
...
...
@@ -139,23 +137,23 @@ if(RES["OK"]) {
var
possibleStates
=
makeSystemStates
(
categories
)
var
initialState
=
buildInitialState
(
categories
)
//[true,false]//
dicts
=
start
.
makeDicts
(
categories
);
Nodes
=
dicts
.
nodes
;
Edges
=
dicts
.
edges
;
if
(
the_data
.
clusters
)
Clusters
=
the_data
.
clusters
var
dicts
=
start
.
makeDicts
(
categories
);
TW
.
Nodes
=
dicts
.
nodes
;
TW
.
Edges
=
dicts
.
edges
;
if
(
the_data
.
clusters
)
TW
.
Clusters
=
the_data
.
clusters
nodes1
=
dicts
.
n1
;
//not used
TW
.
nodes1
=
dicts
.
n1
;
//not used
var
catDict
=
dicts
.
catDict
pr
(
"CategoriesDict: "
)
pr
(
catDict
)
categoriesIndex
=
categories
;
//to_remove
catSoc
=
categories
[
0
];
//to_remove
catSem
=
(
categories
[
1
])?
categories
[
1
]:
false
;
//to_remove
TW
.
categoriesIndex
=
categories
;
//to_remove
TW
.
catSoc
=
categories
[
0
];
//to_remove
TW
.
catSem
=
(
categories
[
1
])?
categories
[
1
]:
false
;
//to_remove
for
(
var
i
in
categories
)
{
Filters
[
i
]
=
{}
Filters
[
i
][
"#slidercat"
+
i
+
"edgesweight"
]
=
true
;
TW
.
Filters
[
i
]
=
{}
TW
.
Filters
[
i
][
"#slidercat"
+
i
+
"edgesweight"
]
=
true
;
}
// [ Initiating Sigma-Canvas ]
...
...
@@ -169,21 +167,21 @@ if(RES["OK"]) {
// [ Poblating the Sigma-Graph ]
var
sigma_utils
=
new
SigmaUtils
();
partialGraph
=
sigma
.
init
(
document
.
getElementById
(
'sigma-example'
))
TW
.
partialGraph
=
sigma
.
init
(
document
.
getElementById
(
'sigma-example'
))
.
drawingProperties
(
sigmaJsDrawingProperties
)
.
graphProperties
(
sigmaJsGraphProperties
)
.
mouseProperties
(
sigmaJsMouseProperties
);
partialGraph
=
sigma_utils
.
FillGraph
(
initialState
,
catDict
,
dicts
.
nodes
,
dicts
.
edges
,
partialGraph
);
partialGraph
.
states
=
[]
partialGraph
.
states
[
0
]
=
false
;
partialGraph
.
states
[
1
]
=
SystemStates
;
partialGraph
.
states
[
1
].
categories
=
categories
partialGraph
.
states
[
1
].
categoriesDict
=
catDict
;
partialGraph
.
states
[
1
].
type
=
initialState
;
partialGraph
.
states
[
1
].
LouvainFait
=
false
;
TW
.
partialGraph
=
sigma_utils
.
FillGraph
(
initialState
,
catDict
,
dicts
.
nodes
,
dicts
.
edges
,
TW
.
partialGraph
);
TW
.
partialGraph
.
states
=
[]
TW
.
partialGraph
.
states
[
0
]
=
false
;
TW
.
partialGraph
.
states
[
1
]
=
TW
.
SystemStates
;
TW
.
partialGraph
.
states
[
1
].
categories
=
categories
TW
.
partialGraph
.
states
[
1
].
categoriesDict
=
catDict
;
TW
.
partialGraph
.
states
[
1
].
type
=
initialState
;
TW
.
partialGraph
.
states
[
1
].
LouvainFait
=
false
;
// [ / Poblating the Sigma-Graph ]
partialGraph
.
states
[
1
].
setState
=
(
function
(
type
,
level
,
sels
,
oppos
)
{
TW
.
partialGraph
.
states
[
1
].
setState
=
(
function
(
type
,
level
,
sels
,
oppos
)
{
var
bistate
=
false
,
typestring
=
false
;
console
.
log
(
"IN THE SET STATE METHOD:"
)
if
(
!
isUndef
(
type
))
{
...
...
@@ -207,8 +205,8 @@ if(RES["OK"]) {
console
.
log
(
"opposites: "
);
console
.
log
(
oppos
)
var
present
=
partialGraph
.
states
.
slice
(
-
1
)[
0
];
// Last
var
past
=
partialGraph
.
states
.
slice
(
-
2
)[
0
]
// avant Last
var
present
=
TW
.
partialGraph
.
states
.
slice
(
-
1
)[
0
];
// Last
var
past
=
TW
.
partialGraph
.
states
.
slice
(
-
2
)[
0
]
// avant Last
console
.
log
(
"previous level: "
+
past
.
level
)
console
.
log
(
"new level: "
+
present
.
level
)
...
...
@@ -224,7 +222,7 @@ if(RES["OK"]) {
LevelButtonDisable
(
true
)
// console.log("printing the first state:")
// first_state = partialGraph.states.slice(-1)[0].type;
// first_state =
TW.
partialGraph.states.slice(-1)[0].type;
// for(var i in first_state) {
// if(first_state[i]) {
// for(var j in Filters[i])
...
...
@@ -279,14 +277,14 @@ if(RES["OK"]) {
bgcolor
:
"#FFA500"
,
onchange
:
function
(
value
){
$
.
doTimeout
(
100
,
function
(){
partialGraph
.
iterNodes
(
function
(
n
)
{
if
(
Nodes
[
n
.
id
].
type
==
catSem
)
{
var
newval
=
parseFloat
(
Nodes
[
n
.
id
].
size
)
+
parseFloat
((
value
-
1
))
*
0.3
TW
.
partialGraph
.
iterNodes
(
function
(
n
)
{
if
(
TW
.
Nodes
[
n
.
id
].
type
==
TW
.
catSem
)
{
var
newval
=
parseFloat
(
TW
.
Nodes
[
n
.
id
].
size
)
+
parseFloat
((
value
-
1
))
*
0.3
n
.
size
=
(
newval
<
1.0
)?
1
:
newval
;
sizeMult
[
catSem
]
=
parseFloat
(
value
-
1
)
*
0.3
;
sizeMult
[
TW
.
catSem
]
=
parseFloat
(
value
-
1
)
*
0.3
;
}
});
partialGraph
.
draw
();
TW
.
partialGraph
.
draw
();
});
}
});
...
...
@@ -305,17 +303,17 @@ if(RES["OK"]) {
}
}).
index
();
partialGraph
.
zoomTo
(
partialGraph
.
_core
.
width
/
2
,
partialGraph
.
_core
.
height
/
2
,
0.8
).
draw
();
TW
.
partialGraph
.
zoomTo
(
TW
.
partialGraph
.
_core
.
width
/
2
,
TW
.
partialGraph
.
_core
.
height
/
2
,
0.8
).
draw
();
// fa2enabled=true;
partialGraph.zoomTo(partialGraph._core.width / 2,
partialGraph._core.height / 2, 0.8).draw();
// fa2enabled=true;
TW.partialGraph.zoomTo(TW.partialGraph._core.width / 2, TW.
partialGraph._core.height / 2, 0.8).draw();
// $.doTimeout(1,function(){
// fa2enabled=true; partialGraph.startForceAtlas2();
// fa2enabled=true;
TW.
partialGraph.startForceAtlas2();
// $.doTimeout(10,function(){
// partialGraph.stopForceAtlas2();
//
TW.
partialGraph.stopForceAtlas2();
// });
// });
twjs_
.
initListeners
(
categories
,
partialGraph
);
twjs_
.
initListeners
(
categories
,
TW
.
partialGraph
);
if
(
categories
.
length
==
1
)
{
$
(
"#changetype"
).
hide
();
...
...
tinawebJS/methods.js
View file @
8a351ffa
This diff is collapsed.
Click to expand it.
tinawebJS/sigma.forceatlas2.js
View file @
8a351ffa
...
...
@@ -341,7 +341,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
var
swingingVSnodes_length
=
swingingSum
/
nodes
.
length
;
/**/
if
(
stopcriteria
&&
(
convg
>
swingingVSnodes_length
)){
pr
(
"i've applied the stopcriteria: "
+
self
.
count
)
partialGraph
.
stopForceAtlas2
();
TW
.
partialGraph
.
stopForceAtlas2
();
}
self
.
p
.
totalEffectiveTraction
=
totalEffectiveTraction
;
...
...
@@ -1128,7 +1128,7 @@ sigma.publicPrototype.startForceAtlas2 = function() {
}
if
(
isolatedBCauseFilter
==
ene
)
{
partialGraph
.
stopForceAtlas2
();
TW
.
partialGraph
.
stopForceAtlas2
();
return
;
}
...
...
@@ -1139,12 +1139,12 @@ sigma.publicPrototype.startForceAtlas2 = function() {
return
true
;
});
var
present
=
partialGraph
.
states
.
slice
(
-
1
)[
0
]
var
present
=
TW
.
partialGraph
.
states
.
slice
(
-
1
)[
0
]
// fixing anomaly in forceatlas2
$
.
doTimeout
(
250
,
function
(){
if
(
!
present
.
level
&&
partialGraph
.
forceatlas2
.
active
&&
partialGraph
.
forceatlas2
.
count
==
0
)
{
if
(
!
present
.
level
&&
TW
.
partialGraph
.
forceatlas2
.
active
&&
TW
.
partialGraph
.
forceatlas2
.
count
==
0
)
{
pr
(
"SUPER JUTSU!!"
)
partialGraph
.
startForceAtlas2
();
TW
.
partialGraph
.
startForceAtlas2
();
return
;
}
});
...
...
@@ -1153,7 +1153,7 @@ sigma.publicPrototype.startForceAtlas2 = function() {
};
sigma
.
publicPrototype
.
stopForceAtlas2
=
function
()
{
var
present
=
partialGraph
.
states
.
slice
(
-
1
)[
0
]
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
)
...
...
@@ -1162,14 +1162,14 @@ sigma.publicPrototype.stopForceAtlas2 = function() {
first_state
=
present
.
type
;
for
(
var
i
in
first_state
)
{
if
(
first_state
[
i
])
{
for
(
var
j
in
Filters
[
i
])
{
for
(
var
j
in
TW
.
Filters
[
i
])
{
original
=
lastFilter
[
j
][
"orig"
]
thelast
=
lastFilter
[
j
][
"last"
]
if
(
thelast
!=
"-"
)
{
if
(
original
==
thelast
)
{
for
(
var
i
in
partialGraph
.
_core
.
graph
.
nodesIndex
){
Nodes
[
i
].
x
=
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
].
x
;
Nodes
[
i
].
y
=
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
].
y
;
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
;
}
}
}
...
...
@@ -1182,15 +1182,14 @@ sigma.publicPrototype.stopForceAtlas2 = function() {
this
.
forceatlas2
.
count
=
0
;
}
this
.
removeGenerator
(
'forceatlas2'
);
partialGraph
.
refresh
();
if
(
minimap
)
$
(
"#overviewzone"
).
show
();
TW
.
partialGraph
.
refresh
();
if
(
first_time
)
{
$
.
doTimeout
(
100
,
function
(){
pr
(
"
\
t
\
t
\
t
\
t
\
tFirst time FA2 Stopped"
)
for
(
var
i
in
partialGraph
.
_core
.
graph
.
nodesIndex
){
Nodes
[
i
].
x
=
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
].
x
;
Nodes
[
i
].
y
=
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
].
y
;
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
;
}
});
first_time
=
false
;
...
...
tinawebJS/sigma.min.js
View file @
8a351ffa
...
...
@@ -1273,9 +1273,9 @@ sigma.classes.Cascade = function() {
*/
function
empty
()
{
if
(
partialGraph
)
{
if
(
partialGraph
.
forceatlas2
)
{
partialGraph
.
stopForceAtlas2
();
if
(
TW
.
partialGraph
)
{
if
(
TW
.
partialGraph
.
forceatlas2
)
{
TW
.
partialGraph
.
stopForceAtlas2
();
}
}
...
...
@@ -2910,8 +2910,8 @@ sigma.classes.Cascade = function() {
self
.
p
.
zoomMultiply
:
1
/
self
.
p
.
zoomMultiply
)
);
partialGraph
.
centreX
=
(
self
.
mouseX
*
(
overviewWidth
/
(
partialGraph
.
_core
.
width
-
1
)));
partialGraph
.
centreY
=
(
self
.
mouseY
*
(
overviewHeight
/
(
partialGraph
.
_core
.
height
-
1
)));
TW
.
partialGraph
.
centreX
=
(
self
.
mouseX
*
(
overviewWidth
/
(
TW
.
partialGraph
.
_core
.
width
-
1
)));
TW
.
partialGraph
.
centreY
=
(
self
.
mouseY
*
(
overviewHeight
/
(
TW
.
partialGraph
.
_core
.
height
-
1
)));
if
(
self
.
p
[
'blockScroll'
])
{
if
(
event
.
preventDefault
)
{
...
...
tinawebJS/sigma.parseCustom.js
View file @
8a351ffa
...
...
@@ -292,13 +292,13 @@ function dictfyGexf( gexf , categories ){
}
var
attention
=
false
if
(
Clusters
.
length
==
0
)
{
if
(
TW
.
Clusters
.
length
==
0
)
{
if
(
nodes
[
1
].
attributes
[
"cluster_index"
]
)
{
attention
=
true
;
}
}
Clusters
=
{}
TW
.
Clusters
=
{}
//New scale for node size: now, between 2 and 5 instead [1,70]
for
(
var
it
in
nodes
){
nodes
[
it
].
size
=
desirableNodeSizeMIN
+
(
parseInt
(
nodes
[
it
].
size
)
-
1
)
*
((
desirableNodeSizeMAX
-
desirableNodeSizeMIN
)
/
(
maxNodeSize
-
minNodeSize
));
...
...
@@ -307,13 +307,13 @@ function dictfyGexf( gexf , categories ){
var
t_cnumber
=
nodes
[
it
].
attributes
[
"cluster_index"
]
nodes
[
it
].
attributes
[
"clust_default"
]
=
t_cnumber
;
var
t_label
=
(
nodes
[
it
].
attributes
[
"cluster_label"
])?
nodes
[
it
].
attributes
[
"cluster_label"
]:
"cluster_"
+
nodes
[
it
].
attributes
[
"cluster_index"
]
if
(
!
Clusters
[
t_type
])
{
Clusters
[
t_type
]
=
{}
Clusters
[
t_type
][
"clust_default"
]
=
{}
if
(
!
TW
.
Clusters
[
t_type
])
{
TW
.
Clusters
[
t_type
]
=
{}
TW
.
Clusters
[
t_type
][
"clust_default"
]
=
{}
}
Clusters
[
t_type
][
"clust_default"
][
t_cnumber
]
=
t_label
TW
.
Clusters
[
t_type
][
"clust_default"
][
t_cnumber
]
=
t_label
}
// partialGraph._core.graph.nodesIndex[it].size=Nodes[it].size;
//
TW.
partialGraph._core.graph.nodesIndex[it].size=Nodes[it].size;
}
...
...
@@ -373,12 +373,12 @@ function dictfyGexf( gexf , categories ){
}
idArray
=
idInRelations
.
map
(
Number
).
join
(
"|"
)
edge
.
categ
=
idArray
;
if
(
!
Relations
[
idArray
])
Relations
[
idArray
]
=
{}
if
(
!
TW
.
Relations
[
idArray
])
TW
.
Relations
[
idArray
]
=
{}
if
(
isUndef
(
Relations
[
idArray
][
source
]))
Relations
[
idArray
][
source
]
=
{};
if
(
isUndef
(
Relations
[
idArray
][
target
]))
Relations
[
idArray
][
target
]
=
{};
Relations
[
idArray
][
source
][
target
]
=
true
;
Relations
[
idArray
][
target
][
source
]
=
true
;
if
(
isUndef
(
TW
.
Relations
[
idArray
][
source
]))
TW
.
Relations
[
idArray
][
source
]
=
{};
if
(
isUndef
(
TW
.
Relations
[
idArray
][
target
]))
TW
.
Relations
[
idArray
][
target
]
=
{};
TW
.
Relations
[
idArray
][
source
][
target
]
=
true
;
TW
.
Relations
[
idArray
][
target
][
source
]
=
true
;
// [ / New Code! ]
...
...
@@ -400,7 +400,7 @@ function dictfyGexf( gexf , categories ){
}
nodes1
[
source
].
neighbours
.
push
(
target
);
nodes1
[
target
].
neighbours
.
push
(
source
);
// partialGraph.addEdge(indice,source,target,edge);
//
TW.
partialGraph.addEdge(indice,source,target,edge);
}
if
(
categories
.
length
>
1
)
{
...
...
@@ -482,9 +482,9 @@ function dictfyGexf( gexf , categories ){
}
}
for
(
var
i
in
Relations
)
{
for
(
var
j
in
Relations
[
i
])
{
Relations
[
i
][
j
]
=
Object
.
keys
(
Relations
[
i
][
j
]).
map
(
Number
)
for
(
var
i
in
TW
.
Relations
)
{
for
(
var
j
in
TW
.
Relations
[
i
])
{
TW
.
Relations
[
i
][
j
]
=
Object
.
keys
(
TW
.
Relations
[
i
][
j
]).
map
(
Number
)
}
}
...
...
@@ -617,12 +617,12 @@ function dictfyJSON( data , categories ) {
}
idArray
=
idInRelations
.
map
(
Number
).
join
(
"|"
)
edge
.
categ
=
idArray
;
if
(
!
Relations
[
idArray
])
Relations
[
idArray
]
=
{}
if
(
!
TW
.
Relations
[
idArray
])
TW
.
Relations
[
idArray
]
=
{}
if
(
isUndef
(
Relations
[
idArray
][
source
]))
Relations
[
idArray
][
source
]
=
{};
if
(
isUndef
(
Relations
[
idArray
][
target
]))
Relations
[
idArray
][
target
]
=
{};
Relations
[
idArray
][
source
][
target
]
=
true
;
Relations
[
idArray
][
target
][
source
]
=
true
;
if
(
isUndef
(
TW
.
Relations
[
idArray
][
source
]))
TW
.
Relations
[
idArray
][
source
]
=
{};
if
(
isUndef
(
TW
.
Relations
[
idArray
][
target
]))
TW
.
Relations
[
idArray
][
target
]
=
{};
TW
.
Relations
[
idArray
][
source
][
target
]
=
true
;
TW
.
Relations
[
idArray
][
target
][
source
]
=
true
;
// [ / New Code! ]
...
...
@@ -720,9 +720,9 @@ function dictfyJSON( data , categories ) {
}
}
for
(
var
i
in
Relations
)
{
for
(
var
j
in
Relations
[
i
])
{
Relations
[
i
][
j
]
=
Object
.
keys
(
Relations
[
i
][
j
]).
map
(
Number
)
for
(
var
i
in
TW
.
Relations
)
{
for
(
var
j
in
TW
.
Relations
[
i
])
{
TW
.
Relations
[
i
][
j
]
=
Object
.
keys
(
TW
.
Relations
[
i
][
j
]).
map
(
Number
)
}
}
...
...
tinawebJS/sigmaUtils.js
View file @
8a351ffa
...
...
@@ -33,11 +33,11 @@ SigmaUtils = function () {
var
typeNow
=
initialState
.
map
(
Number
).
join
(
"|"
)
for
(
var
i
in
Relations
[
typeNow
])
{
for
(
var
i
in
TW
.
Relations
[
typeNow
])
{
s
=
i
;
for
(
var
j
in
Relations
[
typeNow
][
i
])
{
t
=
Relations
[
typeNow
][
i
][
j
]
e
=
Edges
[
s
+
";"
+
t
]
for
(
var
j
in
TW
.
Relations
[
typeNow
][
i
])
{
t
=
TW
.
Relations
[
typeNow
][
i
][
j
]
e
=
TW
.
Edges
[
s
+
";"
+
t
]
if
(
e
)
{
if
(
e
.
source
!=
e
.
target
)
{
var
edge
=
({
...
...
@@ -69,7 +69,7 @@ function showMeSomeLabels(N){
maxIn
=
0
,
minOut
=
50
,
maxOut
=
0
;
partialGraph
.
iterNodes
(
function
(
n
){
TW
.
partialGraph
.
iterNodes
(
function
(
n
){
if
(
n
.
hidden
==
false
){
if
(
parseInt
(
n
.
inDegree
)
<
minIn
)
minIn
=
n
.
inDegree
;
if
(
parseInt
(
n
.
inDegree
)
>
maxIn
)
maxIn
=
n
.
inDegree
;
...
...
@@ -100,51 +100,51 @@ function showMeSomeLabels(N){
if
(
counter
==
N
)
break
;
}
}
partialGraph
.
draw
()
TW
.
partialGraph
.
draw
()
/*======= Show some labels at the beginning =======*/
}
function
getnodes
(){
return
partialGraph
.
_core
.
graph
.
nodes
;
return
TW
.
partialGraph
.
_core
.
graph
.
nodes
;
}
function
getnodesIndex
(){
return
partialGraph
.
_core
.
graph
.
nodesIndex
;
return
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
;
}
function
getedges
(){
return
partialGraph
.
_core
.
graph
.
edges
;
return
TW
.
partialGraph
.
_core
.
graph
.
edges
;
}
function
getedgesIndex
(){
return
partialGraph
.
_core
.
graph
.
edgesIndex
;
return
TW
.
partialGraph
.
_core
.
graph
.
edgesIndex
;
}
function
getVisibleEdges
()
{
return
partialGraph
.
_core
.
graph
.
edges
.
filter
(
function
(
e
)
{
return
TW
.
partialGraph
.
_core
.
graph
.
edges
.
filter
(
function
(
e
)
{
return
!
e
[
'hidden'
];
});
}
function
getVisibleNodes
()
{
return
partialGraph
.
_core
.
graph
.
nodes
.
filter
(
function
(
n
)
{
return
TW
.
partialGraph
.
_core
.
graph
.
nodes
.
filter
(
function
(
n
)
{
return
!
n
[
'hidden'
];
});
}
function
getNodesByAtt
(
att
)
{
return
partialGraph
.
_core
.
graph
.
nodes
.
filter
(
function
(
n
)
{
return
TW
.
partialGraph
.
_core
.
graph
.
nodes
.
filter
(
function
(
n
)
{
return
n
[
'type'
]
==
att
;
});
}
function
getn
(
id
){
return
partialGraph
.
_core
.
graph
.
nodesIndex
[
id
];
return
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
id
];
}
function
gete
(
id
){
return
partialGraph
.
_core
.
graph
.
edgesIndex
[
id
];
return
TW
.
partialGraph
.
_core
.
graph
.
edgesIndex
[
id
];
}
...
...
@@ -182,7 +182,7 @@ function getNodeLabels(elems){
var
labelss
=
[]
for
(
var
i
in
elems
){
var
id
=
(
!
isUndef
(
elems
[
i
].
key
))?
elems
[
i
].
key
:
i
labelss
.
push
(
Nodes
[
id
].
label
)
labelss
.
push
(
TW
.
Nodes
[
id
].
label
)
}
return
labelss
}
...
...
@@ -195,7 +195,7 @@ function getNodeIDs(elems){
function
getSelections
(){
params
=
[];
for
(
var
i
in
selections
){
params
.
push
(
Nodes
[
i
].
label
);
params
.
push
(
TW
.
Nodes
[
i
].
label
);
}
return
params
;
}
...
...
@@ -250,7 +250,7 @@ function clustersBy(daclass) {
var
v_nodes
=
getVisibleNodes
();
var
min_pow
=
0
;
for
(
var
i
in
v_nodes
)
{
var
the_node
=
Nodes
[
v_nodes
[
i
].
id
]
var
the_node
=
TW
.
Nodes
[
v_nodes
[
i
].
id
]
var
attval
=
(
isUndef
(
the_node
.
attributes
)
||
isUndef
(
the_node
.
attributes
[
daclass
])
)?
v_nodes
[
i
][
daclass
]:
the_node
.
attributes
[
daclass
];
if
(
!
isNaN
(
parseFloat
(
attval
))
)
{
//is float
while
(
true
)
{
...
...
@@ -268,7 +268,7 @@ function clustersBy(daclass) {
var
real_max
=
-
1
;
var
themult
=
Math
.
pow
(
10
,
min_pow
);
for
(
var
i
in
v_nodes
)
{
var
the_node
=
Nodes
[
v_nodes
[
i
].
id
]
var
the_node
=
TW
.
Nodes
[
v_nodes
[
i
].
id
]
var
attval
=
(
isUndef
(
the_node
.
attributes
)
||
isUndef
(
the_node
.
attributes
[
daclass
])
)?
v_nodes
[
i
][
daclass
]:
the_node
.
attributes
[
daclass
];
var
attnumber
=
Number
(
attval
);
var
round_number
=
Math
.
round
(
attnumber
*
themult
)
;
...
...
@@ -298,19 +298,19 @@ function clustersBy(daclass) {
var
newval_color
=
Math
.
round
(
(
Min_color
+
(
NodeID_Val
[
i
][
"round"
]
-
real_min
)
*
((
Max_color
-
Min_color
)
/
(
real_max
-
real_min
))
)
);
var
hex_color
=
rgbToHex
(
255
,
(
255
-
newval_color
)
,
0
)
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
].
color
=
hex_color
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
].
color
=
hex_color
var
newval_size
=
Math
.
round
(
(
Min_size
+
(
NodeID_Val
[
i
][
"round"
]
-
real_min
)
*
((
Max_size
-
Min_size
)
/
(
real_max
-
real_min
))
)
);
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)
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
].
label
=
"("
+
NodeID_Val
[
i
][
"real"
].
toFixed
(
min_pow
)
+
") "
+
Nodes
[
i
].
label
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
i
].
label
=
"("
+
NodeID_Val
[
i
][
"real"
].
toFixed
(
min_pow
)
+
") "
+
TW
.
Nodes
[
i
].
label
}
// [ / Scaling node colours(0-255) and sizes(3-5) ]
partialGraph
.
refresh
();
partialGraph
.
draw
();
TW
.
partialGraph
.
refresh
();
TW
.
partialGraph
.
draw
();
// [ Edge-colour by source-target nodes-colours combination ]
...
...
@@ -324,15 +324,14 @@ function clustersBy(daclass) {
var
r
=
(
a
[
0
]
+
b
[
0
])
>>
1
;
var
g
=
(
a
[
1
]
+
b
[
1
])
>>
1
;
var
b
=
(
a
[
2
]
+
b
[
2
])
>>
1
;
partialGraph
.
_core
.
graph
.
edgesIndex
[
e_id
].
color
=
"rgba("
+
[
r
,
g
,
b
].
join
(
","
)
+
",0.5)"
;
TW
.
partialGraph
.
_core
.
graph
.
edgesIndex
[
e_id
].
color
=
"rgba("
+
[
r
,
g
,
b
].
join
(
","
)
+
",0.5)"
;
}
// [ / Edge-colour by source-target nodes-colours combination ]
if
(
daclass
!=
"degree"
)
set_ClustersLegend
(
daclass
)
set_ClustersLegend
(
null
)
partialGraph
.
refresh
();
partialGraph
.
draw
();
TW
.
partialGraph
.
refresh
();
TW
.
partialGraph
.
draw
();
}
function
colorsBy
(
daclass
)
{
...
...
@@ -346,9 +345,9 @@ function colorsBy(daclass) {
pr
(
""
)
if
(
daclass
==
"clust_louvain"
)
{
if
(
!
partialGraph
.
states
.
slice
(
-
1
)[
0
].
LouvainFait
)
{
if
(
!
TW
.
partialGraph
.
states
.
slice
(
-
1
)[
0
].
LouvainFait
)
{
RunLouvain
()
partialGraph
.
states
.
slice
(
-
1
)[
0
].
LouvainFait
=
true
TW
.
partialGraph
.
states
.
slice
(
-
1
)[
0
].
LouvainFait
=
true
}
}
...
...
@@ -356,11 +355,11 @@ function colorsBy(daclass) {
colorList
.
sort
(
function
(){
return
Math
.
random
()
-
0.5
;
});
for
(
var
i
in
v_nodes
)
{
var
the_node
=
Nodes
[
v_nodes
[
i
].
id
]
var
the_node
=
TW
.
Nodes
[
v_nodes
[
i
].
id
]
var
attval
=
(
isUndef
(
the_node
.
attributes
)
||
isUndef
(
the_node
.
attributes
[
daclass
])
)?
v_nodes
[
i
][
daclass
]:
the_node
.
attributes
[
daclass
];
partialGraph
.
_core
.
graph
.
nodesIndex
[
v_nodes
[
i
].
id
].
color
=
colorList
[
attval
]
TW
.
partialGraph
.
_core
.
graph
.
nodesIndex
[
v_nodes
[
i
].
id
].
color
=
colorList
[
attval
]
}
partialGraph
.
draw
();
TW
.
partialGraph
.
draw
();
// [ Edge-colour by source-target nodes-colours combination ]
var
v_edges
=
getVisibleEdges
();
...
...
@@ -374,18 +373,18 @@ function colorsBy(daclass) {
var
r
=
(
a
[
0
]
+
b
[
0
])
>>
1
;
var
g
=
(
a
[
1
]
+
b
[
1
])
>>
1
;
var
b
=
(
a
[
2
]
+
b
[
2
])
>>
1
;
partialGraph
.
_core
.
graph
.
edgesIndex
[
e_id
].
color
=
"rgba("
+
[
r
,
g
,
b
].
join
(
","
)
+
",0.5)"
;
TW
.
partialGraph
.
_core
.
graph
.
edgesIndex
[
e_id
].
color
=
"rgba("
+
[
r
,
g
,
b
].
join
(
","
)
+
",0.5)"
;
}
}
// [ / Edge-colour by source-target nodes-colours combination ]
set_ClustersLegend
(
daclass
)
partialGraph
.
refresh
();
partialGraph
.
draw
();
TW
.
partialGraph
.
refresh
();
TW
.
partialGraph
.
draw
();
}
//just for fun
function
makeEdgeWeightUndef
()
{
for
(
var
e
in
partialGraph
.
_core
.
graph
.
edges
)
{
partialGraph
.
_core
.
graph
.
edges
[
e
].
weight
=
1
;
for
(
var
e
in
TW
.
partialGraph
.
_core
.
graph
.
edges
)
{
TW
.
partialGraph
.
_core
.
graph
.
edges
[
e
].
weight
=
1
;
}
}
\ No newline at end of file
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