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
d3ac46d2
Commit
d3ac46d2
authored
Jan 15, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor adjustments around db to tina weights
parent
0e50ea93
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
18 deletions
+23
-18
extractDataCustom.py
services/db_to_tina_api/extractDataCustom.py
+4
-1
asyncFA2.js
static/tinawebJS/asyncFA2.js
+13
-13
main.js
static/tinawebJS/main.js
+6
-4
No files found.
services/db_to_tina_api/extractDataCustom.py
View file @
d3ac46d2
...
@@ -94,7 +94,7 @@ class MyExtractor:
...
@@ -94,7 +94,7 @@ class MyExtractor:
results
=
self
.
cursor
.
fetchall
()
results
=
self
.
cursor
.
fetchall
()
# debug
# debug
#
mlog("DEBUG", "getScholarsList<== len(all 2-step neighbors) =", len(results))
mlog
(
"DEBUG"
,
"getScholarsList<== len(all 2-step neighbors) ="
,
len
(
results
))
if
len
(
results
)
==
0
:
if
len
(
results
)
==
0
:
# should never happen if input unique_id is valid
# should never happen if input unique_id is valid
...
@@ -293,10 +293,13 @@ class MyExtractor:
...
@@ -293,10 +293,13 @@ class MyExtractor:
scholarsIncluded
=
0
;
scholarsIncluded
=
0
;
for
i
in
self
.
scholars
:
for
i
in
self
.
scholars
:
mlog
(
'INFO'
,
'extractDataCustom:'
+
self
.
scholars
[
i
][
'email'
])
self
.
scholars_colors
[
self
.
scholars
[
i
][
'email'
]
.
strip
()]
=
0
;
self
.
scholars_colors
[
self
.
scholars
[
i
][
'email'
]
.
strip
()]
=
0
;
scholar_keywords
=
self
.
scholars
[
i
][
'keywords_ids'
];
scholar_keywords
=
self
.
scholars
[
i
][
'keywords_ids'
];
for
k
in
range
(
len
(
scholar_keywords
)):
for
k
in
range
(
len
(
scholar_keywords
)):
kw_k
=
scholar_keywords
[
k
]
kw_k
=
scholar_keywords
[
k
]
mlog
(
'INFO'
,
'extractDataCustom:keyword'
+
kw_k
)
if
kw_k
!=
None
and
kw_k
!=
""
:
if
kw_k
!=
None
and
kw_k
!=
""
:
# mlog("DEBUG", kw_k)
# mlog("DEBUG", kw_k)
if
kw_k
in
termsMatrix
:
if
kw_k
in
termsMatrix
:
...
...
static/tinawebJS/asyncFA2.js
View file @
d3ac46d2
...
@@ -8,7 +8,7 @@ var ForceAtlas2 = function(graph) {
...
@@ -8,7 +8,7 @@ var ForceAtlas2 = function(graph) {
linLogMode
:
false
,
linLogMode
:
false
,
outboundAttractionDistribution
:
false
,
outboundAttractionDistribution
:
false
,
adjustSizes
:
false
,
adjustSizes
:
false
,
edgeWeightInfluence
:
0
,
edgeWeightInfluence
:
1
,
scalingRatio
:
1
,
scalingRatio
:
1
,
strongGravityMode
:
false
,
strongGravityMode
:
false
,
gravity
:
1
,
gravity
:
1
,
...
@@ -233,7 +233,7 @@ var ForceAtlas2 = function(graph) {
...
@@ -233,7 +233,7 @@ var ForceAtlas2 = function(graph) {
totalSwinging
+=
n
.
fa2
.
mass
*
swinging
;
totalSwinging
+=
n
.
fa2
.
mass
*
swinging
;
swingingSum
+=
swinging
;
swingingSum
+=
swinging
;
promdxdy
+=
(
Math
.
abs
(
n
.
fa2
.
dx
)
+
Math
.
abs
(
n
.
fa2
.
dy
))
/
2
;
/**/
promdxdy
+=
(
Math
.
abs
(
n
.
fa2
.
dx
)
+
Math
.
abs
(
n
.
fa2
.
dy
))
/
2
;
/**/
totalEffectiveTraction
+=
n
.
fa2
.
mass
*
totalEffectiveTraction
+=
n
.
fa2
.
mass
*
0.5
*
0.5
*
Math
.
sqrt
(
Math
.
sqrt
(
...
@@ -242,15 +242,15 @@ var ForceAtlas2 = function(graph) {
...
@@ -242,15 +242,15 @@ var ForceAtlas2 = function(graph) {
);
);
}
}
});
});
self
.
p
.
totalSwinging
=
totalSwinging
;
self
.
p
.
totalSwinging
=
totalSwinging
;
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(convg > swingingVSnodes_length){
// if(convg > swingingVSnodes_length){
// self.p.banderita=true;
// self.p.banderita=true;
// }
// }
self
.
p
.
totalEffectiveTraction
=
totalEffectiveTraction
;
self
.
p
.
totalEffectiveTraction
=
totalEffectiveTraction
;
// We want that swingingMovement < tolerance * convergenceMovement
// We want that swingingMovement < tolerance * convergenceMovement
...
@@ -367,7 +367,7 @@ var ForceAtlas2 = function(graph) {
...
@@ -367,7 +367,7 @@ var ForceAtlas2 = function(graph) {
// Behavior
// Behavior
this
.
p
.
outboundAttractionDistribution
=
false
;
this
.
p
.
outboundAttractionDistribution
=
false
;
this
.
p
.
linLogMode
=
false
;
this
.
p
.
linLogMode
=
false
;
this
.
p
.
adjustSizes
=
fals
e
;
this
.
p
.
adjustSizes
=
tru
e
;
this
.
p
.
edgeWeightInfluence
=
1
;
this
.
p
.
edgeWeightInfluence
=
1
;
// Performance
// Performance
...
@@ -878,7 +878,7 @@ var Region = function(nodes, depth) {
...
@@ -878,7 +878,7 @@ var Region = function(nodes, depth) {
massCenterX
:
0
,
massCenterX
:
0
,
massCenterY
:
0
massCenterY
:
0
};
};
console
.
log
(
"updating mass and geometry"
);
console
.
log
(
"updating mass and geometry"
);
this
.
updateMassAndGeometry
();
this
.
updateMassAndGeometry
();
}
}
...
@@ -981,7 +981,7 @@ var startForceAtlas2 = function(graph,limit_it) {
...
@@ -981,7 +981,7 @@ var startForceAtlas2 = function(graph,limit_it) {
forceatlas2
=
new
ForceAtlas2
(
graph
);
forceatlas2
=
new
ForceAtlas2
(
graph
);
forceatlas2
.
setAutoSettings
();
forceatlas2
.
setAutoSettings
();
forceatlas2
.
init
();
forceatlas2
.
init
();
count
=
0
;
count
=
0
;
flag
=
false
;
flag
=
false
;
while
(
true
){
while
(
true
){
...
@@ -994,13 +994,13 @@ var startForceAtlas2 = function(graph,limit_it) {
...
@@ -994,13 +994,13 @@ var startForceAtlas2 = function(graph,limit_it) {
}
}
count
++
;
count
++
;
if
(
flag
||
count
>
limit_it
)
break
;
if
(
flag
||
count
>
limit_it
)
break
;
}
}
// pr(forceatlas2.graph.nodes[0].x)
// pr(forceatlas2.graph.nodes[0].x)
// pr(forceatlas2.graph.nodes[0].y)
// pr(forceatlas2.graph.nodes[0].y)
// console.log("\titerations: "+count)
// console.log("\titerations: "+count)
result
=
{
result
=
{
"nodes"
:
forceatlas2
.
graph
.
nodes
,
"nodes"
:
forceatlas2
.
graph
.
nodes
,
"it"
:
count
"it"
:
count
}
}
return
result
;
return
result
;
};
};
...
@@ -1016,5 +1016,5 @@ self.addEventListener("message", function(e) {
...
@@ -1016,5 +1016,5 @@ self.addEventListener("message", function(e) {
"nodes"
:
result
.
nodes
,
"nodes"
:
result
.
nodes
,
"it"
:
result
.
it
"it"
:
result
.
it
});
});
},
false
);
},
false
);
\ No newline at end of file
static/tinawebJS/main.js
View file @
d3ac46d2
...
@@ -259,7 +259,7 @@ function bringTheNoise(sourceinfo,type){
...
@@ -259,7 +259,7 @@ function bringTheNoise(sourceinfo,type){
$
(
'#modalloader'
).
modal
(
'show'
);
$
(
'#modalloader'
).
modal
(
'show'
);
//
console.warn("===> PASSING ON QUERY (type "+type+") TO BRIDGE <===")
console
.
warn
(
"===> PASSING ON QUERY (type "
+
type
+
") TO BRIDGE <==="
)
if
(
type
==
"uid"
)
{
if
(
type
==
"uid"
)
{
// pr("bring the noise, case: unique_id");
// pr("bring the noise, case: unique_id");
// pr(getClientTime()+" : DataExt Ini");
// pr(getClientTime()+" : DataExt Ini");
...
@@ -726,15 +726,17 @@ function SigmaLayouting( URL, DATA, NAME) {
...
@@ -726,15 +726,17 @@ function SigmaLayouting( URL, DATA, NAME) {
pr
(
data
)
pr
(
data
)
if
(
!
isUndef
(
ourGetUrlParam
.
seed
))
seed
=
ourGetUrlParam
.
seed
;
if
(
!
isUndef
(
ourGetUrlParam
.
seed
))
seed
=
ourGetUrlParam
.
seed
;
extractFromJson
(
data
,
seed
);
extractFromJson
(
data
,
seed
);
// changeToMacro("social");
pr
(
getClientTime
()
+
" : DataExt Fin"
);
pr
(
getClientTime
()
+
" : DataExt Fin"
);
// < === DATA EXTRACTED!! === >
// < === DATA EXTRACTED!! === >
if
(
fa2enabled
===
"off"
)
$
(
"#edgesButton"
).
hide
(
);
// changeToMacro("social"
);
pushSWClick
(
"social"
);
pushSWClick
(
"social"
);
if
(
fa2enabled
===
"off"
)
$
(
"#edgesButton"
).
hide
();
pr
(
partialGraph
.
_core
.
graph
.
nodes
.
length
)
pr
(
partialGraph
.
_core
.
graph
.
nodes
.
length
)
pr
(
partialGraph
.
_core
.
graph
.
edges
.
length
)
pr
(
partialGraph
.
_core
.
graph
.
edges
.
length
)
nbnodes
=
partialGraph
.
_core
.
graph
.
nodes
.
length
nbnodes
=
partialGraph
.
_core
.
graph
.
nodes
.
length
if
(
nbnodes
>=
400
&&
nbnodes
<
1000
)
{
if
(
nbnodes
>=
400
&&
nbnodes
<
1000
)
{
snbnodes
=
nbnodes
+
""
;
snbnodes
=
nbnodes
+
""
;
...
...
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