documentationfor yFiles for HTML 2.6

The interface used in an IGraph implementation to control the layout of edges.

Inheritance Hierarchy
Implemented Interfaces

Remarks

This interface provides read-only access to the properties of a bend. In order to modify the state of an instance use the various methods provided by the IGraph this instance belongs to. Bends are stored in IListEnumerable<T>s, that can be obtained from the IEdge implementation that owns this bend. Like all items in an IGraph, this item supports the lookup method that can be used to query additional aspects of the item.

Examples

Working with a bend in the graph
const graph = graphComponent.graph
const node1 = graph.createNodeAt(new Point(0, 0))
const node2 = graph.createNodeAt(new Point(100, 0))
const edge = graph.createEdge(node1, node2)

// add a bend to the edge
const bend = graph.addBend(edge, new Point(50, 20))

// the newly created bend is part of the graph
console.log(graph.contains(bend)) // true

// the bend belongs to its owner
console.log(bend.owner === edge) // true
console.log(edge.bends.size) // 1
console.log(edge.bends.get(0) === bend) // true

// removing the bend removes it from the graph
graph.remove(bend)
console.log(graph.contains(bend)) // false
// and from its owner
console.log(bend.owner === null) // true
console.log(edge.bends.size) // 0
Bends cannot live without an owner in the graph
console.log(graph.contains(bend)) // true
graph.remove(bend.owner)
console.log(graph.contains(bend)) // falseconsole.log(graph.contains(bend)) // true
graph.remove(bend.owner!)
console.log(graph.contains(bend)) // false

Related Reading in the Developer's Guide

The graph model with all relevant types and their relationships is presented in detail in the section The Graph Model.

Using the look-up mechanism is explained in the section Service Locator Pattern: Lookup.

Type Details

yfiles module
view-component
yfiles-umd modules
All view modules
Legacy UMD name
yfiles.graph.IBend

See Also

Properties

Methods