Skip to content

Instantly share code, notes, and snippets.

@simonwuyts
Created March 29, 2019 07:46
Show Gist options
  • Save simonwuyts/08a003146a9bbbcda797856de6bba4f0 to your computer and use it in GitHub Desktop.
Save simonwuyts/08a003146a9bbbcda797856de6bba4f0 to your computer and use it in GitHub Desktop.
// Add a <g> element for every data point
const leaf = svg.selectAll('g').data(circles)
// Append a styled <circle> to every <g> element
leaf
.append('circle')
.attr('id', d => d.data.id)
.attr('r', d => d.r)
.attr('fill-opacity', 0.7)
.attr('fill', d => d.data.color)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment