Permalink
Browse files

Enhanced readme and removed clutter

  • Loading branch information...
bzim committed Jun 20, 2016
1 parent bb013e5 commit 4fd150877db50311d21a21f19f9d1edb2d5d3951
Showing with 13 additions and 18 deletions.
  1. +8 −7 README.md
  2. +5 −11 src/test/java/de/graphml/writer/test/GraphMLWriterTest.java
@@ -7,23 +7,24 @@ http://graphml.graphdrawing.org
This library writes XML nodes, graphs and edges with necessary namespace initialization ahead.
There is explicitly no graph model, complex layout logic or any other fancy stuff. This library just writes.
There is explicitly no graph model, complex layout logic or any other fancy stuff. This library just writes.
Note: All objects which define a graphic state could be reused after they are written to the stream, so a minimal processing memory footprint is possible.
Typically this is where you start with:
1. Build a nice graph model with any of the freely available libraries or your own
2. Do some operations on the graph, express your relations etc.
3. Use this library to write a representational GraphML file
4. View it in an external tool, like yEd or any other graphML supporting renderer
4. View it in an external tool, like yEd or any other GraphML supporting renderer
Furthermore it has some support for writing yEd compatible nodes and edges which are displayable via the great yEd (http://www.yworks.com/products/yed) tool.
Example Code to render a simple Graph
Furthermore it has support for writing yEd (http://www.yworks.com/products/yed) compatible graphic nodes and edges.
Example code to render a simple graph
=====================================
```java
GraphWriter graphWriter = new GraphWriter(new FileOutputStream("target/simple.graphml"),
StandardCharsets.UTF_8.name());
GraphWriter graphWriter = new GraphWriter(new FileOutputStream("target/simple.graphml"));
graphWriter.startDocument();
graphWriter.writeKeys(Arrays.asList(YedKeys.values()));
@@ -16,7 +16,6 @@
* limitations under the License.
*/
import java.io.FileOutputStream;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import org.junit.Test;
@@ -44,8 +43,7 @@
public class GraphMLWriterTest {
@Test
public void writeSimpleGraph() throws Exception {
GraphWriter graphWriter = new GraphWriter(new FileOutputStream("target/simple.graphml"),
StandardCharsets.UTF_8.name());
GraphWriter graphWriter = new GraphWriter(new FileOutputStream("target/simple.graphml"));
graphWriter.startDocument();
graphWriter.writeKeys(Arrays.asList(YedKeys.values()));
@@ -79,8 +77,7 @@ public void writeSimpleGraph() throws Exception {
@Test
public void writeFlowChart() throws Exception {
GraphWriter graphWriter = new GraphWriter(new FileOutputStream("target/flowChart.graphml"),
StandardCharsets.UTF_8.name());
GraphWriter graphWriter = new GraphWriter(new FileOutputStream("target/flowChart.graphml"));
graphWriter.startDocument();
graphWriter.writeKeys(Arrays.asList(YedKeys.values()));
@@ -130,8 +127,7 @@ public void writeFlowChart() throws Exception {
@Test
public void writeSimpleGraphRotatingEdgeLabel() throws Exception {
GraphWriter graphWriter = new GraphWriter(new FileOutputStream("target/simple_rotating_edgelabel.graphml"),
StandardCharsets.UTF_8.name());
GraphWriter graphWriter = new GraphWriter(new FileOutputStream("target/simple_rotating_edgelabel.graphml"));
graphWriter.startDocument();
graphWriter.writeKeys(Arrays.asList(YedKeys.values()));
@@ -165,8 +161,7 @@ public void writeSimpleGraphRotatingEdgeLabel() throws Exception {
@Test
public void writeSubGraph() throws Exception {
GraphWriter graphWriter = new GraphWriter(new FileOutputStream("target/subgraph.graphml"),
StandardCharsets.UTF_8.name());
GraphWriter graphWriter = new GraphWriter(new FileOutputStream("target/subgraph.graphml"));
graphWriter.startDocument();
graphWriter.writeKeys(Arrays.asList(YedKeys.values()));
@@ -234,8 +229,7 @@ public void writeBigGraph() throws Exception {
YedEdge<PolyLineEdge>
edge = new YedEdge<>(new PolyLineEdge());
GraphWriter graphWriter = new GraphWriter(new FileOutputStream("target/big.graphml"),
StandardCharsets.UTF_8.name());
GraphWriter graphWriter = new GraphWriter(new FileOutputStream("target/big.graphml"));
graphWriter.startDocument();
graphWriter.writeKeys(Arrays.asList(YedKeys.values()));

0 comments on commit 4fd1508

Please sign in to comment.