One of the great things about working on the Web is how easy it is to make things interactive. Since D3 exposes the underlying HTML elements—it often forces you to work in them, in fact—making a D3 graph interactive is pretty straightforward: we just use standard HTML events.
For this recipe, we'll take the force-directed layout visualization of the US Census Race Data that we did in the last recipe, Visualizing graphs with force-directed layout, and make it interactive. We'll add a data pane to the right of the graph, and whenever the user hovers over a node, the page will display the census data from that node in the data pane.
We'll start with the visualization from the last recipe, Visualizing graphs with force-directed layout, and add to it.