# Mod $define(mod_flowchartgvz=) # Directives macro $define( flowchart_begin = $tempto(fjs.txt) $tempout(digraph G {$nl()graph [splines=ortho; nodesep=0.5]$nl()) $define(DIRS=) ) $define( flowchart_end = $fileout(true,$path(cache,flowchartgvz_source.gvz),$tempin()$nl()$DIRS()$nl()}) ) # Font $define(font,a_font_name=$tempout(fontname="$a_font_name()"$nl() )) # Set orientation as "from left to right" # flr() $define(flr=$tempout(rankdir=LR$nl())) # Start # fstart(label,goto) $define( fstart, a_label a_goto =$tempout(start [ label="$a_label()" ];$nl()) $append(DIRS,start -> n$a_goto();$nl()) ) # End # fend(label) $define( fend, a_label =$tempout(nend [label="$a_label()"];$nl(){rank=sink; nend;}$nl()) ) # fnode(id,label,nextId) $define( fnode, a_id a_label a_nextId = $bind+(id,n$a_id()) $bind+(nextId,n$a_nextId()) $tempout($id() [label="$a_label()" shape=rect];$nl()) $append(DIRS,$id() -> $nextId() [weight=8];$nl()) ) # Alternative node # fnodea(id,label,nextId) $define( fnodea, a_id a_label a_nextId = $bind+(id,n$a_id()) $bind+(nextId,n$a_nextId()) $tempout($id() [label="$a_label()" shape=rect]; $nextId()_right [shape=point; width=0]; {rank=same; $nextId(); $nextId()_right;}$nl()) $append(DIRS, $nextId() -> $nextId()_right [dir=back]; $id() -> $nextId()_right[arrowhead=none];$nl()) ) # Flowchart node # _fcond(id,label,yesId,noId) $define( fcond, a_id a_label a_yesId a_noId = $bind+(id,n$a_id()) $bind+(yes_id,n$a_yesId()) $bind+(no_id,n$a_noId()) $tempout($id() [label="$a_label()" shape=diamond];$nl(){ rank=same; $id(); $no_id(); }$nl()) $append(DIRS,$id() -> $yes_id()[xlabel="yes"; weight=8; color="firebrick3"];$nl()$id() -> $no_id() [xlabel="no"; color="dodgerblue3"];$nl()) ) # fnode_input(id,label,nextId) $define(finput, a_id a_label a_nextId = $bind+(id,n$a_id()) $bind+(nextId,n$a_nextId()) $tempout($id() [label="$a_label()" shape=parallelogram];$nl()) $append(DIRS, $id() -> $nextId()[weight=8;]$nl()) )