Graph SVG
Graphic/layout definition file have the extension gr.
- include: file
This file usually holds object definitions, but there is no
limitation.
- title:
- layout: pattern
- Objects are identified by single letters.
Each occurence of an object is assigned
a number (s1, s2, ...). This is how objects are referenced later.
- Sub-objects "s" are placed inside another object "m" using the syntax:
m(sss)
- Objects are stacked on top of other objects using the slash /.
mmm/sss
- name: letter-number long_name
Assign a longer name to an object. We can use the short or long name
to reference an object.
- fontsize: size
Default font size is 20.
- def: letter shape title width height fillcolor strokecolor
- shape may be either user defined, or one
of rect, circle, ellipse, filler.
- User defined shape ends with the suffix .s and correspond
to a file name. See below for user defined shapes.
- Title can't have spaces
- spacing: horizontal_spacing vertical_spacing
Control the spacing between objects.
Default horizontal spacing is 10.
Default vertical spacing is 20.
- to: object1 object2 [ options ]
- a=0 arc level
- b=0 Put an arrow at both ends of the line (b=1)
- w=2 line width
- dash= dash pattern like 5,5. Pass as stroke-array argument. See the SVG documentation for details.
- c=black line color
- t=text
- h=-1 hide this line at this step
- fhandle= tells where to connect the line on the source object.
- thandle= tells where to connect the line on the target object.
Default handles are left, tleft, bleft, right, tright, bright, top and bottom.
- re: object1 object2 [ options ]
Works like to:, but there is no arrow at the end of the line.
- show: object [ objects ... ]
Show an object.
- hide: object [ objects ... ]
Hide an object.
- showt: object
Show the name of an object.
- hidet: object
Hides the name of an object.
- step: step-number
User defined shapes
User defined shapes are text file holder SVG statements. There are few differences
- You can insert math expression between two dollar sign. You are provided with
predefined variable you can use to express dimensions and positions. The variables are
- x: X coordinate of the object
- y: Y coordinate of the object
- w: Width of the object
- h: Height of the object
- Line starting with handle: define a handle used to connect lines. You specify
the name of the handle, followed by x,y coordinates (using $math_expression$) and
an anchor for text (either empty or middle).
Here is a sample:
<rect x="$x$" y="$y$" width="$w$" height="$h$" fill="lightblue" stroke="black" stroke-width="1"/>
<circle cx="$x+w/2$" cy="$y+h/2$" r="$w/6$" fill="blue"/>