Created
October 3, 2012 21:32
-
-
Save vlandham/3829989 to your computer and use it in GitHub Desktop.
adding an info div to network visualization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="main" role="main"> | |
<div id="vis"></div> | |
<div id="info"></div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node.on("mouseover", showDetails) | |
.on("mouseout", hideDetails) | |
.on("click", showInfo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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