From 5aa55560afbeb4c36778e40bf676ecd252a62b8f Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 21 May 2014 22:16:57 +0200 Subject: Fix key for initial nodes By default, an array key is used. That could cause problems for detecting the data join, so use the userid as unique identifier (this is also done when detecting updating spam statuses). --- js/spam.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/spam.js b/js/spam.js index 92ca13d..339f5be 100644 --- a/js/spam.js +++ b/js/spam.js @@ -164,7 +164,9 @@ function processData(data) { /* nodes */ var node = contents.append('g').selectAll('circle') - .data(force.nodes()) + .data(force.nodes(), function (d) { + return d.userid; + }) .enter().append('circle') .attr('class', getNodeClasses) .attr('r', function (d) { -- cgit v1.2.1