diff -r 322d0feea350 -r 89ef5ed3c48b src/cm/media/js/lib/yui/yui_3.10.3/api/classes/SVGGraphic.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/cm/media/js/lib/yui/yui_3.10.3/api/classes/SVGGraphic.html Tue Jul 16 14:29:46 2013 +0200 @@ -0,0 +1,4750 @@ + + + + + SVGGraphic - YUI 3 + + + + + + + + +
+
+
+ +

+ +
+
+ API Docs for: 3.10.3 +
+
+
+ +
+ +
+
+
+ Show: + + + + + + + +
+ + +
+
+
+

SVGGraphic Class

+
+ + + + + +
+ Defined in: graphics/js/SVGGraphic.js:1 +
+ + + + + Module: graphics + + + + +
+ + + +
+

SVG implementation of the Graphic class. +SVGGraphic is not intended to be used directly. Instead, use the Graphic class. +If the browser has SVG capabilities, the Graphic +class will point to the SVGGraphic class.

+
+ + + +
+ + +
+
+

Item Index

+ + +
+

Methods

+ + +
+ + + +
+

Properties

+ + +
+ + + +
+

Attributes

+ + +
+ + + +
+ + +
+

Methods

+ + +
+

_appendShape

+ + +
+ (
    + +
  • + + shape + +
  • + +
) +
+ + + + + + + + private + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:449 + +

+ + + + + +
+ +
+

Adds a shape instance to the graphic instance.

+
+ + +
+

Parameters:

+ +
    + +
  • + + shape + Shape + + + + +
    +

    The shape instance to be added to the graphic.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

_createGraphicNode

+ + +
+ (
    + +
  • + + type + +
  • + +
  • + + pe + +
  • + +
) +
+ + + + + + + + + + + + private + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:811 + +

+ + + + + +
+ +
+

Creates a graphic node

+
+ + +
+

Parameters:

+ +
    + +
  • + + type + String + + + + +
    +

    node type to create

    +
    + + +
  • + +
  • + + pe + String + + + + +
    +

    specified pointer-events value

    +
    + + +
  • + +
+
+ + + +
+

Returns:

+ +
+ + + HTMLElement + +
+
+ + + +
+ + +
+

_createGraphics

+ + + () + + + + + + + + private + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:793 + +

+ + + + + +
+ +
+

Creates a contentNode element

+
+ + + + + + +
+ + +
+

_getDocFrag

+ + + () + + + + + + + + + + + + private + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:638 + +

+ + + + + +
+ +
+

Returns a document fragment to for attaching shapes.

+
+ + + + +
+

Returns:

+ +
+ + + DocumentFragment + +
+
+ + + +
+ + +
+

_getShapeClass

+ + +
+ (
    + +
  • + + val + +
  • + +
) +
+ + + + + + + + + + + + private + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:578 + +

+ + + + + +
+ +
+

Returns a shape class. Used by addShape.

+
+ + +
+

Parameters:

+ +
    + +
  • + + val + Shape | String + + + + +
    +

    Indicates which shape class.

    +
    + + +
  • + +
+
+ + + +
+

Returns:

+ +
+ + + Function + +
+
+ + + +
+ + +
+

_getUpdatedContentBounds

+ + + () + + + + + Object + + + + + + + private + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:759 + +

+ + + + + +
+ +
+

Recalculates and returns the contentBounds for the Graphic instance.

+
+ + + + +
+

Returns:

+ +
+ + + Object: + + +
+
+ + + +
+ + +
+

_redraw

+ + + () + + + + + + + + private + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:654 + +

+ + + + + +
+ +
+

Redraws all shapes.

+
+ + + + + + +
+ + +
+

_removeChildren

+ + +
+ (
    + +
  • + + node + +
  • + +
) +
+ + + + + + + + private + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:516 + +

+ + + + + +
+ +
+

Removes all child nodes.

+
+ + +
+

Parameters:

+ + +
+ + + + + +
+ + +
+

_toBack

+ + +
+ (
    + +
  • + + Shape + +
  • + +
) +
+ + + + + + + + private + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:889 + +

+ + + + + +
+ +
+

Inserts shape as the first child of the content node.

+
+ + +
+

Parameters:

+ +
    + +
  • + + Shape + SVGShape + + + + +
    +

    to add.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

_toFront

+ + +
+ (
    + +
  • + + Shape + +
  • + +
) +
+ + + + + + + + private + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:869 + +

+ + + + + +
+ +
+

Inserts shape on the top of the tree.

+
+ + +
+

Parameters:

+ +
    + +
  • + + Shape + SVGShape + + + + +
    +

    to add.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

_toggleVisible

+ + +
+ (
    + +
  • + + val + +
  • + +
) +
+ + + + + + + + private + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:546 + +

+ + + + + +
+ +
+

Toggles visibility

+
+ + +
+

Parameters:

