Fills an area with a radial gradient.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.view.RadialGradient
Constructors
Initializes a new instance of the RadialGradient class.
Parameters
A map of options to pass to the method.
- center - Point
The center of this radial gradient. This option sets the center property on the created object.
- gradientOrigin - Point
The origin of this radial gradient. This option sets the gradientOrigin property on the created object.
- radiusX - number
The radius of the largest circle of this radial gradient in horizontal direction. This option sets the radiusX property on the created object.
- radiusY - number
The radius of the largest circle of this radial gradient in vertical direction. This option sets the radiusY property on the created object.
- spreadMethod - GradientSpreadMethod
The spread method of this gradient. This option sets the spreadMethod property on the created object.
- gradientStops - GradientStop[]
- An array of GradientStops. Each item will be added to the gradientStops collection.
Properties
Gets or sets the center of this radial gradient.
Gets or sets the origin of this radial gradient.
Gets or sets the gradient stops of this brush.
Gets or sets the spread method of this gradient.
Methods
Checks if the specified node references the element represented by this object.
Parameters
A map of options to pass to the method.
- context - ICanvasContext
- The current canvas context.
- item - Node
- The SVG node.
- id - string
- The defs id that has been stored for this instance by the provided context.
Returns
- ↪boolean
true
ifnode
references the element represented by this instance.
Implements
Assigns the fill defined by this instance to the given SVG element
.
Remarks
If this Fill is a gradient and implements the ISvgDefsCreator interface, it will be added to the defs
section of the SVG document per the context
. The fill of the given element will be set to a reference to the gradient element.
This method is very similar in functionality to its static method counter part setFill. However since this method is an instance method, it cannot be called on empty/null
fills. If you are unsure whether the reference actually points to an instance, use the static helper method instead.
Parameters
A map of options to pass to the method.
- element - SVGElement
- The element whose fill should be set.
- context - ICanvasContext
- The context.
See Also
Defined in
Clones this instance by returning a memberwiseClone or this in case this instance is already frozen.
Creates a new SVG gradient that corresponds to this gradient brush.
Parameters
A map of options to pass to the method.
- context - ICanvasContext
- The canvas context that can be used to register brushes etc.
Returns
- ↪SVGElement
- A new SVG gradient that corresponds to this gradient brush
Implements
Freezes and returns this instance.
Remarks
Returns
- ↪Fill
- This instance, made immutable.
Overrides
Determines whether this RadialGradient is equal to the specified object.
Parameters
A map of options to pass to the method.
Returns
- ↪boolean
Implements
Determines if this instance is frozen.
Defined in
Updates the SVG gradient within the defs
section of the SVG document if it has changed.
Parameters
A map of options to pass to the method.
- context - ICanvasContext
- The context.
- oldElement - SVGElement
- The old element.
Implements
Updates the SVG gradient within the defs
section of the SVG document if it has changed.
Parameters
A map of options to pass to the method.
- oldElement - SVGElement
- The old element.
- context - ICanvasContext
- The context.