summaryrefslogtreecommitdiff
path: root/preprocess.js
diff options
context:
space:
mode:
Diffstat (limited to 'preprocess.js')
-rw-r--r--preprocess.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/preprocess.js b/preprocess.js
index 831e3cf..904d6be 100644
--- a/preprocess.js
+++ b/preprocess.js
@@ -74,5 +74,8 @@ function preprocess(data, options) {
data.edges.map(function (link) {
link.source = userIds_indices[link.source];
link.target = userIds_indices[link.target];
+ // for faster lookup, store neighboring nodes per node
+ data.nodes[link.source].related.push(link.target);
+ data.nodes[link.target].related.push(link.source);
});
}