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
3f2ed6af
Commit
3f2ed6af
authored
Apr 20, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prevent label double val overload when alt colors + fix altgrey
parent
05c57e8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
sigmaUtils.js
tinawebJS/sigmaUtils.js
+9
-2
No files found.
tinawebJS/sigmaUtils.js
View file @
3f2ed6af
...
@@ -738,6 +738,7 @@ function clustersBy(daclass) {
...
@@ -738,6 +738,7 @@ function clustersBy(daclass) {
var
hex_color
=
rgbToHex
(
255
,
(
255
-
newval_color
)
,
0
)
var
hex_color
=
rgbToHex
(
255
,
(
255
-
newval_color
)
,
0
)
TW
.
partialGraph
.
graph
.
nodes
(
nid
).
color
=
hex_color
TW
.
partialGraph
.
graph
.
nodes
(
nid
).
color
=
hex_color
TW
.
partialGraph
.
graph
.
nodes
(
nid
).
customAttrs
.
alt_color
=
hex_color
TW
.
partialGraph
.
graph
.
nodes
(
nid
).
customAttrs
.
alt_color
=
hex_color
TW
.
partialGraph
.
graph
.
nodes
(
nid
).
customAttrs
.
altgrey_color
=
false
var
newval_size
=
Math
.
round
(
(
Min_size
+
(
NodeID_Val
[
nid
][
"round"
]
-
real_min
)
*
((
Max_size
-
Min_size
)
/
(
real_max
-
real_min
))
)
);
var
newval_size
=
Math
.
round
(
(
Min_size
+
(
NodeID_Val
[
nid
][
"round"
]
-
real_min
)
*
((
Max_size
-
Min_size
)
/
(
real_max
-
real_min
))
)
);
TW
.
partialGraph
.
graph
.
nodes
(
nid
).
size
=
newval_size
;
TW
.
partialGraph
.
graph
.
nodes
(
nid
).
size
=
newval_size
;
...
@@ -888,8 +889,12 @@ function colorsRelByBins(daclass) {
...
@@ -888,8 +889,12 @@ function colorsRelByBins(daclass) {
var
valSt
=
n
.
attributes
[
daclass
]
var
valSt
=
n
.
attributes
[
daclass
]
var
originalLabel
=
TW
.
Nodes
[
n
.
id
].
label
if
(
doModifyLabel
)
{
if
(
doModifyLabel
)
{
n
.
label
=
`(
${
valSt
}
)
${
n
.
label
}
`
n
.
label
=
`(
${
valSt
}
)
${
originalLabel
}
`
}
else
{
n
.
label
=
originalLabel
}
}
var
theVal
=
parseFloat
(
valSt
)
var
theVal
=
parseFloat
(
valSt
)
...
@@ -907,6 +912,7 @@ function colorsRelByBins(daclass) {
...
@@ -907,6 +912,7 @@ function colorsRelByBins(daclass) {
TW
.
partialGraph
.
graph
.
nodes
(
n
.
id
).
binMin
=
binMin
TW
.
partialGraph
.
graph
.
nodes
(
n
.
id
).
binMin
=
binMin
TW
.
partialGraph
.
graph
.
nodes
(
n
.
id
).
color
=
binColors
[
k
]
TW
.
partialGraph
.
graph
.
nodes
(
n
.
id
).
color
=
binColors
[
k
]
TW
.
partialGraph
.
graph
.
nodes
(
n
.
id
).
customAttrs
.
alt_color
=
binColors
[
k
]
TW
.
partialGraph
.
graph
.
nodes
(
n
.
id
).
customAttrs
.
alt_color
=
binColors
[
k
]
TW
.
partialGraph
.
graph
.
nodes
(
n
.
id
).
customAttrs
.
altgrey_color
=
false
foundBin
=
true
foundBin
=
true
// console.log(`theVal ${theVal} => found its bin ${binMin} ... ${binColors[k]}`)
// console.log(`theVal ${theVal} => found its bin ${binMin} ... ${binColors[k]}`)
...
@@ -983,9 +989,10 @@ function colorsBy(daclass) {
...
@@ -983,9 +989,10 @@ function colorsBy(daclass) {
var
attval
=
(
isUndef
(
the_node
.
attributes
)
||
isUndef
(
the_node
.
attributes
[
daclass
])
)?
v_nodes
[
i
][
daclass
]:
the_node
.
attributes
[
daclass
];
var
attval
=
(
isUndef
(
the_node
.
attributes
)
||
isUndef
(
the_node
.
attributes
[
daclass
])
)?
v_nodes
[
i
][
daclass
]:
the_node
.
attributes
[
daclass
];
TW
.
partialGraph
.
graph
.
nodes
(
v_nodes
[
i
].
id
).
color
=
randomColorList
[
attval
]
TW
.
partialGraph
.
graph
.
nodes
(
v_nodes
[
i
].
id
).
color
=
randomColorList
[
attval
]
TW
.
partialGraph
.
graph
.
nodes
(
v_nodes
[
i
].
id
).
customAttrs
.
alt_color
=
randomColorList
[
attval
]
TW
.
partialGraph
.
graph
.
nodes
(
v_nodes
[
i
].
id
).
customAttrs
.
alt_color
=
randomColorList
[
attval
]
TW
.
partialGraph
.
graph
.
nodes
(
v_nodes
[
i
].
id
).
customAttrs
.
altgrey_color
=
false
}
}
// set the global state
// set the global state
TW
.
handpickedcolor
=
fals
e
TW
.
handpickedcolor
=
tru
e
}
}
// [ Edge-colour by source-target nodes-colours combination ]
// [ Edge-colour by source-target nodes-colours combination ]
...
...
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