graphics-svg-debug.js revision c76f20e944f13ab46599248085dce274728c2c94
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.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} x x-coordinate of the wedge's center point
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} y y-coordinate of the wedge's center point
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} startAngle starting angle in degrees
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} arc sweep of the wedge. Negative values draw clockwise.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} radius radius of wedge. If [optional] yRadius is defined, then radius is the x radius.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} yRadius [optional] y radius for wedge.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp drawWedge: function(x, y, startAngle, arc, radius, yRadius)
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this.path = this._getWedgePath({x:x, y:y, startAngle:startAngle, arc:arc, radius:radius, yRadius:yRadius});
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Generates a path string for a wedge shape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _getWedgePath
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Object} config attributes used to create the path
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @return String
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 path += " L" + Math.round(ax) + ", " + Math.round(ay);
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));
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp path += Math.round(cx) + " " + Math.round(cy) + " " + Math.round(bx) + " " + Math.round(by) + " ";
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') {
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp currentArray = this._pathArray[Math.max(0, this._pathArray.length - 1)];
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this._pathArray[pathArrayLen] = this._pathArray[pathArrayLen].concat([args[i][0], args[i][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 currentArray = this._pathArray[Math.max(0, this._pathArray.length - 1)];
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this._pathArray[pathArrayLen] = this._pathArray[pathArrayLen].concat([x, y]);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Completes a drawing operation.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method end
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp end: function() {
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Sets the size of the graphics object.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method setSize
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param w {Number} width to set for the instance.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param h {Number} height to set for the instance.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp setSize: function(w, h) {
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)
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Base class for creating shapes.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @class SVGShape
180e0891171a381ce4fa08d3867f7226180b8282Tripp var host = this,
180e0891171a381ce4fa08d3867f7226180b8282Tripp host._eventPrefix = host.constructor.EVENT_PREFIX || host.constructor.NAME;
180e0891171a381ce4fa08d3867f7226180b8282Tripp // Need to initPlugins manually, to handle constructor parsing, static Plug parsing
180e0891171a381ce4fa08d3867f7226180b8282Tripp init: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Initializes the shape
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method _initialize
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
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @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.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @return HTMLElement
180e0891171a381ce4fa08d3867f7226180b8282Tripp var node = document.createElementNS("http://www.w3.org/2000/svg", "svg:" + this._type),
180e0891171a381ce4fa08d3867f7226180b8282Tripp if(type.indexOf('mouse') > -1 || type.indexOf('click') > -1)
180e0891171a381ce4fa08d3867f7226180b8282Tripp return true;
180e0891171a381ce4fa08d3867f7226180b8282Tripp return false;
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") + ")");
180e0891171a381ce4fa08d3867f7226180b8282Tripp fillOpacity = fill.opacity = Y_LANG.isNumber(fillOpacity) ? fillOpacity : 1;
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Returns a linear gradient fill
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method _getLinearGradient
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @param {String} type gradient type
180e0891171a381ce4fa08d3867f7226180b8282Tripp gradientNode = graphic.getGradientNode("grad" + this.get("id"), type),
180e0891171a381ce4fa08d3867f7226180b8282Tripp gradientNode.setAttribute("gradientTransform", "rotate(" + rotation + "," + (w/2) + ", " + (h/2) + ")");
180e0891171a381ce4fa08d3867f7226180b8282Tripp gradientNode.setAttribute("gradientUnits", "userSpaceOnUse");
180e0891171a381ce4fa08d3867f7226180b8282Tripp set: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp var host = this;
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Applies translate transformation.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method translate
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @param {Number} x The x-coordinate
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @param {Number} y The y-coordinate
180e0891171a381ce4fa08d3867f7226180b8282Tripp translate: function(x, y)
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Applies translate transformation.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method translate
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @param {Number} x The x-coordinate
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @param {Number} y The y-coordinate
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @protected
180e0891171a381ce4fa08d3867f7226180b8282Tripp _translate: function(x, y)
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Applies a skew to the x-coordinate
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method skewX
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @param {Number} x x-coordinate
180e0891171a381ce4fa08d3867f7226180b8282Tripp skewX: function(x)
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Applies a skew to the x-coordinate
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method skewX
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @param {Number} x x-coordinate
180e0891171a381ce4fa08d3867f7226180b8282Tripp skewY: function(y)
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Applies a rotation.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method rotate
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Applies a scale transform
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method scale
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @param {Number} val
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Applies a matrix transformation
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method matrix
180e0891171a381ce4fa08d3867f7226180b8282Tripp matrix: function(a, b, c, d, e, f)
180e0891171a381ce4fa08d3867f7226180b8282Tripp this._transformArgs[type] = Array.prototype.slice.call(args, 0);
180e0891171a381ce4fa08d3867f7226180b8282Tripp args[1] = this.get("x") + (this.get("width") * transformOrigin[0]);
180e0891171a381ce4fa08d3867f7226180b8282Tripp args[2] = this.get("y") + (this.get("height") * transformOrigin[1]);
180e0891171a381ce4fa08d3867f7226180b8282Tripp val = key + "(" + this._transformArgs[key].toString() + ")";
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Updates the shape.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method _draw
180e0891171a381ce4fa08d3867f7226180b8282Tripp _draw: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Change event listener
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method _updateHandler
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Storage for translateX
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Storage for translateY
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Returns the bounds for a shape.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method getBounds
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @return Object
180e0891171a381ce4fa08d3867f7226180b8282Tripp sinRadians = parseFloat(parseFloat(Math.sin(absRot * radCon)).toFixed(8)),
180e0891171a381ce4fa08d3867f7226180b8282Tripp cosRadians = parseFloat(parseFloat(Math.cos(absRot * radCon)).toFixed(8)),
180e0891171a381ce4fa08d3867f7226180b8282Tripp x = (x + originalWidth * tox) - (sinRadians * (originalHeight * (1 - toy))) - (cosRadians * (originalWidth * tox));
180e0891171a381ce4fa08d3867f7226180b8282Tripp y = (y + originalHeight * toy) - (sinRadians * (originalWidth * tox)) - (cosRadians * originalHeight * toy);
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].
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @attribute transformOrigin
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Array
180e0891171a381ce4fa08d3867f7226180b8282Tripp valueFn: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp * The rotation (in degrees) of the shape.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @attribute rotation
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Number
180e0891171a381ce4fa08d3867f7226180b8282Tripp getter: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp return this._rotation;
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Unique id for class instance.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @attribute id
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type String
180e0891171a381ce4fa08d3867f7226180b8282Tripp valueFn: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp return Y.guid();
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Indicates the x position of shape.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @attribute x
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Number
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Indicates the y position of shape.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @attribute y
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Number
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Indicates the width of the shape
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @attribute width
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Number
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Indicates the height of the shape
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @attribute height
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Number
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Indicates whether the shape is visible.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @attribute visible
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Boolean
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Contains information about the fill of the shape.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * <dt>color</dt><dd>The color of the fill.</dd>
180e0891171a381ce4fa08d3867f7226180b8282Tripp * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>
180e0891171a381ce4fa08d3867f7226180b8282Tripp * <dt>type</dt><dd>Type of fill.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * <dt>solid</dt><dd>Solid single color fill. (default)</dd>
180e0891171a381ce4fa08d3867f7226180b8282Tripp * <dt>linear</dt><dd>Linear gradient fill.</dd>
180e0891171a381ce4fa08d3867f7226180b8282Tripp * <dt>radial</dt><dd>Radial gradient fill.</dd>
180e0891171a381ce4fa08d3867f7226180b8282Tripp * <p>If a gradient (linear or radial) is specified as the fill type. The following properties are used:
180e0891171a381ce4fa08d3867f7226180b8282Tripp * <dt>stops</dt><dd>An array of objects containing the following properties:
c76f20e944f13ab46599248085dce274728c2c94Tripp * <dt>color</dt><dd>The color of the stop.</dd>
c76f20e944f13ab46599248085dce274728c2c94Tripp * <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>
180e0891171a381ce4fa08d3867f7226180b8282Tripp * <dt>offset</dt><dd>Number between 0 and 1 indicating where the color stop is positioned.</dd>
180e0891171a381ce4fa08d3867f7226180b8282Tripp * <dt></dt><dd></dd>
180e0891171a381ce4fa08d3867f7226180b8282Tripp * <dt></dt><dd></dd>
180e0891171a381ce4fa08d3867f7226180b8282Tripp * <dt></dt><dd></dd>
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @attribute fill
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Object
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Contains information about the stroke of the shape.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * <dt>color</dt><dd>The color of the stroke.</dd>
180e0891171a381ce4fa08d3867f7226180b8282Tripp * <dt>weight</dt><dd>Number that indicates the width of the stroke.</dd>
180e0891171a381ce4fa08d3867f7226180b8282Tripp * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>
180e0891171a381ce4fa08d3867f7226180b8282Tripp * <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
180e0891171a381ce4fa08d3867f7226180b8282Tripp * length of the dash. The second index indicates the length of gap.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @attribute stroke
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Object
180e0891171a381ce4fa08d3867f7226180b8282Tripp var tmpl = this.get("stroke") || this._getDefaultStroke();
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Indicates whether or not the instance will size itself based on its contents.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @attribute autoSize
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Boolean
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Determines whether the instance will receive mouse events.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @attribute pointerEvents
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type string
180e0891171a381ce4fa08d3867f7226180b8282Tripp valueFn: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Performs a translate on the x-coordinate. When translating x and y coordinates,
180e0891171a381ce4fa08d3867f7226180b8282Tripp * use the <code>translate</code> method.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @attribute translateX
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Number
180e0891171a381ce4fa08d3867f7226180b8282Tripp getter: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp return this._translateX;
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Performs a translate on the y-coordinate. When translating x and y coordinates,
180e0891171a381ce4fa08d3867f7226180b8282Tripp * use the <code>translate</code> method.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @attribute translateX
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Number
180e0891171a381ce4fa08d3867f7226180b8282Tripp getter: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp return this._translateY;
180e0891171a381ce4fa08d3867f7226180b8282Tripp * The node used for gradient fills.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @attribute gradientNode
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type HTMLElement
c76f20e944f13ab46599248085dce274728c2c94Tripp * Indicates whether to automatically refresh.
c76f20e944f13ab46599248085dce274728c2c94Tripp * @attribute autoDraw
c76f20e944f13ab46599248085dce274728c2c94Tripp * @type Boolean
c76f20e944f13ab46599248085dce274728c2c94Tripp * @readOnly
180e0891171a381ce4fa08d3867f7226180b8282Tripp getter: function()
c76f20e944f13ab46599248085dce274728c2c94Tripp * Dom node for the shape.
c76f20e944f13ab46599248085dce274728c2c94Tripp * @attribute node
c76f20e944f13ab46599248085dce274728c2c94Tripp * @type HTMLElement
c76f20e944f13ab46599248085dce274728c2c94Tripp * @readOnly
180e0891171a381ce4fa08d3867f7226180b8282Tripp getter: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp return this.node;
c76f20e944f13ab46599248085dce274728c2c94Tripp * Reference to the parent graphic instance
c76f20e944f13ab46599248085dce274728c2c94Tripp * @type SVGGraphic
c76f20e944f13ab46599248085dce274728c2c94Tripp * @readOnly
180e0891171a381ce4fa08d3867f7226180b8282Tripp getter: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp return this._graphic;
180e0891171a381ce4fa08d3867f7226180b8282Tripp//Straightup augment, no wrapper functions
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * The SVGPath class creates a shape through the use of drawing methods.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @class SVGPath
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @extends SVGShape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp SVGPath.superclass.constructor.apply(this, arguments);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Left edge of the path
c76f20e944f13ab46599248085dce274728c2c94Tripp * @property _left
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Right edge of the path
c76f20e944f13ab46599248085dce274728c2c94Tripp * @property _right
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Top edge of the path
c76f20e944f13ab46599248085dce274728c2c94Tripp * @property _top
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Bottom edge of the path
c76f20e944f13ab46599248085dce274728c2c94Tripp * @property _bottom
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Indicates the type of shape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @property _type
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @readOnly
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type String
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Draws the path.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _draw
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp _draw: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp //Use transform to handle positioning.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this._transformArgs.translate = [left + tx, top + ty];
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Applies translate transformation.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method translate
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} x The x-coordinate
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} y The y-coordinate
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp translate: function(x, y)
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp //do nothing
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Completes a drawing operation.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method end
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp end: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Clears the path.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method clear
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp clear: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Returns the bounds for a shape.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method getBounds
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @return Object
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Path string of the shape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute path
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type String
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp return this._path;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Indicates the height of the shape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute height
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Indicates the height of the shape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute height
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1TrippSVGPath.prototype = Y.merge(Y.merge(Y.SVGDrawing.prototype, Y.SVGShape.prototype), SVGPath.prototype);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Draws rectangles
09ae00ccf51dc05697a0d0f54341917314ab06d1TrippSVGRect = function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp SVGRect.superclass.constructor.apply(this, arguments);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Indicates the type of shape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @property _type
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @readOnly
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type String
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Draws an ellipse
180e0891171a381ce4fa08d3867f7226180b8282Tripp SVGEllipse.superclass.constructor.apply(this, arguments);
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Indicates the type of shape
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @property _type
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @readOnly
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type String
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Updates the shape.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @method _draw
180e0891171a381ce4fa08d3867f7226180b8282Tripp _draw: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Horizontal radius for the ellipse.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @attribute xRadius
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Number
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @readOnly
180e0891171a381ce4fa08d3867f7226180b8282Tripp getter: function()
180e0891171a381ce4fa08d3867f7226180b8282Tripp * Vertical radius for the ellipse.
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @attribute yRadius
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @type Number
180e0891171a381ce4fa08d3867f7226180b8282Tripp * @readOnly
180e0891171a381ce4fa08d3867f7226180b8282Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Draws an circle
180e0891171a381ce4fa08d3867f7226180b8282Tripp SVGCircle.superclass.constructor.apply(this, arguments);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Indicates the type of shape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @property _type
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @readOnly
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type String
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Updates the shape.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _draw
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp _draw: function()
c76f20e944f13ab46599248085dce274728c2c94Tripp * Indicates the width of the shape
c76f20e944f13ab46599248085dce274728c2c94Tripp * @attribute width
c76f20e944f13ab46599248085dce274728c2c94Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @readOnly
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
c76f20e944f13ab46599248085dce274728c2c94Tripp * Indicates the height of the shape
c76f20e944f13ab46599248085dce274728c2c94Tripp * @attribute height
c76f20e944f13ab46599248085dce274728c2c94Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @readOnly
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Radius of the circle
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute radius
c76f20e944f13ab46599248085dce274728c2c94Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Graphic is a simple drawing api that allows for basic drawing operations.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @class Graphic
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @constructor
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Gets the current position of the node's parentNode in page coordinates.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method getXY
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @return Array The XY position of the shape.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getXY: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Indicates whether or not the instance will size itself based on its contents.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @property autoSize
c76f20e944f13ab46599248085dce274728c2c94Tripp * @type Boolean
c76f20e944f13ab46599248085dce274728c2c94Tripp * @default true
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Indicates whether or not the instance will automatically redraw after a change is made to a shape.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * This property will get set to false when batching operations.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @property autoDraw
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Boolean
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @default true
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Initializes the class.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method initializer
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this.setSize(w, h);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Removes all nodes.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method destroy
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp destroy: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Removes all child nodes.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _removeChildren
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {HTMLElement} node
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Shows and and hides a the graphic instance.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method toggleVisible
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param val {Boolean} indicates whether the instance should be visible.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Toggles visibility
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _toggleVisible
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {HTMLElement} node element to toggle
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Boolean} val indicates visibilitye
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp for(; i < len; ++i)
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Clears the graphics object.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method clear
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp clear: function() {
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Sets the size of the graphics object.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method setSize
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param w {Number} width to set for the instance.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param h {Number} height to set for the instance.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp setSize: function(w, h) {
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)
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Adds the graphics node to the dom.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method render
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {HTMLElement} parentNode node in which to render the graphics node into.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp w = parseInt(parentNode.getComputedStyle("width"), 10),
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp h = parseInt(parentNode.getComputedStyle("height"), 10);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this.setSize(w, h);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp return this;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Creates a group element
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _createGraphics
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp _createGraphics: function() {
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Styles a group element
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _styleGroup
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Creates a graphic node
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _createGraphicNode
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {String} type node type to create
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {String} pe specified pointer-events value
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @return HTMLElement
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp var node = document.createElementNS("http://www.w3.org/2000/svg", "svg:" + type),
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp if(type !== "defs" && type !== "stop" && type !== "linearGradient" && type != "radialGradient")
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Adds a shape instance to the graphic instance.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method addShape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Shape} shape The shape instance to be added to the graphic.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Generates a shape instance by type.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method getShape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {String} type type of shape to generate.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Object} cfg attributes for the shape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @return Shape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * When overflow is set to true, by default, the viewBox will resize to greater values but not values. (for performance)
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * When resizing the viewBox down is desirable, set the resizeDown value to true.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @property resizeDown
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Boolean
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.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this.autoDraw = false;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this._frag = null;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this.autoDraw = true;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Updates the size of the graphics container and the position of its children.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method updateCoordSpace
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp queue = this.resizeDown ? this._shapes : this._redrawQueue;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this.group.setAttribute("viewBox", "" + this._left + " " + this._top + " " + this._width + " " + this._height + "");
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Adds a shape to the redraw queue.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method addToRedrawQueue
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param shape {SVGShape}
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Returns a reference to a gradient definition based on an id and type.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method getGradientNode
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @key {String} id that references the gradient definition
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type {String} description of the gradient type
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @return HTMLElement
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});