Skip to content

Instantly share code, notes, and snippets.

@vlandham
Created October 3, 2012 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vlandham/3829989 to your computer and use it in GitHub Desktop.
Save vlandham/3829989 to your computer and use it in GitHub Desktop.
adding an info div to network visualization
<div id="main" role="main">
<div id="vis"></div>
<div id="info"></div>
</div>
node.on("mouseover", showDetails)
.on("mouseout", hideDetails)
.on("click", showInfo)
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment