public
Created

adding an info div to network visualization

  • Download Gist
index.html
HTML
1 2 3 4
<div id="main" role="main">
<div id="vis"></div>
<div id="info"></div>
</div>
node_click_vis.coffee
CoffeeScript
1 2 3
node.on("mouseover", showDetails)
.on("mouseout", hideDetails)
.on("click", showInfo)
showInfo_vis.coffee
CoffeeScript
1 2 3 4 5 6 7 8 9
showInfo = (d,i) ->
infoDiv = d3.select("#info")
content = "<ul>"
content += "<li>Name: #{d.name}</li>"
content += "<li>Artist: #{d.artist}</li>"
content += "<li>Playcount: #{d.playcount}</li>"
content += "</ul>"
 
infoDiv.html(content)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.