I am starting with D3 and having the following problem:
I've created a directional force layout binding JSON data for links and nodes where data links are:
{
{ "source":"s1" , "target":"t1", "type_link"= "type1"},
{ "source":"s2" , "target":"t2", "type_link"= "type2"}
...
}
...where "source" and "target" identify nodes on both sides of each link.
I need to bind and visualize additional data to each node of previous force layout (no need to add or remove nodes to the layout). New data would be loaded for each existent node from another JSON file:
{
{ "node_id": "s1", value: {JSON object} //with additional data for node "s1"},
{ "node_id": "t1", value: {JSON object} //with additional data for node "t1"}
...
}
So, I would like to append 'value' field data (so, JSON object) to each 'node_id' node.
I thought that I could do it by binding to each node a dataset ( the JSON object), and then appending to each node (not circle) many SVG text as data in JSON object (maybe using . But I've read in https://github.com/mbostock/d3/wiki/Force-Layout that "a given force layout instance can only be used with a single dataset", so I'm confused.
Please, could you hep me with this issue?