SVGShape.js revision 2ebe57b26e070070dacbe6e2b3351d5cefaee874
0fdefaa9ca017edfb76b736c825b34186f33045aTripp * Base class for creating shapes.
0fdefaa9ca017edfb76b736c825b34186f33045aTripp * @module graphics
0fdefaa9ca017edfb76b736c825b34186f33045aTripp * @class SVGShape
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * @constructor
a75ebc38c1de401b679953a9b87bd323f0f48d02Tripp * @param {Object} cfg (optional) Attribute configs
828c58761d90445b8b9d20a82d85dc1479317f71Tripp SVGShape.superclass.constructor.apply(this, arguments);
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Init method, invoked during construction.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Calls `initializer` method.
e7c7565d9550eaa87043aef0df77125ada996deaTripp * @method init
66ca16dd76367c074fe4df1dcf7b555489a9bf85Tripp * @protected
66ca16dd76367c074fe4df1dcf7b555489a9bf85Tripp init: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Initializes the shape
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method _initialize
0fdefaa9ca017edfb76b736c825b34186f33045aTripp var host = this;
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Add a class name to each node.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method addClass
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {String} className the class name to add to the node's class attribute
828c58761d90445b8b9d20a82d85dc1479317f71Tripp node.className.baseVal = Y_LANG.trim([node.className.baseVal, className].join(' '));
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Removes a class name from each node.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method removeClass
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {String} className the class name to remove from the node's class attribute
828c58761d90445b8b9d20a82d85dc1479317f71Tripp classString = classString.replace(new RegExp(className + ' '), className).replace(new RegExp(className), '');
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Gets the current position of the node in page coordinates.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method getXY
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @return Array The XY position of the shape.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp getXY: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Set the position of the shape in page coordinates, regardless of how the node is positioned.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method setXY
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Array} Contains x & y values for new position (coordinates are page-based)
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method contains
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {SVGShape | HTMLElement} needle The possible node or descendent
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @return Boolean Whether or not this shape is the needle or its ancestor.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Compares nodes to determine if they match.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Node instances can be compared to each other and/or HTMLElements.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method compareTo
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {HTMLElement | Node} refNode The reference node to compare to the node.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @return {Boolean} True if the nodes match, false if they do not.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Test if the supplied node matches the supplied selector.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method test
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {String} selector The CSS selector to test against.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @return Boolean Wheter or not the shape matches the selector.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Value function for fill attribute
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method _getDefaultFill
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @return Object
828c58761d90445b8b9d20a82d85dc1479317f71Tripp _getDefaultFill: function() {
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Value function for stroke attribute
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method _getDefaultStroke
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @return Object
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Creates the dom node for the shape.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method createNode
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @return HTMLElement
66ca16dd76367c074fe4df1dcf7b555489a9bf85Tripp var node = DOCUMENT.createElementNS("http://www.w3.org/2000/svg", "svg:" + this._type),
b79c07ef87dd1a48a03fc33a91c37d04f3addae2Tripp this.addClass("yui3-" + SHAPE + " yui3-" + this.name);
e188eaea1f0e60d808be8a4f6ccdbbd3c9b5039bTripp * Overrides default `on` method. Checks to see if its a dom interaction event. If so,
e188eaea1f0e60d808be8a4f6ccdbbd3c9b5039bTripp * return an event attached to the `node` element. If not, return the normal functionality.
e188eaea1f0e60d808be8a4f6ccdbbd3c9b5039bTripp * @method on
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {String} type event type
66ca16dd76367c074fe4df1dcf7b555489a9bf85Tripp * @param {Object} callback function
080b31a43c2a1d068c28eaa3e243bdd6e8a89ffaTripp * Adds a stroke to the shape node.
080b31a43c2a1d068c28eaa3e243bdd6e8a89ffaTripp * @method _strokeChangeHandler
828c58761d90445b8b9d20a82d85dc1479317f71Tripp dash = Y_LANG.isArray(dashstyle) ? dashstyle.toString() : dashstyle;
828c58761d90445b8b9d20a82d85dc1479317f71Tripp stroke.opacity = Y_LANG.isNumber(strokeOpacity) ? strokeOpacity : 1;
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp node.setAttribute("stroke-miterlimit", Math.max(linejoin, 1));
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Adds a fill to the shape node.
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * @method _fillChangeHandler
828c58761d90445b8b9d20a82d85dc1479317f71Tripp node.setAttribute("fill", "url(#grad" + this.get("id") + ")");
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp fillOpacity = Y_LANG.isNumber(fillOpacity) ? fillOpacity : 1;
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Creates a gradient fill
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method _setGradientFill
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {String} type gradient type
828c58761d90445b8b9d20a82d85dc1479317f71Tripp gradientNode = graphic.getGradientNode("grad" + this.get("id"), type),
828c58761d90445b8b9d20a82d85dc1479317f71Tripp tanRadians = parseFloat(parseFloat(Math.tan(rotation * radCon)).toFixed(8)),
a4d2446149b07f9e5c32947091dcbcf4d2eee765Tripp gradientNode.setAttribute("x1", Math.round(100 * x1/w) + "%");
a4d2446149b07f9e5c32947091dcbcf4d2eee765Tripp gradientNode.setAttribute("y1", Math.round(100 * y1/h) + "%");
a4d2446149b07f9e5c32947091dcbcf4d2eee765Tripp gradientNode.setAttribute("x2", Math.round(100 * x2/w) + "%");
a4d2446149b07f9e5c32947091dcbcf4d2eee765Tripp gradientNode.setAttribute("y2", Math.round(100 * y2/h) + "%");
c09beb6ef319616edc832f6f6d137350d74096e0Tripp * Sets the value of an attribute.
c09beb6ef319616edc832f6f6d137350d74096e0Tripp * @method set
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * be passed in to set multiple attributes at once.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * the name param.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp set: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp var host = this;
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Applies translate transformation.
c09beb6ef319616edc832f6f6d137350d74096e0Tripp * @method translate
c09beb6ef319616edc832f6f6d137350d74096e0Tripp * @param {Number} x The value to transate on the x-axis.
c09beb6ef319616edc832f6f6d137350d74096e0Tripp * @param {Number} y The value to translate on the y-axis.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp translate: function(x, y)
66ca16dd76367c074fe4df1dcf7b555489a9bf85Tripp * Performs a translate on the x-coordinate. When translating x and y coordinates,
66ca16dd76367c074fe4df1dcf7b555489a9bf85Tripp * use the `translate` method.
66ca16dd76367c074fe4df1dcf7b555489a9bf85Tripp * @method translateX
66ca16dd76367c074fe4df1dcf7b555489a9bf85Tripp * @param {Number} y The value to translate.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp translateX: function(x)
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Performs a translate on the y-coordinate. When translating x and y coordinates,
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * use the `translate` method.
6a3585e2672045e8e28e6a45f279f80aef446959Tripp * @method translateY
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} y The value to translate.
ed59119d8c00addb07c7ee6c8aefcd1d9cb876f1Tripp translateY: function(y)
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Applies a skew transformation.
6a3585e2672045e8e28e6a45f279f80aef446959Tripp * @method skew
ed59119d8c00addb07c7ee6c8aefcd1d9cb876f1Tripp * @param {Number} x The value to skew on the x-axis.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} y The value to skew on the y-axis.
0fdefaa9ca017edfb76b736c825b34186f33045aTripp skew: function(x, y)
ed59119d8c00addb07c7ee6c8aefcd1d9cb876f1Tripp * Applies a skew to the x-coordinate
6a3585e2672045e8e28e6a45f279f80aef446959Tripp * @method skewX
ed59119d8c00addb07c7ee6c8aefcd1d9cb876f1Tripp * @param {Number} x x-coordinate
ed59119d8c00addb07c7ee6c8aefcd1d9cb876f1Tripp skewX: function(x)
ed59119d8c00addb07c7ee6c8aefcd1d9cb876f1Tripp * Applies a skew to the y-coordinate
ed59119d8c00addb07c7ee6c8aefcd1d9cb876f1Tripp * @method skewY
6a3585e2672045e8e28e6a45f279f80aef446959Tripp * @param {Number} y y-coordinate
ed59119d8c00addb07c7ee6c8aefcd1d9cb876f1Tripp skewY: function(y)
ed59119d8c00addb07c7ee6c8aefcd1d9cb876f1Tripp * Storage for `rotation` atribute.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @property _rotation
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type Number
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Applies a rotate transform.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method rotate
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} deg The degree of the rotation.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Applies a scale transform
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method scale
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} val
6a3585e2672045e8e28e6a45f279f80aef446959Tripp scale: function(x, y)
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Adds a transform to the shape.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method _addTransform
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {String} type The transform being applied.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Array} args The arguments for the transform.
ed59119d8c00addb07c7ee6c8aefcd1d9cb876f1Tripp this._transform = Y_LANG.trim(this._transform + " " + type + "(" + args.join(", ") + ")");
66ca16dd76367c074fe4df1dcf7b555489a9bf85Tripp * Applies all transforms.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method _updateTransform
828c58761d90445b8b9d20a82d85dc1479317f71Tripp if(isPath || (this._transforms && this._transforms.length > 0))
8ab6afc0ff1f6b225e52d7489864024d814b37fcTripp for(; i < len; ++i)
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Draws the shape.
ed59119d8c00addb07c7ee6c8aefcd1d9cb876f1Tripp * @method _draw
ed59119d8c00addb07c7ee6c8aefcd1d9cb876f1Tripp _draw: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Updates `Shape` based on attribute changes.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method _updateHandler
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Storage for translateX
66ca16dd76367c074fe4df1dcf7b555489a9bf85Tripp * @property _translateX
66ca16dd76367c074fe4df1dcf7b555489a9bf85Tripp * @type Number
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Storage for translateY
2ebe57b26e070070dacbe6e2b3351d5cefaee874Tripp * @property _translateY
2ebe57b26e070070dacbe6e2b3351d5cefaee874Tripp * @type Number
2ebe57b26e070070dacbe6e2b3351d5cefaee874Tripp * Storage for the transform attribute.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @property _transform
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type String
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Returns the bounds for a shape.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Calculates the a new bounding box from the original corner coordinates (base on size and position) and the transform matrix.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * | a c dx |
14bfa36e35102dbf271dcff98f773a01c75bd503Tripp * [x, y, 1] * | b d dy | = [a * x + c * y + dx, b * x + d * y + dy, 1]
14bfa36e35102dbf271dcff98f773a01c75bd503Tripp * | 0 0 1 |
14bfa36e35102dbf271dcff98f773a01c75bd503Tripp * The calculated bounding box is used by the graphic instance to calculate its viewBox.
14bfa36e35102dbf271dcff98f773a01c75bd503Tripp * @method getBounds
14bfa36e35102dbf271dcff98f773a01c75bd503Tripp * @return Object
66ca16dd76367c074fe4df1dcf7b555489a9bf85Tripp //The svg path element does not have x and y coordinates. Shapes based on path use translate to "fake" x and y. As a
a89ad754cce3cfc8aee71760e10217b54020360dTripp //result, these values will show up in the transform matrix and should not be used in any conversion formula.
117557654069e56f5003be755819b76fe0f77107Tripp bounds.left = Math.min(x3, Math.min(x1, Math.min(x2, x4)));
117557654069e56f5003be755819b76fe0f77107Tripp bounds.right = Math.max(x3, Math.max(x1, Math.max(x2, x4)));
117557654069e56f5003be755819b76fe0f77107Tripp bounds.top = Math.min(y2, Math.min(y4, Math.min(y3, y1)));
117557654069e56f5003be755819b76fe0f77107Tripp bounds.bottom = Math.max(y2, Math.max(y4, Math.max(y3, y1)));
117557654069e56f5003be755819b76fe0f77107Tripp //if there is a stroke, extend the bounds to accomodate
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Returns the x coordinate for a bounding box's corner based on the corner's original x/y coordinates, rotation and transform origin of the rotation.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method _getRotatedCornerX
c093c1aed867e18aa4778708592e1ceb45d18cffTripp * @param {Number} x original x-coordinate of corner
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} y original y-coordinate of corner
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} tox transform origin x-coordinate of rotation
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} toy transform origin y-coordinate of rotation
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} cosRadians cosine (in radians) of rotation
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} sinRadians sin (in radians) or rotation
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @return Number
2ebe57b26e070070dacbe6e2b3351d5cefaee874Tripp _getRotatedCornerX: function(x, y, tox, toy, cosRadians, sinRadians)
6a3585e2672045e8e28e6a45f279f80aef446959Tripp return (tox + (x - tox) * cosRadians + (y - toy) * sinRadians);
6a3585e2672045e8e28e6a45f279f80aef446959Tripp * Returns the y coordinate for a bounding box's corner based on the corner's original x/y coordinates, rotation and transform origin of the rotation.
6a3585e2672045e8e28e6a45f279f80aef446959Tripp * @method _getRotatedCornerY
6a3585e2672045e8e28e6a45f279f80aef446959Tripp * @param {Number} x original x-coordinate of corner
6a3585e2672045e8e28e6a45f279f80aef446959Tripp * @param {Number} y original y-coordinate of corner
6a3585e2672045e8e28e6a45f279f80aef446959Tripp * @param {Number} tox transform origin x-coordinate of rotation
6a3585e2672045e8e28e6a45f279f80aef446959Tripp * @param {Number} toy transform origin y-coordinate of rotation
091085b5a65d589ca99904fd9e9dec757e17d543Tripp * @param {Number} cosRadians cosine (in radians) of rotation
6a3585e2672045e8e28e6a45f279f80aef446959Tripp * @param {Number} sinRadians sin (in radians) or rotation
6a3585e2672045e8e28e6a45f279f80aef446959Tripp * @return Number
6a3585e2672045e8e28e6a45f279f80aef446959Tripp _getRotatedCornerY: function(x, y, tox, toy, cosRadians, sinRadians)
6a3585e2672045e8e28e6a45f279f80aef446959Tripp return (toy - (x - tox) * sinRadians + (y - toy) * cosRadians);
6a3585e2672045e8e28e6a45f279f80aef446959Tripp * Destroys the instance.
6a3585e2672045e8e28e6a45f279f80aef446959Tripp * @method destroy
2ebe57b26e070070dacbe6e2b3351d5cefaee874Tripp destroy: function()
2ebe57b26e070070dacbe6e2b3351d5cefaee874Tripp * 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
2ebe57b26e070070dacbe6e2b3351d5cefaee874Tripp * fraction of the shape's corresponding bounding box dimension. The default value is [0.5, 0.5].
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @config transformOrigin
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type Array
2ebe57b26e070070dacbe6e2b3351d5cefaee874Tripp valueFn: function()
c093c1aed867e18aa4778708592e1ceb45d18cffTripp * A css transform string.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @config transform
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type String
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @writeOnly
828c58761d90445b8b9d20a82d85dc1479317f71Tripp this._transforms = this.matrix.getTransformArray(val);
828c58761d90445b8b9d20a82d85dc1479317f71Tripp getter: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp return this._transform;
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Unique id for class instance.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @config id
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type String
c093c1aed867e18aa4778708592e1ceb45d18cffTripp valueFn: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp return Y.guid();
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Indicates the x position of shape.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @config x
c093c1aed867e18aa4778708592e1ceb45d18cffTripp * @type Number
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Indicates the y position of shape.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @config y
c093c1aed867e18aa4778708592e1ceb45d18cffTripp * @type Number
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Indicates the width of the shape
e188eaea1f0e60d808be8a4f6ccdbbd3c9b5039bTripp * @config width
e188eaea1f0e60d808be8a4f6ccdbbd3c9b5039bTripp * @type Number
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Indicates the height of the shape
e0caea9528bfbb244d27129aa9dea5aebc07fc18Tripp * @config height
e0caea9528bfbb244d27129aa9dea5aebc07fc18Tripp * @type Number
e0caea9528bfbb244d27129aa9dea5aebc07fc18Tripp * Indicates whether the shape is visible.
e0caea9528bfbb244d27129aa9dea5aebc07fc18Tripp * @config visible
e0caea9528bfbb244d27129aa9dea5aebc07fc18Tripp * @type Boolean
e0caea9528bfbb244d27129aa9dea5aebc07fc18Tripp * Contains information about the fill of the shape.
e0caea9528bfbb244d27129aa9dea5aebc07fc18Tripp * <dt>color</dt><dd>The color of the fill.</dd>
e0caea9528bfbb244d27129aa9dea5aebc07fc18Tripp * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>
e0caea9528bfbb244d27129aa9dea5aebc07fc18Tripp * <dt>type</dt><dd>Type of fill.
e0caea9528bfbb244d27129aa9dea5aebc07fc18Tripp * <dt>solid</dt><dd>Solid single color fill. (default)</dd>
e0caea9528bfbb244d27129aa9dea5aebc07fc18Tripp * <dt>linear</dt><dd>Linear gradient fill.</dd>
e0caea9528bfbb244d27129aa9dea5aebc07fc18Tripp * <dt>radial</dt><dd>Radial gradient fill.</dd>
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * <p>If a gradient (linear or radial) is specified as the fill type. The following properties are used:
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * <dt>stops</dt><dd>An array of objects containing the following properties:
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * <dt>color</dt><dd>The color of the stop.</dd>
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stop. The default value is 1. Note: No effect for IE <= 8</dd>
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * <dt>offset</dt><dd>Number between 0 and 1 indicating where the color stop is positioned.</dd>
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * <dt></dt><dd></dd>
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * <dt></dt><dd></dd>
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * <dt></dt><dd></dd>
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * @config fill
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type Object
e0caea9528bfbb244d27129aa9dea5aebc07fc18Tripp * Contains information about the stroke of the shape.
e0caea9528bfbb244d27129aa9dea5aebc07fc18Tripp * <dt>color</dt><dd>The color of the stroke.</dd>
e0caea9528bfbb244d27129aa9dea5aebc07fc18Tripp * <dt>weight</dt><dd>Number that indicates the width of the stroke.</dd>
e0caea9528bfbb244d27129aa9dea5aebc07fc18Tripp * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>
e0caea9528bfbb244d27129aa9dea5aebc07fc18Tripp * <dt>dashstyle</dt>Indicates whether to draw a dashed stroke. When set to "none", a solid stroke is drawn. When set to an array, the first index indicates the
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * length of the dash. The second index indicates the length of gap.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @config stroke
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type Object
2b904e83040752143af70b087f637e39035bb2e6Tripp var tmpl = this.get("stroke") || this._getDefaultStroke();
2b904e83040752143af70b087f637e39035bb2e6Tripp * Indicates whether or not the instance will size itself based on its contents.
2b904e83040752143af70b087f637e39035bb2e6Tripp * @config autoSize
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type Boolean
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Determines whether the instance will receive mouse events.
a75ebc38c1de401b679953a9b87bd323f0f48d02Tripp * @config pointerEvents
a75ebc38c1de401b679953a9b87bd323f0f48d02Tripp * @type string
a75ebc38c1de401b679953a9b87bd323f0f48d02Tripp valueFn: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * The node used for gradient fills.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @config gradientNode
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type HTMLElement
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Indicates whether to automatically refresh.
a75ebc38c1de401b679953a9b87bd323f0f48d02Tripp * @config autoDraw
a75ebc38c1de401b679953a9b87bd323f0f48d02Tripp * @type Boolean
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @readOnly
828c58761d90445b8b9d20a82d85dc1479317f71Tripp getter: function()
e7c7565d9550eaa87043aef0df77125ada996deaTripp * Dom node for the shape.
e7c7565d9550eaa87043aef0df77125ada996deaTripp * @config node
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type HTMLElement
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @readOnly
828c58761d90445b8b9d20a82d85dc1479317f71Tripp getter: function()
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp return this.node;
e7c7565d9550eaa87043aef0df77125ada996deaTripp * Reference to the parent graphic instance
e7c7565d9550eaa87043aef0df77125ada996deaTripp * @config graphic
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type SVGGraphic
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @readOnly
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp getter: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp return this._graphic;