The default implementation of the IEdgePathCropper.
Related Programming Samples
- 08 Edge Cropping
- Customize where edges at the node are cropped
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.styles.DefaultEdgePathCropper
See Also
Constructors
Creates a new instance of DefaultEdgePathCropper.
Parameters
A map of options to pass to the method.
- extraCropLength - number
An extra length the edge is cropped. This option sets the extraCropLength property on the created object.
- cropAtPort - boolean
The value that determines if the edge path is cropped at the port or at the node bounds. This option sets the cropAtPort property on the created object.
Properties
Methods
Calculates the total length the edge path is cropped.
Remarks
Parameters
A map of options to pass to the method.
- arrow - IArrow
- The arrow at this edge end.
- atSource - boolean
true
if the crop length should be calculated at the edge source.false
otherwise.
Returns
- ↪number
- The total length the edge path is cropped.
See Also
Crops the provided path
at one end of an edge.
Remarks
true
this implementation delegates to cropEdgePathAtPortGeometry. Otherwise the edge path is cropped at the node geometry. If this would result in an empty path, the cropping is delegated to handleEmptyPath instead.Parameters
A map of options to pass to the method.
- edge - IEdge
- The edge whose path is to be cropped.
- atSource - boolean
- Whether to crop the source or target side of the path.
- arrow - IArrow
- The arrow that is used at the end of the edge.
- path - GeneralPath
- The path to crop.
Returns
- ↪GeneralPath
- The cropped path. This is can be either the same instance of the given path or a newly created instance.
Implements
Crops an edge's path at the source or target side with respect to the given arrow.
Remarks
Parameters
A map of options to pass to the method.
- atSource - boolean
- if set to
true
the source side is cropped. - arrow - IArrow
- The arrow to consider for the cropping.
- path - GeneralPath
- The edge's path to crop.
Returns
- ↪GeneralPath
- The cropped path. This is can be either the same instance of the given path or a newly created instance.
cropEdgePathAtPortGeometry
(edge: IEdge, atSource: boolean, arrow: IArrow, path: GeneralPath) : GeneralPathCrops an edge's path at the source or target side at the port geometry with respect to the given arrow.
Parameters
A map of options to pass to the method.
- edge - IEdge
- The edge whose path is to be cropped.
- atSource - boolean
- Whether to crop the source or target side of the path.
- arrow - IArrow
- The arrow that is used at the end of the edge.
- path - GeneralPath
- The path to crop.
Returns
- ↪GeneralPath
- The cropped path. This is can be either the same instance of the given path or a newly created instance.
Returns the geometry that is used to crop the edge at the node outline.
Remarks
Parameters
A map of options to pass to the method.
- node - INode
- The node the edge should be cropped at.
Returns
- ↪IShapeGeometry
- The geometry of the node.
Returns the geometry that is used to crop the edge at the port outline if cropAtPort is set to true
.
Remarks
null
. This method can be overridden to return an arbitrary geometry for a port.Parameters
A map of options to pass to the method.
- port - IPort
- The port the edge should be cropped at.
Returns
- ↪IShapeGeometry
- The geometry of the port.
See Also
Handles the edge path cropping if cropEdgePath would result in a cleared path.
Remarks
This method is called by cropEdgePath if cropAtPort is false
and cropping the edge path at the node geometry would result in an empty path.
The default implementation is to clear the edge path.
Parameters
A map of options to pass to the method.
- edge - IEdge
- The edge whose path is to be cropped.
- atSource - boolean
- Whether to crop the source or target side of the path.
- arrow - IArrow
- The arrow that is used at the end of the edge.
- path - GeneralPath
- The path to crop.
Returns
- ↪GeneralPath
- The cropped path. This is can be either the same instance of the given path or a newly created instance.
Checks whether a given point is inside a node's shape geometry with respect to the edge that is being calculated.