documentationfor yFiles for HTML 2.6

DegreeCentrality

Computes the degree centrality for the nodes of a given graph.

Inheritance Hierarchy
DegreeCentrality

Remarks

Degree centrality is the number of the incoming, outgoing or overall edges incident to a node (measures incoming, outgoing and overall degree).

If both considerIncomingEdges and considerOutgoingEdges are false an InvalidOperationError is thrown.

Other Centrality Measures

yFiles for HTML supports a number of other centrality measures:

Examples

const result = new DegreeCentrality().run(graph)

// add node labels for centrality values
// and adjust node size according to centrality
result.normalizedNodeCentrality.forEach((entry) => {
  const node = entry.key
  const centrality = entry.value
  graph.addLabel(node, `${centrality}`)
  graph.setNodeLayout(
    node,
    new Rect(node.layout.center, new Size(centrality, centrality))
  )
})

Type Details

yfiles module
view-layout-bridge
yfiles-umd modules
view-layout-bridge
Legacy UMD name
yfiles.analysis.DegreeCentrality

See Also

Constructors

Properties

Methods