JSignage:Circle

From SpinetiX Support Wiki

Jump to: navigation, search

.circle()

$.circle( attributes );

Returns: jSignage Object

Description

Draws a circular shape based on a center point and a radius. The shape can be filled and can have an outline. See the circle element in the SVG specification for reference.

Parameters

  • attributes
    Type: Plain Object.
    Contains the circle attributes.

Attributes

The following attributes can be specified:

  • cx, cy
    Type: Number. Default: 0.
    Specifies the x and y coordinates of the center of the circle.
  • r
    Type: Number. Default: 0.
    Specifies the radius of the circle.

Examples

Circle1.png
// draw a red circle and add it to the document
$.circle( { cx: 640, cy: 360, r: 200, fill:'red' }).addTo('svg');


Circle2.png
// draw a red-stroked transparent circle and add it to the document
$.circle( { cx: 640, cy: 360, r: 200, fill:'none', stroke:'red', strokeWidth: '20' }).addTo('svg');


Circle3.png
// draw a transparent circle with a green dashed outline and add it to the document
$.circle( { cx: 640, cy: 360, r: 200, fill:'none', stroke:'green', strokeWidth: '20', 
            strokeDashArray:'30' 
}).addTo('svg');


// draw a circle and add it to the document
var c = $.circle( { cx: 640, cy: 360, r: 200 }).addTo('svg');

// animate the fill color from blue to red during 10 seconds
c.animateColor( 'fill', { from: 'blue', to: 'red', begin: 1, dur: 10, repeatCount: 'indefinite' } );
This page was last modified on 20 August 2014, at 11:52.