--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/cm/media/js/lib/yui/yui_3.10.3/docs/graphics/index.html Tue Jul 16 14:29:46 2013 +0200
@@ -0,0 +1,820 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>Graphics</title>
+ <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic">
+ <link rel="stylesheet" href="../../build/cssgrids/cssgrids-min.css">
+ <link rel="stylesheet" href="../assets/css/main.css">
+ <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
+ <link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
+ <script src="../../build/yui/yui-min.js"></script>
+
+</head>
+<body>
+<!--
+<a href="https://github.com/yui/yui3"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
+-->
+<div id="doc">
+ <div id="hd">
+ <h1><img src="http://yuilibrary.com/img/yui-logo.png"></h1>
+ </div>
+
+ <a href="#toc" class="jump">Jump to Table of Contents</a>
+
+
+ <h1>Graphics</h1>
+ <div class="yui3-g">
+ <div class="yui3-u-3-4">
+ <div id="main">
+ <div class="content"><div class="intro" style="min-height: 184px;">
+ <p>
+ <img src="../assets/graphics/img/ship.png" alt="Screencapture of ship drawn with Graphics" style="border: 1px solid #bfbfbf; float:right; height:150px; margin: 0 0 8px 8px; width:275px;">
+ The Graphics module provides a JavaScript API for creating shapes in a variety of formats across a <a href="http://developer.yahoo.com/yui/articles/gbs">browser test baseline</a>. Based on device and browser capabilities, Graphics leverages SVG, HTML Canvas and VML to render its graphical elements.
+ </p>
+ <p>
+ The Graphics module features a <code>Graphic</code> class that allows you to easily create and manage shapes. Currently, a <code>Graphic</code> instance can be used to create predifined shapes and free-form polygons with fill and stroke properties.
+ </p>
+</div>
+<h2 id="getting-started">Getting Started</h2>
+
+<p>
+To include the source files for Graphics and its dependencies, first load
+the YUI seed file if you haven't already loaded it.
+</p>
+
+<pre class="code prettyprint"><script src="http://yui.yahooapis.com/3.10.3/build/yui/yui-min.js"></script></pre>
+
+
+<p>
+Next, create a new YUI instance for your application and populate it with the
+modules you need by specifying them as arguments to the <code>YUI().use()</code> method.
+YUI will automatically load any dependencies required by the modules you
+specify.
+</p>
+
+<pre class="code prettyprint"><script>
+// Create a new YUI instance and populate it with the required modules.
+YUI().use('graphics', function (Y) {
+ // Graphics is available and ready for use. Add implementation
+ // code here.
+});
+</script></pre>
+
+
+<p>
+For more information on creating YUI instances and on the
+<a href="http://yuilibrary.com/yui/docs/api/classes/YUI.html#method_use"><code>use()</code> method</a>, see the
+documentation for the <a href="../yui/index.html">YUI Global Object</a>.
+</p>
+
+
+<h2 id="using">Using the Graphics module</h2>
+
+<p>The <code>Graphic</code> class acts a factory and container for shapes. You need at least one <code>Graphic</code> instance to create shapes for your application.</p>
+
+<h3 id="instantiating">Instantiating A Graphic instance</h3>
+
+<p>All you need to instantiate a Graphic instance is an HTML element in which to render. Alternatively, you can attach your instance to the body of your page.</p>
+
+<h4 id="css">CSS</h4>
+<pre class="code prettyprint">#mygraphiccontainer {
+ width: 600px;
+ height: 400px;
+}</pre>
+
+<h4 id="html">HTML</h4>
+<pre class="code prettyprint"><div id="mygraphiccontainer"></div></pre>
+
+<h4 id="javascript">JavaScript</h4>
+<pre class="code prettyprint">// Instantiate a graphic instance
+var mygraphic = new Y.Graphic({
+ render: "#mygraphiccontainer"
+});</pre>
+
+
+ <p>By default, <code>Graphic</code> will size to its parent container. The API also provides the option of explicitly setting its <code>width</code> and <code>height</code> attributes. Additionally, the Graphic class provides an <code>autoSize</code> attribute. When set to true, the Graphic instance will expand to fit its contents.
+
+
+<h3 id="creating-shapes">Creating shapes</h3>
+<p>Shapes are created using the <code>addShape</code> method. The <code>addShape</code> method takes a config parameter that defines the shape and its properties. When creating a shape, the shape is determined by the <code>type</code>
+attribute. The <code>Graphics</code> module includes four pre-defined shapes. They can be created by passing a <code>String</code> reference.</p>
+<table>
+ <tr>
+ <th>key</th>
+ <th>shape</th>
+ </tr>
+ <tr>
+ <td>circle</td>
+ <td>Y.Circle</td>
+ </tr>
+ <tr>
+ <td>ellipse</td>
+ <td>Y.Ellipse</td>
+ </tr>
+ <tr>.
+ <td>rect</td>
+ <td>Y.Rect</td>
+ </tr>
+ <tr>
+ <td>path</td>
+ <td>Y.Path</td>
+ </tr>
+</table>
+
+<p>Alternatively, you can create your own custom class and pass it directly through the <code>type</code> attribute.</p>
+
+<p>The below code would create a 300x200 rectangle with a blue fill and a red border.</p>
+
+<pre class="code prettyprint">var mygraphic = new Y.Graphic({render:"#mygraphiccontainer"}),
+ myrect = mygraphic.addShape({
+ type: "rect",
+ width: 300,
+ height: 200,
+ fill: {
+ color: "#0000ff"
+ },
+ stroke: {
+ weight: 2,
+ color: "#ff0000"
+ },
+ x: 50,
+ y: 100
+ });</pre>
+
+<p>This code would create an instance of a custom shape that you have created.</p>
+<pre class="code prettyprint">var mygraphic = new Y.Graphic({render:"#mygraphiccontainer"}),
+ myrect = mygraphic.addShape({
+ type: Y.MyCustomShape,
+ width: 300,
+ height: 200,
+ fill: {
+ color: "#0000ff"
+ },
+ stroke: {
+ weight: 2,
+ color: "#ff0000"
+ },
+ x: 50,
+ y: 100
+ });</pre>
+
+<h3 id="path-drawing-tool">Path Drawing Tool</h3>
+<!-- doesn't contain the header because it may be h3 or h2 -->
+ <p>
+ <div style="float:right; margin: 6px 0 8px 8px;">
+ <a href="graphics-path-tool.html">
+ <img style="border: 1px solid #bfbfbf; height:149px; width:395px;" alt="Screen capture of Graphics path tool" src="../assets/graphics/img/path-tool-capture.png">
+
+ </a>
+ <div>
+ <a href="graphics-path-tool.html" class="button">Read More</a>
+ </div>
+ </div>
+ Try this simple <a href="graphics-path-tool.html">tool</a> that helps you by generating code while you interactively
+ draw graphic paths.
+ </p>
+ <p>
+ As you drag the pencil icon, corresponding graphics code is auto-generated.
+ This code can be copied and pasted into a graphics instance to reproduce
+ the paths you created with the pencil.
+ </p>
+ <p>
+ The <a href="graphics-violin.html">violin example</a> was created with this tool.
+ </p>
+
+
+<h3 id="aboutgraphic">Working with the Graphic Class</h3>
+<p>The <code>Graphics</code> module uses different technologies based on browser capabilities. The <code>Graphics</code> module normalizes these different technologies with a consistent API. Ideally, you should not
+have to interact directly with the underlying technologies or their corresponding HTML elements. Both the <code>Graphic</code> and <code>Shape</code> classes provide APIs for sizing, positioning and customization.</p>
+
+<h4 id="graphicattributes">Graphic Attributes</h4>
+
+<p>The <code>Graphic</code> class exposes the following attributes.</p>
+ <table>
+ <tr>
+ <th>Attribute</th>
+ <th>Type</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>id</code></td>
+ <td><code>String</code></td>
+ <td>Unique identifier for the <code>Graphic</code> instance. If not explicity set, one will be generated.</td></tr>
+ <tr>
+ <td><code>shapes</code></td>
+ <td><code>Object</code></td>
+ <td>Key value pairs containing all shape instances contained in the <code>Graphic</code> instance.</td>
+ </tr>
+ <tr>
+ <td><code>contentBounds</code></td>
+ <td><code>Object</code></td>
+ <td>Object containing size and coordinate data for the content of a Graphic in relation to the coordinate space of the <code>Graphic</code> instance. The following values are included: <code>top</code>, <code>right</code>, <code>bottom</code>, <code>left</code>, <code>width</code> and <code>height</code>.</td>
+ </tr>
+ <tr>
+ <td><code>node</code></td>
+ <td><code>HTMLElement</code></td>
+ <td>Outermost HTMLElement of the <code>Graphic</code> instance. (read-only)</td>
+ </tr>
+ <tr>
+ <td><code>width</code></td>
+ <td><code>Number</code></td>
+ <td>The width of the <code>Graphic</code> instance.</td>
+ </tr>
+ <tr>
+ <td><code>height</code></td>
+ <td><code>Number</code></td>
+ <td>The height of the <code>Graphic</code> instance.</td>
+ </tr>
+ <tr>
+ <td><code>autoSize</code></td>
+ <td><code>boolean</code></td>
+ <td>Determines the sizing of the graphic. See the <a href="http://yuilibrary.com/yui/docs/api/classes/Graphic.html#attr_autoSize">API Docs</a> for possible values and associated behaviors.</td>
+ </tr>
+ <tr>
+ <td><code>preserveAspectRatio</code></td>
+ <td><code>String</code></td>
+ <td> Determines how content is sized when <code>autoSize</code> is set to <code>sizeContentToGraphic</code>. See the <a href="http://yuilibrary.com/yui/docs/api/classes/Graphic.html#attr_preserveAspectRatio">API Docs</a> for possible values.</td>
+ </tr>
+ <tr>
+ <td><code>resizeDown</code></td>
+ <td><code>boolean</code></td>
+ <td>The <code>contentBounds</code> will resize to greater values but not to smaller values. (for performance) When resizing the <code>contentBounds</code> down is desirable, set the resizeDown value to true. The default value is false.</td>
+ </tr>
+ <tr>
+ <td><code>x</code></td>
+ <td><code>Number</code></td>
+ <td>Indicates the x-coordinate for the instance.</td>
+ </tr>
+ <tr>
+ <td><code>y</code></td>
+ <td><code>Number</code></td>
+ <td>Indicates the y-coordinate for the instance.</td>
+ </tr>
+ <tr>
+ <td><code>autoDraw</code></td>
+ <td><code>boolean</code></td>
+ <td>Indicates whether or not the instance will automatically redraw after a change is made to a shape. When performing multiple operations, such adding many shapes, <code>autoDraw</code> can be set to false. Calling <code>_redraw</code> will force a redraw when <code>autoDraw</code> is <code>false</code>.</td>
+ </tr>
+ <tr>
+ <td><code>visible</code></td>
+ <td><code>boolean</code></td>
+ <td>Toggles visibility for a <code>Graphic</code> instance.</td>
+ </tr>
+ </table>
+
+<h4 id="graphicmethods">Graphic Methods</h4>
+
+<p>The <code>Graphic</code> class also has the following public methods.</p>
+ <table>
+ <tr>
+ <th><code>Method</code></th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>getXY</td>
+ <td>Returns an array containing the current position of the graphic instance in page coordinates.</td>
+ </tr>
+ <tr>
+ <td>addShape</td>
+ <td>Generates and returns a shape instance by type.</td>
+ </tr>
+ <tr>
+ <td>removeShape</td>
+ <td>Removes a shape instance from from the graphic instance.</td>
+ </tr>
+ <tr>
+ <td>removeAllShapes</td>
+ <td>Removes all shape instances</td>
+ </tr>
+ <tr>
+ <td>destroy</td>
+ <td>Destroys the graphic instance and all its children.</td>
+ </tr>
+ <tr>
+ <td>getShapeById</td>
+ <td>Returns a shape instance based on an id.</td>
+ </tr>
+ <tr>
+ <td>batch</td>
+ <td>Allows for creating multiple shapes in order to batch appending and redraw operations.</td>
+ </tr>
+ </table>
+
+<h3 id="aboutshapes">Working with Shapes</h3>
+
+<h4 id="shapeattributes">Shape Attributes</h4>
+
+<p>Each shape shares a common set of attributes. Attributes shared across all shapes are listed below:</p>
+
+ <table>
+ <tr>
+ <th>Attribute</th>
+ <th>Type</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>id</code></td>
+ <td><code>String</code></td>
+ <td>Unique identifier for the <code>Shape</code> instance. If not explicity set, one will be generated.</td></tr>
+ </tr>
+ <tr>
+ <td><code>node</code></td>
+ <td><code>HTMLElement</code></td>
+ <td>HTMLElement of the <code>Shape</code> instance. (read-only)</td>
+ </tr>
+ <tr>
+ <td><code>data</code></td>
+ <td><code>String</code></td>
+ <td>Represents an SVG Path string. This will be parsed and added to shape's API to represent the SVG data across all implementations. Note that when using VML or SVG implementations, part of this content will be added to the DOM using respective VML/SVG attributes. If your content comes from an untrusted source, you will need to ensure that no malicious code is included in that content.
+ </tr>
+ <tr>
+ <td><code>x</code></td>
+ <td><code>Number</code></td>
+ <td>The x-coordinate of the shape.</td>
+ </tr>
+ <tr>
+ <td><code>y</code></td>
+ <td><code>Number</code></td>
+ <td>The y-coordinate of the shape.</td>
+ </tr>
+ <tr>
+ <td><code>width</code></td>
+ <td><code>Number</code></td>
+ <td>The width of the <code>Shape</code> instance.</td>
+ </tr>
+ <tr>
+ <td><code>height</code></td>
+ <td><code>Number</code></td>
+ <td>The height of the <code>Shape</code> instance.</td>
+ </tr>
+ <tr>
+ <td><code>visible</code></td>
+ <td><code>boolean</code></td>
+ <td>Toggles visibility for a <code>Shape</code> instance.</td>
+ </tr>
+ <tr>
+ <td><code>fill</code></td>
+ <td><code>Object</code></td>
+ <td>
+ Contains information about the fill of the shape.
+ </td>
+ </tr>
+ <tr>
+ <td>stroke</td>
+ <td><code>Object</code></td>
+ <td>
+ Contains information about the stroke of the shape.
+ </td>
+ </tr>
+ <tr>
+ <td><code>transformOrigin</code></td>
+ <td><code>Array</code></td>
+ <td>The x and y values for the transformOrigin of a transform.</td>
+ </tr>
+ <tr>
+ <td><code>transform</code></td>
+ <td><code>String</code></td>
+ <td>A string containing, in order, transform operations applied to the shape instance. The <code>transform</code> string can contain the following values:
+ <dl>
+ <dt>rotate</dt><dd>Rotates the shape clockwise around it transformOrigin.</dd>
+ <dt>translate</dt><dd>Specifies a 2d translation.</dd>
+ <dt>skew</dt><dd>Skews the shape around the x-axis and y-axis.</dd>
+ <dt>scale</dt><dd>Specifies a 2d scaling operation.</dd>
+ <dt>translateX</dt><dd>Translates the shape along the x-axis.</dd>
+ <dt>translateY</dt><dd>Translates the shape along the y-axis.</dd>
+ <dt>skewX</dt><dd>Skews the shape around the x-axis.</dd>
+ <dt>skewY</dt><dd>Skews the shape around the y-axis.</dd>
+ </dl>
+ Applying transforms through the transform attribute will reset the transform matrix and apply a new transform. The shape class also contains corresponding methods for each transform
+ that will apply the transform to the current matrix. The below code illustrates how you might use the <code>transform</code> attribute to instantiate a recangle with a rotation of 45 degrees.
+<pre class="code prettyprint">var myRect = new Y.Rect({
+ type:"rect",
+ width: 50,
+ height: 40,
+ transform: "rotate(45)"
+};</pre>
+
+ The code below would apply <code>translate</code> and <code>rotate</code> to an existing shape.</p>
+<pre class="code prettyprint">myRect.set("transform", "translate(40, 50) rotate(45)");</pre>
+
+ </td>
+ </tr>
+ </table>
+
+<h4 id="shapemethods">Shape Methods</h4>
+
+<p>Shapes can also be manipulated by the following methods:</p>
+<table>
+ <tr>
+ <th>Method</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>addClass</code></td>
+ <td>Adds a class to the underlying HTMLElement.</td>
+ </tr>
+ <tr>
+ <td><code>removeClass</code></td>
+ <td>Removes a class to the underlying HTMLElement.</td>
+ </tr>
+ <tr>
+ <td><code>getXY</code></td>
+ <td>Gets the current position of the shape in page coordinates. Returns an array, <code>[x, y,]</code>, with the coordinates.</td>
+ </tr>
+ <tr>
+ <td><code>setXY</code></td>
+ <td>Sets the current position of the shape in page coordinates. Accepts an array, <code>[x, y]</code>, with the coordinates.</td>
+ </tr>
+ <tr>
+ <td><code>get</code></td>
+ <td>Returns the value of a given attribute.</td>
+ </tr>
+ <tr>
+ <td><code>set</code></td>
+ <td>Sets the value of an attribute.</td>
+ </tr>
+ <tr>
+ <td><code>rotate</code></td>
+ <td>Rotates the shape clockwise around it <code>transformOrigin</code>.</td>
+ </tr>
+ <tr>
+ <td><code>translate</code></td>
+ <td>Specifies a 2d translation.</td>
+ </tr>
+ <tr>
+ <td><code>translateX</code></td>
+ <td>Translates the shape along the x-axis.</td>
+ </tr>
+ <tr>
+ <td><code>translateY</code></td>
+ <td>Translates the shape along the y-axis.</td>
+ </tr>
+ <tr>
+ <td><code>skew</code></td>
+ <td>Skews the shape around the x-axis and y-axis.</td>
+ </tr>
+ <tr>
+ <td><code>skewX</code></td>
+ <td>Skews the shape around the x-axis.</td>
+ </tr>
+ <tr>
+ <td><code>skewY</code></td>
+ <td>Skews the shape around the y-axis.</td>
+ </tr>
+ <tr>
+ <td><code>scale</code></td>
+ <td>Specifies a 2d scaling operation.</td>
+ </tr>
+</table>
+
+<h4 id="drawingmethods">Drawing Methods</h4>
+
+<p>Unlike the other included shapes, the <code>Path</code> class is not pre-defined. Setting the size, fill and/or stroke of a pre-defined shape will render the shape. This is not true with the <code>Path</code>. To render
+a <code>Path</code> instance, its drawing methods need to be leveraged. These drawing methods can also be leveraged when creating custom shapes. Available drawing methods include:
+<dl>
+ <dt>moveTo</dt><dd>Moves to a coordinate point without drawing a line.</dd>
+ <dt>lineTo</dt><dd>Draws a line segment from the current point to the specified point.</dd>
+ <dt>curveTo</dt><dd>Draws a curve based on a start point, end point and two control points.</dd>
+ <dt>quadraticCurveTo</dt><dd>Draws a quadratic curve based on a start point, end point and two control points.</dd>
+ <dt>end</dt><dd>Ends a drawing operation. The path or custom shape will draw after end is called.</dd>
+ <dt>clear</dt><dd>Clears all contents of a path or custom shape.</dd>
+</dl>
+</p>
+
+<h4 id="strokesandfills">Strokes and Fills</h4>
+
+<p>All <code>Shape</code> instances contain <code>stroke</code> and <code>fill</code> attributes. They are used to define the colors for a <code>Shape</code>.</p>
+
+<h5 id="definingstrokes">Defining a Stroke</h5>
+<p>The <code>stroke</code> attribute has six properties.</p>
+ <dl>
+ <dt>color</dt><dd>The color of the stroke.</dd>
+ <dt>weight</dt><dd>Number that indicates the width of the stroke.</dd>
+ <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>
+ <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
+ length of the dash. The second index indicates the length of gap.
+ <dt>linecap</dt><dd>Specifies the linecap for the stroke. The following values can be specified:
+ <dl>
+ <dt>butt (default)</dt><dd>Specifies a butt linecap.</dd>
+ <dt>square</dt><dd>Specifies a sqare linecap.</dd>
+ <dt>round</dt><dd>Specifies a round linecap.</dd>
+ </dl>
+ </dd>
+ <dt>linejoin</dt><dd>Specifies a linejoin for the stroke. The following values can be specified:
+ <dl>
+ <dt>round (default)</dt><dd>Specifies that the linejoin will be round.</dd>
+ <dt>bevel</dt><dd>Specifies a bevel for the linejoin.</dd>
+ <dt>miter limit</dt><dd>An integer specifying the miter limit of a miter linejoin. If you want to specify a linejoin of miter, you simply specify the limit as opposed to having
+ separate miter and miter limit values.</dd>
+ </dl>
+ </dd>
+ </dl>
+<p>The code below would set a 2 pixel solid red stroke on <code>myshape</code>.</p>
+<pre class="code prettyprint">myshape.set("stroke", {
+ color: "#ff0000",
+ weight: 2
+});</pre>
+
+<p>The <code>dashstyle</code> property can be used to create a dashed stroke on a shape.</p>
+<pre class="code prettyprint">myshape.set("stroke", {
+ color: "#ff0000",
+ weight: 2,
+ dashstyle: [3, 2]
+});</pre>
+
+
+<h5 id="definingfills">Defining a Fill</h5>
+<p>The <code>fill</code> attribute has the following properties.</p>
+ <dl>
+ <dt>color</dt><dd>The color of the fill.</dd>
+ <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>
+ <dt>type</dt><dd>Type of fill.
+ <dl>
+ <dt>solid</dt><dd>Solid single color fill. (default)</dd>
+ <dt>linear</dt><dd>Linear gradient fill.</dd>
+ <dt>radial</dt><dd>Radial gradient fill.</dd>
+ </dl>
+ </dd>
+ </dl>
+
+<p>If a <code>linear</code> or <code>radial</code> is specified as the fill type. The following additional property is used:
+ <dl>
+ <dt>stops</dt><dd>An array of objects containing the following properties:
+ <dl>
+ <dt>color</dt><dd>The color of the stop.</dd>
+ <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>
+ <dt>offset</dt><dd>Number between 0 and 1 indicating where the color stop is positioned.</dd>
+ </dl>
+ </dd>
+ <p>Linear gradients also have the following property:</p>
+ <dt>rotation</dt><dd>Linear gradients flow left to right by default. The rotation property allows you to change the flow by rotation. (e.g. A rotation of 180 would make the gradient pain from right to left.)</dd>
+
+ <p>Radial gradients have the following additional properties:</p>
+ <dt>r</dt><dd>Radius of the gradient circle.</dd>
+ <dt>fx</dt><dd>Focal point x-coordinate of the gradient.</dd>
+ <dt>fy</dt><dd>Focal point y-coordinate of the gradient.</dd>
+ <dt>cx</dt><dd>The x-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.
+ <p><strong>Note: </strong>This property currently has no effect on Android or IE 6 - 8.</p>
+ </dd>
+ <dt>cy</dt><dd>The y-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.
+ <p><strong>Note: </strong>This property currently has no effect on Android or IE 6 - 8.</p>
+ </dd>
+ </dl>
+<h3 id="radial-gradient-tool">Radial Gradient Tool</h3>
+<!-- doesn't contain the header because it may be h3 or h2 -->
+ <p>
+ Try this simple <a href="graphics-radial-tool.html">tool</a> that helps
+ you interactively preview radial gradient fills.
+ <a href="graphics-radial-tool.html">
+ <img style="border: 1px solid #bfbfbf; height:265px; width:645px;" alt="Screen capture of Graphics radial gradient tool" src="../assets/graphics/img/radial_tool_capture.png">
+ </a>
+ <br><a href="graphics-radial-tool.html" class="button">Try It</a>
+
+ </p>
+ <p>
+ Avoid the trial and error, quickly get just the look you want.
+ As you drag and resize different parts of the control, you preview
+ the radial gradient fill and see its property values update.
+ Click the "Get Code Snippet" button for code you can paste into a
+ Graphics instance to reproduce the same gradient.
+ </p>
+
+
+<h2 id="issues">Known Issues</h2>
+<ul class="spaced">
+ <li>
+ <p>Gradients need more need more normalization across technologies. Certain gradient types have limitations on different browsers.
+ </p>
+ <ul>
+ <li>Radial gradients contain the properties <code>cx</code> and <code>cy</code>. These properties currently have no impact on Android or IE 6 - 8.</li>
+ <li>After being initially set, gradients cannot be updated in IE 6 - 8.</li>
+ </ul>
+ </li>
+ <li>
+ <p>Path element currently lacks the ability to have interactivity in Android.</p>
+ </li>
+</ul>
+</div>
+ </div>
+ </div>
+
+ <div class="yui3-u-1-4">
+ <div class="sidebar">
+
+ <div id="toc" class="sidebox">
+ <div class="hd">
+ <h2 class="no-toc">Table of Contents</h2>
+ </div>
+
+ <div class="bd">
+ <ul class="toc">
+<li>
+<a href="#getting-started">Getting Started</a>
+</li>
+<li>
+<a href="#using">Using the Graphics module</a>
+<ul class="toc">
+<li>
+<a href="#instantiating">Instantiating A Graphic instance</a>
+<ul class="toc">
+<li>
+<a href="#css">CSS</a>
+</li>
+<li>
+<a href="#html">HTML</a>
+</li>
+<li>
+<a href="#javascript">JavaScript</a>
+</li>
+</ul>
+</li>
+<li>
+<a href="#creating-shapes">Creating shapes</a>
+</li>
+<li>
+<a href="#path-drawing-tool">Path Drawing Tool</a>
+</li>
+<li>
+<a href="#aboutgraphic">Working with the Graphic Class</a>
+<ul class="toc">
+<li>
+<a href="#graphicattributes">Graphic Attributes</a>
+</li>
+<li>
+<a href="#graphicmethods">Graphic Methods</a>
+</li>
+</ul>
+</li>
+<li>
+<a href="#aboutshapes">Working with Shapes</a>
+<ul class="toc">
+<li>
+<a href="#shapeattributes">Shape Attributes</a>
+</li>
+<li>
+<a href="#shapemethods">Shape Methods</a>
+</li>
+<li>
+<a href="#drawingmethods">Drawing Methods</a>
+</li>
+<li>
+<a href="#strokesandfills">Strokes and Fills</a>
+<ul class="toc">
+<li>
+<a href="#definingstrokes">Defining a Stroke</a>
+</li>
+<li>
+<a href="#definingfills">Defining a Fill</a>
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>
+<a href="#radial-gradient-tool">Radial Gradient Tool</a>
+</li>
+</ul>
+</li>
+<li>
+<a href="#issues">Known Issues</a>
+</li>
+</ul>
+ </div>
+ </div>
+
+
+
+ <div class="sidebox">
+ <div class="hd">
+ <h2 class="no-toc">Examples</h2>
+ </div>
+
+ <div class="bd">
+ <ul class="examples">
+
+
+ <li data-description="Shows how to create a Graphic instance and add shapes.">
+ <a href="graphics-simple.html">Basic Graphics Implementation</a>
+ </li>
+
+
+
+ <li data-description="Shows how to draw lines and polygons.">
+ <a href="graphics-path.html">Basic Path</a>
+ </li>
+
+
+
+ <li data-description="Shows how to create linear and radial gradient fills.">
+ <a href="graphics-gradients.html">Create Gradient Fills</a>
+ </li>
+
+
+
+ <li data-description="Shows how to add drag to a shape.">
+ <a href="graphics-drag.html">Basic drag with graphic object</a>
+ </li>
+
+
+
+ <li data-description="Shows how to apply transforms to shape.">
+ <a href="graphics-transforms.html">Using Transforms</a>
+ </li>
+
+
+
+ <li data-description="Shows how to use a custom shape with the Graphics module.">
+ <a href="graphics-customshape.html">Custom Shape</a>
+ </li>
+
+
+
+ <li data-description="Shows to use the graphics api to draw a realistic glass.">
+ <a href="graphics-muddyglass.html">Transparent Glass with Shadow</a>
+ </li>
+
+
+
+ <li data-description="Shows to use the graphics api to draw a violin.">
+ <a href="graphics-violin.html">Complex Drawing: Violin</a>
+ </li>
+
+
+
+
+ </ul>
+ </div>
+ </div>
+
+
+
+ <div class="sidebox">
+ <div class="hd">
+ <h2 class="no-toc">Examples That Use This Component</h2>
+ </div>
+
+ <div class="bd">
+ <ul class="examples">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li data-description="This example demonstrates animating an element along a curved path using bezier control points.">
+ <a href="../anim/curve.html">Animating Along a Curved Path</a>
+ </li>
+
+
+ </ul>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+</div>
+
+<script src="../assets/vendor/prettify/prettify-min.js"></script>
+<script>prettyPrint();</script>
+
+<script>
+YUI.Env.Tests = {
+ examples: [],
+ project: '../assets',
+ assets: '../assets/graphics',
+ name: 'graphics',
+ title: 'Graphics',
+ newWindow: '',
+ auto: false
+};
+YUI.Env.Tests.examples.push('graphics-simple');
+YUI.Env.Tests.examples.push('graphics-path');
+YUI.Env.Tests.examples.push('graphics-gradients');
+YUI.Env.Tests.examples.push('graphics-drag');
+YUI.Env.Tests.examples.push('graphics-transforms');
+YUI.Env.Tests.examples.push('graphics-customshape');
+YUI.Env.Tests.examples.push('graphics-muddyglass');
+YUI.Env.Tests.examples.push('graphics-violin');
+YUI.Env.Tests.examples.push('curve');
+
+</script>
+<script src="../assets/yui/test-runner.js"></script>
+
+
+
+</body>
+</html>