block by vlandham 3829989

adding an info div to network visualization

Full Screen

index.html

    <div id="main" role="main">
      <div id="vis"></div>
      <div id="info"></div>
    </div>

node_click_vis.coffee

    node.on("mouseover", showDetails)
      .on("mouseout", hideDetails)
      .on("click", showInfo)

showInfo_vis.coffee

  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)