Guest User

Untitled

a guest
Jun 22nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. //apply choropleth
  2. d3.select("#counties").selectAll(".county")
  3. .attr("fill", function (d) {
  4. return getColor(d.properties[attributeArray[currentAttribute]], dataRange);
  5. })
  6. .on("mouseover", function (d) {
  7. d3.select(this)
  8. div.transition()
  9. .duration(300)
  10. div.text(d.properties.County)
  11. .style("opacity", 1)
  12. .style("class", "cntyLabel")
  13. .style("left", (d3.event.pageX) + "px")
  14. .style("top", (d3.event.pageY) + "px");
  15. })
  16. .on("mouseout", function (d) {
  17. div.transition()
  18. .duration(300)
  19. .style("opacity", 0);
  20. })
Add Comment
Please, Sign In to add comment