code: function CoggleApiNode(coggle_api_diagram, node_resource){
    this.diagram = coggle_api_diagram;
    this.id      = node_resource._id;
    this.text    = node_resource.text;
    this.offset  = node_resource.offset;
  
    if('parent' in node_resource){
      this.parent_id = node_resource.parent;
    }
  
    var self = this;
  
    this.children = [];
    if('children' in node_resource){
      node_resource.children.forEach(function(child_resource){
        var child = new CoggleApiNode(coggle_api_diagram, child_resource);
        child.parent_id = this.id;
        self.children.push(child);
      });
    }
  }
docs: !jsjsdoc
  // documentation is produced in the order of definition: we want the main
  // class to be first, so define it first.
  
  doc.CoggleApi = {}
  doc.CoggleApiDiagram = {}
  doc.CoggleApiNode = {}
  
   !jsjsdoc
  
  doc.CoggleApiNode = {
  $brief: "Coggle API Node object, which represents individual parts"+
  "(\"nodes\") of the branches in a Coggle diagarm"
  }
  
  doc.CoggleApiNode.$constructor = {
  $brief: "Create a new instance of a Coggle API Node object.",
  $parameters: {
  coggle_api_diagram: {
  $type:'CoggleApiDiagram',
  $brief:'The Diagram in which this node belongs.'
  },
  node_resource: {
  $type:'Object',
  $brief:'Node Resource object, with at least `_id` (`String`), `text` (`String`), and `offset` (`{x:Number, y:Number}`) fields.'
  }
  }
  }