Skip to content

Instantly share code, notes, and snippets.

@akselx
Created March 1, 2013 00:12
Show Gist options
  • Save akselx/5061323 to your computer and use it in GitHub Desktop.
Save akselx/5061323 to your computer and use it in GitHub Desktop.
INFO 247 - Lab 6 - #1 Selections
Display the source blob
Display the rendered blob
Raw
<circle cx="180" cy="311" r="72"/>
<circle cx="128" cy="90" r="4"/>
<circle cx="502" cy="126" r="49"/>
<circle cx="232" cy="146" r="18"/>
<circle cx="340" cy="282" r="33"/>
{"description":"INFO 247 - Lab 6 - #1 Selections","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":15},"circles.svg":{"default":true,"vim":false,"emacs":false,"fontSize":15},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":15},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":15}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01}
// School of Information, UC Berkeley
// INFO 247 Lab 6: D3.js
// http://blogs.ischool.berkeley.edu/i247s13/lab-6-d3-js/
// Tributary automatically added the contents of "circles.svg"
// to this page.
// Select all circles from this page
var circles = g.selectAll('circle')
//.data([43,31,17])
var attributes={
"fill":"#A82222",
"opacity":.3,
"cy":200,
"stroke-width":5
}
circles.attr(attributes)
// YOUR TURN! Change their color
// YOUR TURN! Change their y position (cy) to 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment