graphics-svg-debug.js revision a481f20e9badfbcdb4e41f05d09044f048da85dc
241f26199f883a9833db7e282b336a1c2d876592Tripp * <a href="http://www.w3.org/TR/SVG/">SVG</a> implementation of the <a href="Drawing.html">`Drawing`</a> class.
241f26199f883a9833db7e282b336a1c2d876592Tripp * `SVGDrawing` is not intended to be used directly. Instead, use the <a href="Drawing.html">`Drawing`</a> class.
241f26199f883a9833db7e282b336a1c2d876592Tripp * If the browser has <a href="http://www.w3.org/TR/SVG/">SVG</a> capabilities, the <a href="Drawing.html">`Drawing`</a>
241f26199f883a9833db7e282b336a1c2d876592Tripp * class will point to the `SVGDrawing` class.
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp * @module graphics
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @class SVGDrawing
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @constructor
38346051f48f13ebda9f86657ed3a6d19255e6beTripp * Indicates the type of shape
38346051f48f13ebda9f86657ed3a6d19255e6beTripp * @property _type
38346051f48f13ebda9f86657ed3a6d19255e6beTripp * @readOnly
38346051f48f13ebda9f86657ed3a6d19255e6beTripp * @type String
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Draws a bezier curve.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method curveTo
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} cp1x x-coordinate for the first control point.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} cp1y y-coordinate for the first control point.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} cp2x x-coordinate for the second control point.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} cp2y y-coordinate for the second control point.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} x x-coordinate for the end point.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} y y-coordinate for the end point.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp currentArray = this._pathArray[Math.max(0, this._pathArray.length - 1)];
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this._pathArray[pathArrayLen] = this._pathArray[pathArrayLen].concat([Math.round(cp1x), Math.round(cp1y), Math.round(cp2x) , Math.round(cp2y), x, y]);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Draws a quadratic bezier curve.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method quadraticCurveTo
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} cpx x-coordinate for the control point.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} cpy y-coordinate for the control point.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} x x-coordinate for the end point.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} y y-coordinate for the end point.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp currentArray = this._pathArray[Math.max(0, this._pathArray.length - 1)];
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this._pathArray[pathArrayLen] = this._pathArray[pathArrayLen].concat([Math.round(cpx), Math.round(cpy), Math.round(x), Math.round(y)]);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Draws a rectangle.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method drawRect
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} x x-coordinate
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} y y-coordinate
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} w width
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} h height
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp drawRect: function(x, y, w, h) {
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this.moveTo(x, y);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this.lineTo(x + w, y);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this.lineTo(x + w, y + h);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this.lineTo(x, y + h);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this.lineTo(x, y);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Draws a rectangle with rounded corners.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method drawRect
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} x x-coordinate
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} y y-coordinate
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} w width
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} h height
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} ew width of the ellipse used to draw the rounded corners
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} eh height of the ellipse used to draw the rounded corners
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this.quadraticCurveTo(x + w, y + h, x + w, y + h - eh);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Draws a wedge.
9794793fecb186466c6196958d9f8e9469a4ebe0Tripp * @method drawWedge
9794793fecb186466c6196958d9f8e9469a4ebe0Tripp * @param {Number} x x-coordinate of the wedge's center point
9794793fecb186466c6196958d9f8e9469a4ebe0Tripp * @param {Number} y y-coordinate of the wedge's center point
9794793fecb186466c6196958d9f8e9469a4ebe0Tripp * @param {Number} startAngle starting angle in degrees
9794793fecb186466c6196958d9f8e9469a4ebe0Tripp * @param {Number} arc sweep of the wedge. Negative values draw clockwise.
9794793fecb186466c6196958d9f8e9469a4ebe0Tripp * @param {Number} radius radius of wedge. If [optional] yRadius is defined, then radius is the x radius.
9794793fecb186466c6196958d9f8e9469a4ebe0Tripp * @param {Number} yRadius [optional] y radius for wedge.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp drawWedge: function(x, y, startAngle, arc, radius, yRadius)
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp // limit sweep to reasonable numbers
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp // First we calculate how many segments are needed
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp // for a smooth arc.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp // Now calculate the sweep of each segment.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp // The math requires radians rather than degrees. To convert from degrees
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp // use the formula (degrees/180)*Math.PI to get radians.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp // convert angle startAngle to radians
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp // draw a line from the center to the start of the curve
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp ax = x + Math.cos(startAngle / 180 * Math.PI) * radius;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp ay = y + Math.sin(startAngle / 180 * Math.PI) * yRadius;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp for(; i < segs; ++i)
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp cx = x + Math.cos(angleMid) * (radius / Math.cos(theta / 2));
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp cy = y + Math.sin(angleMid) * (yRadius / Math.cos(theta / 2));
656a34aea8d08b2d05d28ae23dfc89771293d27bTripp return this;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Draws a line segment using the current line style from the current drawing position to the specified x and y coordinates.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method lineTo
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} point1 x-coordinate for the end point.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} point2 y-coordinate for the end point.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp if (typeof point1 === 'string' || typeof point1 === 'number') {
656a34aea8d08b2d05d28ae23dfc89771293d27bTripp var currentArray = this._pathArray[Math.max(0, this._pathArray.length - 1)];
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Moves the current drawing position to specified x and y coordinates.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method moveTo
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} x x-coordinate for the end point.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} y y-coordinate for the end point.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp moveTo: function(x, y) {
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this._pathArray[pathArrayLen] = this._pathArray[pathArrayLen].concat([x, y]);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Completes a drawing operation.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method end
38346051f48f13ebda9f86657ed3a6d19255e6beTripp end: function()
38346051f48f13ebda9f86657ed3a6d19255e6beTripp * Clears the path.
38346051f48f13ebda9f86657ed3a6d19255e6beTripp * @method clear
38346051f48f13ebda9f86657ed3a6d19255e6beTripp clear: function()
38346051f48f13ebda9f86657ed3a6d19255e6beTripp * Draws the path.
38346051f48f13ebda9f86657ed3a6d19255e6beTripp * @method _closePath
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Updates the size of the graphics object
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _trackSize
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} w width
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} h height
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp _trackSize: function(w, h) {
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp if (w > this._right) {
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp if(w < this._left)
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp if (h < this._top)
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp if (h > this._bottom)
241f26199f883a9833db7e282b336a1c2d876592Tripp * <a href="http://www.w3.org/TR/SVG/">SVG</a> implementation of the <a href="Shape.html">`Shape`</a> class.
241f26199f883a9833db7e282b336a1c2d876592Tripp * `SVGShape` is not intended to be used directly. Instead, use the <a href="Shape.html">`Shape`</a> class.
241f26199f883a9833db7e282b336a1c2d876592Tripp * If the browser has <a href="http://www.w3.org/TR/SVG/">SVG</a> capabilities, the <a href="Shape.html">`Shape`</a>
241f26199f883a9833db7e282b336a1c2d876592Tripp * class will point to the `SVGShape` class.
785617639f6223ecb4afb307de137e64e19db94eTripp * @module graphics
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @class SVGShape
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @constructor
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @param {Object} cfg (optional) Attribute configs
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp SVGShape.superclass.constructor.apply(this, arguments);
45be085c4155ae7ef409ffa4d79457928742f18fTripp * Init method, invoked during construction.
45be085c4155ae7ef409ffa4d79457928742f18fTripp * Calls `initializer` method.
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @method init
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @protected
180e0891171a381ce4fa08d3867f7226180b8282Tripp init: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Initializes the shape
241f26199f883a9833db7e282b336a1c2d876592Tripp * @method initializer
180e0891171a381ce4fa08d3867f7226180b8282Tripp var host = this;
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Add a class name to each node.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method addClass
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @param {String} className the class name to add to the node's class attribute
180e0891171a381ce4fa08d3867f7226180b8282Tripp node.className.baseVal = Y_LANG.trim([node.className.baseVal, className].join(' '));
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Removes a class name from each node.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method removeClass
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @param {String} className the class name to remove from the node's class attribute
180e0891171a381ce4fa08d3867f7226180b8282Tripp classString = classString.replace(new RegExp(className + ' '), className).replace(new RegExp(className), '');
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Gets the current position of the node in page coordinates.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method getXY
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @return Array The XY position of the shape.
180e0891171a381ce4fa08d3867f7226180b8282Tripp getXY: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Set the position of the shape in page coordinates, regardless of how the node is positioned.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method setXY
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @param {Array} Contains x & y values for new position (coordinates are page-based)
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method contains
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @param {SVGShape | HTMLElement} needle The possible node or descendent
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @return Boolean Whether or not this shape is the needle or its ancestor.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Compares nodes to determine if they match.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Node instances can be compared to each other and/or HTMLElements.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method compareTo
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @param {HTMLElement | Node} refNode The reference node to compare to the node.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @return {Boolean} True if the nodes match, false if they do not.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Test if the supplied node matches the supplied selector.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method test
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @param {String} selector The CSS selector to test against.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @return Boolean Wheter or not the shape matches the selector.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Value function for fill attribute
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method _getDefaultFill
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @return Object
180e0891171a381ce4fa08d3867f7226180b8282Tripp _getDefaultFill: function() {
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Value function for stroke attribute
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method _getDefaultStroke
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @return Object
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Creates the dom node for the shape.
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @method createNode
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @return HTMLElement
11ba9f1486f8345f4ed99c74d8b58be3be37a40eTripp var node = DOCUMENT.createElementNS("http://www.w3.org/2000/svg", "svg:" + this._type),
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp this.addClass("yui3-" + SHAPE + " yui3-" + this.name);
45be085c4155ae7ef409ffa4d79457928742f18fTripp * Overrides default `on` method. Checks to see if its a dom interaction event. If so,
45be085c4155ae7ef409ffa4d79457928742f18fTripp * return an event attached to the `node` element. If not, return the normal functionality.
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @method on
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @param {String} type event type
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @param {Object} callback function
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Adds a stroke to the shape node.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method _strokeChangeHandler
180e0891171a381ce4fa08d3867f7226180b8282Tripp dash = Y_LANG.isArray(dashstyle) ? dashstyle.toString() : dashstyle;
180e0891171a381ce4fa08d3867f7226180b8282Tripp stroke.opacity = Y_LANG.isNumber(strokeOpacity) ? strokeOpacity : 1;
180e0891171a381ce4fa08d3867f7226180b8282Tripp node.setAttribute("stroke-miterlimit", Math.max(linejoin, 1));
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Adds a fill to the shape node.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method _fillChangeHandler
180e0891171a381ce4fa08d3867f7226180b8282Tripp node.setAttribute("fill", "url(#grad" + this.get("id") + ")");
656a34aea8d08b2d05d28ae23dfc89771293d27bTripp fillOpacity = Y_LANG.isNumber(fillOpacity) ? fillOpacity : 1;
df9b19c757881bdddda4a3b2094bac020aa00bceTripp * Creates a gradient fill
df9b19c757881bdddda4a3b2094bac020aa00bceTripp * @method _setGradientFill
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @param {String} type gradient type
180e0891171a381ce4fa08d3867f7226180b8282Tripp gradientNode = graphic.getGradientNode("grad" + this.get("id"), type),
df9b19c757881bdddda4a3b2094bac020aa00bceTripp tanRadians = parseFloat(parseFloat(Math.tan(rotation * radCon)).toFixed(8)),
df9b19c757881bdddda4a3b2094bac020aa00bceTripp gradientNode.setAttribute("x1", Math.round(100 * x1/w) + "%");
df9b19c757881bdddda4a3b2094bac020aa00bceTripp gradientNode.setAttribute("y1", Math.round(100 * y1/h) + "%");
df9b19c757881bdddda4a3b2094bac020aa00bceTripp gradientNode.setAttribute("x2", Math.round(100 * x2/w) + "%");
df9b19c757881bdddda4a3b2094bac020aa00bceTripp gradientNode.setAttribute("y2", Math.round(100 * y2/h) + "%");
45be085c4155ae7ef409ffa4d79457928742f18fTripp * Sets the value of an attribute.
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @method set
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can
45be085c4155ae7ef409ffa4d79457928742f18fTripp * be passed in to set multiple attributes at once.
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as
45be085c4155ae7ef409ffa4d79457928742f18fTripp * the name param.
180e0891171a381ce4fa08d3867f7226180b8282Tripp set: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp var host = this;
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * Specifies a 2d translation.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method translate
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp * @param {Number} x The value to transate on the x-axis.
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp * @param {Number} y The value to translate on the y-axis.
180e0891171a381ce4fa08d3867f7226180b8282Tripp translate: function(x, y)
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * Translates the shape along the x-axis. When translating x and y coordinates,
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp * use the `translate` method.
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp * @method translateX
241f26199f883a9833db7e282b336a1c2d876592Tripp * @param {Number} x The value to translate.
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp translateX: function(x)
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * Translates the shape along the y-axis. When translating x and y coordinates,
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp * use the `translate` method.
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp * @method translateY
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp * @param {Number} y The value to translate.
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp translateY: function(y)
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * Skews the shape around the x-axis and y-axis.
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp * @method skew
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp * @param {Number} x The value to skew on the x-axis.
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp * @param {Number} y The value to skew on the y-axis.
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp skew: function(x, y)
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * Skews the shape around the x-axis.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method skewX
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @param {Number} x x-coordinate
180e0891171a381ce4fa08d3867f7226180b8282Tripp skewX: function(x)
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * Skews the shape around the y-axis.
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @method skewY
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @param {Number} y y-coordinate
180e0891171a381ce4fa08d3867f7226180b8282Tripp skewY: function(y)
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * Rotates the shape clockwise around it transformOrigin.
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @method rotate
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @param {Number} deg The degree of the rotation.
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * Specifies a 2d scaling operation.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method scale
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @param {Number} val
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp scale: function(x, y)
45be085c4155ae7ef409ffa4d79457928742f18fTripp * Adds a transform to the shape.
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @method _addTransform
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @param {String} type The transform being applied.
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @param {Array} args The arguments for the transform.
f49cd0540857456c2f91f0b5c08649f0f8ae39e8Tripp this._transform = Y_LANG.trim(this._transform + " " + type + "(" + args.join(", ") + ")");
45be085c4155ae7ef409ffa4d79457928742f18fTripp * Applies all transforms.
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @method _updateTransform
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp if(isPath || (this._transforms && this._transforms.length > 0))
dc4e0dd6d4f81098160c248f0618d0c7a536d6efTripp //need to use translate for x/y coords
dc4e0dd6d4f81098160c248f0618d0c7a536d6efTripp //adjust origin for custom shapes
dc4e0dd6d4f81098160c248f0618d0c7a536d6efTripp if(!(this instanceof Y.SVGPath))
dc4e0dd6d4f81098160c248f0618d0c7a536d6efTripp tx = this._left + (transformOrigin[0] * this.get("width"));
dc4e0dd6d4f81098160c248f0618d0c7a536d6efTripp ty = this._top + (transformOrigin[1] * this.get("height"));
c234453b8a758c5d363f1854275aa88c527163c7Tripp normalizedMatrix.init({dx: x + this._left, dy: y + this._top});
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp for(; i < len; ++i)
c234453b8a758c5d363f1854275aa88c527163c7Tripp normalizedMatrix[key].apply(normalizedMatrix, this._transforms[i]);
45be085c4155ae7ef409ffa4d79457928742f18fTripp * Draws the shape.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method _draw
180e0891171a381ce4fa08d3867f7226180b8282Tripp _draw: function()
45be085c4155ae7ef409ffa4d79457928742f18fTripp * Updates `Shape` based on attribute changes.
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @method _updateHandler
f49cd0540857456c2f91f0b5c08649f0f8ae39e8Tripp * Storage for the transform attribute.
f49cd0540857456c2f91f0b5c08649f0f8ae39e8Tripp * @property _transform
f49cd0540857456c2f91f0b5c08649f0f8ae39e8Tripp * @type String
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Returns the bounds for a shape.
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp * Calculates the a new bounding box from the original corner coordinates (base on size and position) and the transform matrix.
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp * The calculated bounding box is used by the graphic instance to calculate its viewBox.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method getBounds
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @return Object
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp //The svg path element does not have x and y coordinates. Shapes based on path use translate to "fake" x and y. As a
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp //result, these values will show up in the transform matrix and should not be used in any conversion formula.
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp bounds.left = Math.min(x3, Math.min(x1, Math.min(x2, x4)));
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp bounds.right = Math.max(x3, Math.max(x1, Math.max(x2, x4)));
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp bounds.top = Math.min(y2, Math.min(y4, Math.min(y3, y1)));
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp bounds.bottom = Math.max(y2, Math.max(y4, Math.max(y3, y1)));
16ce43caceb6f25725afe3076c38ccfa3b55fbb9Tripp //if there is a stroke, extend the bounds to accomodate
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * 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.
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @method _getRotatedCornerX
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {Number} x original x-coordinate of corner
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {Number} y original y-coordinate of corner
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {Number} tox transform origin x-coordinate of rotation
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {Number} toy transform origin y-coordinate of rotation
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {Number} cosRadians cosine (in radians) of rotation
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {Number} sinRadians sin (in radians) or rotation
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @return Number
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp _getRotatedCornerX: function(x, y, tox, toy, cosRadians, sinRadians)
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp return (tox + (x - tox) * cosRadians + (y - toy) * sinRadians);
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * 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.
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @method _getRotatedCornerY
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {Number} x original x-coordinate of corner
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {Number} y original y-coordinate of corner
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {Number} tox transform origin x-coordinate of rotation
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {Number} toy transform origin y-coordinate of rotation
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {Number} cosRadians cosine (in radians) of rotation
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {Number} sinRadians sin (in radians) or rotation
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @return Number
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp _getRotatedCornerY: function(x, y, tox, toy, cosRadians, sinRadians)
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp return (toy - (x - tox) * sinRadians + (y - toy) * cosRadians);
0cf44740ed7838d2b3eea6d651418d706df34ff6Tripp * Destroys the shape instance.
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @method destroy
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp destroy: function()
0cf44740ed7838d2b3eea6d651418d706df34ff6Tripp * Implementation for shape destruction
0cf44740ed7838d2b3eea6d651418d706df34ff6Tripp * @method destroy
0cf44740ed7838d2b3eea6d651418d706df34ff6Tripp * @protected
0cf44740ed7838d2b3eea6d651418d706df34ff6Tripp this.node = null;
180e0891171a381ce4fa08d3867f7226180b8282Tripp * 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
180e0891171a381ce4fa08d3867f7226180b8282Tripp * fraction of the shape's corresponding bounding box dimension. The default value is [0.5, 0.5].
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config transformOrigin
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Array
180e0891171a381ce4fa08d3867f7226180b8282Tripp valueFn: function()
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * <p>A string containing, in order, transform operations applied to the shape instance. The `transform` string can contain the following values:
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * <dt>rotate</dt><dd>Rotates the shape clockwise around it transformOrigin.</dd>
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * <dt>translate</dt><dd>Specifies a 2d translation.</dd>
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * <dt>skew</dt><dd>Skews the shape around the x-axis and y-axis.</dd>
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * <dt>scale</dt><dd>Specifies a 2d scaling operation.</dd>
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * <dt>translateX</dt><dd>Translates the shape along the x-axis.</dd>
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * <dt>translateY</dt><dd>Translates the shape along the y-axis.</dd>
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * <dt>skewX</dt><dd>Skews the shape around the x-axis.</dd>
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * <dt>skewY</dt><dd>Skews the shape around the y-axis.</dd>
0f600fa8611a355b40bdebf65f34aa01d6db12a6Tripp * <dt>matrix</dt><dd>Specifies a 2D transformation matrix comprised of the specified six values.</dd>
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * <p>Applying transforms through the transform attribute will reset the transform matrix and apply a new transform. The shape class also contains corresponding methods for each transform
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * that will apply the transform to the current matrix. The below code illustrates how you might use the `transform` attribute to instantiate a recangle with a rotation of 45 degrees.</p>
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp var myRect = new Y.Rect({
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp type:"rect",
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp height: 40,
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp transform: "rotate(45)"
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp * <p>The code below would apply `translate` and `rotate` to an existing shape.</p>
ed351bcb31f61fcad5032ac96b86a5b43dff7e85Tripp myRect.set("transform", "translate(40, 50) rotate(45)");
f49cd0540857456c2f91f0b5c08649f0f8ae39e8Tripp * @config transform
f49cd0540857456c2f91f0b5c08649f0f8ae39e8Tripp * @type String
f49cd0540857456c2f91f0b5c08649f0f8ae39e8Tripp this._transforms = this.matrix.getTransformArray(val);
f49cd0540857456c2f91f0b5c08649f0f8ae39e8Tripp getter: function()
f49cd0540857456c2f91f0b5c08649f0f8ae39e8Tripp return this._transform;
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Unique id for class instance.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config id
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type String
180e0891171a381ce4fa08d3867f7226180b8282Tripp valueFn: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp return Y.guid();
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Indicates the x position of shape.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config x
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Number
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Indicates the y position of shape.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config y
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Number
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Indicates the width of the shape
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config width
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Number
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Indicates the height of the shape
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config height
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Number
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Indicates whether the shape is visible.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config visible
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Boolean
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Contains information about the fill of the shape.
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>color</dt><dd>The color of the fill.</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>type</dt><dd>Type of fill.
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>solid</dt><dd>Solid single color fill. (default)</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>linear</dt><dd>Linear gradient fill.</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>radial</dt><dd>Radial gradient fill.</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <p>If a `linear` or `radial` is specified as the fill type. The following additional property is used:
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>stops</dt><dd>An array of objects containing the following properties:
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>color</dt><dd>The color of the stop.</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <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 6 - 8</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>offset</dt><dd>Number between 0 and 1 indicating where the color stop is positioned.</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <p>Linear gradients also have the following property:</p>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>rotation</dt><dd>Linear gradients flow left to right by default. The rotation property allows you to change the flow by rotation. (e.g. A rotation of 180 would make the gradient pain from right to left.)</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <p>Radial gradients have the following additional properties:</p>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>r</dt><dd>Radius of the gradient circle.</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>fx</dt><dd>Focal point x-coordinate of the gradient.</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>fy</dt><dd>Focal point y-coordinate of the gradient.</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>cx</dt><dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <p>The x-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <p><strong>Note: </strong>Currently, this property is not implemented for corresponding `CanvasShape` and `VMLShape` classes which are used on Android or IE 6 - 8.</p>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>cy</dt><dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <p>The y-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <p><strong>Note: </strong>Currently, this property is not implemented for corresponding `CanvasShape` and `VMLShape` classes which are used on Android or IE 6 - 8.</p>
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config fill
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Object
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Contains information about the stroke of the shape.
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>color</dt><dd>The color of the stroke.</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>weight</dt><dd>Number that indicates the width of the stroke.</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <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
ea677677ca663835e4b8ee128f219804d60563f9Tripp * length of the dash. The second index indicates the length of gap.
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>linecap</dt><dd>Specifies the linecap for the stroke. The following values can be specified:
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>butt (default)</dt><dd>Specifies a butt linecap.</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>square</dt><dd>Specifies a sqare linecap.</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>round</dt><dd>Specifies a round linecap.</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>linejoin</dt><dd>Specifies a linejoin for the stroke. The following values can be specified:
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>round (default)</dt><dd>Specifies that the linejoin will be round.</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>bevel</dt><dd>Specifies a bevel for the linejoin.</dd>
ea677677ca663835e4b8ee128f219804d60563f9Tripp * <dt>miter limit</dt><dd>An integer specifying the miter limit of a miter linejoin. If you want to specify a linejoin of miter, you simply specify the limit as opposed to having
ea677677ca663835e4b8ee128f219804d60563f9Tripp * separate miter and miter limit values.</dd>
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config stroke
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Object
d5474153396cca8ee63ab6205c1f2c7ad0cd4183Tripp var tmpl = this.get("stroke") || this._getDefaultStroke(),
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp //Not used. Remove in future.
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp // Only implemented in SVG
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp // Determines whether the instance will receive mouse events.
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp // @config pointerEvents
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp // @type string
180e0891171a381ce4fa08d3867f7226180b8282Tripp valueFn: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp * The node used for gradient fills.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config gradientNode
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type HTMLElement
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp //Not used. Remove in future.
180e0891171a381ce4fa08d3867f7226180b8282Tripp getter: function()
c76f20e944f13ab46599248085dce274728c2c94Tripp * Dom node for the shape.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config node
c76f20e944f13ab46599248085dce274728c2c94Tripp * @type HTMLElement
c76f20e944f13ab46599248085dce274728c2c94Tripp * @readOnly
180e0891171a381ce4fa08d3867f7226180b8282Tripp getter: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp return this.node;
c76f20e944f13ab46599248085dce274728c2c94Tripp * Reference to the parent graphic instance
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config graphic
c76f20e944f13ab46599248085dce274728c2c94Tripp * @type SVGGraphic
c76f20e944f13ab46599248085dce274728c2c94Tripp * @readOnly
180e0891171a381ce4fa08d3867f7226180b8282Tripp getter: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp return this._graphic;
241f26199f883a9833db7e282b336a1c2d876592Tripp * <a href="http://www.w3.org/TR/SVG/">SVG</a> implementation of the <a href="Path.html">`Path`</a> class.
241f26199f883a9833db7e282b336a1c2d876592Tripp * `SVGPath` is not intended to be used directly. Instead, use the <a href="Path.html">`Path`</a> class.
241f26199f883a9833db7e282b336a1c2d876592Tripp * If the browser has <a href="http://www.w3.org/TR/SVG/">SVG</a> capabilities, the <a href="Path.html">`Path`</a>
241f26199f883a9833db7e282b336a1c2d876592Tripp * class will point to the `SVGPath` class.
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp * @module graphics
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @class SVGPath
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @extends SVGShape
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @constructor
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp SVGPath.superclass.constructor.apply(this, arguments);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Left edge of the path
c76f20e944f13ab46599248085dce274728c2c94Tripp * @property _left
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Right edge of the path
c76f20e944f13ab46599248085dce274728c2c94Tripp * @property _right
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Top edge of the path
c76f20e944f13ab46599248085dce274728c2c94Tripp * @property _top
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Bottom edge of the path
c76f20e944f13ab46599248085dce274728c2c94Tripp * @property _bottom
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Indicates the type of shape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @property _type
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @readOnly
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type String
9794793fecb186466c6196958d9f8e9469a4ebe0Tripp * Storage for path
9794793fecb186466c6196958d9f8e9469a4ebe0Tripp * @property _path
9794793fecb186466c6196958d9f8e9469a4ebe0Tripp * @type String
241f26199f883a9833db7e282b336a1c2d876592Tripp * Indicates the path used for the node.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config path
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type String
241f26199f883a9833db7e282b336a1c2d876592Tripp * @readOnly
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp return this._path;
37f0acd515558dd9959c57809370d32b24fd2566Tripp * Indicates the width of the shape
37f0acd515558dd9959c57809370d32b24fd2566Tripp * @config width
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Indicates the height of the shape
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config height
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
241f26199f883a9833db7e282b336a1c2d876592Tripp * <a href="http://www.w3.org/TR/SVG/">SVG</a> implementation of the <a href="Rect.html">`Rect`</a> class.
241f26199f883a9833db7e282b336a1c2d876592Tripp * `SVGRect` is not intended to be used directly. Instead, use the <a href="Rect.html">`Rect`</a> class.
241f26199f883a9833db7e282b336a1c2d876592Tripp * If the browser has <a href="http://www.w3.org/TR/SVG/">SVG</a> capabilities, the <a href="Rect.html">`Rect`</a>
241f26199f883a9833db7e282b336a1c2d876592Tripp * class will point to the `SVGRect` class.
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp * @module graphics
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @class SVGRect
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @constructor
09ae00ccf51dc05697a0d0f54341917314ab06d1TrippSVGRect = function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp SVGRect.superclass.constructor.apply(this, arguments);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Indicates the type of shape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @property _type
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type String
241f26199f883a9833db7e282b336a1c2d876592Tripp * <a href="http://www.w3.org/TR/SVG/">SVG</a> implementation of the <a href="Ellipse.html">`Ellipse`</a> class.
241f26199f883a9833db7e282b336a1c2d876592Tripp * `SVGEllipse` is not intended to be used directly. Instead, use the <a href="Ellipse.html">`Ellipse`</a> class.
241f26199f883a9833db7e282b336a1c2d876592Tripp * If the browser has <a href="http://www.w3.org/TR/SVG/">SVG</a> capabilities, the <a href="Ellipse.html">`Ellipse`</a>
241f26199f883a9833db7e282b336a1c2d876592Tripp * class will point to the `SVGEllipse` class.
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp * @module graphics
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @class SVGEllipse
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @constructor
180e0891171a381ce4fa08d3867f7226180b8282Tripp SVGEllipse.superclass.constructor.apply(this, arguments);
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Indicates the type of shape
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @property _type
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type String
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Updates the shape.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method _draw
180e0891171a381ce4fa08d3867f7226180b8282Tripp _draw: function()
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp // Horizontal radius for the ellipse. This attribute is not implemented in Canvas.
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp // Will add in 3.4.1.
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp // @config xRadius
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp // @type Number
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp // @readOnly
180e0891171a381ce4fa08d3867f7226180b8282Tripp getter: function()
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp // Vertical radius for the ellipse. This attribute is not implemented in Canvas.
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp // Will add in 3.4.1.
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp // @config yRadius
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp // @type Number
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp // @readOnly
180e0891171a381ce4fa08d3867f7226180b8282Tripp getter: function()
241f26199f883a9833db7e282b336a1c2d876592Tripp * <a href="http://www.w3.org/TR/SVG/">SVG</a> implementation of the <a href="Circle.html">`Circle`</a> class.
241f26199f883a9833db7e282b336a1c2d876592Tripp * `SVGCircle` is not intended to be used directly. Instead, use the <a href="Circle.html">`Circle`</a> class.
241f26199f883a9833db7e282b336a1c2d876592Tripp * If the browser has <a href="http://www.w3.org/TR/SVG/">SVG</a> capabilities, the <a href="Circle.html">`Circle`</a>
241f26199f883a9833db7e282b336a1c2d876592Tripp * class will point to the `SVGCircle` class.
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp * @module graphics
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @class SVGCircle
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @constructor
180e0891171a381ce4fa08d3867f7226180b8282Tripp SVGCircle.superclass.constructor.apply(this, arguments);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Indicates the type of shape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @property _type
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type String
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Updates the shape.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _draw
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp _draw: function()
c76f20e944f13ab46599248085dce274728c2c94Tripp * Indicates the width of the shape
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config width
c76f20e944f13ab46599248085dce274728c2c94Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
c76f20e944f13ab46599248085dce274728c2c94Tripp * Indicates the height of the shape
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config height
c76f20e944f13ab46599248085dce274728c2c94Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Radius of the circle
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config radius
c76f20e944f13ab46599248085dce274728c2c94Tripp * @type Number
656a34aea8d08b2d05d28ae23dfc89771293d27bTripp * Draws pie slices
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp * @module graphics
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @class SVGPieSlice
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @constructor
656a34aea8d08b2d05d28ae23dfc89771293d27bTripp SVGPieSlice.superclass.constructor.apply(this, arguments);
656a34aea8d08b2d05d28ae23dfc89771293d27bTripp * Indicates the type of shape
656a34aea8d08b2d05d28ae23dfc89771293d27bTripp * @property _type
656a34aea8d08b2d05d28ae23dfc89771293d27bTripp * @type String
656a34aea8d08b2d05d28ae23dfc89771293d27bTripp * Change event listener
656a34aea8d08b2d05d28ae23dfc89771293d27bTripp * @method _updateHandler
38346051f48f13ebda9f86657ed3a6d19255e6beTripp _draw: function(e)
656a34aea8d08b2d05d28ae23dfc89771293d27bTripp * Starting angle in relation to a circle in which to begin the pie slice drawing.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config startAngle
656a34aea8d08b2d05d28ae23dfc89771293d27bTripp * @type Number
656a34aea8d08b2d05d28ae23dfc89771293d27bTripp * Arc of the slice.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config arc
656a34aea8d08b2d05d28ae23dfc89771293d27bTripp * @type Number
656a34aea8d08b2d05d28ae23dfc89771293d27bTripp * Radius of the circle in which the pie slice is drawn
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config radius
656a34aea8d08b2d05d28ae23dfc89771293d27bTripp * @type Number
241f26199f883a9833db7e282b336a1c2d876592Tripp * <a href="http://www.w3.org/TR/SVG/">SVG</a> implementation of the <a href="Graphic.html">`Graphic`</a> class.
241f26199f883a9833db7e282b336a1c2d876592Tripp * `SVGGraphic` is not intended to be used directly. Instead, use the <a href="Graphic.html">`Graphic`</a> class.
241f26199f883a9833db7e282b336a1c2d876592Tripp * If the browser has <a href="http://www.w3.org/TR/SVG/">SVG</a> capabilities, the <a href="Graphic.html">`Graphic`</a>
241f26199f883a9833db7e282b336a1c2d876592Tripp * class will point to the `SVGGraphic` class.
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp * @module graphics
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @class SVGGraphic
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @constructor
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp SVGGraphic.superclass.constructor.apply(this, arguments);
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * Whether or not to render the `Graphic` automatically after to a specified parent node after init. This can be a Node instance or a CSS selector string.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config render
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * @type Node | String
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Unique id for class instance.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config id
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @type String
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp valueFn: function()
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp return Y.guid();
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Key value pairs in which a shape instance is associated with its id.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config shapes
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @type Object
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @readOnly
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp getter: function()
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp return this._shapes;
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Object containing size and coordinate data for the content of a Graphic in relation to the coordSpace node.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config contentBounds
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @type Object
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @readOnly
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp getter: function()
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * The html element that represents to coordinate system of the Graphic instance.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config node
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @type HTMLElement
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @readOnly
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp getter: function()
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp return this._node;
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * Indicates the width of the `Graphic`.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config width
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * @type Number
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * Indicates the height of the `Graphic`.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config height
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * @type Number
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Determines how the size of instance is calculated. If true, the width and height are determined by the size of the contents.
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * If false, the width and height values are either explicitly set or determined by the size of the parent node's dimensions.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config autoSize
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @type Boolean
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @default false
2393d368346a3ec271a04e495b1bdb61199dac42Tripp * The contentBounds will resize to greater values but not to smaller values. (for performance)
df9b19c757881bdddda4a3b2094bac020aa00bceTripp * When resizing the contentBounds down is desirable, set the resizeDown value to true.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config resizeDown
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @type Boolean
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp getter: function()
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp return this._resizeDown;
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Indicates the x-coordinate for the instance.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config x
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @type Number
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp getter: function()
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp return this._x;
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Indicates the y-coordinate for the instance.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config y
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @type Number
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp getter: function()
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp return this._y;
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Indicates whether or not the instance will automatically redraw after a change is made to a shape.
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * This property will get set to false when batching operations.
1dd0fc68c8d04a0df33c7d60d39d72911d34336fTripp * @config autoDraw
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @type Boolean
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @default true
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp // Indicates the pointer-events setting for the svg:svg element.
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp // @config pointerEvents
ef5e532c437b53336c55c68f3d060ade3d74ab5dTripp // @type String
9794793fecb186466c6196958d9f8e9469a4ebe0Tripp * Storage for `x` attribute.
9794793fecb186466c6196958d9f8e9469a4ebe0Tripp * @property _x
9794793fecb186466c6196958d9f8e9469a4ebe0Tripp * @type Number
9794793fecb186466c6196958d9f8e9469a4ebe0Tripp * Storage for `y` attribute.
9794793fecb186466c6196958d9f8e9469a4ebe0Tripp * @property _y
9794793fecb186466c6196958d9f8e9469a4ebe0Tripp * @type Number
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Gets the current position of the graphic instance in page coordinates.
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @method getXY
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @return Array The XY position of the shape.
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp getXY: function()
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @property _resizeDown
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @type Boolean
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Initializes the class.
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @method initializer
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp initializer: function() {
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Adds the graphics node to the dom.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method render
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {HTMLElement} parentNode node in which to render the graphics node into.
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp w = this.get("width") || parseInt(parentNode.getComputedStyle("width"), 10),
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp h = this.get("height") || parseInt(parentNode.getComputedStyle("height"), 10);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp return this;
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Removes all nodes.
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @method destroy
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp destroy: function()
0cf44740ed7838d2b3eea6d651418d706df34ff6Tripp this._contentNode.parentNode.removeChild(this._contentNode);
0cf44740ed7838d2b3eea6d651418d706df34ff6Tripp this._node = null;
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Generates a shape instance by type.
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * @method addShape
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {Object} cfg attributes for the shape
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @return Shape
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Adds a shape instance to the graphic instance.
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * @method _appendShape
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {Shape} shape The shape instance to be added to the graphic.
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Removes a shape instance from from the graphic instance.
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @method removeShape
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @param {Shape|String} shape The instance or id of the shape to be removed.
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Removes all shape instances from the dom.
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @method removeAllShapes
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Removes all child nodes.
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @method _removeChildren
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {HTMLElement} node
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Clears the graphics object.
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @method clear
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp clear: function() {
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Toggles visibility
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @method _toggleVisible
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {Boolean} val indicates visibilitye
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * Returns a shape class. Used by `addShape`.
9794793fecb186466c6196958d9f8e9469a4ebe0Tripp * @method _getShapeClass
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * @param {Shape | String} val Indicates which shape class.
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * @return Function
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * Look up for shape classes. Used by `addShape` to retrieve a class for instantiation.
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * @property _shapeClass
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * @type Object
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Returns a shape based on the id of its dom node.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method getShapeById
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {String} id Dom id of the shape's node attribute.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @return Shape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Allows for creating multiple shapes in order to batch appending and redraw operations.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method batch
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Function} method Method to execute.
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * Returns a document fragment to for attaching shapes.
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * @method _getDocFrag
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * @return DocumentFragment
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp return this._frag;
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * Redraws all shapes.
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * @method _redraw
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp _redraw: function()
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp var box = this.get("resizeDown") ? this._getUpdatedContentBounds() : this._contentBounds;
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp this._contentNode.setAttribute("viewBox", "" + box.left + " " + box.top + " " + box.width + " " + box.height + "");
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp this._frag = null;
241f26199f883a9833db7e282b336a1c2d876592Tripp * Adds a shape to the redraw queue and calculates the contentBounds. Used internally
241f26199f883a9833db7e282b336a1c2d876592Tripp * by `Shape` instances.
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @method addToRedrawQueue
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param shape {SVGShape}
241f26199f883a9833db7e282b336a1c2d876592Tripp * @protected
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp box.left = box.left < shapeBox.left ? box.left : shapeBox.left;
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp box.top = box.top < shapeBox.top ? box.top : shapeBox.top;
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp box.right = box.right > shapeBox.right ? box.right : shapeBox.right;
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp box.bottom = box.bottom > shapeBox.bottom ? box.bottom : shapeBox.bottom;
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * Recalculates and returns the `contentBounds` for the `Graphic` instance.
ea677677ca663835e4b8ee128f219804d60563f9Tripp * @method _getUpdatedContentBounds
a674c2c1af7be192fa94e4401511641f5a95ee47Tripp * @return {Object}
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Creates a contentNode element
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @method _createGraphics
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp _createGraphics: function() {
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp contentNode.setAttribute("pointer-events", pointerEvents);
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * Creates a graphic node
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @method _createGraphicNode
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {String} type node type to create
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @param {String} pe specified pointer-events value
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp * @return HTMLElement
11ba9f1486f8345f4ed99c74d8b58be3be37a40eTripp var node = DOCUMENT.createElementNS("http://www.w3.org/2000/svg", "svg:" + type),
9ef05fa33949a0e91fa62aea328cc344e8a606caTripp if(type !== "defs" && type !== "stop" && type !== "linearGradient" && type != "radialGradient")
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Returns a reference to a gradient definition based on an id and type.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method getGradientNode
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @param {String} key id that references the gradient definition
45be085c4155ae7ef409ffa4d79457928742f18fTripp * @param {String} type description of the gradient type
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @return HTMLElement
241f26199f883a9833db7e282b336a1c2d876592Tripp * @protected
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp if(gradients.hasOwnProperty(key) && gradients[key].tagName.indexOf(type) > -1)
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp key = key || "gradient" + Math.round(100000 * Math.random());
c76f20e944f13ab46599248085dce274728c2c94Tripp}, '@VERSION@' ,{requires:['graphics'], skinnable:false});