GraphStream Users

Archives de la liste Aide


Help request for generating an SVG export


Chronologique Discussions 
  • From: Xavier Roger-Machart <xrogermachart AT gmail.com>
  • To: graphstream-users AT litislab.fr
  • Subject: Help request for generating an SVG export
  • Date: Wed, 21 Mar 2012 12:23:45 +0100

Hello,

I'm trying to create an SVG export of a simple graph, however I could not find a way to have a working image yet. Here's roughly what I wrote :

        String path = "C:\\test.svg";

        Graph graph = new SingleGraph("GraphStream");
       
        graph.addNode("A");
        graph.addNode("B");
        graph.addNode("C");
        graph.addEdge("AB", "A", "B");
        graph.addEdge("BC", "B", "C");
        graph.addEdge("CA", "C", "A");
       
        FileSink out = FileSinkFactory.sinkFor(path);
       
        try {
            out.writeAll(graph, path);
            out.flush();
        } catch (IOException ex) {
            Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
            return;
        }

This will generate an SVG file that actually contains some lines, but it seems they've not been organized yet or something. Also it contains lines not no points :

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<svg xmlns:svg="http://www.w3.org/2000/svg" width="100%" height="100%">
  <g id="AB">
    <line x1="0.000000" y1="0.000000" x2="0.000000" y2="0.000000"/>
  </g>
  <g id="BC">
    <line x1="0.000000" y1="0.000000" x2="0.000000" y2="0.000000"/>
  </g>
  <g id="CA">
    <line x1="0.000000" y1="0.000000" x2="0.000000" y2="0.000000"/>
  </g>

What am I doing wrong here, and is there any documentation I missed out on that particular subject ?

Thanks

Xavier



Archives gérées par MHonArc 2.6.16.

Top of page