JSFiddle

  • Cellular Automata in Raphael #7 is the latest revision

    Raphael 2.1.0, HTML, CSS, JavaScript

    var paper = Raphael("canvas", 500, 400),
    	KEY_SIDE = 12,
    	GRID_SIDE = 10,
    	M = 47,
    	N = 30;
    
    var settings = {};
    
    Raphael.el.fill = function ...
  • N-Spangled Banner #6 is the latest revision

    This is a simple Bootstrap skeleton. You can fork it to get a ready to use Bootstrap fiddle.

    var paper = Raphael("canvas", 600, 400);
    var FLY = paper.width - 10,
     	HOIST = FLY / 1.9,
    	STRIPE = HOIST / 13,
    	RED = "#B22234 ...
  • Basic star

    Raphael 2.1.0, HTML, CSS, JavaScript

    var paper = Raphael(0, 0, 500, 500);
    
    function star(x, y, r) {
        // start at the top point
        var path = "M ...
  • Flag base

    Raphael 2.1.0, HTML, CSS, JavaScript

    var paper = Raphael("canvas", 800, 600);
    var FLY = paper.width - 10,
     	HOIST = FLY / 1.9,
    	STRIPE = HOIST / 13,
    	RED = "#B22234 ...
  • Raphael star

    Extends paper to include a five-point star

    var paper = Raphael(0, 0, 500, 500);
    
    // x and y are the center points of the star, while r is ...
  • Chapter 8: Moon phases #15 is the latest revision

    Raphael 2.1.0, HTML, CSS, JavaScript

    function moon(opts) {
        opts = opts || {};
    
        // set defaults (using ternery if/else statements)
        opts.r = typeof opts.r === "number" ? opts.r ...
  • Chapter 8: Paper Moon #5 is the latest revision

    Raphael 2.1.0, HTML, CSS, JavaScript

    function moon(opts) {
        opts = opts || {};
    
        // set defaults (using ternery if/else statements)
        opts.r = typeof opts.r === "number" ? opts.r ...
  • Chapter 8: Resizing #3 is the latest revision

    Raphael 2.1.0, HTML, CSS, JavaScript

    var paper = Raphael("canvas", 200, 200);
    
    for (var c = 0; c < 20; c += 1) {
        paper.rect(c * 10, c * 10 ...
  • Chapter 8: Getwidth #9 is the latest revision

    Raphael 2.1.0, HTML, CSS, JavaScript

    var w = document.getElementById("canvas").offsetWidth;
    document.getElementById("output").innerHTML = w;
    
  • Chapter 7: Solar system #15 is the latest revision

    Raphael 2.1.0, HTML, CSS, JavaScript

    var paper = Raphael(0, 0, 550, 450);
    
    paper.customAttributes.progress = function (v) {
        var path = this.data("mypath");
        if (!path) {
            return ...