documentationfor yFiles for HTML 2.6

INodeDefaults

Interface used by IGraph and the like to declare and obtain the defaults for nodes and their labels or ports.

Inheritance Hierarchy
INodeDefaults

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 nodes
// the defaults for nodes can be set on the INodeDefaults instance
// which can be retrieved from the graph's node defaults property
graph.nodeDefaults.size = new Size(50, 30)
graph.nodeDefaults.style = new ShapeNodeStyle({
  shape: ShapeNodeShape.ELLIPSE,
  fill: Fill.YELLOW
})

// 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 node ports can be set on the IPortDefaults instance
// found at the Ports property of the node defaults
graph.nodeDefaults.ports.autoCleanUp = false
graph.nodeDefaults.ports.locationParameter =
  FreeNodePortLocationModel.NODE_CENTER_ANCHORED

Type Details

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

See Also

Properties

Methods