Show last authors
1 {{warning}}
2 This is still an experimental feature and **not** part of the release. Please refer to the nightly builds if you wish to try it.
3 {{/warning}}
4
5 A simple HTTP POST request is used to send the input graph and retrieve its the layouted version. You can just perform your own request to the correct URL and pass all required information. However, as we might change internal APIs we recommend you to use the (very small) wrapper implementations we provide for a specific language. We do not provide a wrapper for each language, feel free to write your own and contact us so we can add it to the list below.
6
7 == Language Bindings ==
8
9 Each zip archive contains the wrapper class you can use to call our service as well as a small example illustrating the usage pattern for the specific language.
10
11 * [[JavaScript>>attach:Java-0.1.0.zip]]
12 * [[Java>>attach:Java-0.1.0.zip]]
13 * [[C#>>attach:C#-0.1.0.zip]]
14
15 == Examples ==
16
17 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).
18
19 {{code title="graph"}}
20 "{id:\"root\",children:[{id:\"n1\",labels:[{text:\"n1\"}],width:100,height:100},"
21 + "{id:\"n2\",labels:[{text:\"n2\"}],width:100,height:50,children:[{id:\"n3\","
22 + "labels:[{text:\"n3\"}],width:20,height:20},{id:\"n4\",labels:[{text:\"n4\"}],width:20,"
23 + "height:20}],edges:[{id:\"e4\",source:\"n3\",target:\"n4\"}]}],"
24 + "edges:[{id:\"e1\",source:\"n1\",target:\"n2\"}]}";
25 {{/code}}
26
27 {{code title="options"}}
28 spacing: 100
29 algorithm: "de.cau.cs.kieler.klay.layered"
30 edgeRouting: ORTHOGONAL
31 {{/code}}
32
33 === JavaScript ===
34
35 {{code language="js"}}
36 var graph = "[graph]";
37 var options = { opt1: val1 };
38 $.kielerLayout({graph: graph, options: options,
39 iFormat: 'org.json', oFormat: 'org.json',
40 success : function (data) {
41 console.log(data);
42 }
43 });
44 {{/code}}
45
46 === Java ===
47
48 {{code language="java"}}
49 String graph = "[graph]";
50 Map<String, Object> opts = new HashMap<String, Object>();
51 String layouted = KIELERLayout.layout(server, "org.json", "org.json", options, graph);
52 {{/code}}
53
54 === C# ===
55
56 {{code language="c#"}}
57 String graph = "[graph]";
58 Dictionary<String, Object> options = new Dictionary<String, Object>();
59 String layouted = KIELER.KIELERLayout.layout(server, "org.json", "org.json", options, graph);
60 {{/code}}
61
62
63
64