/** * Returns a String containing the "Dot" graph definition. * * @return the "Dot" graph definition */ public String graph() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintWriter out = new PrintWriter(baos); Injector localInjector = Guice.createInjector(new GraphvizModule()); GraphvizGrapher renderer = localInjector.getInstance(GraphvizGrapher.class); renderer.setOut(out); renderer.setRankdir("TB"); if (!roots.isEmpty()) { renderer.graph(injector, roots); } renderer.graph(injector); return fixupGraph(baos.toString("UTF-8")); }