GraphStream Users

Archives de la liste Aide

Re: Polyline or curvy edge support?

Chronologique Discussions 
  • From: guilhelm savin <guilhelm.savin AT>
  • To: "graphstream-users AT" <graphstream-users AT>, vili.auvinen AT
  • Subject: Re: Polyline or curvy edge support?
  • Date: Mon, 4 Nov 2013 00:20:00 +0100

Hi Vili,

This is an already implemented (but ok not documented) feature, in the gs-ui viewer.
You just have to use the "ui.points" attribute of edges, which should be a one dimension double array of xyz coordinates : ui.points = { x1, y1, z1, x2, y2, z2, ...... }

Here is a small example :

import org.graphstream.graph.Graph;
import org.graphstream.graph.implementations.AdjacencyListGraph;

public class Test {
    public static void main(String[] args) throws Exception {
        Graph g = new AdjacencyListGraph("g");
        g.addNode("A").addAttribute("xyz", new double[] { 0, 0 });
        g.addNode("B").addAttribute("xyz", new double[] { 10, 10 });

        g.addEdge("AB", "A", "B", false)
                        (Object) new double[] { 0, 0, 0, 0, 5, 0, 5, 10, 0, 10,
                                10, 0 });

        g.addAttribute("ui.stylesheet", "edge {shape: polyline; }"); // or shape: cubic-curve




2013/10/15 <vili.auvinen AT>

Do you have any schedule for implementing polyline or curvy edge support?

I have a directed hierarchical layout (like a process model) and I would like
to add edges that do not overlap with nodes. I would like to use your library
but the lack of this feature is holding me back.

I thought of using the dot layout from graphviz and utilize its coordinates for
nodes and edges. There's a GraphicEdge class that has control points - would it
be possible to implement that way?



Guilhelm Savin
PhD Student of Computer Science

  • Re: Polyline or curvy edge support?, guilhelm savin, 04/11/2013

Archives gérées par MHonArc 2.6.16.

Top of page