A default implementation of the IArrow interface that can render ArrowTypes.
Remarks
This is a convertible type that can be used with the following notation(s) in parameter lists, parameter objects or setters.
The strings applying to this scheme are converted to Arrows:
'[color] [scale] type'
color = CSS color strings
scale = xx-small|x-small|small|medium|large|x-large|xx-large
type = normal|none|default|simple|short|diamond|cross|circle|ball|triangle
Valid color strings are the same as for Color. Square brackets mark optional declarations.
Examples
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.styles.Arrow
See Also
Constructors
Creates a new arrow with default values for stroke and brush.
Parameters
A map of options to pass to the method.
- type - ArrowType
The type of this arrow. This option sets the type property on the created object.
- scale - number
The scale factor of this arrow. This option sets the scale property on the created object.
- stroke - Stroke
- fill - Fill
- cropLength - number
The cropping length associated with this instance. This option sets the cropLength property on the created object.
Examples
Creates a new arrow with the given color to use for stroke and brush.
Remarks
Parameters
A map of options to pass to the method.
- color - Color
- The color to use for stroke and brush.
- type - ArrowType
The type of this arrow. This option sets the type property on the created object.
- scale - number
The scale factor of this arrow. This option sets the scale property on the created object.
- stroke - Stroke
- cropLength - number
The cropping length associated with this instance. This option sets the cropLength property on the created object.
Properties
Gets or sets the cropping length associated with this instance.
Remarks
This value is defined as the distance between the node-edge intersection and the tip of the arrow.
It is used by IEdgeStyle implementations to let the edge appear to end shortly before its actual target.
See Also
Implements
Gets the length of the arrow (the distance from the arrow's tip to the position where the visual representation of the edge's path should begin).
Gets or sets the type of this arrow.
Methods
Create a clone of this object.
getBoundsProvider
(edge: IEdge, atSource: boolean, anchor: Point, directionVector: Point) : IBoundsProviderGets an IBoundsProvider implementation that can yield this arrow's bounds if painted at the given location using the given direction for the given edge.
Parameters
A map of options to pass to the method.
- edge - IEdge
- the edge this arrow belongs to
- atSource - boolean
- whether this will be the source arrow
- anchor - Point
- the anchor point for the tip of the arrow
- directionVector - Point
- the direction the arrow is pointing in
Returns
- ↪IBoundsProvider
- an implementation of the IBoundsProvider interface that can subsequently be used to query the bounds. Clients will always call this method before using the implementation and may not cache the instance returned. This allows for applying the flyweight design pattern to implementations.
See Also
Implements
Gets an IVisualCreator implementation that will paint this arrow at the given location using the given direction for the given edge.
Parameters
A map of options to pass to the method.
- edge - IEdge
- the edge this arrow belongs to
- atSource - boolean
- whether this will be the source arrow
- anchor - Point
- the anchor point for the tip of the arrow
- direction - Point
- the direction the arrow is pointing in
Returns
- ↪IVisualCreator
- an implementation of the IVisualCreator interface that can subsequently be used to perform the actual painting. Clients will always call this method before using the implementation and may not cache the instance returned. This allows for applying the flyweight design pattern to implementations.
See Also
Implements
Returns a hash code for this object.
Remarks
The hash code is a numeric value that can be used to treat this object as a key in a hash table or similar data structure.
Two objects that are considered equal must have the same hash code. However, the reverse does not hold and two objects having the same hash code don't have to be equal. Ideally, the hash code should be roughly uniformly-distributed to prevent hash tables from performing poorly. Calculating the hash code is also a potentially frequent operation and should therefore be fast.
Returns
- ↪number
- the hash code for this object