From: Dmitry Baranovskiy Date: Tue, 15 Dec 2009 01:31:43 +0000 (+1100) Subject: Update reference with ids to attributes for easy linking X-Git-Tag: semver~6 X-Git-Url: http://git.roojs.org/?p=raphael;a=commitdiff_plain;h=0fac6d9087ec9ec8c502544a4f342d52be96a8cf Update reference with ids to attributes for easy linking --- diff --git a/reference.html b/reference.html index 7c86d4f..a12ab49 100644 --- a/reference.html +++ b/reference.html @@ -52,6 +52,10 @@
  • width number
  • height number
  • +

    or

    +
      +
    1. all array (first 3 or 4 elements in the array are equal to [containerID, width, height] or [x, y, width, height]. The rest are element descriptions in format {type: type, <attributes>})
    2. +

    Usage

    // Each of the following examples create a canvas that is 320px wide by 200px high
     // Canvas is created at the viewport's 10,50 coordinate
    @@ -59,7 +63,9 @@ var paper = Raphael(10, 50, 320, 200);
     // Canvas is created at the top left corner of the #notepad element (or its top right corner in dir="rtl" elements)
     var paper = Raphael(document.getElementById("notepad"), 320, 200);
     // Same as above
    -var paper = Raphael("notepad", 320, 200);
    +var paper = Raphael("notepad", 320, 200); +// Image dump +var set = Raphael(["notepad", 320, 200, {type: "rect", x: 10, y: 10, width: 25, height: 25, stroke: "#f00"}, {type: "text", x: 30, y: 40, text: "Dump"}]);

    Element’s generic methods

    @@ -188,45 +194,54 @@ c.scale(.5, .75); // makes the circle half as wide, and 75% as high
  • attributeNames array in this case method returns array of current values for given attribute names
  • +

    or

    +

    no parameters, in this case object containing all attributes will be returned

    Possible parameters

    Please refer to the SVG specification for an explanation of these parameters.

    Usage

    var c = paper.circle(10, 10, 10);
     c.attr("fill", "black");                              // using strings
     c.attr({fill: "#000", stroke: "#f00", opacity: 0.5}); // using params object
    -c.attr({gradient: "90-#fff-#000", "stroke-dasharray": "-..", "clip-rect": "10, 10, 100, 100"});
    +c.attr({fill: "90-#fff-#000", "stroke-dasharray": "-..", "clip-rect": "10, 10, 100, 100"});

    animate

    @@ -243,7 +258,7 @@ c.attr({gradient: "90-#fff-#000", "stroke-dasharray": "-..", "clip-rect": "10, 1
    1. newAttrs object A parameters object of the animation results. (Not all attributes can be animated.)
    2. ms number The duration of the animation, given in milliseconds.
    3. -
    4. easing string [“>”, “<”, “<>”, “backIn”, “backOut”, “bounce”, “elastic”] [optional]
    5. +
    6. easing string [“>”, “<”, “<>”, “backIn”, “backOut”, “bounce”, “elastic”] or function [optional]
    7. callback function [optional]

    Attributes that can be animated

    @@ -613,7 +628,7 @@ paper.circle(100, 100, 20).red(); “Ninja Mode”

    - If you want to leave no trace of Raphaël (Well, Raphaël creates only one global variable Raphael, but anyway.) You can use ninja method. + If you want to leave no trace of Raphaël (Well, Raphaël creates only one global variable Raphael, but anyway.) You can use ninja method. Beware, that in this case plugins could stop working, because they are depending on global variable existance.

    Usage

    (function (local_raphael) {
    @@ -748,7 +763,7 @@ paper.circle(100, 100, 20).red();
                                 Some Rights Reserved by Dmitry Baranovskiy
                             
                             

    - Font by Jos Buivenga · Logo by Wasabicube · + Logo by Wasabicube · Work at this project started as 20% time at Atlassian

    @@ -763,6 +778,5 @@ paper.circle(100, 100, 20).red(); var pageTracker = _gat._getTracker("UA-616618-3"); pageTracker._trackPageview(); -