An IFoldingEdgeConverter implementation that makes the view contain at most one folding edge between each pair of nodes by letting a single folding edge represent all master edges.
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
Type Details
- yFiles module
- view
See Also
Sample Graphs
Constructors
Parameters
A map of options to pass to the method.
- foldingEdgeDefaults - FoldingEdgeDefaults
- The defaults to apply to folding edges. This option either sets the value directly or recursively sets properties to the instance of the foldingEdgeDefaults property on the created object.
- ignoreEdgeDirection - boolean
- A value indicating whether edge direction should be ignored for the determination of the folding edges that are currently part of the graph . This option sets the ignoreEdgeDirection property on the created object.
Properties
Gets or sets the defaults to apply to folding edges.
Remarks
Gets or sets a value indicating whether edge direction should be ignored for the determination of the folding edges that are currently part of the graph .
Property Value
true
if edge direction should be ignored; false
otherwise.Methods
addFirstSeparateEdge
(converterContext: IFoldingEdgeConverterContext, foldingView: IFoldingView, masterEdge: IEdge, viewSourceNode: INode, sourceIsCollapsed: boolean, viewTargetNode: INode, targetIsCollapsed: boolean)Adds the first separate edge to the source and target node pair using the addAsSeparateEdge method.
Parameters
A map of options to pass to the method.
- converterContext - IFoldingEdgeConverterContext
- The context providing methods for edge conversion.
- foldingView - IFoldingView
- The folding view in which the edges reside.
- masterEdge - IEdge
- The master edge to be represented.
- viewSourceNode - INode
- The view's source node.
- sourceIsCollapsed - boolean
- Indicates whether the source node is collapsed.
- viewTargetNode - INode
- The view's target node.
- targetIsCollapsed - boolean
- Indicates whether the target node is collapsed.
addFoldingEdge
(converterContext: IFoldingEdgeConverterContext, foldingView: IFoldingView, masterEdge: IEdge, source: INode, sourceIsCollapsed: boolean, target: INode, targetIsCollapsed: boolean)Tries to add the folding edge to an existing folding edge, considering the ignoreEdgeDirection property.
Remarks
Parameters
A map of options to pass to the method.
- converterContext - IFoldingEdgeConverterContext
- The context providing methods for edge conversion.
- foldingView - IFoldingView
- The folding view in which the edges reside.
- masterEdge - IEdge
- The master edge to be represented.
- source - INode
- The source node of the edge.
- sourceIsCollapsed - boolean
- Indicates whether the source node is collapsed.
- target - INode
- The target node of the edge.
- targetIsCollapsed - boolean
- Indicates whether the target node is collapsed.
Implements
initializeFoldingEdgeState
(state: FoldingEdgeState, foldingView: IFoldingView, foldingEdge: IEdge, masterEdges: IListEnumerable<IEdge>)Initializes the folding edge appearance.
Remarks
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 getMasterEdges
See Also
Implements
updateFoldingEdgeState
(state: FoldingEdgeState, foldingView: IFoldingView, foldingEdge: IEdge, masterEdges: IListEnumerable<IEdge>)Updates the folding edge appearance.
Remarks
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
Implements
updateMasterEdges
(state: FoldingEdgeState, foldingView: IFoldingView, masterEdges: IListEnumerable<IEdge>)Callback to optionally back propagate state changes on a folding edge's state to the masterEdges
.
Remarks
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.