mercredi 22 avril 2015

Getting data from CSV into tooltip - d3 force direct graph

I read all the data from CSV file and assigned the source and targets as follow:

d3.csv("data/Project.csv", function(links) {

  var nodesByName = {};

  // Create nodes for each unique source and target.
  links.forEach(function(link) {
    link.source = nodeByName(link.Project);
    link.target = nodeByName(link.URL);
  });

when I use tool-tip for the mouse-move on each node on the graph, I could not retrieve the data associated with that node.

The csv file structure as follow: Project, URL, Data1, Data2, Data3

What I want is, when the mouse goes over each node on the graph, the tool-tip should show the Data1, Data2,... ect.




Aucun commentaire:

Enregistrer un commentaire