Skip to content

Instantly share code, notes, and snippets.

@sfrdmn
Created September 21, 2011 20:48
Show Gist options
  • Save sfrdmn/1233255 to your computer and use it in GitHub Desktop.
Save sfrdmn/1233255 to your computer and use it in GitHub Desktop.
DAI 523 - 9/21 - Modify SVG
// The following line selects all circles on the page and changes their stroke-width to 10 (px)
d3.selectAll("circle").attr("stroke-width", 10)
// Two slashes means "comment". Commented code is not run.
// It is good to comment your code so you remember what's going on.
// d3.selectAll("circle").attr("fill", "blue");
// The following lines deal with making selections and then sub selections within those selections
d3.selectAll("circle").attr("stroke-width", 10);
d3.select("#blue").selectAll("circle").attr("stroke","rgb(34,56,35)");
d3.select("#red").selectAll("circle")
.attr("cx", 150 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment