Skip to content

Instantly share code, notes, and snippets.

@ng-the-engineer
Last active May 17, 2021 18:07
Show Gist options
  • Save ng-the-engineer/ab0d4333a228f3b898b6e2fd3c162055 to your computer and use it in GitHub Desktop.
Save ng-the-engineer/ab0d4333a228f3b898b6e2fd3c162055 to your computer and use it in GitHub Desktop.
Code snippet of tutorial bubble plot
svg
.append("g")
.selectAll("dot")
.data(data)
.enter()
.attr("class", "bubbles")
.attr("cx", (d) => x(d.lastUse))
.attr("cy", (d) => y(d.exp))
.attr("r", (d) => z(d.competency ** 3 / 100))
.style("fill", (d) => myColor(d.category))
.on("mouseover", showTooltip)
.on("mousemove", moveTooltip)
.on("mouseleave", hideTooltip);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment