Last active
September 4, 2021 12:19
-
-
Save russelllim22/e292941bc9577d39376edd270d99def7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
let svg = d3.select("#plotSVG") | |
svg.selectAll(".bubble") | |
.data(articleData) // bind each element of the data array to one SVG circle | |
.join("circle") | |
.attr("class", "bubble") | |
.attr("cx", d => d.views) // set the x position based on the number of claps | |
.attr("cy", d => d.reads) // set the y position based on the number of views | |
.attr("r", d => d.readingTime) // set the radius based on the article reading time | |
.attr("stroke", "darkblue") | |
.attr("fill", d => "lightblue") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment