Remarks
See Also
Developer's Guide
API
- nodes, NodeDecorator, edges, EdgeDecorator, labels, LabelDecorator, ports, PortDecorator, bends, BendDecorator
Members
Constructors
Initializes a new instance of the GraphDecorator class.
Parameters
- graph: IGraph
- The graph.
Properties
Property Value
Examples
The bend can be decorated in various ways. LookupDecorator<TDecoratedType, TInterface>.addConstant decorates the bend's ILookup.lookup to return the same instance for each bend.
graph.decorator.bends.handle.addConstant(new ConstantHandle())LookupDecorator<TDecoratedType, TInterface>.addConstant with a predicate decorates the bend's ILookup.lookup only to return the same instance for each bend for which the predicate returns true.
graph.decorator.bends.handle.addConstant(
(bend) => bend.tag !== null,
new ConstantHandle(),
)LookupDecorator<TDecoratedType, TInterface>.addFactory calls the provided factory method to return a new instance of the queried type created for the given bend or for bends for which the predicate returns true, respectively:
graph.decorator.bends.handle.addFactory((bend) => new CustomHandle(bend))
graph.decorator.bends.handle.addFactory(
(bend) => bend.tag !== null,
(bend) => new CustomHandle(bend),
)LookupDecorator<TDecoratedType, TInterface>.addWrapperFactory calls the provided factory method to return a new instance of the queried type which wraps the default implementation, once for all bends and once only for bends for which the predicate returns true.
graph.decorator.bends.handle.addWrapperFactory(
(bend, original) => new HandleWrapper(bend!, original),
)
graph.decorator.bends.handle.addWrapperFactory(
(bend) => bend.tag !== null,
(bend, original) => new HandleWrapper(bend!, original),
)Finally LookupDecorator<TDecoratedType, TInterface>.hide hides the default implementation by letting the lookup always return null for all bends and for bends for which the predicate returns true, respectively
graph.decorator.bends.handle.hide()
graph.decorator.bends.handle.hide((bend) => bend.tag !== null)Property Value
Examples
The edge can be decorated in various ways. LookupDecorator<TDecoratedType, TInterface>.addConstant decorates the edge's ILookup.lookup to return the same instance for each edge.
graph.decorator.edges.selectionRenderer.addConstant(
new ConstantSelection(),
)LookupDecorator<TDecoratedType, TInterface>.addConstant with a predicate decorates the edge's ILookup.lookup only to return the same instance for each edge for which the predicate returns true.
graph.decorator.edges.selectionRenderer.addConstant(
(edge) => edge.tag !== null,
new ConstantSelection(),
)LookupDecorator<TDecoratedType, TInterface>.addFactory calls the provided factory method to return a new instance of the queried type created for the given edge or for edges for which the predicate returns true, respectively:
graph.decorator.edges.selectionRenderer.addFactory(
(edge) => new CustomSelection(edge),
)
graph.decorator.edges.selectionRenderer.addFactory(
(edge) => edge.tag !== null,
(edge) => new CustomSelection(edge),
)LookupDecorator<TDecoratedType, TInterface>.addWrapperFactory calls the provided factory method to return a new instance of the queried type which wraps the default implementation, once for all edges and once only for edges for which the predicate returns true.
graph.decorator.edges.selectionRenderer.addWrapperFactory(
(edge, original) => new SelectionWrapper(edge, original),
)
graph.decorator.edges.selectionRenderer.addWrapperFactory(
(edge) => edge.tag !== null,
(edge, original) => new SelectionWrapper(edge, original),
)Finally LookupDecorator<TDecoratedType, TInterface>.hide hides the default implementation by letting the lookup always return null for all edges and for edges for which the predicate returns true, respectively
graph.decorator.edges.selectionRenderer.hide()
graph.decorator.edges.selectionRenderer.hide((edge) => edge.tag !== null)Property Value
Examples
The label can be decorated in various ways. LookupDecorator<TDecoratedType, TInterface>.addConstant decorates the label's ILookup.lookup to return the same instance for each label.
graph.decorator.labels.editLabelHelper.addConstant(
new ConstantEditLabelHelper(),
)LookupDecorator<TDecoratedType, TInterface>.addConstant with a predicate decorates the label's ILookup.lookup only to return the same instance for each label for which the predicate returns true.
graph.decorator.labels.editLabelHelper.addConstant(
(label) => label.tag !== null,
new ConstantEditLabelHelper(),
)LookupDecorator<TDecoratedType, TInterface>.addFactory calls the provided factory method to return a new instance of the queried type created for the given label or for labels for which the predicate returns true, respectively:
graph.decorator.labels.editLabelHelper.addFactory(
(label) => new CustomEditLabelHelper(label),
)
graph.decorator.labels.editLabelHelper.addFactory(
(label) => label.tag !== null,
(label) => new CustomEditLabelHelper(label),
)LookupDecorator<TDecoratedType, TInterface>.addWrapperFactory calls the provided factory method to return a new instance of the queried type which wraps the default implementation, once for all labels and once only for labels for which the predicate returns true.
graph.decorator.labels.editLabelHelper.addWrapperFactory(
(label, original) => new EditLabelHelperWrapper(label!, original),
)
graph.decorator.labels.editLabelHelper.addWrapperFactory(
(label) => label.tag !== null,
(label, original) => new EditLabelHelperWrapper(label!, original),
)Finally LookupDecorator<TDecoratedType, TInterface>.hide hides the default implementation by letting the lookup always return null for all labels and for labels for which the predicate returns true, respectively
graph.decorator.labels.editLabelHelper.hide()
graph.decorator.labels.editLabelHelper.hide((label) => label.tag !== null)Property Value
Examples
The node can be decorated in various ways. LookupDecorator<TDecoratedType, TInterface>.addConstant decorates the node's ILookup.lookup to return the same instance for each node.
graph.decorator.nodes.sizeConstraintProvider.addConstant(
new ConstantSizeConstraintProvider(),
)LookupDecorator<TDecoratedType, TInterface>.addConstant with a predicate decorates the node's ILookup.lookup only to return the same instance for each node for which the predicate returns true.
graph.decorator.nodes.sizeConstraintProvider.addConstant(
(node) => node.tag !== null,
new ConstantSizeConstraintProvider(),
)LookupDecorator<TDecoratedType, TInterface>.addFactory calls the provided factory method to return a new instance of the queried type created for the given node or for nodes for which the predicate returns true, respectively:
graph.decorator.nodes.sizeConstraintProvider.addFactory(
(node) => new CustomSizeConstraintProvider(node),
)
graph.decorator.nodes.sizeConstraintProvider.addFactory(
(node) => node.tag !== null,
(node) => new CustomSizeConstraintProvider(node),
)LookupDecorator<TDecoratedType, TInterface>.addWrapperFactory calls the provided factory method to return a new instance of the queried type which wraps the default implementation, once for all nodes and once only for nodes for which the predicate returns true.
graph.decorator.nodes.sizeConstraintProvider.addWrapperFactory(
(node, originalProvider) =>
new SizeConstraintProviderWrapper(node, originalProvider),
)
graph.decorator.nodes.sizeConstraintProvider.addWrapperFactory(
(node) => node.tag !== null,
(node, originalProvider) =>
new SizeConstraintProviderWrapper(node, originalProvider),
)Finally LookupDecorator<TDecoratedType, TInterface>.hide hides the default implementation by letting the lookup always return null for all nodes and for nodes for which the predicate returns true, respectively
graph.decorator.nodes.sizeConstraintProvider.hide()
graph.decorator.nodes.sizeConstraintProvider.hide(
(node) => node.tag !== null,
)Property Value
Examples
The port can be decorated in various ways. LookupDecorator<TDecoratedType, TInterface>.addConstant decorates the port's ILookup.lookup to return the same instance for each port.
graph.decorator.ports.handleProvider.addConstant(
new ConstantHandleProvider(),
)LookupDecorator<TDecoratedType, TInterface>.addConstant with a predicate decorates the port's ILookup.lookup only to return the same instance for each port for which the predicate returns true.
graph.decorator.ports.handleProvider.addConstant(
(port) => port.tag !== null,
new ConstantHandleProvider(),
)LookupDecorator<TDecoratedType, TInterface>.addFactory calls the provided factory method to return a new instance of the queried type created for the given port or for ports for which the predicate returns true, respectively:
graph.decorator.ports.handleProvider.addFactory(
(port) => new CustomHandleProvider(port),
)
graph.decorator.ports.handleProvider.addFactory(
(port) => port.tag !== null,
(port) => new CustomHandleProvider(port),
)LookupDecorator<TDecoratedType, TInterface>.addWrapperFactory calls the provided factory method to return a new instance of the queried type which wraps the default implementation, once for all ports and once only for ports for which the predicate returns true.
graph.decorator.ports.handleProvider.addWrapperFactory(
(port, original) => new HandleProviderWrapper(port!, original),
)
graph.decorator.ports.handleProvider.addWrapperFactory(
(port) => port.tag !== null,
(port, original) => new HandleProviderWrapper(port!, original),
)Finally LookupDecorator<TDecoratedType, TInterface>.hide hides the default implementation by letting the lookup always return null for all ports and for ports for which the predicate returns true, respectively
graph.decorator.ports.handleProvider.hide()
graph.decorator.ports.handleProvider.hide((port) => port.tag !== null)