Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

 

 

Language Bindings

 

Examples

The graph is passed in serialized form of either graph format. In this example we use the JSON format (for JavaScript also native JSON can be passed).

graph
"{id:\"root\",children:[{id:\"n1\",labels:[{text:\"n1\"}],width:100,height:100},"
                        + "{id:\"n2\",labels:[{text:\"n2\"}],width:100,height:50,children:[{id:\"n3\","
                        + "labels:[{text:\"n3\"}],width:20,height:20},{id:\"n4\",labels:[{text:\"n4\"}],width:20,"
                        + "height:20}],edges:[{id:\"e4\",source:\"n3\",target:\"n4\"}]}],"
                        + "edges:[{id:\"e1\",source:\"n1\",target:\"n2\"}]}";
options
spacing: 100
algorithm: "de.cau.cs.kieler.klay.layered"
edgeRouting: ORTHOGONAL

JavaScript

var graph = "[graph]";
var options = { opt1: val1 };
$.kielerLayout({graph: graph, options: options,
    iFormat: 'org.json', oFormat: 'org.json',
    success : function (data) {
        console.log(data);
    }
});

Java

String graph = "[graph]";
Map<String, Object> opts = new HashMap<String, Object>();
String layouted = KIELERLayout.layout(server, "org.json", "org.json", options, graph);

C#

String graph = "[graph]";
Dictionary<String, Object> options = new Dictionary<String, Object>();
String layouted = KIELER.KIELERLayout.layout(server, "org.json", "org.json", options, graph);

 

 

  • No labels