Circle
A circle shape.
options OptionsStore
The configuration of this element.
Constructors
Circle (geometry: Circle, options?: ShapeOptions)
Creates a new Circle instance with the specified configuration.
Parameters
geometry Circle
The geometric object that defines the circle center and radius.
options? ShapeOptions
The configuration options.
Methods
bbox
Returns the bounding box of the element with applied transformations.
Returns
Rect - The bounding box of the element with transformations applied.
className
Gets the class attribute of the element. The class will be rendered only for SVG output.
Returns
string the value of the class
attribute of the element.
className
Sets the class attribute of the element. The class will be rendered only for SVG output.
Parameters
className string
The value of the class attribute.
clip
Gets the clipping path for this element.
Returns
Path - The clipping path for this element.
clip
Sets the clipping path for this element. The Path instance will be monitored for changes. Can be replaced by calling the clip
method.
The following example demonstrates how to set a clipping path on a Circle.
The following example demonstrates how to clear a clipping path.
Parameters
clip Path
The element clipping path.
clippedBBox
Returns the bounding box of the element with clipping and transformations applied. This is the rectangle that will fit around the actual rendered element.
Returns
Rect - The bounding box of the element with clipping and transformations applied.
containsPoint
Returns true
if the shape contains the specified point.
Parameters
point Point
The point that should be checked.
Returns
boolean value indicating if the shape contains the point.
fill
Sets the fill of the Shape (see the basic usage example).
Parameters
color string
The fill color to set.
opacity? number
The fill opacity to set.
Returns
Circle - The current instance to allow chaining.
geometry
Gets the geometry of the circle.
Returns
Circle The current geometry of the circle.
geometry
Sets the geometry of the circle.
Parameters
value Circle
The new geometry to use.
opacity
Gets the element opacity.
Returns
number The current element opacity.
opacity
Sets the opacity of the element.
Parameters
opacity number
The element opacity. Ranges from 0 (completely transparent) to 1 (completely opaque).
stroke
Sets the stroke of the Shape.
Parameters
color string
The stroke color to set.
width? number
The stroke width to set.
opacity? number
The stroke opacity to set.
Returns
Circle - The current instance to allow chaining.
transform
Gets the transformation of the element.
Returns
Transformation - The current transformation on the element.
transform
Sets the transformation of the element.
Parameters
transform Transformation
The transformation to apply to the element.
visible
Gets the visibility of the element.
Returns
boolean true if the element is visible. Otherwise, returns false
.
visible
Sets the visibility of the element.
Parameters
visible boolean
A flag which indicates if the element will be visible.