graphics-svg-debug.js revision 09ae00ccf51dc05697a0d0f54341917314ab06d1
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
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp var host = this,
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp host._eventPrefix = host.constructor.EVENT_PREFIX || host.constructor.NAME;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp // Need to initPlugins manually, to handle constructor parsing, static Plug parsing
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp init: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Initializes the shape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _initialize
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp var host = this;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Add a class name to each node.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method addClass
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {String} className the class name to add to the node's class attribute
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp node.className.baseVal = Y_LANG.trim([node.className.baseVal, className].join(' '));
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Removes a class name from each node.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method removeClass
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {String} className the class name to remove from the node's class attribute
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp classString = classString.replace(new RegExp(className + ' '), className).replace(new RegExp(className), '');
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Gets the current position of the node in page coordinates.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method getXY
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @return Array The XY position of the shape.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getXY: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Set the position of the shape in page coordinates, regardless of how the node is positioned.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method setXY
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Array} Contains X & Y values for new position (coordinates are page-based)
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method contains
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {SVGShape | HTMLElement} needle The possible node or descendent
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @return Boolean Whether or not this shape is the needle or its ancestor.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Compares nodes to determine if they match.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Node instances can be compared to each other and/or HTMLElements.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method compareTo
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {HTMLElement | Node} refNode The reference node to compare to the node.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @return {Boolean} True if the nodes match, false if they do not.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Test if the supplied node matches the supplied selector.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method test
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {String} selector The CSS selector to test against.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @return Boolean Wheter or not the shape matches the selector.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Value function for fill attribute
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _getDefaultFill
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @return Object
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp _getDefaultFill: function() {
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Value function for stroke attribute
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _getDefaultStroke
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @return Object
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Creates the dom node for the shape.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @return HTMLElement
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp var node = document.createElementNS("http://www.w3.org/2000/svg", "svg:" + this._type),
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp if(type.indexOf('mouse') > -1 || type.indexOf('click') > -1)
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp return true;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp return false;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Adds a stroke to the shape node.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _strokeChangeHandler
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp dash = Y_LANG.isArray(dashstyle) ? dashstyle.toString() : dashstyle;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp stroke.opacity = Y_LANG.isNumber(strokeOpacity) ? strokeOpacity : 1;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp node.setAttribute("stroke-miterlimit", Math.max(linejoin, 1));
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Adds a fill to the shape node.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _fillChangeHandler
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp node.setAttribute("fill", "url(#grad" + this.get("id") + ")");
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp fillOpacity = fill.opacity = Y_LANG.isNumber(fillOpacity) ? fillOpacity : 1;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Returns a linear gradient fill
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _getLinearGradient
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {String} type gradient type
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp gradientNode = graphic.getGradientNode("grad" + this.get("id"), type),
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp gradientNode.setAttribute("gradientTransform", "rotate(" + rotation + "," + (w/2) + ", " + (h/2) + ")");
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp gradientNode.setAttribute("gradientUnits", "userSpaceOnUse");
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp set: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp var host = this;
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 * Applies translate transformation.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method translate
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} x The x-coordinate
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} y The y-coordinate
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @protected
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp _translate: function(x, y)
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Applies a skew to the x-coordinate
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method skewX
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} x x-coordinate
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp skewX: function(x)
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Applies a skew to the x-coordinate
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method skewX
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} x x-coordinate
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp skewY: function(y)
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Applies a rotation.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method rotate
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Applies a scale transform
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method scale
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @param {Number} val
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Applies a matrix transformation
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method matrix
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp matrix: function(a, b, c, d, e, f)
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp this._transformArgs[type] = Array.prototype.slice.call(args, 0);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp //this.fire("transformAdded");
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp args[1] = this.get("x") + (this.get("width") * transformOrigin[0]);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp args[2] = this.get("y") + (this.get("height") * transformOrigin[1]);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp val = key + "(" + this._transformArgs[key].toString() + ")";
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Updates the shape.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _draw
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp _draw: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Change event listener
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method _updateHandler
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Storage for translateX
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Storage for translateY
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Returns the bounds for a shape.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @method getBounds
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @return Object
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp sinRadians = parseFloat(parseFloat(Math.sin(absRot * radCon)).toFixed(8)),
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp cosRadians = parseFloat(parseFloat(Math.cos(absRot * radCon)).toFixed(8)),
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp x = (x + originalWidth * tox) - (sinRadians * (originalHeight * (1 - toy))) - (cosRadians * (originalWidth * tox));
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp y = (y + originalHeight * toy) - (sinRadians * (originalWidth * tox)) - (cosRadians * originalHeight * toy);
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * 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
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * fraction of the shape's corresponding bounding box dimension. The default value is [0.5, 0.5].
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute transformOrigin
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Array
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp valueFn: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * The rotation (in degrees) of the shape.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute rotation
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp return this._rotation;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Unique id for class instance.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute id
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type String
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp valueFn: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp return Y.guid();
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Indicates the x position of shape.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute x
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Indicates the y position of shape.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute y
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Indicates the width of the shape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute width
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Indicates the height of the shape
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute height
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Indicates whether the shape is visible.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute visible
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Boolean
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Contains information about the fill of the shape.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <dt>color</dt><dd>The color of the fill.</dd>
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <dt>type</dt><dd>Type of fill.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <dt>solid</dt><dd>Solid single color fill. (default)</dd>
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <dt>linear</dt><dd>Linear gradient fill.</dd>
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <dt>radial</dt><dd>Radial gradient fill.</dd>
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <p>If a gradient (linear or radial) is specified as the fill type. The following properties are used:
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <dt>stops</dt><dd>An array of objects containing the following properties:
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <dt>color</dt><dd></dd>
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <dt>opacity</dt><dd></dd>
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <dt>offset</dt><dd>Number between 0 and 1 indicating where the color stop is positioned.</dd>
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <dt></dt><dd></dd>
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <dt></dt><dd></dd>
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <dt></dt><dd></dd>
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute fill
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Object
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Contains information about the stroke of the shape.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <dt>color</dt><dd>The color of the stroke.</dd>
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <dt>weight</dt><dd>Number that indicates the width of the stroke.</dd>
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * <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
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * length of the dash. The second index indicates the length of gap.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute stroke
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Object
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp var tmpl = this.get("stroke") || this._getDefaultStroke();
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Indicates whether or not the instance will size itself based on its contents.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute autoSize
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Boolean
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Determines whether the instance will receive mouse events.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute pointerEvents
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type string
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp valueFn: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Performs a translate on the x-coordinate. When translating x and y coordinates,
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * use the <code>translate</code> method.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute translateX
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp return this._translateX;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Performs a translate on the y-coordinate. When translating x and y coordinates,
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * use the <code>translate</code> method.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute translateX
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp return this._translateY;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * The node used for gradient fills.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute gradientNode
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type HTMLElement
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp return this.node;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp return this._graphic;
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp //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
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Right edge of the path
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Top edge of the path
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Bottom edge of the path
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
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp SVGEllipse.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()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Horizontal radius for the ellipse.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute xRadius
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @readOnly
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Vertical radius for the ellipse.
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute yRadius
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type Number
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @readOnly
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Draws an circle
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp Y_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()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute width
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @readOnly
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute height
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @readOnly
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp getter: function()
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * Radius of the circle
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @attribute radius
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
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp * @type String
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());
09ae00ccf51dc05697a0d0f54341917314ab06d1Tripp}, '@VERSION@' ,{skinnable:false, requires:['graphics']});