Kroket Graph Description Language

Overall Conventions

Graphs are defined using a custom markup language.
Each markup describes an entity of the graph that can be parametrized using attributes.
Markups start with a < character, which must be followed by the name of the entity.
Markups end with the /> character sequence.
<entity  />
Attributes of an entity must be described within its markup delimiters.
The format is the following: name="value" (name is the attribute's name and value its value).
The value of an attribute must be quoted.

Example

example
<info title="Example" date="02/06/2010" />
<node id="n0" shape="circle" text="entry" text_style="bold" fill_color="#a9c3c3" />
<node id="n1" text="exit" text_color="red" stroke_style="dots" />
<edge id="e0" src_port="n0" src_style="open_dot" dest_port="n1" stroke_width="2" />
<group id="g0" contents="[n0, n1]" shape="rectangle" />

Available entities

info entity

The info entity is intended to contain general information related to the graph.
There should be only one info entity in a graph file.

Attributes of the info entity:
NameDescriptionTypeExampleMandatoryDefault
titleTitle of the graphstringgraph00yesn/a
commentsShort description of the graphstringbla bla blanoempty
dateDate of creation or last modificationstring27/11/2010noempty
revisionRevision numberstring1.0noempty

node entity

The node entity describes a node of the graph.
Nodes are identified with a unique ID which should be different of any other ID used in the file.
The number of nodes is unlimited.

Attributes of the node entity:
NameDescriptionTypeExampleMandatoryDefault
idID of the nodestringnode00yesn/a
shapeShape of the nodenode shaperectanglenoellipse
tagsTags of the nodelist of strings[mammal, cat]no[ ]
The tags attribute enables the assignment of keywords to a node. This can be used for filtering purposes.

edge entity

The edge entity describes an edge of the graph. An edge connects two nodes.
Edges are identified with a unique ID which should be different of any other ID used in the file.
The number of edges is unlimited.

Attributes of the edge entity:
NameDescriptionTypeExampleMandatoryDefault
idID of the edgestringedge00yesn/a
src_portName of the source node's port the edge connects toport namenode01/inputyesn/a
dest_portName of the destination node's port the edge connects toport namenode00/outputyesn/a
src_styleStyle of the connection to the source nodeconnection styleclosed_dotnoline
dest_styleStyle of the connection to the destination nodeconnection styledotnoarrow
src_textLabel of the source's portstringdata Y outnoempty
dest_textLabel of the destination's portstringdata X innoempty

group entity

The group entity describes a group.
A group contains nodes which in some way - according to the semantic of the graph - are related to each other. It may contain subgroups as well.
The number of group entities is limited by the number of nodes, as a node can not belong directly to two groups at the same time. Otherwise, it is virtually unlimited.

Attributes of the group entity:
NameDescriptionTypeExampleMandatoryDefault
idID of the groupstringgrp00yesn/a
contentsIDs of the edges and nodes of the groupList of IDs[node00, grp01, node01]yesn/a
shapeShape of the groupgroup shapeellipsenorectangle
expandedState of the groupbooleanfalsenotrue
The contents attribute of a group must be enumerated in a comma separated list.

Extra Attributes

The node, edge, and group entities share extra facultative attributes (mainly used for visual customization).

NameDescriptionTypeExampleDefault
fill_colorColor used for fillingstringred or #ff0000white
fill_styleStyle of the fillingfilling stylesolidsolid
stroke_colorColor used for strokingstringgreen or #00ff00black
stroke_styleStyle of the strokingstroking styledashessolid
stroke_widthWidth of the strokinginteger31
textLabel contentstringbla bla blaempty
text_colorFont color used for the labelstringblue or #0000ffblack
text_styleFont style used for the labellabel style IDboldnormal
text_sizeFont size used for the labelinteger810
A color is either a keyword or a numerical RGB specification. The format of an RGB value in hexadecimal notation is a # character immediately followed by six hexadecimal characters.
Each pair of hexadecimal values represents the Red, Green or Blue component as in the following string: #rrggbb