+ +
    + +
  • + + val + Boolean + + + + +
    +

    indicates visibilitye

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

addShape

+ + +
+ (
    + +
  • + + cfg + +
  • + +
) +
+ + + + + + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:429 + +

+ + + + + +
+ +
+

Generates a shape instance by type.

+
+ + +
+

Parameters:

+ +
    + +
  • + + cfg + Object + + + + +
    +

    attributes for the shape

    +
    + + +
  • + +
+
+ + + +
+

Returns:

+ +
+ + + Shape + +
+
+ + + +
+ + +
+

addToRedrawQueue

+ + +
+ (
    + +
  • + + shape + +
  • + +
) +
+ + + + + + + + protected + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:728 + +

+ + + + + +
+ +
+

Adds a shape to the redraw queue and calculates the contentBounds. Used internally +by Shape instances.

+
+ + +
+

Parameters:

+ +
    + +
  • + + shape + SVGShape + + + + +
    + +
    + + +
  • + +
+
+ + + + + +
+ + +
+

batch

+ + +
+ (
    + +
  • + + method + +
  • + +
) +
+ + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:624 + +

+ + + + + +
+ +
+

Allows for creating multiple shapes in order to batch appending and redraw operations.

+
+ + +
+

Parameters:

+ +
    + +
  • + + method + Function + + + + +
    +

    Method to execute.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

clear

+ + + () + + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:537 + +

+ + + + + +
+ +
+

Clears the graphics object.

+
+ + + + + + +
+ + +
+

destroy

+ + + () + + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:404 + +

+ + + + + +
+ +
+

Removes all nodes.

+
+ + + + + + +
+ + +
+

getGradientNode

+ + +
+ (
    + +
  • + + key + +
  • + +
  • + + type + +
  • + +
) +
+ + + + + + + + + + + + protected + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:831 + +

+ + + + + +
+ +
+

Returns a reference to a gradient definition based on an id and type.

+
+ + +
+

Parameters:

+ +
    + +
  • + + key + String + + + + +
    +

    id that references the gradient definition

    +
    + + +
  • + +
  • + + type + String + + + + +
    +

    description of the gradient type

    +
    + + +
  • + +
+
+ + + +
+

Returns:

+ +
+ + + HTMLElement + +
+
+ + + +
+ + +
+

getShapeById

+ + +
+ (
    + +
  • + + id + +
  • + +
) +
+ + + + + + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:611 + +

+ + + + + +
+ +
+

Returns a shape based on the id of its dom node.

+
+ + +
+

Parameters:

+ +
    + +
  • + + id + String + + + + +
    +

    Dom id of the shape's node attribute.

    +
    + + +
  • + +
+
+ + + +
+

Returns:

+ +
+ + + Shape + +
+
+ + + +
+ + +
+

getXY

+ + + () + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:337 + +

+ + + + + +
+ +
+

Gets the current position of the graphic instance in page coordinates.

+
+ + + + +
+

Returns:

+ +
+ + + Array The XY position of the shape. + +
+
+ + + +
+ + +
+

initializer

+ + + () + + + + + + + + private + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:354 + +

+ + + + + +
+ +
+

Initializes the class.

+
+ + + + + + +
+ + +
+

removeAllShapes

+ + + () + + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:497 + +

+ + + + + +
+ +
+

Removes all shape instances from the dom.

+
+ + + + + + +
+ + +
+

removeShape

+ + +
+ (
    + +
  • + + shape + +
  • + +
) +
+ + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:470 + +

+ + + + + +
+ +
+

Removes a shape instance from from the graphic instance.

+
+ + +
+

Parameters:

+ +
    + +
  • + + shape + Shape | String + + + + +
    +

    The instance or id of the shape to be removed.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

render

+ + +
+ (
    + +
  • + + parentNode + +
  • + +
) +
+ + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:386 + +

+ + + + + +
+ +
+

Adds the graphics node to the dom.

+
+ + +
+

Parameters:

+ +
    + +
  • + + parentNode + HTMLElement + + + + +
    +

    node in which to render the graphics node into.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+

set

+ + +
+ (
    + +
  • + + name + +
  • + +
  • + + value + +
  • + +
) +
+ + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:273 + +

+ + + + + +
+ +
+

Sets the value of an attribute.

+
+ + +
+

Parameters:

+ +
    + +
  • + + name + String | Object + + + + +
    +

    The name of the attribute. Alternatively, an object of key value pairs can +be passed in to set multiple attributes at once.

    +
    + + +
  • + +
  • + + value + Any + + + + +
    +

    The value to set the attribute to. This value is ignored if an object is received as +the name param.

    +
    + + +
  • + +
+
+ + + + + +
+ + +
+ + + +
+

Properties

+ + +
+

_shapeClass

+ Object + + + + + private + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:596 + +

+ + + + +
+ +
+

