addClass = function addClass(id, style) {
  if (typeof classes[id] === 'undefined') {
    classes[id] = {
      id: id,
      styles: [],
      textStyles: []
    };
  }

  if (typeof style !== 'undefined') {
    if (style !== null) {
      style.forEach(function (s) {
        if (s.match('color')) {
          var newStyle1 = s.replace('fill', 'bgFill');
          var newStyle2 = newStyle1.replace('color', 'fill');
          classes[id].textStyles.push(newStyle2);
        }

        classes[id].styles.push(s);
      });
    }
  }
}
Called by parser when a graph definition is found, stores the direction of the chart.
@param dir