Interface used by FoldingManager and IFoldingView which is responsible for managing edges between folder nodes.
Remarks
Examples
const defaultFoldingEdgeConverter = new FoldingEdgeConverter()
// initialize the new edges with a gray style
defaultFoldingEdgeConverter.foldingEdgeDefaults.style =
new PolylineEdgeStyle({ stroke: 'gray' })
defaultFoldingEdgeConverter.foldingEdgeDefaults.copyLabels = true
// initialize the labels with a new style
defaultFoldingEdgeConverter.foldingEdgeDefaults.labels.style =
new LabelStyle()
defaultFoldingEdgeConverter.foldingEdgeDefaults.labels.shareStyleInstance =
true
// initialize all label properties (the default)
// but synchronize only the text after initialization
defaultFoldingEdgeConverter.foldingEdgeDefaults.labels.updateFoldingOptions =
FoldingSynchronizationOptions.LABEL_TEXT
defaultFoldingEdgeConverter.foldingEdgeDefaults.labels.updateMasterOptions =
FoldingSynchronizationOptions.LABEL_TEXT
defaultFoldingEdgeConverter.foldingEdgeDefaults.labels.autoAdjustPreferredSize =
true
manager.foldingEdgeConverter = defaultFoldingEdgeConverter
const mergingFoldingEdgeConverter = new MergingFoldingEdgeConverter()
mergingFoldingEdgeConverter.ignoreEdgeDirection = true
mergingFoldingEdgeConverter.foldingEdgeDefaults.copyLabels = true
mergingFoldingEdgeConverter.foldingEdgeDefaults.style =
new PolylineEdgeStyle({ stroke: 'gray' })
manager.foldingEdgeConverter = mergingFoldingEdgeConverter
Type Details
- yFiles module
- view
See Also
Sample Graphs
Methods
addFoldingEdge
(converterContext: IFoldingEdgeConverterContext, foldingView: IFoldingView, masterEdge: IEdge, source: INode, sourceIsCollapsed: boolean, target: INode, targetIsCollapsed: boolean)This method gets called by the IFoldingView implementation to determine whether a given edge in the masterGraph should be represented by a folding edge in the given view.
Remarks
converterContext
object that implements the IFoldingEdgeConverterContext interface, which needs to be used by the implementation to communicate the result of the query. The implementation needs to either call addAsSeparateEdge or addToExistingFoldingEdge. The implementation can optionally query the existing folding edges between the source and target node and decide whether to add the edge to the existing folding edge.Parameters
A map of options to pass to the method.
- converterContext - IFoldingEdgeConverterContext
- The IFoldingEdgeConverterContext implementation that needs to be called in order to communicate the results of this query.
- foldingView - IFoldingView
- The instance into which the folding edge is going to be inserted.
- masterEdge - IEdge
- The edge from the masterGraph that needs to be represented by a folding edge. Note that you may not return this instance.
- source - INode
- The source node that belongs to the IFoldingView graph that will act as the local view node of the actual source node.
- sourceIsCollapsed - boolean
- Determines whether the
source
is currently a folder node. - target - INode
- The target node that belongs to the IFoldingView graph that will act as the local view node of the actual target node.
- targetIsCollapsed - boolean
- Determines whether the
target
is currently a folder node.
initializeFoldingEdgeState
(state: FoldingEdgeState, foldingView: IFoldingView, foldingEdge: IEdge, masterEdges: IListEnumerable<IEdge>)Triggered by the view to initially create the appearance of a folding edge.
Remarks
foldingEdge
, because this would create and enqueue undo events. Rather, the properties provided by the state
implementation must be set.Parameters
A map of options to pass to the method.
- state - FoldingEdgeState
- The FoldingEdgeState of the edge to change.
- foldingView - IFoldingView
- The graph to which the folding edge belongs.
- foldingEdge - IEdge
- The folding edge for which the appearance shall be determined.
- masterEdges - IListEnumerable<IEdge>
- The list of master edges, that the folding edge initially represents.
See Also
updateFoldingEdgeState
(state: FoldingEdgeState, foldingView: IFoldingView, foldingEdge: IEdge, masterEdges: IListEnumerable<IEdge>)Triggered by the view to adjust the appearance of a folding edge.
Remarks
For instance, it can be used to reflect a state change in the master edges that make up that folding edge.
Implementations may not use the IFoldingView's graph instance to modify the foldingEdge
, because this would create and enqueue undo events. Rather, the properties provided by the state
implementation must be set.
Parameters
A map of options to pass to the method.
- state - FoldingEdgeState
- The FoldingEdgeState of the edge to change.
- foldingView - IFoldingView
- The graph to which the folding edge belongs.
- foldingEdge - IEdge
- The folding edge for which the appearance might need an update.
- masterEdges - IListEnumerable<IEdge>
- The list of master edges, that the folding edge currently represents.
See Also
updateMasterEdges
(state: FoldingEdgeState, foldingView: IFoldingView, masterEdges: IListEnumerable<IEdge>)Callback to optionally back propagate state changes on a folding edge's state to the masterEdges
.
Parameters
A map of options to pass to the method.
- state - FoldingEdgeState
- The state to synchronize with the master edges.
- foldingView - IFoldingView
- The graph to which the folding edge belongs.
- masterEdges - IListEnumerable<IEdge>
- The edges in the masterGraph to update.
See Also
Static Methods
Parameters
A map of options to pass to the method.
- addFoldingEdge - function(IFoldingEdgeConverterContext, IFoldingView, IEdge, INode, boolean, INode, boolean):void
This method gets called by the IFoldingView implementation to determine whether a given edge in the masterGraph should be represented by a folding edge in the given view.
This property holds the implementation for addFoldingEdge.
- updateFoldingEdgeState - function(FoldingEdgeState, IFoldingView, IEdge, IListEnumerable<IEdge>):void
Triggered by the view to adjust the appearance of a folding edge.
This property holds the implementation for updateFoldingEdgeState.
- updateMasterEdges - function(FoldingEdgeState, IFoldingView, IListEnumerable<IEdge>):void
Callback to optionally back propagate state changes on a folding edge's state to the
masterEdges
.This property holds the implementation for updateMasterEdges.
- initializeFoldingEdgeState - function(FoldingEdgeState, IFoldingView, IEdge, IListEnumerable<IEdge>):void
Triggered by the view to initially create the appearance of a folding edge.
This property holds the implementation for initializeFoldingEdgeState.