Look up for shape classes. Used by addShape to retrieve a class for instantiation.

+
+ + + + + + +
+ + +
+

_x

+ Number + + + + + private + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:319 + +

+ + + + +
+ +
+

Storage for x attribute.

+
+ + + + + + +
+ + +
+

_y

+ Number + + + + + private + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:328 + +

+ + + + +
+ +
+

Storage for y attribute.

+
+ + + + + + +
+ + +
+ + + +
+

Attributes

+ + +
+ +

autoDraw

+ Boolean + + + + + private + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:238 + +

+ + + + +
+ +
+

Indicates whether or not the instance will automatically redraw after a change is made to a shape. +This property will get set to false when batching operations.

+
+ + +

Default: true

+ + + + + +
+ + +
+ +

autoSize

+ Boolean | String + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:132 + +

+ + + + +
+ +
+

Determines the sizing of the Graphic.

+ +
+
sizeContentToGraphic
The Graphic's width and height attributes are, either explicitly set through the + width and height attributes or are determined by the dimensions of the parent element. The + content contained in the Graphic will be sized to fit with in the Graphic instance's dimensions. When using this + setting, the preserveAspectRatio attribute will determine how the contents are sized.
+
sizeGraphicToContent
(Also accepts a value of true) The Graphic's width and height are determined by the + size and positioning of the content.
+
false
The Graphic's width and height attributes are, either explicitly set through the width + and height attributes or are determined by the dimensions of the parent element. The contents of the + Graphic instance are not affected by this setting.
+
+
+ + +

Default: false

+ + + + + +
+ + +
+ +

contentBounds

+ Object + + + + + + + + + + + + + + + readonly + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:66 + +

+ + + + +
+ +
+

Object containing size and coordinate data for the content of a Graphic in relation to the coordSpace node.

+
+ + + + + + +
+ + +
+ +

height

+ Number + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:115 + +

+ + + + +
+ +
+

Indicates the height of the Graphic.

+
+ + + + + + +
+ + +
+ +

id

+ String + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:27 + +

+ + + + +
+ +
+

Unique id for class instance.

+
+ + + + + + +
+ + +
+ +

node

+ HTMLElement + + + + + + + + + + + + + + + readonly + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:82 + +

+ + + + +
+ +
+

The html element that represents to coordinate system of the Graphic instance.

+
+ + + + + + +
+ + +
+ +

preserveAspectRatio

+ String + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:156 + +

+ + + + +
+ +
+

Determines how content is sized when autoSize is set to sizeContentToGraphic.

+ +

+
none
Do not force uniform scaling. Scale the graphic content of the given element non-uniformly if necessary + such that the element's bounding box exactly matches the viewport rectangle.
+
xMinYMin
Force uniform scaling position along the top left of the Graphic's node.
+
xMidYMin
Force uniform scaling horizontally centered and positioned at the top of the Graphic's node.
+
xMaxYMin
Force uniform scaling positioned horizontally from the right and vertically from the top.
+
xMinYMid
Force uniform scaling positioned horizontally from the left and vertically centered. +
xMidYMid (the default)
Force uniform scaling with the content centered.
+
xMaxYMid
Force uniform scaling positioned horizontally from the right and vertically centered.
+
xMinYMax
Force uniform scaling positioned horizontally from the left and vertically from the bottom.
+
xMidYMax
Force uniform scaling horizontally centered and position vertically from the bottom.
+
xMaxYMax
Force uniform scaling positioned horizontally from the right and vertically from the bottom.
+

+
+ + +

Default: xMidYMid

+ + + + + +
+ + +
+ +

render

+ Node | String + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:18 + +

+ + + + +
+ +
+

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.

+
+ + + + + + +
+ + +
+ +

resizeDown

+ Boolean + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:181 + +

+ + + + +
+ +
+

The contentBounds will resize to greater values but not to smaller values. (for performance) +When resizing the contentBounds down is desirable, set the resizeDown value to true.

+
+ + + + + + +
+ + +
+ +

shapes

+ Object + + + + + + + + + + + + + + + readonly + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:50 + +

+ + + + +
+ +
+

Key value pairs in which a shape instance is associated with its id.

+
+ + + + + + +
+ + +
+ +

width

+ Number + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:98 + +

+ + + + +
+ +
+

Indicates the width of the Graphic.

+
+ + + + + + +
+ + +
+ +

x

+ Number + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:192 + +

+ + + + +
+ +
+

Indicates the x-coordinate for the instance.

+
+ + + + + + +
+ + +
+ +

y

+ Number + + + + + + + + + + + + + + + +
+ + + +

+ + Defined in + + + + + graphics/js/SVGGraphic.js:215 + +

+ + + + +
+ +
+

Indicates the y-coordinate for the instance.

+
+ + + + + + +
+ + +
+ + + +
+
+ +
+
+
+
+
+
+ + + + + + + + + +