Ellipse
API reference › HTML SVG › Ellipse
Represents the SVG <ellipse> (ellipse) element for rendering ellipses.
Provides a concrete <ellipse> element implementation that returns SvgVoid::ELLIPSE and provides geometry,
paint, and transform attribute methods.
The <ellipse> element is an SVG basic shape used to create ellipses based on a center point and two radii.
See also: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/ellipse (BaseVoid for the base implementation.).
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$attributes protected | mixed[] | HTML attributes array used by the implementing class. Default: []. | UIAwesome\ |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() final | Initializes a new tag instance. | UIAwesome\ |
__toString() | Returns the rendered tag string. | UIAwesome\ |
accesskey() | Sets the accesskey attribute. | UIAwesome\ |
addAriaAttribute() | Sets an aria-* attribute. | UIAwesome\ |
addAttribute() | Adds or updates a single HTML attribute for the element. | UIAwesome\ |
addDataAttribute() | Sets a data-* attribute. | UIAwesome\ |
addEvent() | Sets an on* event attribute. | UIAwesome\ |
ariaAttributes() | Sets multiple aria-* attributes. | UIAwesome\ |
attributes() | Adds or updates multiple HTML attributes for the element. | UIAwesome\ |
class() | Sets the class attribute. | UIAwesome\ |
config() | Applies application-scoped config recipes to this tag. | UIAwesome\ |
cx() | Sets the SVG cx attribute for the element. | Ellipse |
cy() | Sets the SVG cy attribute for the element. | Ellipse |
dataAttributes() | Sets multiple data-* attributes. | UIAwesome\ |
dir() | Sets the dir attribute. | UIAwesome\ |
events() | Sets multiple on* event attributes. | UIAwesome\ |
fill() | Sets the SVG fill attribute for the element. | Ellipse |
fillOpacity() | Sets SVG fill-opacity attribute for the element. | Ellipse |
fillRule() | Sets SVG fill-rule attribute for the element. | Ellipse |
getAttribute() | Returns the value of a single HTML attribute. | UIAwesome\ |
getAttributes() | Returns the array of HTML attributes for the element. | UIAwesome\ |
hidden() | Sets the hidden attribute. | UIAwesome\ |
id() | Sets the id attribute. | UIAwesome\ |
lang() | Sets the lang attribute. | UIAwesome\ |
opacity() | Sets the SVG opacity attribute for the element. | Ellipse |
pathLength() | Sets the SVG pathLength attribute for the element. | Ellipse |
removeAriaAttribute() | Removes an aria-* attribute. | UIAwesome\ |
removeAttribute() | Removes a specific HTML attribute from the element. | UIAwesome\ |
removeDataAttribute() | Removes a data-* attribute. | UIAwesome\ |
removeEvent() | Removes an on* event attribute. | UIAwesome\ |
render() final | Renders the tag with lifecycle hooks. | UIAwesome\ |
replaceAttributes() | Replaces all HTML attributes for the element. | UIAwesome\ |
role() | Sets the role attribute. | UIAwesome\ |
rx() | Sets the SVG rx attribute for the element. | Ellipse |
ry() | Sets the SVG ry attribute for the element. | Ellipse |
stroke() | Sets the SVG stroke attribute for the element. | Ellipse |
strokeDashArray() | Sets the SVG stroke-dasharray attribute for the element. | Ellipse |
strokeLineCap() | Sets the SVG stroke-linecap attribute for the element. | Ellipse |
strokeLineJoin() | Sets the SVG stroke-linejoin attribute for the element. | Ellipse |
strokeMiterlimit() | Sets SVG stroke-miterlimit attribute for the element. | Ellipse |
strokeOpacity() | Sets SVG stroke-opacity attribute for the element. | Ellipse |
strokeWidth() | Sets the SVG stroke-width attribute for the element. | Ellipse |
style() | Sets the style attribute. | UIAwesome\ |
tag() static | Creates and configures a new tag instance. | UIAwesome\ |
title() | Sets the title attribute. | UIAwesome\ |
transform() | Sets the SVG transform attribute for the element. | Ellipse |
translate() | Sets the translate attribute. | UIAwesome\ |
afterRun() protected | Post-processes rendered output. | UIAwesome\ |
beforeRun() protected | Validates state before rendering. | UIAwesome\ |
getTag() protected | Returns the tag enumeration for the <ellipse> element. | Ellipse |
loadDefault() protected | Returns class-level default definitions. | UIAwesome\ |
run() protected | Renders the void element. | UIAwesome\ |
Method details
Section titled “Method details”public function cx(float|int|string|null $value): staticSets the SVG cx attribute for the element.
Creates a new instance with the specified center x-coordinate value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | float| | Center x-coordinate value (for example, ‘50’, ‘50%’, or null to unset). |
Returns
static: New instance with the updated cx attribute.
public function cy(float|int|string|null $value): staticSets the SVG cy attribute for the element.
Creates a new instance with the specified center y-coordinate value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | float| | Center y-coordinate value (for example, ‘50’, ‘50%’, or null to unset). |
Returns
static: New instance with the updated cy attribute.
fill()
Section titled “fill() ”public function fill(string|null $value): staticSets the SVG fill attribute for the element.
Creates a new instance with the specified fill value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string| | Fill value (for example, ‘red’, ‘url(#gradient1)’, or null to unset). |
Returns
static: New instance with the updated fill attribute.
fillOpacity()
Section titled “fillOpacity() ”public function fillOpacity(float|int|string|null $value): staticSets SVG fill-opacity attribute for the element.
Creates a new instance with the specified fill opacity value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | float| | Fill opacity value (for example, ‘0.5’ or null to unset). |
Returns
static: New instance with the updated fill-opacity attribute.
Throws
InvalidArgumentException: If the value is outside the allowed range (‘0’-‘1’) and notnull.
fillRule()
Section titled “fillRule() ”public function fillRule(UIAwesome\Html\Svg\Values\FillRule|string|null $value): staticSets SVG fill-rule attribute for the element.
Creates a new instance with the specified fill rule value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | UIAwesome\| | Fill rule value to set for the element. Accepts ‘nonzero’, ‘evenodd’, FillRule enum, or null to unset. |
Returns
static: New instance with the updated fill-rule attribute.
Throws
InvalidArgumentException: If the provided value is not a validFillRuleenum or string.
opacity()
Section titled “opacity() ”public function opacity(float|int|string|null $value): staticSets the SVG opacity attribute for the element.
Creates a new instance with the specified opacity value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | float| | Opacity value (for example, ‘0.5’, or null to unset). |
Returns
static: New instance with the updated opacity attribute.
Throws
InvalidArgumentException: If the value is outside the allowed range (‘0’-‘1’) and notnull.
pathLength()
Section titled “pathLength() ”public function pathLength(float|int|string|null $value): staticSets the SVG pathLength attribute for the element.
Creates a new instance with the specified path length value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | float| | Path length value (for example, ‘100’, or null to unset). |
Returns
static: New instance with the updated pathLength attribute.
Throws
InvalidArgumentException: If the provided value is not a positive number ornull.
See also
- https://www.w3.org/TR/SVG2/paths.html#PathLengthAttribute (Usage example: $element->pathLength(100); $element->pathLength(50.5); $element->pathLength(null);)
public function rx(float|int|string|null $value): staticSets the SVG rx attribute for the element.
Creates a new instance with the specified x-axis radius value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | float| | X-axis radius value (for example, ‘50’, ‘10px’, ‘50%’, or null to unset). |
Returns
static: New instance with the updated rx attribute.
public function ry(float|int|string|null $value): staticSets the SVG ry attribute for the element.
Creates a new instance with the specified y-axis radius value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | float| | Y-axis radius value (for example, ‘50’, ‘10px’, ‘50%’, or null to unset). |
Returns
static: New instance with the updated ry attribute.
stroke()
Section titled “stroke() ”public function stroke(string|null $value): staticSets the SVG stroke attribute for the element.
Creates a new instance with the specified stroke value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string| | Stroke paint value (for example, ‘black’, ‘url(#gradient1)’, or null to unset). |
Returns
static: New instance with the updated stroke attribute.
strokeDashArray()
Section titled “strokeDashArray() ”public function strokeDashArray(float|int|string|null $value): staticSets the SVG stroke-dasharray attribute for the element.
Creates a new instance with the specified dash array value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | float| | Dash array value (for example, ‘5.3’, or null to unset). |
Returns
static: New instance with the updated stroke-dasharray attribute.
See also
- https://www.w3.org/TR/SVG2/painting.html#StrokeDashing (Usage example: $element->strokeDashArray(5.3); $element->strokeDashArray(4); $element->strokeDashArray(null);)
strokeLineCap()
Section titled “strokeLineCap() ”public function strokeLineCap(string|UIAwesome\Html\Svg\Values\StrokeLineCap|null $value): staticSets the SVG stroke-linecap attribute for the element.
Creates a new instance with the specified stroke line cap value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|UIAwesome\| | Stroke line cap style (for example, ‘round’, StrokeLineCap enum, or null to unset). |
Returns
static: New instance with the updated stroke-linecap attribute.
Throws
InvalidArgumentException: If the provided value is not a validStrokeLineCapenum or string.
strokeLineJoin()
Section titled “strokeLineJoin() ”public function strokeLineJoin(string|UIAwesome\Html\Svg\Values\StrokeLineJoin|null $value): staticSets the SVG stroke-linejoin attribute for the element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|UIAwesome\| | Stroke line join style (for example, ‘miter’, StrokeLineJoin enum, or null to unset). |
Returns
static: New instance with the updated stroke-linejoin attribute.
Throws
InvalidArgumentException: If the provided value is not a validStrokeLineJoinenum or string.
strokeMiterlimit()
Section titled “strokeMiterlimit() ”public function strokeMiterlimit(float|int|string|null $value): staticSets SVG stroke-miterlimit attribute for the element.
Creates a new instance with the specified stroke miter limit value for the rendered element.
The stroke-miterlimit attribute controls the limit on the ratio of the miter length to the stroke width. When
the limit is exceeded, the join is converted from a miter to a bevel. The value must be a number ’>= 1’.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | float| | Stroke miter limit value (for example, ‘4’ or null to unset). |
Returns
static: New instance with the updated stroke-miterlimit attribute.
Throws
InvalidArgumentException: If value is not a number ’>= 1’ ornull.
See also
- https://www.w3.org/TR/SVG2/painting.html#StrokeMiterlimitProperty (Usage example: $element->strokeMiterlimit(4); $element->strokeMiterlimit(null);)
strokeOpacity()
Section titled “strokeOpacity() ”public function strokeOpacity(float|int|string|null $value): staticSets SVG stroke-opacity attribute for the element.
Creates a new instance with the specified stroke opacity value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | float| | Stroke opacity value (for example, ‘0.8’ or null to unset). |
Returns
static: New instance with the updated stroke-opacity attribute.
Throws
InvalidArgumentException: If the value is outside the allowed range (‘0’-‘1’) and notnull.
strokeWidth()
Section titled “strokeWidth() ”public function strokeWidth(int|string|null $value): staticSets the SVG stroke-width attribute for the element.
Creates a new instance with the specified stroke width value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | int| | Stroke width value (for example, ‘2’, ‘1.5em’, or null to unset). |
Returns
static: New instance with the updated stroke-width attribute.
transform()
Section titled “transform() ”public function transform(string|null $value): staticSets the SVG transform attribute for the element.
Creates a new instance with the specified transform value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string| | Transform value (for example, ‘rotate(45)’, ‘scale(2)’, or null to unset). |
Returns
static: New instance with the updated transform attribute.
getTag()
Section titled “getTag() ”protected function getTag(): BackedEnumReturns the tag enumeration for the <ellipse> element.
Returns
BackedEnum: Tag enumeration instance for <ellipse>. SvgVoid for valid SVG void-level tags.