First steps
User guide
Using layouts
Features
Hyperlinks
Styles of nodes
Styles of edges
Background
Groups of graph elements
GraphXML
Property files
Mathematics
|
Groups of graph elementsSometimes there are a lot of nodes or edges that should have the same property, e.g. the same color. Hypergraph provides an easy way to do this without adding the information to each and every node or edge. Each node or edge can belong to a group (or class in GraphXML). This group can have all properties that are supported for nodes resp. edges and these properties are valid for all elements that belong to this group. The properties of the class are defined in a style element directly under the graph element and the name of the class is always an attribute of the node, edge or the graphic property. Example : The following GraphXML code defines two nodes and one edge, where the first node and the edge belong to the class myClass and the other node doesn't belong to any class. All nodes in this class will be red on a white background. The edges in this class will be blue. <graph> <style> <line tag="edge" class="myClass" colour="blue" /> <line tag="node" class="myClass" colour="red" /> <fill tag="node" class="myClass" colour="white" /> </style> ... <node name="id_1" class="myClass"><label>This will be red with white background</label></node> <node name="id_2"><label>This will have the default color</label></node> ... <!-- a blue edge --> <edge class="myClass" source="id_1" target="id_2"/> ... </graph> |