GraphStream Users

Archives de la liste Aide

Help request for generating an SVG export

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


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.addEdge("AB", "A", "B");
        graph.addEdge("BC", "B", "C");
        graph.addEdge("CA", "C", "A");
        FileSink out = FileSinkFactory.sinkFor(path);
        try {
            out.writeAll(graph, path);
        } catch (IOException ex) {
            Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);

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="" width="100%" height="100%">
  <g id="AB">
    <line x1="0.000000" y1="0.000000" x2="0.000000" y2="0.000000"/>
  <g id="BC">
    <line x1="0.000000" y1="0.000000" x2="0.000000" y2="0.000000"/>
  <g id="CA">
    <line x1="0.000000" y1="0.000000" x2="0.000000" y2="0.000000"/>

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



Archives gérées par MHonArc 2.6.16.

Top of page