Fills an area with a linear gradient.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.view.LinearGradient
See Also
Constructors
Initializes a new instance of the LinearGradient class.
Parameters
A map of options to pass to the method.
- spreadMethod - GradientSpreadMethod
The spread method of this gradient. This option sets the spreadMethod property on the created object.
- startPoint - Point
The start point of this gradient. This option sets the startPoint property on the created object.
- endPoint - Point
The end point of this gradient. This option sets the endPoint 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 end point of this gradient.
Gets or sets the gradient stops of this brush.
Gets or sets the spread method of this gradient.
Gets or sets the start point 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 LinearGradient 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.