Cuttlefish extended format (cxf)

From Cuttlefish Wiki
Jump to: navigation, search

Cuttlefish extended format (.cxf)[edit]

The graph file format .cff is useful when automated graph files are generated, but when we need to work with the graph files its grammar is too cryptic and it is not easy to figure out how will be the resulting graph. For that purpose, the extended format shows a more user friendly set of rules in a way that creating and editing our graph files by hand will not be a too painful job. This time, configuration, node and edge lines can appear in any order. Also nodes or edges are allowed to be described with line breaks and any amount of white spaces and tabulators between so the file is readable by a human. The fields between parentheses are compulsory, but all the others can be omitted or appear in any order.

Configuration command: its three explicit parameters define whether the graph is undirected (arrows are not displayed) and whether to display node and edge labels or not.

       configuration: undirected hide_node_labels hide_edge_labels draw_straight_edges multi_graph

For example, if we want to set up our network as undirected and we don't want to see the edge labels in the representation, qe have to add to the file the following line:

configuration: undirected hide_edge_labels

The multi_graph parameter must be used in order to allow parallel edges.


Node definition: they should always start with “node:” and have the integer unique identifier of the node in the graph between parentheses. All the other fields are optional and can appear in any order. When the label has white spaces inside, it is not necessary to add quotation marks around it.

     node: (id) label{label} color{R,G,B} borderColor{R,G,B} size{size} shape{shape} width{width}
           position{x,y} var1{var1} var2{var2} hide
  • id: an integer unique identifier for the node inside a network.
  • label: a string to appear as the name of the node when representing it. It can have white spaces inside.
  • color{R,G,B}: three real values between 0 and 1 that represent the amount of Red, Green and Blue for the color of the node's filling, black by defalult. i.e. color{0.2,0.4,1}
  • borderColor{R,G,B}: similar description as color for the border of the node. By default it is black.
  • size: real value representing the size of the representation of the node, given its shape
  • shape: shape of the symbol that represents the node in the visualization. Possible shapes are "circle" or "square", being circle the default.
  • width: width of the border around the node, by default 1.
  • (var1): String optional variable for particular uses. It will not appear on the network representation, but their values will be accessible through a data browser.
  • (var2): Additional field as var1
  • hide: if this parameter is present, the node will be added to the network but it will be omitted when visualising it, as well as all its adjacent edges.

A sample node line for a purple square vertex would be:

node: (777) label{The vertex} color{1,0,1} shape{square}

Edge definition: they should always start with “edge:” followed by the endpoint pair between parentheses. The label can have whitespaces inside as in the node case.

       edge: (id_source, id_destination) label{label} weight{weight} width{width} color{R,G,B} var1{var1} var2{var2} hide
  • id_origin: integer identifier of the origin vertex of the edge
  • id_dest: integer identifier of the destination of the edge
  • weight: real value for the weight of the edge.
  • width: real value for the width associated to the edge, it will not be displayed by default, but it will be taken into account when calculating the layouts.
  • color: color to paint the edge as in the vertices, represented by three real values.
  • var1, var2: additional strings for keeping network data.
  • hide: if this parameter is present, the edge will be added to the network but it will not be displayed in the visualisation.

Sample edge:

edge: (777, 3) weight{0.001} color{0.4,0.1,0} width{4}


Some example files: testGraph1.cxf BA2.cxf

Back to User documentation