You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since jLouvain is not using an immutable datastructure it is possible that the data provided during initialization (nodes and edges) will be different when calculating the community.
How to reproduce
This behavior can be seen in the provided example/example.html
The prepared community on line 298 var community = jLouvain().nodes(node_data).edges(edge_data); will be calculated in the on-click handler defined in line 367. This will happen AFTER d3 used the data to display the graph and AFTER d3 modified edge_data
Moving line 364 var community_assignment_result = community(); up to line 299 will result in different communities:
Reason
The library d3 is changing the value inside edge_data from {source : 1 ..} to {source: {key: "1", value: 1, index: 1 ...}}. Therefore using edge.source will result in unexpected behavior. Especially using partition[edge.source] will return undefined.
The text was updated successfully, but these errors were encountered:
Description
Since jLouvain is not using an immutable datastructure it is possible that the data provided during initialization (nodes and edges) will be different when calculating the community.
How to reproduce
This behavior can be seen in the provided example/example.html
The prepared
community
on line 298var community = jLouvain().nodes(node_data).edges(edge_data);
will be calculated in the on-click handler defined in line 367. This will happen AFTER d3 used the data to display the graph and AFTER d3 modifiededge_data
Moving line 364
var community_assignment_result = community();
up to line 299 will result in different communities:Reason
The library d3 is changing the value inside
edge_data
from{source : 1 ..}
to{source: {key: "1", value: 1, index: 1 ...}}
. Therefore usingedge.source
will result in unexpected behavior. Especially usingpartition[edge.source]
will returnundefined
.The text was updated successfully, but these errors were encountered: