Commit eb8da4a4 authored by Romain Loth's avatar Romain Loth

better cluster coloring for str vals

parent 1ad3e5bb
...@@ -949,12 +949,17 @@ function clusterColoring(daclass) { ...@@ -949,12 +949,17 @@ function clusterColoring(daclass) {
if (valGroup.labl == "_non_numeric_") { if (valGroup.labl == "_non_numeric_") {
theColor == '#bbb' theColor == '#bbb'
} }
else if (valGroup.val) { else {
theColor = colList[ valGroup.val ] let val = valGroup.val || valGroup.range
} // use the int as an index between 0 and nColors
else if (valGroup.range) { if (parseInt(val) == val) {
let someRepresentativeInt = stringToSomeInt(valGroup.range) % nColors theColor = colList [val] % nColors
theColor = colList[ someRepresentativeInt ] }
// or create a representative int on the same range
else {
let someRepresentativeInt = stringToSomeInt(val) % nColors
theColor = colList[ someRepresentativeInt ]
}
} }
if (valGroup.nids.length) { if (valGroup.nids.length) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment