getGraphId = function getGraphId(label) {
  var keys = Object.keys(idCache);

  for (var i = 0; i < keys.length; i++) {
    if (idCache[keys[i]].label === label) {
      return keys[i];
    }
  }

  return undefined;
}
Setup arrow head and define the marker. The result is appended to the svg.