algorithms.degree
degree(options: CommonAlgorithmOptions & AlgorithmWriteOptions): NodeScalarResultCompute the degree (total edge count) for each node synchronously.
Unlike the heavy algorithms this runs on the main thread and returns
immediately. When writeTo is supplied degree values are written to node
properties via ApplyAlgorithmResultCommand (recorded in history, undoable).
Does not emit algorithm lifecycle events.
options | CommonAlgorithmOptions & AlgorithmWriteOptions | CommonAlgorithmOptions merged with AlgorithmWriteOptions. |
Returns: NodeScalarResult
Example
const deg = api.algorithms.degree({ writeTo: "degree" });