// O(1) degree off the CSR adjacency
ctx.degreeOf(slot: number): numberO(1) degree off the CSR adjacency.
| Name | Description |
|---|---|
slot: number | a node slot, as handed out by |
Returns
numberits whole-graph degree, loops counted twice
Example
// Inside a custom layout, ctx is supplied by the library.cy.layout({ impl: { run(ctx) { const slots = ctx.nodeSlots(); console.log(ctx.degreeOf(slots[0])); // 1} } }).run();