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
8e111c66
Commit
8e111c66
authored
Jun 21, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix deselections (actually commit
21064f3b
went too far)
we need both neighbor agregated sums AND detailed info
parent
f22f6272
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
16 deletions
+33
-16
Tinaweb.js
static/tinawebJS/Tinaweb.js
+31
-11
enviroment.js
static/tinawebJS/enviroment.js
+2
-4
sigma.parseCustom.js
static/tinawebJS/sigma.parseCustom.js
+0
-1
No files found.
static/tinawebJS/Tinaweb.js
View file @
8e111c66
...
@@ -179,26 +179,29 @@ function SelectionEngine() {
...
@@ -179,26 +179,29 @@ function SelectionEngine() {
// Dictionaries of: selection+neighbors for the new state and updateRelatedNodesPanel
// Dictionaries of: selection+neighbors for the new state and updateRelatedNodesPanel
let
selections
=
{}
let
selections
=
{}
// detailed relations sorted by types and srcid (for state cache, deselects etc)
let
activeRelations
=
{}
let
activeRelations
=
{}
activeRelations
[
activetypesKey
]
=
{}
activeRelations
[
activetypesKey
]
=
{}
// cumulated neighbor weights no matter what srcid (for tagCloud etc)
let
sameSideNeighbors
=
{}
let
oppoSideNeighbors
=
{}
// targeted arg 'nodes' can be nid array or single nid
// targeted arg 'nodes' can be nid array or single nid
var
ndsids
=
[]
var
ndsids
=
[]
if
(
args
.
nodes
)
{
if
(
args
.
nodes
)
{
if
(
!
$
.
isArray
(
args
.
nodes
))
ndsids
.
push
(
args
.
nodes
);
if
(
!
$
.
isArray
(
args
.
nodes
))
ndsids
.
push
(
args
.
nodes
);
else
ndsids
=
args
.
nodes
;
else
ndsids
=
args
.
nodes
;
// for state cache
activeRelations
[
activetypesKey
]
=
{}
// shortcut
var
sameSideNeighbors
=
activeRelations
[
activetypesKey
]
for
(
var
i
in
ndsids
)
{
for
(
var
i
in
ndsids
)
{
var
srcnid
=
ndsids
[
i
];
var
srcnid
=
ndsids
[
i
];
if
(
TW
.
Relations
[
activetypesKey
]
&&
TW
.
Relations
[
activetypesKey
][
srcnid
]
)
{
if
(
TW
.
Relations
[
activetypesKey
]
&&
TW
.
Relations
[
activetypesKey
][
srcnid
]
)
{
var
neighs
=
TW
.
Relations
[
activetypesKey
][
srcnid
]
var
neighs
=
TW
.
Relations
[
activetypesKey
][
srcnid
]
activeRelations
[
activetypesKey
][
srcnid
]
=
{}
if
(
neighs
)
{
if
(
neighs
)
{
for
(
var
j
in
neighs
)
{
for
(
var
j
in
neighs
)
{
var
tgtnid
=
neighs
[
j
]
var
tgtnid
=
neighs
[
j
]
...
@@ -223,14 +226,21 @@ function SelectionEngine() {
...
@@ -223,14 +226,21 @@ function SelectionEngine() {
sameSideNeighbors
[
tgtnid
]
=
0
sameSideNeighbors
[
tgtnid
]
=
0
}
}
// and the detailed info
if
(
typeof
activeRelations
[
activetypesKey
][
srcnid
][
tgtnid
]
==
'undefined'
)
{
activeRelations
[
activetypesKey
][
srcnid
][
tgtnid
]
=
0
}
// **make the edge active**
// **make the edge active**
if
(
e1
&&
!
e1
.
hidden
)
{
if
(
e1
&&
!
e1
.
hidden
)
{
e1
.
customAttrs
.
activeEdge
=
1
;
e1
.
customAttrs
.
activeEdge
=
1
;
sameSideNeighbors
[
tgtnid
]
+=
e1
.
weight
||
1
sameSideNeighbors
[
tgtnid
]
+=
e1
.
weight
||
1
activeRelations
[
activetypesKey
][
srcnid
][
tgtnid
]
+=
e1
.
weight
||
1
}
}
if
(
e2
&&
!
e2
.
hidden
)
{
if
(
e2
&&
!
e2
.
hidden
)
{
e2
.
customAttrs
.
activeEdge
=
1
;
e2
.
customAttrs
.
activeEdge
=
1
;
sameSideNeighbors
[
tgtnid
]
+=
e2
.
weight
||
1
sameSideNeighbors
[
tgtnid
]
+=
e2
.
weight
||
1
activeRelations
[
activetypesKey
][
srcnid
][
tgtnid
]
+=
e2
.
weight
||
1
}
}
// we add as neighbor to color it (except if already in targeted)
// we add as neighbor to color it (except if already in targeted)
...
@@ -263,12 +273,21 @@ function SelectionEngine() {
...
@@ -263,12 +273,21 @@ function SelectionEngine() {
let
srcnid
=
theSelection
[
i
]
let
srcnid
=
theSelection
[
i
]
var
bipaNeighs
=
TW
.
Relations
[
"1|1"
][
srcnid
];
var
bipaNeighs
=
TW
.
Relations
[
"1|1"
][
srcnid
];
activeRelations
[
"1|1"
][
srcnid
]
=
{}
for
(
var
k
in
bipaNeighs
)
{
for
(
var
k
in
bipaNeighs
)
{
if
(
typeof
activeRelations
[
"1|1"
][
bipaNeighs
[
k
]]
==
"undefined"
)
if
(
typeof
activeRelations
[
"1|1"
][
srcnid
][
bipaNeighs
[
k
]]
==
"undefined"
)
{
activeRelations
[
"1|1"
][
bipaNeighs
[
k
]]
=
0
;
activeRelations
[
"1|1"
][
srcnid
][
bipaNeighs
[
k
]]
=
0
;
}
if
(
typeof
oppoSideNeighbors
[
bipaNeighs
[
k
]]
==
"undefined"
)
{
oppoSideNeighbors
[
bipaNeighs
[
k
]]
=
0
;
}
// cumulated for all srcnids
// cumulated for all srcnids
activeRelations
[
"1|1"
][
bipaNeighs
[
k
]]
++
;
oppoSideNeighbors
[
bipaNeighs
[
k
]]
++
// and the details
activeRelations
[
"1|1"
][
srcnid
][
bipaNeighs
[
k
]]
++
;
}
}
}
}
}
}
...
@@ -279,12 +298,12 @@ function SelectionEngine() {
...
@@ -279,12 +298,12 @@ function SelectionEngine() {
let
same
=
[]
let
same
=
[]
if
(
activeRelations
[
"1|1"
])
{
if
(
activeRelations
[
"1|1"
])
{
oppos
=
ArraySortByValue
(
activeRelations
[
"1|1"
]
,
function
(
a
,
b
){
oppos
=
ArraySortByValue
(
oppoSideNeighbors
,
function
(
a
,
b
){
return
b
-
a
return
b
-
a
});
});
}
}
same
=
ArraySortByValue
(
activeRelations
[
activetypesKey
]
,
function
(
a
,
b
){
same
=
ArraySortByValue
(
sameSideNeighbors
,
function
(
a
,
b
){
return
b
-
a
return
b
-
a
});
});
...
@@ -311,6 +330,7 @@ function SelectionEngine() {
...
@@ -311,6 +330,7 @@ function SelectionEngine() {
TW
.
partialGraph
.
render
();
TW
.
partialGraph
.
render
();
updateRelatedNodesPanel
(
theSelection
,
same
,
oppos
)
updateRelatedNodesPanel
(
theSelection
,
same
,
oppos
)
if
(
TW
.
conf
.
debug
.
logSelections
)
{
if
(
TW
.
conf
.
debug
.
logSelections
)
{
...
...
static/tinawebJS/enviroment.js
View file @
8e111c66
...
@@ -427,6 +427,8 @@ function changeLevel() {
...
@@ -427,6 +427,8 @@ function changeLevel() {
var
sels
=
present
.
selectionNids
;
//[144, 384, 543]//TW.states[last].selectionNids;
var
sels
=
present
.
selectionNids
;
//[144, 384, 543]//TW.states[last].selectionNids;
deselectNodes
()
let
selsChecker
=
{}
let
selsChecker
=
{}
for
(
let
i
in
sels
)
{
for
(
let
i
in
sels
)
{
selsChecker
[
sels
[
i
]]
=
true
selsChecker
[
sels
[
i
]]
=
true
...
@@ -448,7 +450,6 @@ function changeLevel() {
...
@@ -448,7 +450,6 @@ function changeLevel() {
var
nodes_2_colour
=
{}
var
nodes_2_colour
=
{}
var
edges_2_colour
=
{}
var
edges_2_colour
=
{}
// £TODO: factorize with same strategy in MultipleSelection2 beginning
for
(
var
i
in
sels
)
{
for
(
var
i
in
sels
)
{
s
=
sels
[
i
];
s
=
sels
[
i
];
neigh
=
TW
.
Relations
[
activetypesKey
][
s
]
neigh
=
TW
.
Relations
[
activetypesKey
][
s
]
...
@@ -463,9 +464,6 @@ function changeLevel() {
...
@@ -463,9 +464,6 @@ function changeLevel() {
}
}
}
}
}
}
for
(
var
i
in
sels
)
nodes_2_colour
[
sels
[
i
]]
=
true
;
var
futurelevel
=
null
var
futurelevel
=
null
...
...
static/tinawebJS/sigma.parseCustom.js
View file @
8e111c66
...
@@ -1015,7 +1015,6 @@ function dictfyJSON( data , categories ) {
...
@@ -1015,7 +1015,6 @@ function dictfyJSON( data , categories ) {
for
(
var
nid
in
data
.
nodes
)
{
for
(
var
nid
in
data
.
nodes
)
{
let
n
=
data
.
nodes
[
nid
];
let
n
=
data
.
nodes
[
nid
];
console
.
log
(
">>"
,
n
)
let
node
=
{}
let
node
=
{}
node
.
id
=
(
n
.
id
)
?
n
.
id
:
nid
;
// use the key if no id
node
.
id
=
(
n
.
id
)
?
n
.
id
:
nid
;
// use the key if no id
...
...
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