Skip to content

Instantly share code, notes, and snippets.

@akselx
Created February 22, 2013 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akselx/5009639 to your computer and use it in GitHub Desktop.
Save akselx/5009639 to your computer and use it in GitHub Desktop.
INFO247 / Lab 5 / #1
{"description":"INFO247 / Lab 5 / #1","endpoint":"","display":"div","public":true,"require":[{"name":"raphael.js","url":"http://poezn.github.com/raphael/raphael.js"}],"fileconfigs":{"inlet.js":{"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 5: Raphaël.js
// http://blogs.ischool.berkeley.edu/i247s13/lab-5-raphael-js/
// Get the dimensions of the content window. This is something specific to Tributary
// and has nothing to do with Raphaël.js
var contentHeight = tb.sh,
contentWidth = tb.sw;
// HTML element to use for visualization
var contentElement = "display";
// Finally, let's create a "paper": A canvas you can draw on.
var canvas = Raphael(contentElement, contentWidth, contentHeight);
// ===========================================================
// START DRAWING HERE
// Let's draw a circle!
// Here's how you do it:
// http://raphaeljs.com/reference.html#Paper.circle
var circ = canvas.circle(495, 406, 166);
var rect = canvas.rect(40, 447, 50, 117, 8);
var attributes={
"fill":"#1B4DEB",
"stroke-width":6,
"fill":"#EB1B1B"};
rect.attr(attributes)
circ.attr(attributes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment