Responsible:

The KGraph Text (KGT) project provides a textual syntax and editor for specifying KGraphs. While editing the KGraph in the textual editor, we provide a visualization of the graph in a KLighD view. This project was started with two use cases in mind:

  1. Unit testing: KGT is a light-weight format that test graphs can be stored in.
  2. Layout algorithm development: KGT is easy to use for testing layout algorithms while developing them.

This page documents the basic syntax of the KGT format and how to use the editor together with the KLighD view.

Quick Start Tutorial

This short tutorial will walk you through writing your first KGT file. Grab a cup of tea and a few biscuits and work your way through it.

Before starting the tutorial, make sure that you have an Eclipse installation with the KIELER KGraph Editing and Visualization feature installed.

  1. Make sure that a KLighD view will be created for you once you start editing a KGT file. Open the Eclipse preferences and navigate to the KIELER View Management page. Make sure that Graphical representations of textually formulated KGraphs is checked.
  2. Create an empty project in your Eclipse workspace. Right-click the project and select New -> Other... In the dialog that pops up, select Empty KGraph from the KGraph category. Give the new file a proper name and click Finish to create it.
  3. Open the new file. The KGraph editor should open, as should a KLighD view. Both should be empty.
  4. Start by adding a few nodes. Enter the following text into the editor:

    knode node1 {
        size: width=100 height=100
    }
    
    knode node2 {
        size: width=100 height=100
    }
    
    knode node3 {
        size: width=100 height=100
    } 

    The KLighD view should update itself and show three rectangles, each representing one of the three nodes.

  5. Let's add connection points to the nodes. Add a few ports to them:

    knode node1 {
        size: width=100 height=100
    
        kport port1_1 {
            size: width=10 height=10
        }
        
        kport port1_2 {
            size: width=10 height=10
        }
    }
    
    knode node2 {
        size: width=100 height=100
        
        kport port2_1 {
            size: width=10 height=10
        }
        
        kport port2_2 {
            size: width=10 height=10
        }
    }
    
    knode node3 {
        size: width=100 height=100
        
        kport port3_1 {
            size: width=10 height=10
        }
    }

    The nodes in the KLighD view should now have black ports in the top left corner. This is of course not where we want the ports to end up, so we will have to tell the layout algorithm to place them wherever it's most convenient. The corresponding layout option is called port constraints. Add the following two lines under the size specification of each node to set the proper constraints on it:

        properties:
            de.cau.cs.kieler.portConstraints=FREE 

    The KLighD view should be updated again and place all ports on the left side of their node.

The KGraph Text Format

This section needs to be written.

 

10 height=10