Remove coloring nodes based on counts

This commit is contained in:
Ivan Danyliuk 2018-08-24 23:11:21 +03:00
parent ae85073d7e
commit 03b8a05706
No known key found for this signature in database
GPG Key ID: 97ED33CE024E1DBF
3 changed files with 10 additions and 24 deletions

File diff suppressed because one or more lines are too long

View File

@ -275,20 +275,12 @@ function blinkLink(links, indices) {
});
}
var nodeCounters = {};
var maxCounter = 0;
var nodeMaterials = {};
// blinkNodes updates nodes color increasing its temperature
// in a heatmap style
// blinkNodes updates nodes color
function blinkNodes(nodes, indices) {
indices.forEach(idx => {
nodeCounters[idx] = nodeCounters[idx] ? nodeCounters[idx]+1 : 1;
if (nodeCounters[idx] > maxCounter) {
maxCounter = nodeCounters[idx];
}
});
// TODO: FIXME: how to make simple map counter without this fucking bullshit?
// TODO: implement proper node blink
/*
Object.keys(nodeCounters).forEach(idx => {
let c = nodeCounters[idx];
let scale = c / maxCounter;
@ -298,6 +290,7 @@ function blinkNodes(nodes, indices) {
}
nodes.children[idx].material = nodeMaterials[color];
});
*/
}
function animatePropagation(nodes, links, plog) {

View File

@ -36,20 +36,12 @@ function blinkLink(links, indices) {
});
}
var nodeCounters = {};
var maxCounter = 0;
var nodeMaterials = {};
// blinkNodes updates nodes color increasing its temperature
// in a heatmap style
// blinkNodes updates nodes color
function blinkNodes(nodes, indices) {
indices.forEach(idx => {
nodeCounters[idx] = nodeCounters[idx] ? nodeCounters[idx]+1 : 1;
if (nodeCounters[idx] > maxCounter) {
maxCounter = nodeCounters[idx];
}
});
// TODO: FIXME: how to make simple map counter without this fucking bullshit?
// TODO: implement proper node blink
/*
Object.keys(nodeCounters).forEach(idx => {
let c = nodeCounters[idx];
let scale = c / maxCounter;
@ -59,6 +51,7 @@ function blinkNodes(nodes, indices) {
}
nodes.children[idx].material = nodeMaterials[color];
});
*/
}
function animatePropagation(nodes, links, plog) {