docs: function degree(graph, kind) {
    var getNodeDegree;
    var result = Object.create(null);
  
    kind = (kind || 'both').toLowerCase();
    if (kind === 'both' || kind === 'inout') {
      getNodeDegree = inoutDegreeCalculator;
    } else if (kind === 'in') {
      getNodeDegree = inDegreeCalculator;
    } else if (kind === 'out') {
      getNodeDegree = outDegreeCalculator;
    } else {
      throw new Error('Expected centrality degree kind is: in, out or both');
    }
  
    graph.forEachNode(calculateNodeDegree);
  
    return result;
  
    function calculateNodeDegree(node) {
      var links = graph.getLinks(node.id);
      result[node.id] = getNodeDegree(links, node.id);
    }
  }