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
b2bb0ba6
Commit
b2bb0ba6
authored
Apr 07, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove most init comments
parent
c2449196
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
51 deletions
+58
-51
enviroment.js
tinawebJS/enviroment.js
+23
-17
main.js
tinawebJS/main.js
+19
-18
sigma.parseCustom.js
tinawebJS/sigma.parseCustom.js
+14
-14
sigmaUtils.js
tinawebJS/sigmaUtils.js
+2
-2
No files found.
tinawebJS/enviroment.js
View file @
b2bb0ba6
...
...
@@ -410,22 +410,25 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
// type_attrb = "type"
// criteria = "size"
if
(
TW
.
partialGraph
.
nEdges
<
3
)
{
$
(
sliderDivID
).
freshslider
({
range
:
true
,
step
:
1
,
value
:[
10
,
60
],
enabled
:
false
,
onchange
:
function
(
low
,
high
){
console
.
log
(
low
,
high
);
}
});
return
;
}
//
if(TW.partialGraph.nEdges<3) {
//
$(sliderDivID).freshslider({
//
range: true,
//
step:1,
//
value:[10, 60],
//
enabled: false,
//
onchange:function(low, high){
//
console.log(low, high);
//
}
//
});
//
return;
//
}
var
filterparams
=
AlgorithmForSliders
(
TW
.
Edges
,
type_attrb
,
type
,
criteria
)
//OK
console
.
log
(
"EdgeWeightFilter: "
+
type
)
console
.
log
(
filterparams
)
// TODO make an index
// console.log("EdgeWeightFilter: "+type)
// console.log(filterparams)
var
steps
=
filterparams
[
"steps"
]
var
finalarray
=
filterparams
[
"finalarray"
]
if
(
steps
<
3
)
{
...
...
@@ -435,7 +438,9 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
value
:[
10
,
60
],
enabled
:
false
,
onchange
:
function
(
low
,
high
){
console
.
log
(
low
,
high
);
// TODO REFA fix edge selector
// console.log(low, high);
}
});
return
;
...
...
@@ -618,9 +623,10 @@ function NodeWeightFilter( categories , sliderDivID , type_attrb , type , crit
return
;
}
// £TODO make this into a type_attrb index (eg weight index) instead of recalculating each time
var
filterparams
=
AlgorithmForSliders
(
TW
.
Nodes
,
type
,
type_attrb
,
criteria
)
console
.
log
(
"NodeWeightFilter: "
+
type
)
console
.
log
(
filterparams
)
//
console.log("NodeWeightFilter: "+type)
//
console.log(filterparams)
var
steps
=
filterparams
[
"steps"
]
var
finalarray
=
filterparams
[
"finalarray"
]
...
...
tinawebJS/main.js
View file @
b2bb0ba6
...
...
@@ -98,8 +98,7 @@ if(RES["OK"]) {
var
fileparam
;
// = { db|api.json , somefile.json|gexf }
var
the_data
=
RES
[
"data"
];
console
.
log
(
'RES'
,
RES
)
// console.log('initial AjaxSync result RES', RES)
var
the_file
=
""
;
if
(
!
isUndef
(
getUrlParam
.
mode
)
&&
getUrlParam
.
mode
==
"db.json"
)
{
...
...
@@ -122,20 +121,22 @@ if(RES["OK"]) {
var
files_selector
=
'<select onchange="jsActionOnGexfSelector(this.value , true);">'
for
(
var
path
in
the_data
)
{
console
.
log
(
"
\
t"
+
path
+
" has:"
)
console
.
log
(
the_data
[
path
])
var
the_gexfs
=
the_data
[
path
][
"gexfs"
]
console
.
log
(
"
\
t
\
tThese are the available Gexfs:"
)
for
(
var
gexf
in
the_gexfs
)
{
var
gexfBasename
=
gexf
.
replace
(
/
\.
gexf$/
,
""
)
// more human-readable in the menu
console
.
log
(
"
\
t
\
t
\
t"
+
gexf
+
" -> table:"
+
the_gexfs
[
gexf
][
"semantic"
][
"table"
]
)
TW
.
field
[
path
+
"/"
+
gexf
]
=
the_gexfs
[
gexf
][
"semantic"
][
"table"
]
// ex : data/AXA/RiskV2PageRank5000.gexf:"ISItermsAxa_2015"
TW
.
gexfDict
[
path
+
"/"
+
gexf
]
=
gexf
// ex : data/AXA/RiskV2PageRank1000.gexf:"RiskV2PageRank1000.gexf"
var
selected
=
(
the_file
==
(
path
+
"/"
+
gexf
))?
"selected"
:
""
files_selector
+=
'<option '
+
selected
+
'>'
+
gexfBasename
+
'</option>'
}
console
.
log
(
files_selector
)
//
console.log( files_selector )
break
;
}
files_selector
+=
"</select>"
...
...
@@ -143,19 +144,19 @@ if(RES["OK"]) {
console
.
log
(
"
\n
============================
\n
"
)
console
.
log
(
TW
.
field
)
console
.
log
(
TW
.
gexfDict
)
//
console.log("\n============================\n")
//
console.log(TW.field)
//
console.log(TW.gexfDict)
var
sub_RES
=
AjaxSync
({
URL
:
fileparam
});
the_data
=
sub_RES
[
"data"
]
fileparam
=
sub_RES
[
"format"
]
console
.
log
(
the_data
.
length
)
console
.
log
(
fileparam
)
//
console.log(the_data.length)
//
console.log(fileparam)
getUrlParam
.
file
=
the_file
;
console
.
log
(
" . .. . -. - .- . - -."
)
console
.
log
(
getUrlParam
.
file
)
console
.
log
(
"
\n
============================
\n
"
)
//
console.log("\n============================\n")
}
...
...
@@ -170,8 +171,8 @@ if(RES["OK"]) {
console
.
log
(
"parsing the data"
)
var
start
=
new
ParseCustom
(
fileparam
,
the_data
);
categories
=
start
.
scanFile
();
//user should choose the order of categories
console
.
log
(
"Categories: "
)
console
.
log
(
categories
)
//
console.log("Categories: ")
//
console.log(categories)
var
possibleStates
=
makeSystemStates
(
categories
)
var
initialState
=
buildInitialState
(
categories
)
//[true,false]//
...
...
@@ -183,8 +184,8 @@ if(RES["OK"]) {
TW
.
nodes1
=
dicts
.
n1
;
//not used
var
catDict
=
dicts
.
catDict
console
.
log
(
"CategoriesDict: "
)
console
.
log
(
catDict
)
//
console.log("CategoriesDict: ")
//
console.log(catDict)
TW
.
categoriesIndex
=
categories
;
//to_remove
TW
.
catSoc
=
categories
[
0
];
//to_remove
...
...
@@ -208,8 +209,8 @@ if(RES["OK"]) {
// NB new sigma.js: autoResize (no need for AdjustSigmaCanvas + sigmaLimits)
console
.
log
(
"categories: "
+
categories
)
console
.
log
(
"initial state: "
+
initialState
)
//
console.log("categories: "+categories)
//
console.log("initial state: "+initialState)
// [ Poblating the Sigma-Graph ]
var
sigma_utils
=
new
SigmaUtils
();
...
...
@@ -253,7 +254,7 @@ if(RES["OK"]) {
sigmaJsMouseProperties
)
console
.
log
(
"customS
ettings"
,
customSettings
)
console
.
info
(
"sigma s
ettings"
,
customSettings
)
// custom nodes rendering
if
(
customSettings
[
'twNodeRendBorder'
])
{
...
...
tinawebJS/sigma.parseCustom.js
View file @
b2bb0ba6
...
...
@@ -138,7 +138,7 @@ function scanGexf(gexf) {
// for {1,2}partite graphs
function
dictfyGexf
(
gexf
,
categories
){
console
.
warn
(
"ParseCustom gexf 2nd loop, main data extraction"
)
console
.
log
(
"ParseCustom gexf 2nd loop, main data extraction"
)
var
catDict
=
{}
...
...
@@ -202,9 +202,9 @@ function dictfyGexf( gexf , categories ){
numberOfNGrams
=
0
;
// debug: for local stats
let
allSizes
=
[]
let
sumSizes
=
0
let
sizeStats
=
{
'mean'
:
null
,
'median'
:
null
,
'max'
:
0
,
'min'
:
1000000000
}
//
let allSizes = []
//
let sumSizes = 0
//
let sizeStats = {'mean':null, 'median':null, 'max':0, 'min':1000000000}
for
(
i
=
0
;
i
<
nodesNodes
.
length
;
i
++
)
{
var
nodesNode
=
nodesNodes
[
i
];
// Each xml node 'nodes' (plural)
...
...
@@ -230,10 +230,10 @@ function dictfyGexf( gexf , categories ){
size
=
parseFloat
(
sizeNode
.
getAttribute
(
'value'
));
// debug: for stats ---------------------------
allSizes
.
push
(
size
)
sumSizes
+=
size
if
(
size
<
sizeStats
.
min
)
sizeStats
.
min
=
size
if
(
size
>
sizeStats
.
max
)
sizeStats
.
max
=
size
//
allSizes.push(size)
//
sumSizes += size
//
if (size < sizeStats.min) sizeStats.min = size
//
if (size > sizeStats.max) sizeStats.max = size
// --------------------------------------------
}
// [ / get Size ]
...
...
@@ -311,12 +311,12 @@ function dictfyGexf( gexf , categories ){
}
// -------------- debug: for local stats ----------------
allSizes
.
sort
();
let
N
=
allSizes
.
length
sizeStats
.
median
=
allSizes
[
Math
.
round
(
N
/
2
)]
sizeStats
.
mean
=
Math
.
round
(
sumSizes
/
N
*
100
)
/
100
console
.
log
(
"parseCustom(gexf) sizeStats:"
,
sizeStats
)
//
allSizes.sort();
//
let N = allSizes.length
//
sizeStats.median = allSizes[Math.round(N/2)]
//
sizeStats.mean = Math.round(sumSizes/N * 100)/100
//
//
console.log("parseCustom(gexf) sizeStats:", sizeStats)
// ------------- /debug: for local stats ----------------
var
attention
=
false
...
...
tinawebJS/sigmaUtils.js
View file @
b2bb0ba6
...
...
@@ -7,7 +7,7 @@ SigmaUtils = function () {
this
.
FillGraph
=
function
(
initialState
,
catDict
,
nodes
,
edges
,
graph
)
{
console
.
log
(
"Filling the graaaaph:"
)
console
.
log
(
catDict
)
//
console.log(catDict)
for
(
var
i
in
nodes
)
{
var
n
=
nodes
[
i
];
...
...
@@ -31,7 +31,7 @@ SigmaUtils = function () {
if
(
n
.
shape
)
node
.
shape
=
n
.
shape
;
// console.log("FillGraph, created new node:", node)
if
(
Number
(
n
.
id
)
==
287
)
console
.
log
(
"node 287:"
,
n
,
n
ode
)
if
(
Number
(
n
.
id
)
==
287
)
console
.
log
(
"node 287:"
,
node
)
// REFA new way => no separate id
graph
.
nodes
.
push
(
node
);
...
...
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