documentationfor yFiles for HTML 3.0.0.3

ObjectBindings<TDataItem>

A container for providers for specified properties of an object that provide the values that can later be applied to these properties.

Inheritance Hierarchy
ObjectBindings

Remarks

ObjectBindings<TDataItem> are used in NodeCreator.styleBindings, EdgeCreator.styleBindings and LabelCreator. styleBindings and can be used to configure the properties of the INodeStyle, IEdgeStyle or ILabelStyle assigned to a node, edge or label.

The following sample shows how to use styleBindings to configure the style of a node:

nodesSource.nodeCreator.defaults.shareStyleInstance = false
nodesSource.nodeCreator.defaults.style = new ShapeNodeStyle({
  stroke: 'darkOrange',
  fill: 'lightYellow',
  shape: 'round-rectangle',
})
nodesSource.nodeCreator.styleBindings.addBinding(
  'stroke',
  (employee) =>
    employee.position.includes('Chief') ? 'darkRed' : 'darkOrange',
)
nodesSource.nodeCreator.styleBindings.addBinding('shape', (employee) =>
  employee.freelancer ? 'hexagon' : 'roundRectangle',
)

Type Parameters

TDataItem
The type of the data item these bindings will use to resolve the values from.

Type Details

yFiles module
view

Constructors

Methods