An interface which provides methods that handle orthogonal editing of individual edges and can be decorated to the ILookup of IEdges.
Remarks
The OrthogonalEdgeEditingContext queries implementations to achieve orthogonal edge editing from an edge's lookup. Edge styles can supply suitable instances in their renderer's lookup. For instance, the PolylineEdgeStyle offers an instance that enables orthogonal editing when the orthogonalEditing property is set to true
.
Custom implementations can be decorated to EdgeDecorator's orthogonalEdgeHelper.
This interface is for editing edges in such a way that their path stays orthogonal, i.e. all segments are oriented either horizontally or vertically.
Rather than creating IOrthogonalEdgeHelper implementations from scratch, it is advisable to extend subclasses of OrthogonalEdgeHelper for better customization.
Examples
graph.decorator.edges.orthogonalEdgeHelper.addFactory(
(edge) =>
new OrthogonalEdgeHelper({
edge,
implicitlyMoveEnds: true,
}),
)
Type Details
- yFiles module
- view
See Also
Methods
Invoked after the edge this helper was provided for has been edited orthogonally.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context which edited the edge.
- graph - IGraph
- The graph to use for modifying the edge instance.
Gets the declared orientation of the given segment at the edge this helper was provided for.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context for which the orientation is needed.
- segmentIndex - number
- The index of the segment.
Returns
- ↪SegmentOrientation
- The declared orientation of the segment.
Determines whether the edge this helper was provided for should be edited orthogonally in the specified input mode context.
Remarks
false
, the other methods will not be queried at all.Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context in which the edge is about to be edited.
Returns
- ↪boolean
true
if the edge should be orthogonally edited in the specified input mode context;false
otherwise.
Determines whether this end of the edge this helper was provided for can be moved in the input mode context.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context in which the segment is edited.
- sourceEnd - boolean
- if set to
true
the source end of the edge is queried, otherwise the target end.
Returns
- ↪boolean
true
if the end of the edge can be moved for the specified input mode context;false
otherwise, in which case the corresponding segment needs to be split to keep the segment orientation orthogonal.
Static Methods
Parameters
A map of options to pass to the method.
- getSegmentOrientation - function(IInputModeContext, number):SegmentOrientation
Gets the declared orientation of the given segment at the edge this helper was provided for.
This property holds the implementation for getSegmentOrientation.
- shouldMoveEndImplicitly - function(IInputModeContext, boolean):boolean
Determines whether this end of the edge this helper was provided for can be moved in the input mode context.
This property holds the implementation for shouldMoveEndImplicitly.
- shouldEditOrthogonally - function(IInputModeContext):boolean
Determines whether the edge this helper was provided for should be edited orthogonally in the specified input mode context.
This property holds the implementation for shouldEditOrthogonally.
- cleanUpEdge - function(IInputModeContext, IGraph):void
Invoked after the edge this helper was provided for has been edited orthogonally.
This property holds the implementation for cleanUpEdge.