public void writeGraph(final OutputStream os) throws IOException { // read in the html template resource. InputStream is = this.getClass().getClassLoader().getResourceAsStream("vizjs/HtmlTemplate.html"); String result; { ByteArrayOutputStream baos = new ByteArrayOutputStream(); writer.writeGraph(baos); result = baos.toString(); } if(LOG.isDebugEnabled()) { LOG.debug("DOT: "+result); } // read the document. Document document; try { document = $(is).document(); // append in the gexf. $(document).find("#dot-source").append(result); writeDocument(document, os); } catch (SAXException e) { throw new IOException("Exception loading document.", e); } }
public void writeGraph(final OutputStream os) throws IOException { // read in the html template resource. InputStream is = this.getClass().getClassLoader().getResourceAsStream("vizjs/HtmlTemplate.html"); String result; { ByteArrayOutputStream baos = new ByteArrayOutputStream(); writer.writeGraph(baos); result = baos.toString(); } if(LOG.isDebugEnabled()) { LOG.debug("DOT: "+result); } // read the document. Document document; try { document = $(is).document(); // append in the gexf. $(document).find("#dot-source").append(result); writeDocument(document, os); } catch (SAXException e) { throw new IOException("Exception loading document.", e); } }