!if $wims_read_parm!=slib_header
 !goto proc
!endif
slib_title=Graphviz
slib_parms=0\
slib_author=Bernadette PERRIN-RIOU
slib_out=the coordinates in pixels of the nodes of a graph\ 
which has been just created by graphviz, one node by line. The first line is \
the size in pixels of the image. On each line, the items from 2 to the end should be\
the text in the nodes (no garanty). 
slib_comment=
slib_example=
 
!exit

:proc
!reset slib_out

slib_points=$slib_graphviz_out
slib_out=!line 2 of $slib_points
slib_cnt=!linecnt $slib_points
!for slib_j =3 to $slib_cnt 
 slib_l=!line $slib_j of $slib_points
 !if graph isin $slib_l
   !distribute words $slib_l into slib_b,slib_coeff,slib_xrange,slib_yrange
 !endif

 !if node isin $slib_l
  !distribute words $slib_l into slib_b,slib_no,slib_x,slib_y,slib_border
  slib_text=!words 7 to -5 of $slib_l
   slib_x=$[round(100*$slib_coeff*($slib_x-$slib_border/2))]
   slib_y=$[round(100*$slib_coeff*($slib_yrange-$slib_y-$slib_border/2))]
  slib_out=!append line $slib_x,$slib_y,$slib_text to $slib_out
  !reset slib_x, slib_y
 !endif
!next
slib_out=$slib_out\
$slib_graphviz_out