documentationfor yFiles for HTML 2.6

ILabelDefaults

Interface used by IGraph and the like to declare and obtain the defaults for labels.

Inheritance Hierarchy
ILabelDefaults

Remarks

Note that changing these defaults does not change properties of already created model items. Rather, only items created after the change are affected.

Examples

Setting defaults for labels
// Labels on nodes, edges, and ports have different ILabelDefaults instances.
// These can be retrieved from their owner type's defaults

// the defaults for node labels can be set on the ILabelDefaults instance
// found at the Labels property of the node defaults
graph.nodeDefaults.labels.layoutParameter = InteriorLabelModel.CENTER
graph.nodeDefaults.labels.style = new DefaultLabelStyle()

// the defaults for edge labels can be set on the ILabelDefaults instance
// found at the Labels property of the edge defaults
graph.edgeDefaults.labels.layoutParameter = InteriorLabelModel.CENTER
graph.edgeDefaults.labels.style = new DefaultLabelStyle()

// defaults for port labels can be set on the ILabelDefaults instance
// found at the Labels property of their owner type's defaults
graph.nodeDefaults.ports.labels.layoutParameter =
  new InsideOutsidePortLabelModel().createInsideParameter()
graph.edgeDefaults.ports.labels.layoutParameter =
  new FreePortLabelModel().createDefaultParameter()

Type Details

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

See Also

Properties

Methods