This is the interface for a factory that is used for creating the constituents of an IGraph that are encountered during the parsing of GraphML
Inheritance Hierarchy
IGraphElementFactory
Type Details
- yfiles module
- view-graphml
- yfiles-umd modules
- view-graphml, view
- Legacy UMD name
- yfiles.graphml.IGraphElementFactory
See Also
Methods
Adds a new port to the given IPortOwner.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - IParseContext
- The context from which the graph, the CreationProperties, and the objectStack can be queried.
- owner - IPortOwner
- The owner of the port.
Returns
- ↪IPort
- A newly created port.
createEdge
(context: IParseContext, sourceNode: INode, sourcePort: IPort, targetNode: INode, targetPort: IPort) : IEdgeCreates an edge for the given context and the provided source and target nodes or ports.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - IParseContext
- The context from which the graph, the CreationProperties, and the objectStack can be queried.
- sourceNode - INode
- The source node for the edge.
- sourcePort - IPort
- The source port for the edge, if specified, otherwise
null
. - targetNode - INode
- The target node for the edge.
- targetPort - IPort
- The target port for the edge, if specified, otherwise
null
.
Returns
- ↪IEdge
- A newly created edge.
Creates a node for the given context.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - IParseContext
- The context from which the graph, the CreationProperties, and the objectStack can be queried.
Returns
- ↪INode
- A newly created node
Static Methods
Creates an implementation of the interface IGraphElementFactory from the given definition.
Remarks
The given object must contain exactly the abstract members of the IGraphElementFactory interface. No member may be omitted and no additional members can be added. While additional custom members can later be added directly on the instance, this is discouraged.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- createNode - function(IParseContext):INode
Creates a node for the given context.
This property holds the implementation for createNode.
- createEdge - function(IParseContext, INode, IPort, INode, IPort):IEdge
Creates an edge for the given context and the provided source and target nodes or ports.
This property holds the implementation for createEdge.
- addPort - function(IParseContext, IPortOwner):IPort
Adds a new port to the given IPortOwner.
This property holds the implementation for addPort.
Returns
- ↪IGraphElementFactory
- An instance of the IGraphElementFactory interface based on the given definition.