addon/utils/data-processor.js
function _normalizeVertexTree(vertex) {
  var children = vertex.get('children');

  if(children) {
    children = children.filter(function (child) {
      _normalizeVertexTree(child);
      return child.get('type') !== 'vertex' || child.get('treeParent') === vertex;
    });

    vertex._setChildren(children);
  }

  return vertex;
}
function _normalizeVertexTree(vertex) {
  var children = vertex.get('children');

  if(children) {
    children = children.filter(function (child) {
      _normalizeVertexTree(child);
      return child.get('type') !== 'vertex' || child.get('treeParent') === vertex;
    });

    vertex._setChildren(children);
  }

  return vertex;
}
function _normalizeVertexTree ( vertex ) { var children = vertex . get ( 'children' ) ; if ( children ) { children = children . filter ( function ( child ) { _normalizeVertexTree ( child ) ; return child . get ( 'type' ) !== 'vertex' || child . get ( 'treeParent' ) === vertex ; } ) ; vertex . _setChildren ( children ) ; } return vertex ; }
Part of step 1
To remove recurring vertices in the tree
@param vertex {Object} root vertex
Part of step 1 To remove recurring vertices in the tree