Version 3.18.1
Show:

File: graphics/js/SVGPath.js

            /**
             * <a href="http://www.w3.org/TR/SVG/">SVG</a> implementation of the <a href="Path.html">`Path`</a> class.
             * `SVGPath` is not intended to be used directly. Instead, use the <a href="Path.html">`Path`</a> class.
             * If the browser has <a href="http://www.w3.org/TR/SVG/">SVG</a> capabilities, the <a href="Path.html">`Path`</a>
             * class will point to the `SVGPath` class.
             *
             * @module graphics
             * @class SVGPath
             * @extends SVGShape
             * @constructor
             */
            SVGPath = function()
            {
            	SVGPath.superclass.constructor.apply(this, arguments);
            };
            SVGPath.NAME = "path";
            Y.extend(SVGPath, Y.SVGShape, {
                /**
                 * Left edge of the path
                 *
                 * @property _left
                 * @type Number
                 * @private
                 */
                _left: 0,
            
                /**
                 * Right edge of the path
                 *
                 * @property _right
                 * @type Number
                 * @private
                 */
                _right: 0,
            
                /**
                 * Top edge of the path
                 *
                 * @property _top
                 * @type Number
                 * @private
                 */
                _top: 0,
            
                /**
                 * Bottom edge of the path
                 *
                 * @property _bottom
                 * @type Number
                 * @private
                 */
                _bottom: 0,
            
                /**
                 * Indicates the type of shape
                 *
                 * @property _type
                 * @readOnly
                 * @type String
                 * @private
                 */
                _type: "path",
            
                /**
                 * Storage for path
                 *
                 * @property _path
                 * @type String
                 * @private
                 */
            	_path: ""
            });
            
            SVGPath.ATTRS = Y.merge(Y.SVGShape.ATTRS, {
            	/**
            	 * Indicates the path used for the node.
            	 *
            	 * @config path
            	 * @type String
                 * @readOnly
            	 */
            	path: {
            		readOnly: true,
            
            		getter: function()
            		{
            			return this._path;
            		}
            	},
            
            	/**
            	 * Indicates the width of the shape
            	 *
            	 * @config width
            	 * @type Number
            	 */
            	width: {
            		getter: function()
            		{
            			var val = Math.max(this._right - this._left, 0);
            			return val;
            		}
            	},
            
            	/**
            	 * Indicates the height of the shape
            	 *
            	 * @config height
            	 * @type Number
            	 */
            	height: {
            		getter: function()
            		{
            			return Math.max(this._bottom - this._top, 0);
            		}
            	}
            });
            Y.SVGPath = SVGPath;