1 /** This file is part of Shapes.
3 ** Shapes is free software: you can redistribute it and/or modify
4 ** it under the terms of the GNU General Public License as published by
5 ** the Free Software Foundation, either version 3 of the License, or
8 ** Shapes is distributed in the hope that it will be useful,
9 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ** GNU General Public License for more details.
13 ** You should have received a copy of the GNU General Public License
14 ** along with Shapes. If not, see <http://www.gnu.org/licenses/>.
16 ** Copyright 2014 Henrik Tidefelt
19 /** This example is placed in the <problems> directory since it just contains
23 ##needs ..Shapes..Data / seq-support
26 ##lookin ..Shapes..Data
27 ##lookin ..Shapes..Geometry
28 ##lookin ..Shapes..Layout
30 g0: [hierarchical_graph undirected:true
32 (> 'A g11 <) (> 'B g12 <) (> 'C g13 <) /** Subgraphs that already exist. **/
34 leafs: [list /** The argument is named "leafs" rather than "nodes", since the nodes given here are not all nodes. **/
35 (> key:'a <) (> 'b <) 'c /** Just like the nodes in a flat graph. **/
38 (> (> complex:'A entry:'x <) (> complex:'B entry:'y <) <) /** Nodes refered to using entry in the interface of a complex. **/
39 (> (> 'A 'x <) (> 'A 'y <) <)
40 (> 'a (> 'B 'y <) <) /** A single key, 'a, refers to a leaf. **/
44 /** The nodes exposed in the interface must not be adjacent. **/
45 (> public_entry:'a leaf:'a <) /** The clumsy way of exposing a leaf node. **/
46 'b /** The easy way to expose a leaf node using its own key. **/
47 (> public_entry:'Ax complex:'A entry:'x <) /** Expose the entry 'x in the complex 'A under the entry 'Ax in the interface. **/
48 (> 'Bx 'B 'x <) (> 'Cy 'c 'y <)