@Autowired(required = true)
private OrganizationService organizationService;
public DirectedGraph createGraphForOrganization(Long organizationId) {
DirectedGraph data = new DirectedGraph();
List<Node> nodes = new ArrayList<Node>();
List<Link> links = new ArrayList<Link>();
Organization organization = organizationService.get(organizationId);
Node rootNode = new Node();
rootNode.setType("organization");
rootNode.setId(Long.toString(organizationId));
rootNode.setUuid(organization.getUuid());
rootNode.setMatch(Float.toString(generator.nextFloat() * 1.0f));
rootNode.setName(organization.getName());
rootNode.setPopularity(Long.toString(organization.getUserDomains().size()));
nodes.add(rootNode);
addGroupNodes(nodes, links, organization);
data.setNodes(nodes);
data.setLinks(links);
return data;
}