summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-05-21 22:16:57 +0200
committerPeter Wu <peter@lekensteyn.nl>2014-05-21 22:16:57 +0200
commit5aa55560afbeb4c36778e40bf676ecd252a62b8f (patch)
tree2079b8c4e06985a63d821e3d0ddd11a44cae9994
parent47238c16d89e69fbb540e8869ba11e6ae47183f4 (diff)
downloadd3viz-5aa55560afbeb4c36778e40bf676ecd252a62b8f.tar.gz
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).
-rw-r--r--js/spam.js4
1 files changed, 3 insertions, 1 deletions
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) {