~ubuntu-branches/ubuntu/utopic/moodle/utopic

« back to all changes in this revision

Viewing changes to lib/yuilib/3.9.1/build/graphics/graphics.js

  • Committer: Package Import Robot
  • Author(s): Thijs Kinkhorst
  • Date: 2014-05-12 16:10:38 UTC
  • mfrom: (36.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140512161038-puyqf65k4e0s8ytz
Tags: 2.6.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
2
 
YUI.add('graphics', function (Y, NAME) {
3
 
 
4
 
/**
5
 
 *
6
 
 * <p>The `Graphics` module provides a JavaScript API for creating shapes in a variety of formats across
7
 
 * a <a href="http://developer.yahoo.com/yui/articles/gbs">browser test baseline</a>.
8
 
 * Based on device and browser capabilities, `Graphics` leverages <a href="http://www.w3.org/TR/SVG/">SVG</a>,
9
 
 * <a href="http://www.w3.org/TR/html5/the-canvas-element.html">Canvas</a> and <a href="http://www.w3.org/TR/NOTE-VML">VML</a>
10
 
 * to render its graphical elements.</p>
11
 
 *
12
 
 * <p>The `Graphics` module features a <a href="../classes/Graphic.html">`Graphic`</a> class that allows you to easily create and manage shapes.
13
 
 * Currently, a <a href="../classes/Graphic.html">`Graphic`</a> instance can be used to create predifined shapes and free-form polygons with fill
14
 
 * and stroke properties.</p>
15
 
 *
16
 
 * <p>The `Graphics` module normalizes an API through the use of alias and implementation classes that share
17
 
 * interfaces. Each alias class points to an appropriate implementation class dependent on the browser's
18
 
 * capabilities. There should rarely, if ever, be a need to interact directly with an implementation class.</p>
19
 
 *
20
 
 * <p>Below is a list of available classes.
21
 
 *     <ul>
22
 
 *         <li><a href="../classes/Graphic.html">`Graphic`</a>
23
 
 *         <li><a href="../classes/Shape.html">`Shape`</a>
24
 
 *         <li><a href="../classes/Circle.html">`Circle`</a>
25
 
 *         <li><a href="../classes/Ellipse.html">`Ellipse`</a>
26
 
 *         <li><a href="../classes/Rect.html">`Rect`</a>
27
 
 *         <li><a href="../classes/Path.html">`Path`</a>
28
 
 *     </ul>
29
 
 * You can also extend the `Shape` class to create your own custom shape classes.</p>
30
 
 * @module graphics
31
 
 * @main graphics
32
 
 */
33
 
var SETTER = "setter",
34
 
        PluginHost = Y.Plugin.Host,
35
 
    VALUE = "value",
36
 
    VALUEFN = "valueFn",
37
 
    READONLY = "readOnly",
38
 
    Y_LANG = Y.Lang,
39
 
    STR = "string",
40
 
    WRITE_ONCE = "writeOnce",
41
 
    GraphicBase,
42
 
    AttributeLite;
43
 
 
44
 
    /**
45
 
         * AttributeLite provides Attribute-like getters and setters for shape classes in the Graphics module.
46
 
     * It provides a get/set API without the event infastructure. This class is temporary and a work in progress.
47
 
         *
48
 
         * @class AttributeLite
49
 
         * @constructor
50
 
         */
51
 
    AttributeLite = function()
52
 
    {
53
 
        var host = this; // help compression
54
 
 
55
 
        // Perf tweak - avoid creating event literals if not required.
56
 
        host._ATTR_E_FACADE = {};
57
 
 
58
 
        Y.EventTarget.call(this, {emitFacade:true});
59
 
        host._state = {};
60
 
        host.prototype = Y.mix(AttributeLite.prototype, host.prototype);
61
 
    };
62
 
 
63
 
    AttributeLite.prototype = {
64
 
                /**
65
 
                 * Initializes the attributes for a shape. If an attribute config is passed into the constructor of the host,
66
 
                 * the initial values will be overwritten.
67
 
                 *
68
 
                 * @method addAttrs
69
 
                 * @param {Object} cfg Optional object containing attributes key value pairs to be set.
70
 
                 */
71
 
                addAttrs: function(cfg)
72
 
                {
73
 
                        var host = this,
74
 
                                attrConfig = this.constructor.ATTRS,
75
 
                                attr,
76
 
                                i,
77
 
                                fn,
78
 
                                state = host._state;
79
 
                        for(i in attrConfig)
80
 
                        {
81
 
                                if(attrConfig.hasOwnProperty(i))
82
 
                                {
83
 
                                        attr = attrConfig[i];
84
 
                                        if(attr.hasOwnProperty(VALUE))
85
 
                                        {
86
 
                                                state[i] = attr.value;
87
 
                                        }
88
 
                                        else if(attr.hasOwnProperty(VALUEFN))
89
 
                                        {
90
 
                                                fn = attr.valueFn;
91
 
                                                if(Y_LANG.isString(fn))
92
 
                                                {
93
 
                                                        state[i] = host[fn].apply(host);
94
 
                                                }
95
 
                                                else
96
 
                                                {
97
 
                                                        state[i] = fn.apply(host);
98
 
                                                }
99
 
                                        }
100
 
                }
101
 
            }
102
 
                        host._state = state;
103
 
            for(i in attrConfig)
104
 
                        {
105
 
                                if(attrConfig.hasOwnProperty(i))
106
 
                                {
107
 
                                        attr = attrConfig[i];
108
 
                    if(attr.hasOwnProperty(READONLY) && attr.readOnly)
109
 
                                        {
110
 
                                                continue;
111
 
                                        }
112
 
 
113
 
                                        if(attr.hasOwnProperty(WRITE_ONCE) && attr.writeOnce)
114
 
                                        {
115
 
                                                attr.readOnly = true;
116
 
                                        }
117
 
 
118
 
                                        if(cfg && cfg.hasOwnProperty(i))
119
 
                                        {
120
 
                                                if(attr.hasOwnProperty(SETTER))
121
 
                                                {
122
 
                                                        host._state[i] = attr.setter.apply(host, [cfg[i]]);
123
 
                                                }
124
 
                                                else
125
 
                                                {
126
 
                                                        host._state[i] = cfg[i];
127
 
                                                }
128
 
                                        }
129
 
                                }
130
 
                        }
131
 
                },
132
 
 
133
 
        /**
134
 
         * For a given item, returns the value of the property requested, or undefined if not found.
135
 
         *
136
 
         * @method get
137
 
         * @param name {String} The name of the item
138
 
         * @return {Any} The value of the supplied property.
139
 
         */
140
 
        get: function(attr)
141
 
        {
142
 
            var host = this,
143
 
                getter,
144
 
                attrConfig = host.constructor.ATTRS;
145
 
            if(attrConfig && attrConfig[attr])
146
 
            {
147
 
                getter = attrConfig[attr].getter;
148
 
                if(getter)
149
 
                {
150
 
                    if(typeof getter === STR)
151
 
                    {
152
 
                        return host[getter].apply(host);
153
 
                    }
154
 
                    return attrConfig[attr].getter.apply(host);
155
 
                }
156
 
 
157
 
                return host._state[attr];
158
 
            }
159
 
            return null;
160
 
        },
161
 
 
162
 
        /**
163
 
         * Sets the value of an attribute.
164
 
         *
165
 
         * @method set
166
 
         * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can
167
 
         * be passed in to set multiple attributes at once.
168
 
         * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as
169
 
         * the name param.
170
 
         */
171
 
        set: function()
172
 
        {
173
 
            var attr = arguments[0],
174
 
                i;
175
 
            if(Y_LANG.isObject(attr))
176
 
            {
177
 
                for(i in attr)
178
 
                {
179
 
                    if(attr.hasOwnProperty(i))
180
 
                    {
181
 
                        this._set(i, attr[i]);
182
 
                    }
183
 
                }
184
 
            }
185
 
            else
186
 
            {
187
 
                this._set.apply(this, arguments);
188
 
            }
189
 
        },
190
 
 
191
 
                /**
192
 
         * Provides setter logic. Used by `set`.
193
 
         *
194
 
         * @method _set
195
 
         * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can
196
 
         * be passed in to set multiple attributes at once.
197
 
         * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as
198
 
         * the name param.
199
 
                 * @protected
200
 
                 */
201
 
                _set: function(attr, val)
202
 
                {
203
 
                        var host = this,
204
 
                                setter,
205
 
                                args,
206
 
                                attrConfig = host.constructor.ATTRS;
207
 
                        if(attrConfig && attrConfig.hasOwnProperty(attr))
208
 
                        {
209
 
                                setter = attrConfig[attr].setter;
210
 
                                if(setter)
211
 
                                {
212
 
                                        args = [val];
213
 
                                        if(typeof setter === STR)
214
 
                                        {
215
 
                                                val = host[setter].apply(host, args);
216
 
                                        }
217
 
                                        else
218
 
                    {
219
 
                        val = attrConfig[attr].setter.apply(host, args);
220
 
                    }
221
 
                                }
222
 
                                host._state[attr] = val;
223
 
                        }
224
 
                }
225
 
        };
226
 
    Y.mix(AttributeLite, Y.EventTarget, false, null, 1);
227
 
        Y.AttributeLite = AttributeLite;
228
 
 
229
 
    /**
230
 
     * GraphicBase serves as the base class for the graphic layer. It serves the same purpose as
231
 
     * Base but uses a lightweight getter/setter class instead of Attribute.
232
 
     * This class is temporary and a work in progress.
233
 
     *
234
 
     * @class GraphicBase
235
 
     * @constructor
236
 
     * @param {Object} cfg Key value pairs for attributes
237
 
     */
238
 
    GraphicBase = function(cfg)
239
 
    {
240
 
        var host = this,
241
 
            PluginHost = Y.Plugin && Y.Plugin.Host;
242
 
        if (host._initPlugins && PluginHost) {
243
 
            PluginHost.call(host);
244
 
        }
245
 
 
246
 
        host.name = host.constructor.NAME;
247
 
        host._eventPrefix = host.constructor.EVENT_PREFIX || host.constructor.NAME;
248
 
        AttributeLite.call(host);
249
 
        host.addAttrs(cfg);
250
 
        host.init.apply(this, arguments);
251
 
        if (host._initPlugins) {
252
 
            // Need to initPlugins manually, to handle constructor parsing, static Plug parsing
253
 
            host._initPlugins(cfg);
254
 
        }
255
 
        host.initialized = true;
256
 
    };
257
 
 
258
 
    GraphicBase.NAME = "baseGraphic";
259
 
 
260
 
    GraphicBase.prototype = {
261
 
        /**
262
 
         * Init method, invoked during construction.
263
 
         * Fires an init event after calling `initializer` on implementers.
264
 
         *
265
 
         * @method init
266
 
         * @protected
267
 
         */
268
 
        init: function()
269
 
        {
270
 
            this.publish("init", {
271
 
                fireOnce:true
272
 
            });
273
 
            this.initializer.apply(this, arguments);
274
 
            this.fire("init", {cfg: arguments[0]});
275
 
        },
276
 
 
277
 
        /**
278
 
         * Camel case concatanates two strings.
279
 
         *
280
 
         * @method _camelCaseConcat
281
 
         * @param {String} prefix The first string
282
 
         * @param {String} name The second string
283
 
         * @return String
284
 
         * @private
285
 
         */
286
 
        _camelCaseConcat: function(prefix, name)
287
 
        {
288
 
            return prefix + name.charAt(0).toUpperCase() + name.slice(1);
289
 
        }
290
 
    };
291
 
//Straightup augment, no wrapper functions
292
 
Y.mix(GraphicBase, Y.AttributeLite, false, null, 1);
293
 
Y.mix(GraphicBase, PluginHost, false, null, 1);
294
 
GraphicBase.prototype.constructor = GraphicBase;
295
 
GraphicBase.plug = PluginHost.plug;
296
 
GraphicBase.unplug = PluginHost.unplug;
297
 
Y.GraphicBase = GraphicBase;
298
 
 
299
 
 
300
 
/**
301
 
 * `Drawing` provides a set of drawing methods used by `Path` and custom shape classes.
302
 
 * `Drawing` has the following implementations based on browser capability.
303
 
 *  <ul>
304
 
 *      <li><a href="SVGDrawing.html">`SVGDrawing`</a></li>
305
 
 *      <li><a href="VMLDrawing.html">`VMLDrawing`</a></li>
306
 
 *      <li><a href="CanvasDrawing.html">`CanvasDrawing`</a></li>
307
 
 *  </ul>
308
 
 *
309
 
 * @class Drawing
310
 
 * @constructor
311
 
 */
312
 
    /**
313
 
     * Draws a line segment using the current line style from the current drawing position to the specified x and y coordinates.
314
 
     *
315
 
     * @method lineTo
316
 
     * @param {Number} point1 x-coordinate for the end point.
317
 
     * @param {Number} point2 y-coordinate for the end point.
318
 
     */
319
 
    /**
320
 
     * Moves the current drawing position to specified x and y coordinates.
321
 
     *
322
 
     * @method moveTo
323
 
     * @param {Number} x x-coordinate for the end point.
324
 
     * @param {Number} y y-coordinate for the end point.
325
 
     */
326
 
    /**
327
 
     * Draws a bezier curve.
328
 
     *
329
 
     * @method curveTo
330
 
     * @param {Number} cp1x x-coordinate for the first control point.
331
 
     * @param {Number} cp1y y-coordinate for the first control point.
332
 
     * @param {Number} cp2x x-coordinate for the second control point.
333
 
     * @param {Number} cp2y y-coordinate for the second control point.
334
 
     * @param {Number} x x-coordinate for the end point.
335
 
     * @param {Number} y y-coordinate for the end point.
336
 
     */
337
 
    /**
338
 
     * Draws a quadratic bezier curve.
339
 
     *
340
 
     * @method quadraticCurveTo
341
 
     * @param {Number} cpx x-coordinate for the control point.
342
 
     * @param {Number} cpy y-coordinate for the control point.
343
 
     * @param {Number} x x-coordinate for the end point.
344
 
     * @param {Number} y y-coordinate for the end point.
345
 
     */
346
 
    /**
347
 
     * Draws a rectangle.
348
 
     *
349
 
     * @method drawRect
350
 
     * @param {Number} x x-coordinate
351
 
     * @param {Number} y y-coordinate
352
 
     * @param {Number} w width
353
 
     * @param {Number} h height
354
 
     */
355
 
    /**
356
 
     * Draws a rectangle with rounded corners.
357
 
     *
358
 
     * @method drawRoundRect
359
 
     * @param {Number} x x-coordinate
360
 
     * @param {Number} y y-coordinate
361
 
     * @param {Number} w width
362
 
     * @param {Number} h height
363
 
     * @param {Number} ew width of the ellipse used to draw the rounded corners
364
 
     * @param {Number} eh height of the ellipse used to draw the rounded corners
365
 
     */
366
 
    /**
367
 
     * Completes a drawing operation.
368
 
     *
369
 
     * @method end
370
 
     */
371
 
    /**
372
 
     * Clears the path.
373
 
     *
374
 
     * @method clear
375
 
     */
376
 
/**
377
 
 *  <p>Base class for creating shapes.</p>
378
 
 *  <p>`Shape` is an abstract class and is not meant to be used directly. The following classes extend
379
 
 *  `Shape`.
380
 
 *
381
 
 *  <ul>
382
 
 *      <li><a href="Circle.html">`Circle`</a></li>
383
 
 *      <li><a href="Ellipse.html">`Ellipse`</a></li>
384
 
 *      <li><a href="Rect.html">`Rect`</a></li>
385
 
 *      <li><a href="Path.html">`Path`</a></li>
386
 
 *  </ul>
387
 
 *
388
 
 * `Shape` can also be extended to create custom shape classes.</p>
389
 
 *
390
 
 * `Shape` has the following implementations based on browser capability.
391
 
 *  <ul>
392
 
 *      <li><a href="SVGShape.html">`SVGShape`</a></li>
393
 
 *      <li><a href="VMLShape.html">`VMLShape`</a></li>
394
 
 *      <li><a href="CanvasShape.html">`CanvasShape`</a></li>
395
 
 *  </ul>
396
 
 *
397
 
 * It is not necessary to interact with these classes directly. `Shape` will point to the appropriate implemention.</p>
398
 
 *
399
 
 * @class Shape
400
 
 * @constructor
401
 
 * @param {Object} cfg (optional) Attribute configs
402
 
 */
403
 
    /**
404
 
     * Init method, invoked during construction.
405
 
     * Calls `initializer` method.
406
 
     *
407
 
     * @method init
408
 
     * @protected
409
 
     */
410
 
        /**
411
 
         * Initializes the shape
412
 
         *
413
 
         * @private
414
 
         * @method initializer
415
 
         */
416
 
        /**
417
 
         * Add a class name to each node.
418
 
         *
419
 
         * @method addClass
420
 
         * @param {String} className the class name to add to the node's class attribute
421
 
         */
422
 
        /**
423
 
         * Removes a class name from each node.
424
 
         *
425
 
         * @method removeClass
426
 
         * @param {String} className the class name to remove from the node's class attribute
427
 
         */
428
 
        /**
429
 
         * Gets the current position of the node in page coordinates.
430
 
         *
431
 
         * @method getXY
432
 
         * @return Array The XY position of the shape.
433
 
         */
434
 
        /**
435
 
         * Set the position of the shape in page coordinates, regardless of how the node is positioned.
436
 
         *
437
 
         * @method setXY
438
 
         * @param {Array} Contains x & y values for new position (coordinates are page-based)
439
 
         */
440
 
        /**
441
 
         * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy.
442
 
         *
443
 
         * @method contains
444
 
         * @param {Shape | HTMLElement} needle The possible node or descendent
445
 
         * @return Boolean Whether or not this shape is the needle or its ancestor.
446
 
         */
447
 
        /**
448
 
         * Compares nodes to determine if they match.
449
 
         * Node instances can be compared to each other and/or HTMLElements.
450
 
         * @method compareTo
451
 
         * @param {HTMLElement | Node} refNode The reference node to compare to the node.
452
 
         * @return {Boolean} True if the nodes match, false if they do not.
453
 
         */
454
 
        /**
455
 
         * Test if the supplied node matches the supplied selector.
456
 
         *
457
 
         * @method test
458
 
         * @param {String} selector The CSS selector to test against.
459
 
         * @return Boolean Wheter or not the shape matches the selector.
460
 
         */
461
 
    /**
462
 
     * Sets the value of an attribute.
463
 
     *
464
 
     * @method set
465
 
     * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can
466
 
     * be passed in to set multiple attributes at once.
467
 
     * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as
468
 
     * the name param.
469
 
     */
470
 
        /**
471
 
         * Specifies a 2d translation.
472
 
         *
473
 
         * @method translate
474
 
         * @param {Number} x The value to transate on the x-axis.
475
 
         * @param {Number} y The value to translate on the y-axis.
476
 
         */
477
 
        /**
478
 
         * Translates the shape along the x-axis. When translating x and y coordinates,
479
 
         * use the `translate` method.
480
 
         *
481
 
         * @method translateX
482
 
         * @param {Number} x The value to translate.
483
 
         */
484
 
        /**
485
 
         * Translates the shape along the y-axis. When translating x and y coordinates,
486
 
         * use the `translate` method.
487
 
         *
488
 
         * @method translateY
489
 
         * @param {Number} y The value to translate.
490
 
         */
491
 
    /**
492
 
     * Skews the shape around the x-axis and y-axis.
493
 
     *
494
 
     * @method skew
495
 
     * @param {Number} x The value to skew on the x-axis.
496
 
     * @param {Number} y The value to skew on the y-axis.
497
 
     */
498
 
        /**
499
 
         * Skews the shape around the x-axis.
500
 
         *
501
 
         * @method skewX
502
 
         * @param {Number} x x-coordinate
503
 
         */
504
 
        /**
505
 
         * Skews the shape around the y-axis.
506
 
         *
507
 
         * @method skewY
508
 
         * @param {Number} y y-coordinate
509
 
         */
510
 
        /**
511
 
         * Rotates the shape clockwise around it transformOrigin.
512
 
         *
513
 
         * @method rotate
514
 
         * @param {Number} deg The degree of the rotation.
515
 
         */
516
 
        /**
517
 
         * Specifies a 2d scaling operation.
518
 
         *
519
 
         * @method scale
520
 
         * @param {Number} val
521
 
         */
522
 
        /**
523
 
         * Returns the bounds for a shape.
524
 
         *
525
 
     * Calculates the a new bounding box from the original corner coordinates (base on size and position) and the transform matrix.
526
 
     * The calculated bounding box is used by the graphic instance to calculate its viewBox.
527
 
     *
528
 
         * @method getBounds
529
 
         * @return Object
530
 
         */
531
 
    /**
532
 
     * Destroys the instance.
533
 
     *
534
 
     * @method destroy
535
 
     */
536
 
        /**
537
 
         * An array of x, y values which indicates the transformOrigin in which to rotate the shape. Valid values range between 0 and 1 representing a
538
 
         * fraction of the shape's corresponding bounding box dimension. The default value is [0.5, 0.5].
539
 
         *
540
 
         * @config transformOrigin
541
 
         * @type Array
542
 
         */
543
 
    /**
544
 
     * <p>A string containing, in order, transform operations applied to the shape instance. The `transform` string can contain the following values:
545
 
     *
546
 
     *    <dl>
547
 
     *        <dt>rotate</dt><dd>Rotates the shape clockwise around it transformOrigin.</dd>
548
 
     *        <dt>translate</dt><dd>Specifies a 2d translation.</dd>
549
 
     *        <dt>skew</dt><dd>Skews the shape around the x-axis and y-axis.</dd>
550
 
     *        <dt>scale</dt><dd>Specifies a 2d scaling operation.</dd>
551
 
     *        <dt>translateX</dt><dd>Translates the shape along the x-axis.</dd>
552
 
     *        <dt>translateY</dt><dd>Translates the shape along the y-axis.</dd>
553
 
     *        <dt>skewX</dt><dd>Skews the shape around the x-axis.</dd>
554
 
     *        <dt>skewY</dt><dd>Skews the shape around the y-axis.</dd>
555
 
     *        <dt>matrix</dt><dd>Specifies a 2D transformation matrix comprised of the specified six values.</dd>
556
 
     *    </dl>
557
 
     * </p>
558
 
     * <p>Applying transforms through the transform attribute will reset the transform matrix and apply a new transform. The shape class also contains
559
 
     * corresponding methods for each transform that will apply the transform to the current matrix. The below code illustrates how you might use the
560
 
     * `transform` attribute to instantiate a recangle with a rotation of 45 degrees.</p>
561
 
            var myRect = new Y.Rect({
562
 
                type:"rect",
563
 
                width: 50,
564
 
                height: 40,
565
 
                transform: "rotate(45)"
566
 
            };
567
 
     * <p>The code below would apply `translate` and `rotate` to an existing shape.</p>
568
 
 
569
 
        myRect.set("transform", "translate(40, 50) rotate(45)");
570
 
         * @config transform
571
 
     * @type String
572
 
         */
573
 
        /**
574
 
         * Unique id for class instance.
575
 
         *
576
 
         * @config id
577
 
         * @type String
578
 
         */
579
 
        /**
580
 
         * Indicates the x position of shape.
581
 
         *
582
 
         * @config x
583
 
         * @type Number
584
 
         */
585
 
        /**
586
 
         * Indicates the y position of shape.
587
 
         *
588
 
         * @config y
589
 
         * @type Number
590
 
         */
591
 
        /**
592
 
         * Indicates the width of the shape
593
 
         *
594
 
         * @config width
595
 
         * @type Number
596
 
         */
597
 
        /**
598
 
         * Indicates the height of the shape
599
 
         *
600
 
         * @config height
601
 
         * @type Number
602
 
         */
603
 
        /**
604
 
         * Indicates whether the shape is visible.
605
 
         *
606
 
         * @config visible
607
 
         * @type Boolean
608
 
         */
609
 
        /**
610
 
         * Contains information about the fill of the shape.
611
 
     *  <dl>
612
 
     *      <dt>color</dt><dd>The color of the fill.</dd>
613
 
     *      <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>
614
 
     *      <dt>type</dt><dd>Type of fill.
615
 
     *          <dl>
616
 
     *              <dt>solid</dt><dd>Solid single color fill. (default)</dd>
617
 
     *              <dt>linear</dt><dd>Linear gradient fill.</dd>
618
 
     *              <dt>radial</dt><dd>Radial gradient fill.</dd>
619
 
     *          </dl>
620
 
     *      </dd>
621
 
     *  </dl>
622
 
     *  <p>If a `linear` or `radial` is specified as the fill type. The following additional property is used:
623
 
     *  <dl>
624
 
     *      <dt>stops</dt><dd>An array of objects containing the following properties:
625
 
     *          <dl>
626
 
     *              <dt>color</dt><dd>The color of the stop.</dd>
627
 
     *              <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stop. The default value is 1.
628
 
     *              Note: No effect for IE 6 - 8</dd>
629
 
     *              <dt>offset</dt><dd>Number between 0 and 1 indicating where the color stop is positioned.</dd>
630
 
     *          </dl>
631
 
     *      </dd>
632
 
     *      <p>Linear gradients also have the following property:</p>
633
 
     *      <dt>rotation</dt><dd>Linear gradients flow left to right by default. The rotation property allows you to change the
634
 
     *      flow by rotation. (e.g. A rotation of 180 would make the gradient pain from right to left.)</dd>
635
 
     *      <p>Radial gradients have the following additional properties:</p>
636
 
     *      <dt>r</dt><dd>Radius of the gradient circle.</dd>
637
 
     *      <dt>fx</dt><dd>Focal point x-coordinate of the gradient.</dd>
638
 
     *      <dt>fy</dt><dd>Focal point y-coordinate of the gradient.</dd>
639
 
     *      <dt>cx</dt><dd>
640
 
     *          <p>The x-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>
641
 
     *          <p><strong>Note: </strong>Currently, this property is not implemented for corresponding `CanvasShape` and
642
 
     *          `VMLShape` classes which are used on Android or IE 6 - 8.</p>
643
 
     *      </dd>
644
 
     *      <dt>cy</dt><dd>
645
 
     *          <p>The y-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>
646
 
     *          <p><strong>Note: </strong>Currently, this property is not implemented for corresponding `CanvasShape` and `VMLShape`
647
 
     *          classes which are used on Android or IE 6 - 8.</p>
648
 
     *      </dd>
649
 
     *  </dl>
650
 
         *
651
 
         * @config fill
652
 
         * @type Object
653
 
         */
654
 
        /**
655
 
         * Contains information about the stroke of the shape.
656
 
     *  <dl>
657
 
     *      <dt>color</dt><dd>The color of the stroke.</dd>
658
 
     *      <dt>weight</dt><dd>Number that indicates the width of the stroke.</dd>
659
 
     *      <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>
660
 
     *      <dt>dashstyle</dt>Indicates whether to draw a dashed stroke. When set to "none", a solid stroke is drawn. When set
661
 
     *      to an array, the first index indicates the length of the dash. The second index indicates the length of gap.
662
 
     *      <dt>linecap</dt><dd>Specifies the linecap for the stroke. The following values can be specified:
663
 
     *          <dl>
664
 
     *              <dt>butt (default)</dt><dd>Specifies a butt linecap.</dd>
665
 
     *              <dt>square</dt><dd>Specifies a sqare linecap.</dd>
666
 
     *              <dt>round</dt><dd>Specifies a round linecap.</dd>
667
 
     *          </dl>
668
 
     *      </dd>
669
 
     *      <dt>linejoin</dt><dd>Specifies a linejoin for the stroke. The following values can be specified:
670
 
     *          <dl>
671
 
     *              <dt>round (default)</dt><dd>Specifies that the linejoin will be round.</dd>
672
 
     *              <dt>bevel</dt><dd>Specifies a bevel for the linejoin.</dd>
673
 
     *              <dt>miter limit</dt><dd>An integer specifying the miter limit of a miter linejoin. If you want to specify a linejoin
674
 
     *              of miter, you simply specify the limit as opposed to having separate miter and miter limit values.</dd>
675
 
     *          </dl>
676
 
     *      </dd>
677
 
     *  </dl>
678
 
         *
679
 
         * @config stroke
680
 
         * @type Object
681
 
         */
682
 
        /**
683
 
         * Dom node for the shape.
684
 
         *
685
 
         * @config node
686
 
         * @type HTMLElement
687
 
         * @readOnly
688
 
         */
689
 
    /**
690
 
     * Represents an SVG Path string. This will be parsed and added to shape's API to represent the SVG data across all
691
 
     * implementations. Note that when using VML or SVG implementations, part of this content will be added to the DOM using
692
 
     * respective VML/SVG attributes. If your content comes from an untrusted source, you will need to ensure that no
693
 
     * malicious code is included in that content.
694
 
     *
695
 
     * @config data
696
 
     * @type String
697
 
     */
698
 
        /**
699
 
         * Reference to the parent graphic instance
700
 
         *
701
 
         * @config graphic
702
 
         * @type Graphic
703
 
         * @readOnly
704
 
         */
705
 
 
706
 
/**
707
 
 * <p>Creates circle shape with editable attributes.</p>
708
 
 * <p>`Circle` instances can be created using the <a href="Graphic.html#method_addShape">`addShape`</a> method of the
709
 
 * <a href="Graphic.html">`Graphic`</a> class. The method's `cfg` argument contains a `type` attribute. Assigning "circle"
710
 
 * or `Y.Circle` to this attribute will create a `Circle` instance. Required attributes for instantiating a `Circle` are
711
 
 * `type` and `radius`. Optional attributes include:
712
 
 *  <ul>
713
 
 *      <li><a href="#attr_fill">fill</a></li>
714
 
 *      <li><a href="#attr_id">id</a></li>
715
 
 *      <li><a href="#attr_stroke">stroke</a></li>
716
 
 *      <li><a href="#attr_transform">transform</a></li>
717
 
 *      <li><a href="#attr_transformOrigin">transformOrigin</a></li>
718
 
 *      <li><a href="#attr_visible">visible</a></li>
719
 
 *      <li><a href="#attr_x">x</a></li>
720
 
 *      <li><a href="#attr_y">y</a></li>
721
 
 *  </ul>
722
 
 *
723
 
 * The below code creates a circle by defining the `type` attribute as "circle":</p>
724
 
 
725
 
        var myCircle = myGraphic.addShape({
726
 
            type: "circle",
727
 
            radius: 10,
728
 
            fill: {
729
 
                color: "#9aa"
730
 
            },
731
 
            stroke: {
732
 
                weight: 1,
733
 
                color: "#000"
734
 
            }
735
 
        });
736
 
 
737
 
 * Below, this same circle is created by defining the `type` attribute with a class reference:
738
 
 *
739
 
        var myCircle = myGraphic.addShape({
740
 
            type: Y.Circle,
741
 
            radius: 10,
742
 
            fill: {
743
 
                color: "#9aa"
744
 
            },
745
 
            stroke: {
746
 
                weight: 1,
747
 
                color: "#000"
748
 
            }
749
 
        });
750
 
 *
751
 
 * <p>`Circle` has the following implementations based on browser capability.
752
 
 *  <ul>
753
 
 *      <li><a href="SVGCircle.html">`SVGCircle`</a></li>
754
 
 *      <li><a href="VMLCircle.html">`VMLCircle`</a></li>
755
 
 *      <li><a href="CanvasCircle.html">`CanvasCircle`</a></li>
756
 
 *  </ul>
757
 
 *
758
 
 * It is not necessary to interact with these classes directly. `Circle` will point to the appropriate implemention.</p>
759
 
 *
760
 
 * @class Circle
761
 
 * @extends Shape
762
 
 * @constructor
763
 
 */
764
 
    /**
765
 
     * Radius of the circle
766
 
     *
767
 
     * @config radius
768
 
     * @type Number
769
 
     */
770
 
/**
771
 
 * <p>Creates an ellipse shape with editable attributes.</p>
772
 
 * <p>`Ellipse` instances can be created using the <a href="Graphic.html#method_addShape">`addShape`</a> method of the
773
 
 * <a href="Graphic.html">`Graphic`</a> class. The method's `cfg` argument contains a `type` attribute. Assigning "ellipse"
774
 
 * or `Y.Ellipse` to this attribute will create a `Ellipse` instance. Required attributes for instantiating a `Ellipse` are
775
 
 * `type`, `width` and `height`. Optional attributes include:
776
 
 *  <ul>
777
 
 *      <li><a href="#attr_fill">fill</a></li>
778
 
 *      <li><a href="#attr_id">id</a></li>
779
 
 *      <li><a href="#attr_stroke">stroke</a></li>
780
 
 *      <li><a href="#attr_transform">transform</a></li>
781
 
 *      <li><a href="#attr_transformOrigin">transformOrigin</a></li>
782
 
 *      <li><a href="#attr_visible">visible</a></li>
783
 
 *      <li><a href="#attr_x">x</a></li>
784
 
 *      <li><a href="#attr_y">y</a></li>
785
 
 *  </ul>
786
 
 *
787
 
 * The below code creates an ellipse by defining the `type` attribute as "ellipse":</p>
788
 
 
789
 
        var myEllipse = myGraphic.addShape({
790
 
            type: "ellipse",
791
 
            width: 20,
792
 
            height: 10,
793
 
            fill: {
794
 
                color: "#9aa"
795
 
            },
796
 
            stroke: {
797
 
                weight: 1,
798
 
                color: "#000"
799
 
            }
800
 
        });
801
 
 
802
 
 * Below, the same ellipse is created by defining the `type` attribute with a class reference:
803
 
 *
804
 
        var myEllipse = myGraphic.addShape({
805
 
            type: Y.Ellipse,
806
 
            width: 20,
807
 
            height: 10,
808
 
            fill: {
809
 
                color: "#9aa"
810
 
            },
811
 
            stroke: {
812
 
                weight: 1,
813
 
                color: "#000"
814
 
            }
815
 
        });
816
 
 *
817
 
 * <p>`Ellipse` has the following implementations based on browser capability.
818
 
 *  <ul>
819
 
 *      <li><a href="SVGEllipse.html">`SVGEllipse`</a></li>
820
 
 *      <li><a href="VMLEllipse.html">`VMLEllipse`</a></li>
821
 
 *      <li><a href="CanvasEllipse.html">`CanvasEllipse`</a></li>
822
 
 *  </ul>
823
 
 *
824
 
 * It is not necessary to interact with these classes directly. `Ellipse` will point to the appropriate implemention.</p>
825
 
 *
826
 
 * @class Ellipse
827
 
 * @extends Shape
828
 
 * @constructor
829
 
 */
830
 
/**
831
 
 * <p>Creates an rectangle shape with editable attributes.</p>
832
 
 * <p>`Rect` instances can be created using the <a href="Graphic.html#method_addShape">`addShape`</a> method of the
833
 
 * <a href="Graphic.html">`Graphic`</a> class. The method's `cfg` argument contains a `type` attribute. Assigning "rect"
834
 
 * or `Y.Rect` to this attribute will create a `Rect` instance. Required attributes for instantiating a `Rect` are `type`,
835
 
 * `width` and `height`. Optional attributes include:
836
 
 *  <ul>
837
 
 *      <li><a href="#attr_fill">fill</a></li>
838
 
 *      <li><a href="#attr_id">id</a></li>
839
 
 *      <li><a href="#attr_stroke">stroke</a></li>
840
 
 *      <li><a href="#attr_transform">transform</a></li>
841
 
 *      <li><a href="#attr_transformOrigin">transformOrigin</a></li>
842
 
 *      <li><a href="#attr_visible">visible</a></li>
843
 
 *      <li><a href="#attr_x">x</a></li>
844
 
 *      <li><a href="#attr_y">y</a></li>
845
 
 *  </ul>
846
 
 *
847
 
 * The below code creates a rectangle by defining the `type` attribute as "rect":</p>
848
 
 
849
 
        var myRect = myGraphic.addShape({
850
 
            type: "rect",
851
 
            width: 20,
852
 
            height: 10,
853
 
            fill: {
854
 
                color: "#9aa"
855
 
            },
856
 
            stroke: {
857
 
                weight: 1,
858
 
                color: "#000"
859
 
            }
860
 
        });
861
 
 
862
 
 * Below, the same rectangle is created by defining the `type` attribute with a class reference:
863
 
 *
864
 
        var myRect = myGraphic.addShape({
865
 
            type: Y.Rect,
866
 
            width: 20,
867
 
            height: 10,
868
 
            fill: {
869
 
                color: "#9aa"
870
 
            },
871
 
            stroke: {
872
 
                weight: 1,
873
 
                color: "#000"
874
 
            }
875
 
        });
876
 
 *
877
 
 * <p>`Rect` has the following implementations based on browser capability.
878
 
 *  <ul>
879
 
 *      <li><a href="SVGRect.html">`SVGRect`</a></li>
880
 
 *      <li><a href="VMLRect.html">`VMLRect`</a></li>
881
 
 *      <li><a href="CanvasRect.html">`CanvasRect`</a></li>
882
 
 *  </ul>
883
 
 *
884
 
 * It is not necessary to interact with these classes directly. `Rect` will point to the appropriate implemention.</p>
885
 
 *
886
 
 * @class Rect
887
 
 * @extends Shape
888
 
 * @constructor
889
 
 */
890
 
/**
891
 
 * <p>The `Path` class creates a shape through the use of drawing methods. The `Path` class has the following drawing methods available:</p>
892
 
 *  <ul>
893
 
 *      <li><a href="#method_clear">`clear`</a></li>
894
 
 *      <li><a href="#method_curveTo">`curveTo`</a></li>
895
 
 *      <li><a href="#method_drawRect">`drawRect`</a></li>
896
 
 *      <li><a href="#method_drawRoundRect">`drawRoundRect`</a></li>
897
 
 *      <li><a href="#method_end">`end`</a></li>
898
 
 *      <li><a href="#method_lineTo">`lineTo`</a></li>
899
 
 *      <li><a href="#method_moveTo">`moveTo`</a></li>
900
 
 *      <li><a href="#method_quadraticCurveTo">`quadraticCurveTo`</a></li>
901
 
 *  </ul>
902
 
 *
903
 
 *  <p>Like other shapes, `Path` elements are created using the <a href="Graphic.html#method_addShape">`addShape`</a>
904
 
 *  method of the <a href="Graphic.html">`Graphic`</a> class. The method's `cfg` argument contains a `type` attribute.
905
 
 *  Assigning "path" or `Y.Path` to this attribute will create a `Path` instance. After instantiation, a series of drawing
906
 
 *  operations must be performed in order to render a shape. The below code instantiates a path element by defining the
907
 
 *  `type` attribute as "path":</p>
908
 
 
909
 
        var myPath = myGraphic.addShape({
910
 
            type: "path",
911
 
            fill: {
912
 
                color: "#9aa"
913
 
            },
914
 
            stroke: {
915
 
                weight: 1,
916
 
                color: "#000"
917
 
            }
918
 
        });
919
 
 
920
 
 * Below a `Path` element with the same properties is instantiated by defining the `type` attribute with a class reference:
921
 
 *
922
 
        var myPath = myGraphic.addShape({
923
 
            type: Y.Path,
924
 
            fill: {
925
 
                color: "#9aa"
926
 
            },
927
 
            stroke: {
928
 
                weight: 1,
929
 
                color: "#000"
930
 
            }
931
 
        });
932
 
 
933
 
 * After instantiation, a shape or segment needs to be drawn for an element to render. After all draw operations are performed,
934
 
 * the <a href="#method_end">`end`</a> method will render the shape. The code below will draw a triangle:
935
 
 
936
 
        myPath.moveTo(35, 5);
937
 
        myPath.lineTo(65, 65);
938
 
        myPath.lineTo(5, 65);
939
 
        myPath.lineTo(35, 5);
940
 
        myPath.end();
941
 
 *
942
 
 * <p>`Path` has the following implementations based on browser capability.
943
 
 *  <ul>
944
 
 *      <li><a href="SVGPath.html">`SVGPath`</a></li>
945
 
 *      <li><a href="VMLPath.html">`VMLPath`</a></li>
946
 
 *      <li><a href="CanvasPath.html">`CanvasPath`</a></li>
947
 
 *  </ul>
948
 
 * It is not necessary to interact with these classes directly. `Path` will point to the appropriate implemention.</p>
949
 
 *
950
 
 * @class Path
951
 
 * @extends Shape
952
 
 * @uses Drawing
953
 
 * @constructor
954
 
 */
955
 
        /**
956
 
         * Indicates the path used for the node.
957
 
         *
958
 
         * @config path
959
 
         * @type String
960
 
     * @readOnly
961
 
         */
962
 
/**
963
 
 * `Graphic` acts a factory and container for shapes. You need at least one `Graphic` instance to create shapes for your application.
964
 
 * <p>The code block below creates a `Graphic` instance and appends it to an HTMLElement with the id 'mygraphiccontainer'.</p>
965
 
 
966
 
        var myGraphic = new Y.Graphic({render:"#mygraphiccontainer"});
967
 
 
968
 
 * <p>Alternatively, you can add a `Graphic` instance to the DOM using the <a href="#method_render">`render`</a> method.</p>
969
 
        var myGraphic = new Y.Graphic();
970
 
        myGraphic.render("#mygraphiccontainer");
971
 
 
972
 
 * `Graphic` has the following implementations based on browser capability.
973
 
 *  <ul>
974
 
 *      <li><a href="SVGGraphic.html">`SVGGraphic`</a></li>
975
 
 *      <li><a href="VMLGraphic.html">`VMLGraphic`</a></li>
976
 
 *      <li><a href="CanvasGraphic.html">`CanvasGraphic`</a></li>
977
 
 *  </ul>
978
 
 *
979
 
 * It is not necessary to interact with these classes directly. `Graphic` will point to the appropriate implemention.</p>
980
 
 *
981
 
 * @class Graphic
982
 
 * @constructor
983
 
 */
984
 
    /**
985
 
     * Whether or not to render the `Graphic` automatically after to a specified parent node after init. This can be a Node
986
 
     * instance or a CSS selector string.
987
 
     *
988
 
     * @config render
989
 
     * @type Node | String
990
 
     */
991
 
    /**
992
 
         * Unique id for class instance.
993
 
         *
994
 
         * @config id
995
 
         * @type String
996
 
         */
997
 
    /**
998
 
     * Key value pairs in which a shape instance is associated with its id.
999
 
     *
1000
 
     *  @config shapes
1001
 
     *  @type Object
1002
 
     *  @readOnly
1003
 
     */
1004
 
    /**
1005
 
     *  Object containing size and coordinate data for the content of a Graphic in relation to the coordSpace node.
1006
 
     *
1007
 
     *  @config contentBounds
1008
 
     *  @type Object
1009
 
     *  @readOnly
1010
 
     */
1011
 
    /**
1012
 
     *  The html element that represents to coordinate system of the Graphic instance.
1013
 
     *
1014
 
     *  @config node
1015
 
     *  @type HTMLElement
1016
 
     *  @readOnly
1017
 
     */
1018
 
        /**
1019
 
         * Indicates the width of the `Graphic`.
1020
 
         *
1021
 
         * @config width
1022
 
         * @type Number
1023
 
         */
1024
 
        /**
1025
 
         * Indicates the height of the `Graphic`.
1026
 
         *
1027
 
         * @config height
1028
 
         * @type Number
1029
 
         */
1030
 
    /**
1031
 
     *  Determines the sizing of the Graphic.
1032
 
     *
1033
 
     *  <dl>
1034
 
     *      <dt>sizeContentToGraphic</dt><dd>The Graphic's width and height attributes are, either explicitly set through the
1035
 
     *      <code>width</code> and <code>height</code> attributes or are determined by the dimensions of the parent element. The
1036
 
     *      content contained in the Graphic will be sized to fit with in the Graphic instance's dimensions. When using this
1037
 
     *      setting, the <code>preserveAspectRatio</code> attribute will determine how the contents are sized.</dd>
1038
 
     *      <dt>sizeGraphicToContent</dt><dd>(Also accepts a value of true) The Graphic's width and height are determined by the
1039
 
     *      size and positioning of the content.</dd>
1040
 
     *      <dt>false</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code>
1041
 
     *      and <code>height</code> attributes or are determined by the dimensions of the parent element. The contents of the
1042
 
     *      Graphic instance are not affected by this setting.</dd>
1043
 
     *  </dl>
1044
 
     *
1045
 
     *
1046
 
     *  @config autoSize
1047
 
     *  @type Boolean | String
1048
 
     *  @default false
1049
 
     */
1050
 
    /**
1051
 
     * Determines how content is sized when <code>autoSize</code> is set to <code>sizeContentToGraphic</code>.
1052
 
     *
1053
 
     *  <dl>
1054
 
     *      <dt>none<dt><dd>Do not force uniform scaling. Scale the graphic content of the given element non-uniformly if necessary
1055
 
     *      such that the element's bounding box exactly matches the viewport rectangle.</dd>
1056
 
     *      <dt>xMinYMin</dt><dd>Force uniform scaling position along the top left of the Graphic's node.</dd>
1057
 
     *      <dt>xMidYMin</dt><dd>Force uniform scaling horizontally centered and positioned at the top of the Graphic's node.<dd>
1058
 
     *      <dt>xMaxYMin</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the top.</dd>
1059
 
     *      <dt>xMinYMid</dt>Force uniform scaling positioned horizontally from the left and vertically centered.</dd>
1060
 
     *      <dt>xMidYMid (the default)</dt><dd>Force uniform scaling with the content centered.</dd>
1061
 
     *      <dt>xMaxYMid</dt><dd>Force uniform scaling positioned horizontally from the right and vertically centered.</dd>
1062
 
     *      <dt>xMinYMax</dt><dd>Force uniform scaling positioned horizontally from the left and vertically from the bottom.</dd>
1063
 
     *      <dt>xMidYMax</dt><dd>Force uniform scaling horizontally centered and position vertically from the bottom.</dd>
1064
 
     *      <dt>xMaxYMax</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the bottom.</dd>
1065
 
     *  </dl>
1066
 
     *
1067
 
     * @config preserveAspectRatio
1068
 
     * @type String
1069
 
     * @default xMidYMid
1070
 
     */
1071
 
    /**
1072
 
     * The contentBounds will resize to greater values but not to smaller values. (for performance)
1073
 
     * When resizing the contentBounds down is desirable, set the resizeDown value to true.
1074
 
     *
1075
 
     * @config resizeDown
1076
 
     * @type Boolean
1077
 
     */
1078
 
        /**
1079
 
         * Indicates the x-coordinate for the instance.
1080
 
         *
1081
 
         * @config x
1082
 
         * @type Number
1083
 
         */
1084
 
        /**
1085
 
         * Indicates the y-coordinate for the instance.
1086
 
         *
1087
 
         * @config y
1088
 
         * @type Number
1089
 
         */
1090
 
    /**
1091
 
     * Indicates whether or not the instance will automatically redraw after a change is made to a shape.
1092
 
     * This property will get set to false when batching operations.
1093
 
     *
1094
 
     * @config autoDraw
1095
 
     * @type Boolean
1096
 
     * @default true
1097
 
     * @private
1098
 
     */
1099
 
        /**
1100
 
         * Indicates whether the `Graphic` and its children are visible.
1101
 
         *
1102
 
         * @config visible
1103
 
         * @type Boolean
1104
 
         */
1105
 
    /**
1106
 
     * Gets the current position of the graphic instance in page coordinates.
1107
 
     *
1108
 
     * @method getXY
1109
 
     * @return Array The XY position of the shape.
1110
 
     */
1111
 
    /**
1112
 
     * Adds the graphics node to the dom.
1113
 
     *
1114
 
     * @method render
1115
 
     * @param {Node|String} parentNode node in which to render the graphics node into.
1116
 
     */
1117
 
    /**
1118
 
     * Removes all nodes.
1119
 
     *
1120
 
     * @method destroy
1121
 
     */
1122
 
    /**
1123
 
     * <p>Generates a shape instance by type. The method accepts an object that contain's the shape's
1124
 
     * type and attributes to be customized. For example, the code below would create a rectangle:</p>
1125
 
     *
1126
 
            var myRect = myGraphic.addShape({
1127
 
                type: "rect",
1128
 
                width: 40,
1129
 
                height: 30,
1130
 
                fill: {
1131
 
                    color: "#9aa"
1132
 
                },
1133
 
                stroke: {
1134
 
                    weight: 1,
1135
 
                    color: "#000"
1136
 
                }
1137
 
            });
1138
 
     *
1139
 
     * <p>The `Graphics` module includes a few basic shapes. More information on their creation
1140
 
     * can be found in each shape's documentation:
1141
 
     *
1142
 
     *  <ul>
1143
 
     *      <li><a href="Circle.html">`Circle`</a></li>
1144
 
     *      <li><a href="Ellipse.html">`Ellipse`</a></li>
1145
 
     *      <li><a href="Rect.html">`Rect`</a></li>
1146
 
     *      <li><a href="Path.html">`Path`</a></li>
1147
 
     *  </ul>
1148
 
     *
1149
 
     *  The `Graphics` module also allows for the creation of custom shapes. If a custom shape
1150
 
     *  has been created, it can be instantiated with the `addShape` method as well. The attributes,
1151
 
     *  required and optional, would need to be defined in the custom shape.
1152
 
     *
1153
 
            var myCustomShape = myGraphic.addShape({
1154
 
                type: Y.MyCustomShape,
1155
 
                width: 50,
1156
 
                height: 50,
1157
 
                fill: {
1158
 
                    color: "#9aa"
1159
 
                },
1160
 
                stroke: {
1161
 
                    weight: 1,
1162
 
                    color: "#000"
1163
 
                }
1164
 
            });
1165
 
     *
1166
 
     * @method addShape
1167
 
     * @param {Object} cfg Object containing the shape's type and attributes.
1168
 
     * @return Shape
1169
 
     */
1170
 
    /**
1171
 
     * Removes a shape instance from from the graphic instance.
1172
 
     *
1173
 
     * @method removeShape
1174
 
     * @param {Shape|String} shape The instance or id of the shape to be removed.
1175
 
     */
1176
 
    /**
1177
 
     * Removes all shape instances from the dom.
1178
 
     *
1179
 
     * @method removeAllShapes
1180
 
     */
1181
 
    /**
1182
 
     * Returns a shape based on the id of its dom node.
1183
 
     *
1184
 
     * @method getShapeById
1185
 
     * @param {String} id Dom id of the shape's node attribute.
1186
 
     * @return Shape
1187
 
     */
1188
 
        /**
1189
 
         * Allows for creating multiple shapes in order to batch appending and redraw operations.
1190
 
         *
1191
 
         * @method batch
1192
 
         * @param {Function} method Method to execute.
1193
 
         */
1194
 
 
1195
 
 
1196
 
}, '3.9.1', {"requires": ["node", "event-custom", "pluginhost", "matrix", "classnamemanager"]});