An interface which provides methods that handle orthogonal editing of individual edges and can be decorated to the ILookup of IEdges.
Inheritance Hierarchy
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,
}),
)See Also
Developer's Guide
API
- orthogonalEdgeHelperProvider
Members
No filters for this type
Methods
Invoked after the edge this helper was provided for has been edited orthogonally.
Invoked after the edge this helper was provided for has been edited orthogonally.
This callback can be used to remove unused bends and finalize the orthogonal edge editing gesture.
abstract
Parameters
- context: IInputModeContext
- The input mode context which edited the edge.
- graph: IGraph
- The graph to use for modifying the edge instance.
See Also
Developer's Guide
Implemented in
OrthogonalEdgeHelper.cleanUpEdgegetSegmentOrientation
(context: IInputModeContext, segmentIndex: number): SegmentOrientationabstractGets the declared orientation of the given segment at the edge this helper was provided for.
getSegmentOrientation
(context: IInputModeContext, segmentIndex: number): SegmentOrientationabstract
Gets the declared orientation of the given segment at the edge this helper was provided for.
The orientation cannot always be inferred from the current geometry: If a segment has a zero length it is unclear what orientation it should have, also a segment could be accidentally orthogonally oriented, while in fact it is considered NON_ORTHOGONAL.
abstract
Parameters
- context: IInputModeContext
- The input mode context for which the orientation is needed.
- segmentIndex: number
- The index of the segment.
Return Value
- SegmentOrientation
- The declared orientation of the segment.
See Also
Developer's Guide
Implemented in
OrthogonalEdgeHelper.getSegmentOrientationDetermines whether the edge this helper was provided for should be edited orthogonally in the specified input mode context.
Determines whether the edge this helper was provided for should be edited orthogonally in the specified input mode context.
If this method returns
false, the other methods will not be queried at all.abstract
Parameters
- context: IInputModeContext
- The input mode context in which the edge is about to be edited.
Return Value
- boolean
trueif the edge should be orthogonally edited in the specified input mode context;falseotherwise.
See Also
Developer's Guide
Implemented in
OrthogonalEdgeHelper.shouldEditOrthogonallyDetermines whether this end of the edge this helper was provided for can be moved in the input mode context.
Determines whether this end of the edge this helper was provided for can be moved in the input mode context.
This information is required to determine whether an edge's first or last segment needs to be split or the adjacent edge end can be moved along with the other end of the segment.
abstract
Parameters
- context: IInputModeContext
- The input mode context in which the segment is edited.
- sourceEnd: boolean
- if set to
truethe source end of the edge is queried, otherwise the target end.
Return Value
- boolean
trueif the end of the edge can be moved for the specified input mode context;falseotherwise, in which case the corresponding segment needs to be split to keep the segment orientation orthogonal.
See Also
Developer's Guide