GraphStream Users

Archives de la liste Aide


SVG Export Problems


Chronologique Discussions 
  • From: Eduardo Lidanski <eduardo.lidanski AT pikolab.net>
  • To: graphstream-users AT litislab.fr
  • Subject: SVG Export Problems
  • Date: Wed, 13 Nov 2013 17:04:51 +0100

Hi,

first of all thanks for this great library.
I am trying to export my graph to SVG but no success.
An example:

public class ExportTest {

public static void main(String args[]) {

DefaultGraph g = new DefaultGraph("export SVG");
g.addAttribute("ui.quality");
g.addAttribute("ui.antialias");

g.addNode("A");

g.addNode("B");

g.addNode("C");

g.addEdge("AB", "A", "B");

g.addEdge("AC", "A", "C");

g.addEdge("BC", "B", "C");

g.display();
String path = "export/graph.svg";

FileSink out = new FileSinkSVG2();
SpringBox sb = new SpringBox();
g.addSink(sb);

sb.addAttributeSink(g);
sb.shake();
sb.compute();

while (sb.getStabilization() < 1) {
sb.compute();
}

try {
out.writeAll(g, path);
} catch (IOException ex) {
System.err.println(ex);
return;
}

}

}

But I get the svg file attached, which is clearly not correct.

What am I doing wrong?

Thank you
Eduardo


Attachment: graph.svg
Description: image/svg




Archives gérées par MHonArc 2.6.16.

Top of page