Uploaded image for project: 'Kieler Pragmatics'
  1. Kieler Pragmatics
  2. KIPRA-1363

KGraph elements should contain more implicit (default) layout information

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Nice to have
    • Resolution: Fixed
    • Affects Version/s: 0.10.0, 0.11.0
    • Fix Version/s: 2014/05
    • Component/s: KGraph Language
    • Labels:
      None

      Description

      When writing KGraph models, it is often necessary to provide lots of redundant information just to render a few elements, e.g. nodes and edges with labels. To get a small example graph, it is necessary to specify an edge label placement property value for each edge.

       kedge (-> node_B)  { 
      		klabel "just an edge label" {
      			properties :
      			  de.cau.cs.kieler.edgeLabelPlacement = CENTER
      		}
        } 
      

      Also, one cannot use node IDs for the node labels, so each node has to have a label in addition to its ID.

      // the following defines two nodes (my_node_1 and my_node_2) with node labels
      knode my_node_1 {
      	properties:
      		de.cau.cs.kieler.nodeLabelPlacement = "[H_CENTER, V_CENTER, INSIDE]"
      	krectangle rect {
      		ktext ("my_node_1") text {
      			areaData: topLeftAnchor = left 5 , top 2 bottomRightAnchor = right 5, bottom 2 
      	}
      }
       
      knode my_node_2 {
      	properties:
      		de.cau.cs.kieler.nodeLabelPlacement = "[H_CENTER, V_CENTER, INSIDE]"
      	krectangle rect {
      		ktext ("my_node_1 *oops*") text {
      			areaData: topLeftAnchor = left 5 , top 2 bottomRightAnchor = right 5, bottom 2 
      	}
      }
      

      This makes KGraph models lengthy, tedious to write, error-prone and hard to maintain because one would copy-paste a lot.

      KGraph should provide default settings automatically if information is omitted in a model:

      • Edge labels should by default have an overridable
        de.cau.cs.kieler.edgeLabelPlacement = CENTER
      • It should be possible to inject the ID of a node as its label text. Admittedly in many cases it makes sense to have different labels and IDs, but for small examples it is desirable to just use the ID as a label by default.

        Attachments

          Activity

            People

            Assignee:
            cds Christoph Daniel Schulze [X] (Inactive)
            Reporter:
            bdu Bjoern Duderstadt [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: